Skip to main content

Application SDK

The Application SDK is a set of libraries provided to aid with the development of applications that leverage the IBM Spectrum Discover platform capabilities. An application in this context is described as a program that can act upon the source data to extract relevant metadata or can modify the source data as instructed. Examples of this are content inspection, anonymization, or data movement. When a policy is run against an application the application receives instructions from the Spectrum Discover PolicyEngine (called 'action params') and a list of documents to perform those actions on.

The application libraries provide functions to:

  • Initialize the application and register it with the Spectrum Discover host
  • Read and parse work messages from the PolicyEngine
  • Retrieve the contents of the documents via Spectrum Discover/COS/NFS/SMB connections
  • Construct and send the results back to the PolicyEngine with associated tags

The Application SDK provides abstracted methods to send and receive the relevant information for the work messages and sending the results back to the PolicyEngine.

An example application using these libraries is also provided in Spectrum_Discover_Example_Application repository.

Building a python wheel

If you have local modifications to the SDK that you would like to send via a Pull Request (PR), you can test your build locally by creating a python wheel. If you are not making changes to the SDK, there is no need to run the below commands and you can use the currently published SDK on pypi. You can create a local python wheel with the following command:

Edit the setup.py to increment the version number
 $ python3 -m pip install wheel
 $ python3 setup.py sdist bdist_wheel --universal --dist=dist
Edit the Dockerfile to increment the patch arg version

Building a docker image

This dockerfile has been switched to use buildah.

buildah has the benefit of creating a mount while building so you no longer need to copy temp files into the build which increases the layer size. This also assumes that you have a ubi8_packages.tar.gz file that contains rpms that are not available in the ubi repos. In our case we are using rpms from centos 8 as you cannot distribute non-ubi redhat rpms. Read the Red Hat UBI FAQ for more information.

The ubi8_packages.tar.gz file needs to contain the rpms and relevant dependencies for things like nfs-utils and cifs-utils. Before packaging up the rpms, you can issue a createrepo . within the folder to generate the repodata. The tar.gz also needs to include a file to setup the repo. In our case we called it ubi8_local.repo and the contents are:

[ubi-8-local]
baseurl = file:///install_media/ubi8_packages/
enabled = 1
gpgcheck = 0
name = Packages required for updating ubi8 images

Assuming that you have already created the wheel, you can then create the SDK image:

mkdir -p install_media
cp ubi8_packages.tar.gz install_media
cp dist/ibm_spectrum_discover_application_sdk-*-py2.py3-none-any.whl install_media
sudo buildah bud -f Dockerfile -t docker-daemon:ibmcom/spectrum-discover-application-sdk:latest -v $(pwd)/install_media:/install_media/ .

You can now use this docker image as a template for containerizing the Example Application.

Release files for ibm-spectrum-discover-application-sdk 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ibm-spectrum-discover-application-sdk 2.1.2
File Interpreter ABI Platform
ibm_spectrum_discover_application_sdk-2.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / ibm_spectrum_discover_application_sdk-2.1.2-py2.py3-none-any.whl

Download URL ibm_spectrum_discover_application_sdk-2.1.2-py2.py3-none-any.whl
Size 20.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d65ffb9097af4c3d992cf9576aceec8b09b39d974628bec425e8528fdc1c4252
BLAKE2b-256 checksum
How to use checksums
2a601a5274c85fe22d728eba269f666749638830f0c675233e9c0c7005890233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

2.1.2 This release

1 release file

0.0.22

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.16

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page