Package Management for the Service
If a data function author in your organization creates a Spotfire analysis that uses packages from a public or private repository, then the administrator must make sure that the packages are installed on Spotfire Server.
Important: Packages must be installed in the same type of
environment as where they are executed. For example, if you built the
debian:11-slim Docker image for your containerized
Spotfire Service for R, make sure the packages are installed on
a node manager running the same operating system as the containerized engines.
If this is not possible, then see the workaround options in
Troubleshooting the Service.
R programmers in your organization can develop
their own packages or take advantage of some of the thousands of compatible
packages developed by other
R programmers, and then share the analyses that
use those functions with Spotfire users in your organization.
Note: Data function authors must be in the Script Author group to create
and save data functions that use
R.
The largest and most commonly-used, curated repository for R packages is the Comprehensive R Archive Network (CRAN). Most packages that are not installed with the Spotfire Service for R are downloaded from this repository.
The service provides the following ways to add packages.
- Installing packages directly on the node manager computer, using the R engine installed there.
- This way makes the packages accessible to a
Spotfire Service for R engine running on a node when the
engine session is created. This method is the most efficient, because calling
install.packages()
directly on the server ensures that all dependent packages are also installed. If you use this method, you must specify the package path in the custom configuration file. See Configuring the Service for more information. - Building an SPK that contains custom-designed or CRAN packages that are compatible with the supported R engine.
- The SPK is uploaded to the server. Packages are stored as part of
the deployment and are accessible to the
Spotfire Service for R engine running on a node when the
engine session is created. This way of installing packages requires that you
create and manually maintain a Debian Control File (DCF) that lists all
packages to be installed, including dependent packages. Because the DCF
controls SPK versioning, it provides better package governance than directly
uploading to the server. See
The Spotfire Package (SPK)
for detailed instructions for creating an SPK and managing its packages. See
Installing R Packages Manually
for more information.
Important: If you create an SPK on a computer other than the computer where the node manager is installed, then be sure to use a computer that is running same operating system as the computer where the packages are going to be deployed. For example, If you are creating an SPK on Linux, be sure your Linux OS type and version are the same as that of the computer where the node manager is installed.
- Configuring the
packagePath
incustom.properties
to point to a mounted drive or directory that contains packages that are compatible with the R engine. - This way of package management is the most controlled, where only packages in the specified repository are used. Data function authors must also configure their systems to write their data functions to use these packages.
Regardless of which way your organization uses to manage packages, the
administrator who installs the
R packages must do the following.
- Coordinate with the author of a Spotfire data function to ensure that all R packages that are used in the analysis are installed on the host computer running the nodes on which the Spotfire Service for R is running.
- Ensure that all required and
dependent packages associated with the needed packages are also installed. (The
author of the data function can provide the administrator with this
information.)
Note: The SPK package management tools handle installing all required and dependent packages needed by a specified package.
- Find help
Spotfire includes many avenues to help with packages, whether they are R language packages to use with Spotfire Service for R or Spotfire packages (SPKs). - The Spotfire Package (SPK)
A Spotfire SPK is usually created and tested by developers to package and deploy third-party extensions to the Spotfire Server, which can then be distributed to the Spotfire Server node for use by another service. - Installing R Packages Manually
If you have write permission to the computer hosting Spotfire Service for R, then you can install packages to a specific location manually, and then point to the package location in the custom configuration. - Creating a Spotfire Analysis to Display Installed Packages
You can create a data function for a Spotfire analysis that displays a table of all packages installed and available to the R engine running in your Spotfire Service for R.
- Find help
Spotfire includes many avenues to help with packages, whether they are R language packages to use with Spotfire Service for R or Spotfire packages (SPKs). - The Spotfire Package (SPK)
A Spotfire SPK is usually created and tested by developers to package and deploy third-party extensions to the Spotfire Server, which can then be distributed to the Spotfire Server node for use by another service. - Installing R Packages Manually
If you have write permission to the computer hosting Spotfire Service for R, then you can install packages to a specific location manually, and then point to the package location in the custom configuration. - Creating a Spotfire Analysis to Display Installed Packages
You can create a data function for a Spotfire analysis that displays a table of all packages installed and available to the R engine running in your Spotfire Service for R.