Skip to content

Commit 474d497

Browse files
authored
[CTM-142] New terra base image (#4888)
1 parent a14baf8 commit 474d497

File tree

18 files changed

+57
-38
lines changed

18 files changed

+57
-38
lines changed

automation/src/test/resources/reference.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
leonardo {
2+
baseImageUrl = "us.gcr.io/broad-dsp-gcr-public/terra-base:1.0.0"
23
rImageUrl = "us.gcr.io/broad-dsp-gcr-public/terra-jupyter-r:2.2.7"
34
pythonImageUrl = "us.gcr.io/broad-dsp-gcr-public/terra-jupyter-python:1.1.6"
45
hailImageUrl = "us.gcr.io/broad-dsp-gcr-public/terra-jupyter-hail:1.1.14"

automation/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/LeonardoConfig.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ object LeonardoConfig extends CommonConfig {
1212
object Leonardo {
1313
val apiUrl: String = leonardo.getString("apiUrl")
1414
val notebooksServiceAccountEmail: String = leonardo.getString("notebooksServiceAccountEmail")
15+
val baseImageUrl: String = leonardo.getString("baseImageUrl")
1516
val rImageUrl: String = leonardo.getString("rImageUrl")
1617
val pythonImageUrl: String = leonardo.getString("pythonImageUrl")
1718
val hailImageUrl: String = leonardo.getString("hailImageUrl")
1819
val gatkImageUrl: String = leonardo.getString("gatkImageUrl")
1920
val aouImageUrl: String = leonardo.getString("aouImageUrl")
20-
val baseImageUrl: String = leonardo.getString("baseImageUrl")
2121
val rstudioBioconductorImage =
22-
ContainerImage(leonardo.getString("rstudioBioconductorImageUrl"), ContainerRegistry.GCR)
22+
ContainerImage(leonardo.getString("rstudioBioconductorImageUrl"), ContainerRegistry.GAR)
2323

2424
private val topic = ProjectTopicName.of(gcs.getString("serviceProject"), leonardo.getString("topicName"))
2525
val location: Location = Location(leonardo.getString("location"))

automation/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/RuntimeFixtureSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ trait RuntimeFixtureSpec
115115
billingProject,
116116
runtimeName,
117117
getRuntimeRequest(cloudService.getOrElse(CloudService.GCE),
118-
toolDockerImage.map(i => ContainerImage(i, ContainerRegistry.GCR)),
118+
toolDockerImage.map(i => ContainerImage(i, ContainerRegistry.GAR)),
119119
welderRegistry
120120
)
121121
)

automation/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/runtimes/RuntimeCreationDiskSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class RuntimeCreationDiskSpec extends BillingProjectFixtureSpec with ParallelTes
213213
)
214214

215215
val createRuntime2Request = createRuntimeRequest.copy(toolDockerImage =
216-
Some(ContainerImage(LeonardoConfig.Leonardo.pythonImageUrl, ContainerRegistry.GCR))
216+
Some(ContainerImage(LeonardoConfig.Leonardo.pythonImageUrl, ContainerRegistry.GAR))
217217
) // this just needs to be a different image from default image Leonardo uses, which is gatk
218218

219219
val createRuntimeCloneRequest = createRuntime2Request.copy(

automation/src/test/scala/org/broadinstitute/dsde/workbench/leonardo/runtimes/RuntimeDataprocSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class RuntimeDataprocSpec extends BillingProjectFixtureSpec with ParallelTestExe
106106
false
107107
)
108108
),
109-
toolDockerImage = Some(ContainerImage(LeonardoConfig.Leonardo.hailImageUrl, ContainerRegistry.GCR))
109+
toolDockerImage = Some(ContainerImage(LeonardoConfig.Leonardo.hailImageUrl, ContainerRegistry.GAR))
110110
)
111111
getRuntimeResponse <- LeonardoApiClient.createRuntimeWithWait(project, runtimeName, createRuntimeRequest)
112112
runtime = ClusterCopy.fromGetRuntimeResponseCopy(getRuntimeResponse)

core/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/containerModels.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ sealed trait ContainerRegistry extends EnumEntry with Product with Serializable
1212
object ContainerRegistry extends Enum[ContainerRegistry] {
1313
val values = findValues
1414

15-
final case object GCR extends ContainerRegistry {
15+
final case object GAR extends ContainerRegistry {
1616
val regex: Regex =
17-
"""^((?:us\.|eu\.|asia\.)?gcr.io)/([\w.-]+/[\w.-]+)(?::(\w[\w.-]+))?(?:@([\w+.-]+:[A-Fa-f0-9]{32,}))?$""".r
18-
override def toString: String = "GCR"
17+
// with GCR switching to GAR but keeping the old addresses valid, this accepts both gcr.io and gar.io addresses
18+
"""^((?:us\.|eu\.|asia\.)?(?:gcr|gar)\.io)/([\w.-]+/[\w.-]+)(?::(\w[\w.-]+))?(?:@([\w+.-]+:[A-Fa-f0-9]{32,}))?$""".r
19+
20+
override def toString: String = "GAR"
1921
}
2022

2123
final case object GHCR extends ContainerRegistry {

http/src/main/resources/init-resources/gce-init.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,7 @@ if [ ! -z "$JUPYTER_DOCKER_IMAGE" ] ; then
537537
# Starts the locking logic (used for AOU). google_sign_in.js is likely not used anymore
538538
docker exec -u 0 $JUPYTER_SERVER_NAME /bin/bash -c "$JUPYTER_HOME/scripts/extension/install_jupyter_contrib_nbextensions.sh \
539539
&& mkdir -p $JUPYTER_USER_HOME/.jupyter/custom/ \
540+
&& chown -R jupyter:users $JUPYTER_USER_HOME/.jupyter \
540541
&& cp $JUPYTER_HOME/custom/google_sign_in.js $JUPYTER_USER_HOME/.jupyter/custom/ \
541542
&& ls -la $JUPYTER_HOME/custom/extension_entry_jupyter.js \
542543
&& cp $JUPYTER_HOME/custom/extension_entry_jupyter.js $JUPYTER_USER_HOME/.jupyter/custom/custom.js \

http/src/main/resources/init-resources/init-actions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ EOF
275275
# If any image is hosted in a GAR registry (detected by regex) then
276276
# authorize docker to interact with gcr.io.
277277
# NOTE: GCR images are now hosted on GAR, but the file paths haven't changed, they automatically redirect.
278-
if grep -qF "gcr.io" <<< "${JUPYTER_DOCKER_IMAGE}${RSTUDIO_DOCKER_IMAGE}${PROXY_DOCKER_IMAGE}${WELDER_DOCKER_IMAGE}" ; then
278+
if grep -qF "gcr.io|gar.io" <<< "${JUPYTER_DOCKER_IMAGE}${RSTUDIO_DOCKER_IMAGE}${PROXY_DOCKER_IMAGE}${WELDER_DOCKER_IMAGE}" ; then
279279
log 'Authorizing GCR/GAR...'
280280
gcloud auth configure-docker
281281
fi
@@ -329,7 +329,6 @@ EOF
329329

330330
# Jupyter-specific setup, only do if Jupyter is installed
331331
if [ ! -z ${JUPYTER_DOCKER_IMAGE} ] ; then
332-
log 'Installing Jupydocker kernelspecs...'
333332

334333
# Install notebook.json
335334
if [ ! -z ${JUPYTER_NOTEBOOK_FRONTEND_CONFIG_URI} ] ; then
@@ -476,6 +475,7 @@ EOF
476475
# Install the custom jupyter extensions needed to lock notebooks into edit or safe modes (required by AOU)
477476
docker exec -u 0 $JUPYTER_SERVER_NAME /bin/bash -c "$JUPYTER_HOME/scripts/extension/install_jupyter_contrib_nbextensions.sh \
478477
&& mkdir -p $JUPYTER_USER_HOME/.jupyter/custom/ \
478+
&& chown -R jupyter:users $JUPYTER_USER_HOME/.jupyter \
479479
&& cp $JUPYTER_HOME/custom/google_sign_in.js $JUPYTER_USER_HOME/.jupyter/custom/ \
480480
&& ls -la $JUPYTER_HOME/custom/extension_entry_jupyter.js \
481481
&& cp $JUPYTER_HOME/custom/extension_entry_jupyter.js $JUPYTER_USER_HOME/.jupyter/custom/custom.js \

http/src/main/resources/init-resources/jupyter-docker-compose-gce.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ services:
3333
R_LIBS: "${NOTEBOOKS_DIR}/packages"
3434
# The next two lines aren't great. But they're for updating PYTHONPATH, PATH in older than (inclusive) us.gcr.io/broad-dsp-gcr-public/terra-jupyter-base:1.0.2
3535
# We should remove the two lines once we no longer support older images. In the meantime, we need to be careful updating Jupyter base images.
36+
# NOTE: its very important to update these paths to access any tools added or moved in the base image
3637
PYTHONPATH: "/etc/jupyter/custom:/usr/lib/spark/python:${NOTEBOOKS_DIR}/packages"
37-
PATH: "/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${NOTEBOOKS_DIR}/.local/bin:${NOTEBOOKS_DIR}/packages/bin"
38+
PATH: "/root/.local/bin:/etc/jupyter/bin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${NOTEBOOKS_DIR}/.local/bin:${NOTEBOOKS_DIR}/packages/bin"
3839
env_file:
3940
- /var/custom_env_vars.env
4041
# See https://docs.docker.com/engine/reference/run/#user-memory-constraints

http/src/main/resources/init-resources/jupyter-docker-compose.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ services:
5151
# The next two lines aren't great. But they're for updating PYTHONPATH, PATH in older than (inclusive) us.gcr.io/broad-dsp-gcr-public/terra-jupyter-base:1.0.2.
5252
# We should remove the two lines once we no longer support older images.
5353
# When we update base image in terra-docker next time, we should verify the paths are still valid
54+
# NOTE: its very important to update these paths to access any tools added or moved in the base image
5455
PYTHONPATH: "/etc/jupyter/custom:/usr/lib/spark/python:${NOTEBOOKS_DIR}/packages"
55-
PATH: "/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${HOME}/.local/bin:${NOTEBOOKS_DIR}/packages/bin"
56+
PATH: "/root/.local/bin:/etc/jupyter/bin:/opt/conda/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${HOME}/.local/bin:${NOTEBOOKS_DIR}/packages/bin"
5657
env_file:
5758
- /var/custom_env_vars.env
5859
# See https://docs.docker.com/engine/reference/run/#user-memory-constraints

0 commit comments

Comments
 (0)