Managing environments

You can perform management tasks for environments, such as creating or customizing an environment template, stopping runtimes, and promoting environments to a deployment space. You must have the Admin role or Editor in a project.

Changing the environment of a notebook

You can switch environments for different reasons, for example, you can:

  • Select an environment with more processing power or more RAM
  • Change from using an environment without Spark to a Spark environment

You can only change the environment of a notebook if the notebook is unlocked. You can change the environment:

  • From the notebook opened in edit mode:

    1. Save your notebook changes.
    2. Click the Notebook Info icon (Notebook Info icon) from the notebook toolbar and then click Environment.
    3. Select another template with the compute power and memory capacity from the list.
    4. Select Change environment. This stops the active runtime and starts the newly selected environment.
  • From the Assets page of your project:

    1. Select the notebook in the Notebooks section, click Actions > Change Environment and select another environment. The kernel must be stopped before you can change the environment. This new runtime environment will be instantiated the next time the notebook is opened for editing.

Promoting an environment template to a space

If you created an environment template and associated it with an asset that you promoted to a deployment space, you can also promote the environment template to the same space. Promoting the environment template to the same space enables running the asset in the same environment that was used in the project.

You can only promote environment templates that you created. However, you can't promote a custom environment template if it uses a custom runtime image. In this situation, you must use a separate image for Watson Machine Learning that is created by an administrator.

To promote an environment template associated with an asset that you promoted to a deployment space:

  1. From the Manage tab of your project on the Environments page under Templates, select the custom environment template and click Actions > Promote.
  2. Select the space that you promoted your asset to as the target deployment space and optionally provide a description and tags.

Stopping active runtimes

Jupyter notebook runtimes are started per user and not per notebook. Stopping a notebook kernel doesn't stop the environment runtime in which the kernel is started because other notebooks might be started in the same environment. Only stop a notebook runtime if you are sure that no other notebook kernels are active.

Only runtimes that are started for jobs are automatically shut down after the scheduled job completes. For example, if you schedule to run a notebook once a day for two months, the runtime instance is activated every day for the duration of the scheduled job and deactivated again after the job finishes.

Project users with Admin role can stop all runtimes in the project. Users who are added to the project with Editor role can stop the runtimes that they started, but can't stop other project users’ runtimes. Users who are added to the project with the Viewer role can't see the runtimes in the project.

You can stop runtimes under Tool runtimes on the Environments page on the Manage tab of your project.

Important: Only stop a runtime if you are sure that no notebook kernels are active in the same environment runtime.

Default idle timeouts

If you don't stop an active runtime when you no longer need it, it is stopped for you after a defined idle time.

The following table shows the default idle timeout values for runtimes by tool and type of runtime.

Default idle timeout values for environment runtimes shown by tool
Tool Runtime idle timeout
Jupyter notebook editor CPU and GPU runtimes: 18 hours
Spark runtimes: 30 minutes
JupyterLab CPU and GPU runtimes: 18 hours
Spark runtimes: 30 minutes
RStudio 2 hours
SPSS Modeler 15 minutes

Cluster administrators can disable the default idle timeout for CPU and GPU runtimes and Rstudio. For details, see Disabling the default CPU and GPU idle timeout.

Changing this idle timeout doesn't affect jobs. It only applies to interactive content.

Migrating custom environment templates from Runtime 24.1 to Runtime 25.1

In Runtime 25.1, instead of a combination of conda virtual environments and conda package manager, a combination of Python virtual environments and pip package manager is used.

If you are using the default packages of a runtime, you will not notice the change at all. However, if you performed any kind of package customization (within a notebook or through a custom environment) in an environment template that is based on Runtime 24.1 and uses conda, you must migrate it before Runtime 24.1 is removed.

Additional packages that are installed within a notebook

What to do with additional packages that are installed within a notebook
Before After Notes
You are using pip to install additional packages No changes required N/A
You are using conda to install additional python packages Find the equivalent package on PyPI and use pip to install it. If the pip package requires additional system libraries that are not included in the package and that are not within the default images, we recommend to first check whether there is a viable alternative that has no additional requirements for system libraries. If that is not possible, reach out to IBM Support.
You are using conda to install additional R packages Installing additional R packages is not supported any more. Reach out to IBM Support if your business case requires additional R packages.

Additional packages that are installed by using custom environments

What to do with additional packages that are installed by using custom environments
Before After Notes
You only used the pip section of the conda.yaml Convert to requirements.txt format No changes required other than the format change. See example
You have python package entries outside of the pip section Find PyPI replacements for conda packages and add them to requirements.txt If the pip package requires additional system libraries that are not included in the package and that are not within the default images, we recommend to first check whether there is a viable alternative that has no additional requirements for system libraries. If that is not possible, reach out to IBM Support.
You have R package entries outside of the pip section Installing additional R packages is not supported any more. Reach out to IBM Support if your business case requires additional R packages.

Moving requirements from conda.yaml to requirements.txt

To move requirements from conda.yaml to requirements.txt, extract all packages from the pip section and then list them in the requirements.txt file (one package in one line):

Old: conda.yaml

dependencies:
  - pip:
    - pandas==1.5.0
    - numpy==1.23.0
    - scikit-learn==1.1.0

New: requirements.txt

pandas==1.5.0
numpy==1.23.0
scikit-learn==1.1.0