This repo contains the terra-jupyter-base image that is compatible with notebook service in Terra called Leonardo. For example, use us.gcr.io/broad-dsp-gcr-public/terra-base:{version} in terra.
This image is different from the legacy base image that is currently use to build the docker images cached in Terra (terra-jupyter-base). The current purpose of this new base image is to to unblock users from creating custom images in Terra.
The terra-jupyter-base extends the Ubuntu base image by including the following:
- OS prerequisites
- google-cloud-sdk
- Python 3.10
- Conda
- Jupyter & JupyterLab
- Leonardo customizations/extensions
- Terra notebook utils
To see the complete contents of this image please see the Dockerfile.
To select an older version this image, you can search the CHANGELOG.md for a specific package version you need.
Once you find an image version that you want, simply copy and paste the image url from the changelog into the corresponding custom docker field in the Terra notebook runtime widget.
To update UV packages, first cd into theterra-base directory, then either:
- run
uv add <package_name>or remove to add or remove a specific package in the project - modify the pyproject.toml file, then run
uv lock
To activate a virtual environment for local testing:
source .venv/bin/activate
uv sync(.venv is created when you run uv install)
To build the image locally, run the following command in the root of the repo:
docker build terra-base -t us.gcr.io/broad-dsp-gcr-public/terra-base:{version}
docker push us.gcr.io/broad-dsp-gcr-public/terra-base:{version}If you change the following paths:
JUPYTER_HOMEJUPYTER_USERCONDA_HOME
You may need to update the following files appropriately here and in Leonardo:
- terra-docker
run_jupyter.sh- the notebook extension scripts
- leonardo
gce-init.shinit-action.sh- the
jupyterUserhomein RuntimeTemplateValues