Building custom images to install ODBC drivers

You can build custom images based on the SPSS Modeler runtime images available in IBM Watson Studio. Building custom images enables you to optimize the standard software configuration of an SPSS Modeler runtime for your application needs. Custom images can also be used in air-gapped environments with requirements which forbid exposing any operations to the internet.

For example, you can use custom images to install custom ODBC drivers.

To create a custom image, you need to download the image of the SPSS Modeler runtime that you want to customize, build a new custom image by adding ODBC drivers to the image you downloaded, register the new image, and finally update the environment definition you created in your project to use the new custom image.

Creating and registering a custom image

Required role: You must be a Cloud Pak for Data cluster administrator to create and register a custom image.

Follow these steps to create and register a custom image:

  1. Prepare to build a new image by:

    1. Getting the registry URL to use for Docker commands and in scripts. The SPSS Modeler runtime images are stored in a Docker image registry. In Cloud Pak for Data, you can only use an external registry outside of the Cloud Pak for Data OpenShift cluster. To use that registry, you need the URL to the external registry that was used during the installation of Cloud Pak for Data. You use the same URL for all commands and in all scripts that you run.
    2. Downloading the configuration file for the SPSS Modeler runtime image that you want to customize. See Downloading the configuration file.
    3. Downloading the image in the configuration. See Downloading the image.
  2. Add customizations and build a new image. See Creating a custom image.
    Example docker file for installing the SAP Hana driver:
    FROM <modeler_runtime image> as custom-hana-runtime
    USER root
    # Install SAP Hana driver
    RUN mkdir -p /opt/sap
    ADD hanaclient-2.7.26-linux-x64.tar.gz /opt/sap
    RUN /opt/sap/client/hdbinst --path=/opt/sap/hdbclient
    # enable SAP Hana
    RUN sed -i '2iSAP HANA Client=Installed' ${SDAPDRIVER_HOME}/odbcinst.ini
    USER modeler-user
    Example docker file for installing the Exasol driver:
    FROM <modeler_runtime image> as custom-exasol-runtime
    USER root
    # Install Exasol driver
    RUN mkdir -p /opt/exasol
    ADD EXASOL_ODBC-7.1.4.tar.gz /opt/exasol
    RUN mv /opt/exasol/EXASOL_ODBC-7.1.4/* /opt/exasol && \
        rm -rf /opt/exasol/EXASOL_ODBC-7.1.4
    # enable Exasol
    RUN sed -i '2iEXASolution Driver=Installed' ${SDAPDRIVER_HOME}/odbcinst.ini
    USER modeler-user
    Example docker file for installing the Teradata driver:
    FROM <modeler_runtime image> as custom-teradata-runtime
    USER root
    # Install Teradata Tools & Utilities
    ADD TeradataToolsAndUtilitiesBase__linux_x8664.17.20.05.00-1.tar.gz /opt
    RUN cd /opt/TeradataToolsAndUtilitiesBase && \
        ./setup.sh a && \
        cd /opt && \
        rm -rf /opt/TeradataToolsAndUtilitiesBase*
    # enable Teradata
    RUN sed -i '2iTeradata ODBC Driver=Installed' ${SDAPDRIVER_HOME}/odbcinst.ini
    USER modeler-user
    Note: The folder name will vary depending on the version of the driver package you're using.
  3. Push the image to the container server. See Registering the custom image.
  4. Change and upload the configuration file. See Uploading the change configuration.

Considerations

If you use custom images to run SPSS Modeler, you must consider the following aspects:

  • It's your responsibility to ensure that all updates that are made to the available runtime images in Watson Studio, including all security updates, are also made to your custom images. Watch out for new fix packs or any related information. When new versions of Cloud Pak for Data are released, we strongly encourage you to rebuild all of your custom images.