Installing Custom Packages in Kubeflow Notebooks at Runtime
Describes how to install custom packages in existing Kubeflow notebooks that persist between restarts.
You can only install custom packages in a Kubeflow notebook in connected HPE Ezmeral Unified Analytics Software environments for two types of packages – conda packages and pip packages.
You cannot install custom packages in air-gapped environments. Packages installed to the base environment do not persist; the packages are removed after the notebook restarts.
- Install packages to the base environment
- Create and install your own conda environment
- Use the conda environment of another notebook user, if permitted by the environment owner
- If packages do not have to persist between restarts, install the packages to the base conda environment. This applies to both single-user and multi-user modes.
- If packages must persist between restarts, create an individual conda environment. This applies to both single-user and multi-user modes.
Single-User Mode
- Create an individual conda
environment:
conda create --prefix ~/.conda/envs/kf-users-env --clone base
- Activate the conda environment:
conda activate kf-users-env
Multi-User Mode
Any user with access to the notebook, typically the owner, can create the conda environment. The conda environment is shared with other users (between contributors). All users get equivalent permissions. Users can use the existing packages, as well as install and remove the packages.
- Create the conda
environment:
umask 0000 && conda create --prefix ~/.conda/envs/kf-users-env --clone base
- Activate the conda environment:
conda activate kf-users-env
- Add users (contributors) to the conda
environment:
conda config --append envs_dirs /home/<notebook_owner_username>/.conda/envs
- Activate the conda environment for
users:
conda activate kf-users-env
- Install the conda
package:
conda install package-name=<version>
- Install the PIP
package:
pip install package-name==<version>