Skip to content

Commit 78ca7b3

Browse files
Add logic check to check for presence of env var before activating service account (#358)
1 parent 1b55562 commit 78ca7b3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

engines/pyfunc-ensembler-job/app.Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ FROM ${BASE_IMAGE}
44

55
ARG MODEL_URL
66
ARG GOOGLE_APPLICATION_CREDENTIALS
7-
RUN gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}
7+
# Run docker build using the credentials if provided
8+
RUN if [[-z "$GOOGLE_APPLICATION_CREDENTIALS"]]; then gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}; fi
89
RUN gsutil -m cp -r ${MODEL_URL} .
910
ARG FOLDER_NAME
1011
RUN /bin/bash -c ". activate ${CONDA_ENVIRONMENT} && conda env update --name ${CONDA_ENVIRONMENT} --file /${HOME}/${FOLDER_NAME}/conda.yaml"

engines/pyfunc-ensembler-service/app.Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ ARG MODEL_URL
66
ARG FOLDER_NAME
77
ARG GOOGLE_APPLICATION_CREDENTIALS
88

9-
RUN gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}
9+
# Run docker build using the credentials if provided
10+
RUN if [[-z "$GOOGLE_APPLICATION_CREDENTIALS"]]; then gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}; fi
1011
RUN gsutil -m cp -r ${MODEL_URL} .
1112

1213
# Install dependencies required by the user-defined ensembler

0 commit comments

Comments
 (0)