Building custom images

You can build custom images based on Jupyter notebooks and RStudio runtime images available in IBM Watson Studio. The images contain pre-selected open-source, as well as selected IBM libraries. Building custom images enables you to optimize the standard software configuration of a 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.

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

You can also build custom images based on the SPSS Modeler runtime images to install custom ODBC drivers. Follow the instructions under Building custom images to install ODBC drivers instead of the instructions here.

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.

Important: You must carry out the following steps on all existing custom images each time you upgrade Cloud Pak for Data to rebase the image with the latest Cloud Pak for Data runtime image, which includes all of the latest fixes, including security fixes.

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 Watson Studio 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 runtime image that you want to customize. See Downloading the configuration file.

    3. Downloading the image in the configuration. See Downloading the image.

  2. Adding customizations and building a new image. See Creating a custom image.

  3. Pushing the image to the container server. See Registering the custom image.

  4. Changing and uploading the configuration file. See Uploading the custom configuration.

Using the image in projects

After the custom image was created and registered, it can be selected in IBM Watson Studio to run notebooks or to launch RStudio. To do this, you need to create an environment template that uses the custom image and then select this environment template to run your notebook or launch RStudio.

Required role: You need Admin or Editor permissions on the project to create an environment template and select the custom image.

Following these steps to create an environment template.

Considerations

If you use custom runtime images, you must consider the following aspects:

  • Custom images that were created before Cloud Pak for Data 4.5.1 cannot benefit from mamba, because the mamba binary is included in the runtime image itself. If the image contains no mamba, customizations will fallback to using conda by default.
  • To use mamba in older custom images, you need to recreate the custom images based on the latest images available for download in Cloud Pak for Data 4.5.1 or you need to install mamba into your custom image.
  • Custom runtime images for notebooks can't be built for Spark environments.
  • Custom runtime images can't be used in a deployment. You need to create a separate image for Watson Machine Learning. See Customizing deployment runtime images.
  • It is 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.
  • Custom images can only be used in the notebook editor, JuypterLab, and RStudio. You can't use custom images based on Watson Studio Jupyter runtimes in Watson Machine Learning or in Data Refinery.
  • Currently, you can't add arbitrary notebook or JupyterLab extensions to a custom image.

Parent topic: Customizing environments