| Product | Version |
| Spotfire Analyst | All Supported Versions |
Keywords:
Spotfire Analyst, SpotfireSPK, buildSPK, SPK package, TERR package deployment, custom package, package management, DCF file, Spotfire deployment
Purpose
This article describes how to create an SPK file for deploying custom TERR/R packages to Spotfire Analyst using the SpotfireSPK package. Unlike Spotfire Statistics Services (TERR Service), which uses buildServerSPK(), Spotfire Analyst packages are created using buildSPK().
Overview
An SPK file is a Spotfire deployment package that can contain custom TERR/R packages and their dependencies. Once created, the SPK can be added to a Spotfire Server deployment and distributed to Spotfire Analyst clients.
Prerequisites
- Spotfire Analyst installed.
- TERR installed and operational.
- SpotfireSPK package installed.
- Custom TERR/R package installed and validated.
- All package dependencies available in the configured TERR library path.
Step 1: Load SpotfireSPK
library(SpotfireSPK)To view package creation documentation:
help(topic = "buildSPK", package = "SpotfireSPK")Step 2: Create a Package Definition File (DCF)
Create a DCF file containing the packages that will be included in the deployment.
packages_to_bundle <- collapse="," temp="temp">Example DCF content:
Packages: custom.packageVerify the contents:
readLines("C:/temp/TERRPackages.dcf")Step 3: Verify Package Installation
Before generating the SPK file, confirm that the package is installed and can be located by TERR.
find.package("custom.package")
installed.packages()[,c("Package","Version")]Review any package dependencies:
packageDescription("custom.package")$Imports
packageDescription("custom.package")$Depends
tools::package_dependencies(
"custom.package",
recursive = TRUE
)Step 4: Create the Analyst SPK Package
Use the buildSPK() function to create the deployment package.
library(SpotfireSPK)
buildSPK(
listFile = "C:/temp/TERRPackages.dcf",
spkFile = "C:/temp/custom_r_packages.spk"
)Upon successful completion, the following SPK file will be created:
C:/temp/custom_r_packages.spkUnderstanding buildSPK() vs buildServerSPK()
- buildSPK() is used for packages intended for Spotfire Analyst deployments.
- buildServerSPK() is used for packages intended for Spotfire Statistics Services (TERR Service).
- Both functions validate package dependencies before creating the SPK package.
- Missing dependencies will prevent successful package generation.
Common Errors and Resolutions
Package Not Installed
Warning:
no package 'custom.package' was found
Error:
package 'custom.package' is not installedResolution:
- Install the package into a library available to TERR.
- Verify installation using
find.package(). - Ensure the package is correctly referenced in the DCF file.
Missing Dependency
Error:
package '<dependency>' is not installedResolution:
- Install all required dependencies.
- Review package Imports and Depends sections.
- Validate recursive dependencies before rerunning
buildSPK().
R Version Compatibility Issues
package requires R version X.X.X
TERR supports R version Y.Y.YResolution:
- Review the package DESCRIPTION file.
- Verify compatibility with the TERR version used by Spotfire Analyst.
- Update or rebuild the package if necessary.
Validation Checklist
- Install the custom package.
- Install all package dependencies.
- Verify package visibility.
- Review package requirements.
- Create the DCF file.
- Run
buildSPK(). - Confirm SPK file generation.
- Add the SPK file to a Spotfire Server deployment area.
- Update the deployment and assign it to affected users/groups.
- Restart Spotfire Analyst and validate package availability.
Key Findings
buildSPK()packages custom TERR/R libraries for Spotfire Analyst deployment.- The DCF file controls which packages are included in the SPK.
- All package dependencies must be installed before package creation.
- Dependency validation occurs automatically during the build process.
- Version compatibility between the package and TERR should be verified before deployment.
Conclusion
Creating an SPK package for Spotfire Analyst is a straightforward process using the SpotfireSPK package and the buildSPK() function. Ensuring that all required packages, dependencies, and TERR compatibility requirements are validated beforehand helps prevent package creation and deployment failures.
Comments
0 comments
Please sign in to leave a comment.