Building a Spotfire Package (SPK) for Python Packages from a Docker Image on Windows

You can build a Spotfire package (SPK) using a Docker image on Windows, and then place the SPK on a Spotfire Server running on Linux.

Perform this task from the command line on a Windows computer.

Prerequisites

Before you begin, make sure you have downloaded the TIBCO Spotfire® Statistics Services installation from the TIBCO product site edelivery.tibco.com (license and account required). Spotfire® Statistics Services includes the Spotfire Service for Python.

Procedure

  1. Extract the contents of the Spotfire Service for Python installation archive.
  2. Browse to the python directory.
  3. Copy the Spotfire package wheel file (spotfire-<version>-py2.py3-none-any.whl) and place the copy in the python/dockerfiles/python-build-base directory.
  4. Create the file requirements.txt and place it in the same directory from where you are running the spotfire-spk script.
    The file requirements.txt contains a list of packages, with their version numbers, that are included in the SPK. For example:
    #
    ####### example-service-requirements.txt #######
    #
    scipy == 1.3.3
    matplotlib == 3.1.2
    statsmodels == 0.10.2
  5. Call the following commands.
    set PYTHON_VERSION=3.7.5
    set SPOTFIRE_WHEEL_VERSION=1.0.1
    docker build --build-arg PYTHON_VERSION --build-arg SPOTFIRE_WHEEL_VERSION -t python-build-base:%PYTHON_VERSION% python-build-base
  6. Build the SPK.
    spotfire-spk <python-build-base-tag> [arguments to spotfire.spk module]
    spotfire-spk 3.7.5 packages python-packages.spk requirements.txt
    The file python-packages.spk containing the packages specified in requirements.txt is created.

What to do next

Add the SPK to the Spotfire Server Deployment area, and then validate and save the area. See Adding Software Packages to a Deployment Area and Updating Services in the TIBCO Spotfire® Server Installation and Administration guide for more information. If you have specified the --analyst flag in the arguments to the spotfire.spk module, then the next time the Spotfire Analyst users connect to the Spotfire Server, they are prompted to update their installations with the new packages. Business authors and consumers connecting to Spotfire from a web browser can view analyses with data functions that use the functions in the packages.