Using the IBM Spectrum Discover application catalog
Use the IBM Spectrum® Discover application catalog to search, download, or deploy applications (which are provided by IBM®, customers, or third parties) to use in IBM Spectrum Discover.
To use the commands in the examples throughout this document, you must use Secure Shell (SSH) to
log in to the IBM Spectrum
Discover. You also must have an
authentication token that is generated from the command-line interface (CLI). (The token expires
after 1 hour.) Run the following command to generate a token:
ssh moadmin@<your IP entered during mmconfigappliance>
# Enter in the password you set during the mmconfigappliance
export SD_USER=<sdadmin or another user with dataadmin privileges>
export SD_PASSWORD=<password for SD_USER above>
export OVA=images
gettokenNote: In
this example,
gettoken is an alias under the moadmin user. Using
an alias saves the token in an environment variable that is called
TOKEN.Note: The examples in the sections throughout this document use the aliases
tcurl
and tcurl_json under the moadmin user, which also uses the
TOKEN environment variable.Information about the endpoints
Follow the procedure to access information on endpoints:
- Go to IBM Spectrum Discover Knowledge Center.
- Choose the version of IBM Spectrum Discover that you are running.
- Go to .
Querying the available applications
Run this command to query the applications that are available on
dockerhub:tcurl https://${OVA}/api/application/appcatalog/publicregistry | jqThe
output that is generated contains information that is gathered from the image itself (and from
dockerhub).Downloading an application image
Run the following command after you identify an application to
download:
tcurl_json https://localhost/api/application/appcatalog/image/ibmcom/spectrum-discover-example-application -X POST | jqNote: In
this example,
ibmcom/spectrum-discover-example-application is the
repo_name used in the publicregistry command.Running an application
After you download an application to your local docker cache, you can use it as a Kubernetes pod
within IBM Spectrum
Discover. Create a JSON-formatted file
with the following information (the file that is created is named example.json):



{
"repo_name": "ibmcom/spectrum-discover-example-application",
"version": "1.2.3",
"description": "Unique description about your use of this application",
"application_name": "example",
"my_env_var": "my_value",
"LOG_LEVEL": "DEBUG"
}
Note: In this example:
- The
repo_nameis the samerepo_namethat you used to download the application image. - The
versionis the same as the version from the output of thepublicregistrycommand. - The
descriptionis a unique description that is based on your application use. - The
application_nameis the name that gets registered within thepolicyengine. The system automatically appends a-applicationto the end of the file name for identification.
Run the following command to start the application as a Kubernetes pod:
tcurl_json https://localhost/api/application/appcatalog/helm -d@example.json -X POST | jq
You can add
environment variables to the JSON example. These environment variables can be ones that your
application needs or they can be ones that can override some software development kit (SDK) values.
The application SDK supports the following environment variables that can override default settings: - LOG_LEVEL - INFO (default), DEBUG
- Specifies the log level for the application to run with.
- MAX_POLL_INTERVAL - 86400000 (in milliseconds)(default - 1 day)
- Specifies when the Kafka consumer becomes unresponsive. Set this value higher than the time it takes for the application to process up to 100 records before it sends the reply to IBM Spectrum Discover. The default allows approximately 15 minutes for each record.
- PRESERVE_STAT_TIME - False (default), True
- Specifies whether to preserve atime or mtime when you run the deep-inspection application. If
the application processes records from Network File System (NFS), Server Message Block (SMB), or
local IBM Spectrum
Scale connections, the system preserves
the exact atime or mtime (in nanoseconds).
If the application processes records from a remote IBM Spectrum Scale connection, the system preserves atime or mtime up to and including seconds (with no subsecond preservation). The connection user must also have write access to the files. If the connection user does not have write access to the files, the system skips restoration of the atime or mtime because of permission errors. If
DEBUGis on, you can see the original atime or mtime in the logs, so you can potentially manually restore any that fail.

Scaling an application
An application by design processes each of the records one at a time. You can scale the number of
replicas the pod is running to process records in parallel. You can scale up to 10 replicas based on
the number of partitions available for the Kafka topics. Create a JSON-formatted file with the
following information (the file that is created is named
replicas.json):
{
"replicas": 10
}Then, run the following command to scale the
replicas:
tcurl_json https://localhost/api/application/appcatalog/helm/interesting-anaconda-example-application -d@replicas.json -X PATCHNote: In
this example,
interesting-anaconda-example-application is the combination of
deployment_name and chart_name from the Running an
application section.Stopping an application
Run the following command to stop an application (no matter how many replicas you
scale):
tcurl_json https://localhost/api/application/appcatalog/helm/interesting-anaconda -X DELETE | jqNote: In
this example,
interesting-anaconda is the chart_name when the
application was started.Deleting an application image
Run the following command (after you stop the application) to delete the application from your
local docker
cache:
tcurl https://localhost/api/application/appcatalog/image/ibmcom/spectrum-discover-example-application -X DELETE | jq