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
9 changes: 5 additions & 4 deletions http/src/main/resources/init-resources/gce-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,13 @@ else
fi

if 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
DOCKER_COMPOSE="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /var:/var docker/compose:1.29.2"
log 'Authorizing GAR...'
$GCLOUD_CMD auth configure-docker
lucymcnatt marked this conversation as resolved.
Show resolved Hide resolved
fi

DOCKER_COMPOSE="docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v /var:/var docker/compose:1.29.2"


function apply_user_script() {
local CONTAINER_NAME=$1
local TARGET_DIR=$2
Expand Down
5 changes: 3 additions & 2 deletions http/src/main/resources/init-resources/init-actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,11 @@ END
fi
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.
# 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 GAR...'
gcloud auth configure-docker
fi

Expand Down
3 changes: 1 addition & 2 deletions jenkins/gce-custom-images/prepare_gce_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ terra_jupyter_aou_old="us.gcr.io/broad-dsp-gcr-public/terra-jupyter-aou:2.2.7"
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"

# This array determines which of the above images are baked into the custom image
# the entry must match the var name above, which must correspond to a valid docker URI
docker_image_var_names="welder_server terra_jupyter_python terra_jupyter_r terra_jupyter_bioconductor terra_jupyter_gatk terra_jupyter_aou terra_jupyter_aou_old openidc_proxy anvil_rstudio_bioconductor cryptomining_detector cos_gpu_installer google_cloud_toolbox docker_composer docker_composer_with_auth"
docker_image_var_names="welder_server terra_jupyter_python terra_jupyter_r terra_jupyter_bioconductor terra_jupyter_gatk terra_jupyter_aou terra_jupyter_aou_old openidc_proxy anvil_rstudio_bioconductor cryptomining_detector cos_gpu_installer google_cloud_toolbox docker_composer"

#
# Functions
Expand Down
Loading