Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorize to GAR in init scripts #4782

Merged
merged 11 commits into from
Oct 2, 2024
10 changes: 7 additions & 3 deletions http/src/main/resources/init-resources/gce-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,13 @@ START_TIME=$(date +%s)
STEP_TIMINGS=($(date +%s))


# Use specific docker compose command if the container is coming from GCR, see https://hub.docker.com/r/cryptopants/docker-compose-gcr
# TODO - Also check for GAR see https://broadworkbench.atlassian.net/browse/IA-4518
if grep -qF "gcr.io" <<< "${JUPYTER_DOCKER_IMAGE}${RSTUDIO_DOCKER_IMAGE}${PROXY_DOCKER_IMAGE}${WELDER_DOCKER_IMAGE}" ; then
# everything in the public broad us.gcr.io bucket has been migrated to GAR
if grep -qF "us.gcr.io" <<< "${JUPYTER_DOCKER_IMAGE}${RSTUDIO_DOCKER_IMAGE}${PROXY_DOCKER_IMAGE}${WELDER_DOCKER_IMAGE}" ; then
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved
log 'Authorizing GAR...'
DOCKER_COMPOSE="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /var:/var docker/compose:1.29.2"
# if coming from a private repo on GCR, need to use credentials supplied in cryptopants/docker-compose-gcr
# (see https://hub.docker.com/r/cryptopants/docker-compose-gcr)
elif grep -qF "gcr.io" <<< "${JUPYTER_DOCKER_IMAGE}${RSTUDIO_DOCKER_IMAGE}${PROXY_DOCKER_IMAGE}${WELDER_DOCKER_IMAGE}" ; then
log 'Authorizing GCR...'
DOCKER_COMPOSE="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /var:/var -w=/var cryptopants/docker-compose-gcr"
else
Expand Down
6 changes: 3 additions & 3 deletions http/src/main/resources/init-resources/init-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ END
fi


# If any image is hosted in a GCR registry (detected by regex) then
# If any image is hosted in a GAR registry (detected by regex) then
# authorize docker to interact with gcr.io.
# TODO - Also check for GAR see https://broadworkbench.atlassian.net/browse/IA-4518
# NOTE: GCR images are now hosted on GAR, but the file paths haven't changed, they automatically redirect.
if grep -qF "gcr.io" <<< "${JUPYTER_DOCKER_IMAGE}${RSTUDIO_DOCKER_IMAGE}${PROXY_DOCKER_IMAGE}${WELDER_DOCKER_IMAGE}" ; then
log 'Authorizing GCR...'
log 'Authorizing GCR/GAR...'
gcloud auth configure-docker
fi

Expand Down
1 change: 0 additions & 1 deletion jenkins/gce-custom-images/prepare_gce_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ terra_jupyter_aou_old="us.gcr.io/broad-dsp-gcr-public/terra-jupyter-aou:2.2.13"
cos_gpu_installer="gcr.io/cos-cloud/cos-gpu-installer:v2.1.9"
google_cloud_toolbox="us.gcr.io/cos-cloud/toolbox:v20230714"
docker_composer="docker/compose:1.29.2"
docker_composer_with_auth="cryptopants/docker-compose-gcr"
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved

# If you change this you must also change Leo reference.conf!
cryptomining_detector="us.gcr.io/broad-dsp-gcr-public/cryptomining-detector:0.0.2"
Expand Down
Loading