Skip to content

Commit bf5a7d5

Browse files
authored
[CTM-142] New terra base image with sudo (#511)
* [CTM-142] New terra base image with sudo * move to old file structure * add to publishing steps * tweaks * Update comment * make version 1.0.0
1 parent ca0b855 commit bf5a7d5

39 files changed

+3716
-76
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
required: true
88
type: choice
99
options:
10+
- terra-base
1011
- terra-jupyter-aou
1112
- terra-jupyter-base
1213
- terra-jupyter-bioconductor

README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This repo provides docker images for running jupyter notebook in [Terra](https:/
55
Make sure to go through the [contributing guide](https://github.com/DataBiosphere/terra-docker/blob/master/CONTRIBUTING.md#contributing) as you make changes to this repo.
66

77
# Terra Base Images
8-
[terra-jupyter-base](terra-jupyter-base/README.md)
8+
[terra-base](terra-base/README.md)
99

1010
[terra-jupyter-python](terra-jupyter-python/README.md)
1111

@@ -20,15 +20,18 @@ Make sure to go through the [contributing guide](https://github.com/DataBiospher
2020
# How to create your own Custom image to use with notebooks on Terra
2121
Custom docker images need to use a Terra base image (see above) in order to work with the service that runs notebooks on Terra.
2222
* You can use any of the base images above
23-
* Here is an example of how to build off of a base image: Add `FROM us.gcr.io/broad-dsp-gcr-public/terra-jupyter-base:0.0.1` to your dockerfile (`terra-jupyter-base` is the smallest image you can extend from)
23+
* `terra-base` is the smallest image, but doesn't include any scientific packages on top of Jupyter and R
24+
* Here is an example of how to build off of a base image: Add `FROM us.gcr.io/broad-dsp-gcr-public/terra-base:0.0.1` to your dockerfile
2425
* Customize your image (see the [terra-jupyter-python](terra-jupyter-python/Dockerfile) dockerfile for an example of how to extend from one of our base images
25-
* Publish the image to either GCR or Dockerhub; the image must be public to be used
26+
* Publish the image to either GAR or Dockerhub;
27+
* If using Dockerhub, the image **must be public** to be used
2628
* Use the published container image location when creating notebook runtime
2729
* Dockerhub image example: [image name]:[tag]
28-
* GCR image example: us.gcr.io/repository/[image name]:[tag]
29-
* Since 6/28/2021, we introduced a few changes that might impact building custom images
30-
- Home directory of new images will be `/home/jupyter`. This means if your dockerfile is referencing `/home/jupyter-user` directory, you need to update it to $HOME (recommended) or `/home/jupyter`.
31-
- Creating VMs with custom images will take much longer than terra supported images because `docker pull` will take a few min. If the custom image ends up being too large, VM creation may time out. New base images are much larger in size than previous versions.
30+
* GAR image example: us.gcr.io/repository/[image name]:[tag]
31+
* Some things to keep in mind when creating custom images:
32+
- The home directory of new images will be `/home/jupyter`. This means if your dockerfile is referencing the `/home/jupyter-user` directory, you need to update it to $HOME (recommended) or `/home/jupyter`.
33+
- Creating VMs with custom images may take longer than terra supported images because `docker pull` will take a few min. If the custom image ends up being too large, VM creation may time out.
34+
-
3235

3336
# Development
3437
## Using git secrets
@@ -56,25 +59,25 @@ Once you have the container running, you should be able to access jupyter at htt
5659
Detailed documentation on how to integrate the terra-docker image with Leonardo can be found [here](https://broadworkbench.atlassian.net/wiki/spaces/IA/pages/2519564289/Integrating+new+Terra+docker+images+with+Leonardo)
5760

5861
### If you are adding a new image:
59-
- Create a new directory with the Dockerfile and a CHANGELOG.md.
62+
- Create a new directory with the Dockerfile and a CHANGELOG.md.
6063
- Add the directory name (also referred to as the image name) as an entry to the image_data array in the file in config/conf.json. For more info on what is needed for a new image, see the section on the config
6164
- If you wish the image to be baked into our custom image, which makes the runtime load significantly faster (recommended), make a PR into the leonardo [repo](https://github.com/DataBiosphere/leonardo) doing the following within the `jenkins` folder:
62-
- Add the image to the parameter list in the Jenkinsfile
63-
- Update the relevant `prepare` script in each subdirectory. Currently there is a prepare script for gce and dataproc.
64-
- It is recommended to add a test in the `automation` directory (`automation/src/test/resources/reference.conf`)
65-
- Add your image to the `reference.conf` in the automation directory. This will be the only place any future version updates to your image happen. This ensures, along with the test in the previous step, that any changes to the image are tested.
66-
- Run the GHA to generate the image, and add it to `reference.conf` in the http directory (`http/src/main/resources/reference.conf`)
65+
- Add the image to the parameter list in the Jenkinsfile
66+
- Update the relevant `prepare` script in each subdirectory. Currently there is a prepare script for gce and dataproc.
67+
- It is recommended to add a test in the `automation` directory (`automation/src/test/resources/reference.conf`)
68+
- Add your image to the `reference.conf` in the automation directory. This will be the only place any future version updates to your image happen. This ensures, along with the test in the previous step, that any changes to the image are tested.
69+
- Run the GHA to generate the image, and add it to `reference.conf` in the http directory (`http/src/main/resources/reference.conf`)
6770

6871
### If you are updating an existing image:
6972
- [Create your terra-docker PR](https://broadworkbench.atlassian.net/wiki/spaces/IA/pages/2519564289/Integrating+new+Terra+docker+images+with+Leonardo#1.-Create-a-terra-docker-PR)
70-
- Update the version in config/conf.json
71-
- Update CHANGELOG.md and VERSION file
72-
- Ensure that no `From` statements need to be updated based on the image you updated (i.e., if you update the base image, you will need to update several other images)
73-
- Run updateVersions.sc to bump all images dependent on the base
73+
- Update the version in config/conf.json
74+
- Update CHANGELOG.md and VERSION file
75+
- Ensure that no `From` statements need to be updated based on the image you updated (i.e., if you update the base image, you will need to update several other images)
76+
- Run updateVersions.sc to bump all images dependent on the base
7477
- [Merge your terra-docker PR and check if the image(s) and version json files are created](https://broadworkbench.atlassian.net/wiki/spaces/IA/pages/2519564289/Integrating+new+Terra+docker+images+with+Leonardo#2.-Merge-your-terra-docker-PR-and-check-images-are-created)
7578
- [Open a PR in leonardo](https://broadworkbench.atlassian.net/wiki/spaces/IA/pages/2519564289/Integrating+new+Terra+docker+images+with+Leonardo#3.-Create-a-new-leo-PR-that-integrates-the-new-images)
76-
- Update the relevant `prepare` script within the `jenkins` folder
77-
- Update the automation `reference.conf` file
79+
- Update the relevant `prepare` script within the `jenkins` folder
80+
- Update the automation `reference.conf` file
7881
- [Run the GHA on your branch to generate the new image](https://broadworkbench.atlassian.net/wiki/spaces/IA/pages/2519564289/Integrating+new+Terra+docker+images+with+Leonardo#4.-Run-the-Github-Action-in-leo-to-generate-a-new-custom-COS-image)
7982
- [Update the leonardo PR to use the newly generated image](https://broadworkbench.atlassian.net/wiki/spaces/IA/pages/2519564289/Integrating+new+Terra+docker+images+with+Leonardo#5.-Update-the-Leo-PR-to-use-the-generated-OS-images)
8083
- Ensure that the `terra-docker-versions-candidate.json` file (which is what the UI sources the dropdown from) in the `terra-docjker-image-documentation-[env]` bucket correclty references your new docker image
@@ -85,11 +88,11 @@ Detailed documentation on how to integrate the terra-docker image with Leonardo
8588
Build the image:
8689
run `docker build [your_dir] -t [name]`.
8790

88-
`docker build terra-jupyter-base -t terra-jupyter-base`
91+
`docker build terra-base -t terra-base`
8992

9093
If you're on an M1 and building an image from a locally built image, replace the current FROM command:
9194

92-
`FROM --platform=linux/amd64 terra-jupyter-base`
95+
`FROM --platform=linux/amd64 terra-base`
9396

9497
Apple Silicon chips later then M1 (ex. M3) need:
9598

@@ -120,9 +123,9 @@ To launch an image through Terra, navigate to https://app.terra.bio or your BEE'
120123

121124
## Config
122125

123-
There is a config file located at `config/conf.json` that contains the configuration used by all automated jobs and build scripts that interface with this repo.
126+
There is a config file located at `config/conf.json` that contains the configuration used by all automated jobs and build scripts that interface with this repo.
124127

125-
There is a field for "spark_version" top-level which must be updated if we update the debian version used in the custom image.
128+
There is a field for "spark_version" top-level which must be updated if we update the debian version used in the custom image.
126129
Currently it assumes 1.4x https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-release-1.4
127130

128131
There are some constants included, such as the tools supported by this repo. Of particular interest is the image_data array.
@@ -163,7 +166,7 @@ Each time you update or add an image, you will need to update the appropriate en
163166

164167
The scripts folder has scripts used for building.
165168
- `generate_package_docs.py` This script is run once by build.sh each time an image is built. It is used to generate a .json with the versions for the packages in the image.
166-
- `generate_version_docs.py` This script is run each time an image is built. It builds a new file master version file for the UI to look up the current versions to reference.
169+
- `generate_version_docs.py` This script is run each time an image is built. It builds a new file master version file for the UI to look up the current versions to reference.
167170

168171
## Image dependencies
169172

build_all.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
# Example: ./build_all.sh
44

55
# Create the ordered list of images to build
6-
# 1- terra-jupyter-base
7-
# 2- terra-jupyter-python
8-
# 3- terra-jupyter-r
9-
# 4- terra-jupyter-gatk
10-
# 5- terra-jupyter-hail
11-
# 6- terra-jupyter-aou
12-
# 7- terra-jupyter-bioconductor
13-
# 8- terra-rstudio-aou
14-
# 9- wondershaper
15-
images=("terra-jupyter-base" "terra-jupyter-python" "terra-jupyter-r" "terra-jupyter-gatk" "terra-jupyter-hail" "terra-jupyter-aou" "terra-jupyter-bioconductor" "terra-rstudio-aou" "wondershaper")
6+
# 1- terra-base
7+
# 2- terra-jupyter-base
8+
# 3- terra-jupyter-python
9+
# 4- terra-jupyter-r
10+
# 5- terra-jupyter-gatk
11+
# 6- terra-jupyter-hail
12+
# 7- terra-jupyter-aou
13+
# 8- terra-jupyter-bioconductor
14+
# 9- terra-rstudio-aou
15+
# 10- wondershaper
16+
images=("terra-base", "terra-jupyter-base" "terra-jupyter-python" "terra-jupyter-r" "terra-jupyter-gatk" "terra-jupyter-hail" "terra-jupyter-aou" "terra-jupyter-bioconductor" "terra-rstudio-aou" "wondershaper")
1617

1718
# Loop over each image to build in the correct order
1819
for image in "${images[@]}"; do
@@ -22,4 +23,4 @@ for image in "${images[@]}"; do
2223
done
2324

2425
# Once all images have been built, generate and push the 'terra-docker-versions-new' doc
25-
python scripts/generate_version_docs.py
26+
python scripts/generate_version_docs.py

config/conf.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,24 @@
9595
"include_in_custom_gce" : true
9696
}
9797
},
98+
{
99+
"name" : "terra-base",
100+
"base_label" : "New Base",
101+
"tools" : [
102+
"python"
103+
],
104+
"packages" : {
105+
106+
},
107+
"version" : "1.0.0",
108+
"automated_flags" : {
109+
"generate_docs" : true,
110+
"include_in_ui" : true,
111+
"build" : true,
112+
"include_in_custom_dataproc" : true,
113+
"include_in_custom_gce" : true
114+
}
115+
},
98116
{
99117
"name" : "terra-jupyter-r",
100118
"base_label" : "R",

terra-base/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## 1.0.0 - 12/16/2025
2+
3+
- Extends GPU-enabled Ubuntu base image
4+
- Uses Python 3.10
5+
- Add UV
6+
- Add conda
7+
- Add Jupyter
8+
- Add Leonardo customizations/extensions
9+
10+
Image URL: `us.gcr.io/broad-dsp-gcr-public/terra-base:1.0.0`

0 commit comments

Comments
 (0)