Skip to content

Pre-download docker images when creating GCP cluster #1721

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

Merged
merged 2 commits into from
Dec 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions manager/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ function cluster_up_gcp() {
gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS > /dev/null 2>&1
gcloud container clusters get-credentials $CORTEX_CLUSTER_NAME --project $CORTEX_GCP_PROJECT --region $CORTEX_GCP_ZONE > /dev/null 2>&1 # write both stderr and stdout to dev/null

start_pre_download_images

echo -n "○ updating cluster configuration "
setup_configmap_gcp
setup_secrets_gcp
Expand All @@ -128,6 +130,8 @@ function cluster_up_gcp() {

validate_cortex_gcp

await_pre_download_images

echo -e "\ncortex is ready!"

print_endpoints_gcp
Expand Down Expand Up @@ -470,7 +474,7 @@ function start_pre_download_images() {
export CORTEX_IMAGE_TENSORFLOW_SERVING_INF="${registry}/tensorflow-serving-inf:${tag}"
export CORTEX_IMAGE_TENSORFLOW_PREDICTOR="${registry}/tensorflow-predictor:${tag}"

if [[ "$CORTEX_INSTANCE_TYPE" == p* ]] || [[ "$CORTEX_INSTANCE_TYPE" == g* ]]; then
if [[ "$CORTEX_INSTANCE_TYPE" == p* ]] || [[ "$CORTEX_INSTANCE_TYPE" == g* ]] || [ -n "$CORTEX_ACCELERATOR_TYPE" ]; then
envsubst < manifests/image-downloader-gpu.yaml | kubectl apply -f - &>/dev/null
elif [[ "$CORTEX_INSTANCE_TYPE" == inf* ]]; then
envsubst < manifests/image-downloader-inf.yaml | kubectl apply -f - &>/dev/null
Expand All @@ -485,7 +489,7 @@ function await_pre_download_images() {
printed_dot="false"
i=0
until [ "$(kubectl get daemonset image-downloader -n=default -o 'jsonpath={.status.numberReady}')" == "$(kubectl get daemonset image-downloader -n=default -o 'jsonpath={.status.desiredNumberScheduled}')" ]; do
if [ $i -eq 100 ]; then break; fi # give up after 5 minutes
if [ $i -eq 120 ]; then break; fi # give up after 6 minutes
echo -n "."
printed_dot="true"
((i=i+1))
Expand Down