Skip to content

Latest commit

 

History

History

README.md

terra-jupyter-base image

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.

Context

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.

Image contents

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.

Selecting prior versions of this image

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.

Updating the UV packages

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)

Building the image

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}

NOTE: Changing paths

If you change the following paths:

  • JUPYTER_HOME
  • JUPYTER_USER
  • CONDA_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.sh
    • init-action.sh
    • the jupyterUserhome in RuntimeTemplateValues