diff --git a/test/e2e_test_gke.yaml b/test/e2e_test_gke.yaml index 399618b5f50f..8099420019c4 100644 --- a/test/e2e_test_gke.yaml +++ b/test/e2e_test_gke.yaml @@ -65,7 +65,7 @@ spec: - name: image-name value: "{{inputs.parameters.target-image-prefix}}{{inputs.parameters.api-integration-test-image-suffix}}" - name: build-frontend-integration-tests-image - template: build-image + template: build-image-after-pull arguments: parameters: - name: docker-path @@ -213,6 +213,53 @@ spec: privileged: true mirrorVolumeMounts: true + # Build image and upload to GCR in the specified project + - name: build-image-after-pull + inputs: + parameters: + # GCS URI prefix pointing to a .tar.gz archive of Docker build context + - name: image-build-context-gcs-uri + value: "{{workflow.parameters.image-build-context-gcs-uri}}" + # The relative code path to the Dockerfile + - name: docker-path + # Name of the Docker file to use. "Dockerfile" by default + - name: docker-file + value: Dockerfile + - name: image-name + outputs: + parameters: + - name: strict-image-name + valueFrom: + path: /outputs/strict-image-name/file + container: + image: gcr.io/ml-pipeline-test/image-builder:v20181128-0.1.3-rc.1-109-ga5a14dc-e3b0c4 + imagePullPolicy: 'Always' + command: [ + sh, -xc, + ' + sleep 60 + if [ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" ]; then + gcloud auth activate-service-account --key-file="${GOOGLE_APPLICATION_CREDENTIALS}" + fi + gcloud auth configure-docker + docker pull gcr.io/ml-pipeline-test/selenium-standalone-chrome-nodejs:v20181109-0.1.1-56-gb190e72-dirty-28e8ac && "$0" "$@" + ', + /build.sh, + "--image-build-context-gcs-uri", "{{inputs.parameters.image-build-context-gcs-uri}}", + "--docker_path", "{{inputs.parameters.docker-path}}", + "--docker_file", "{{inputs.parameters.docker-file}}", + "--image_name", "{{inputs.parameters.image-name}}", + ] + env: + - name: DOCKER_HOST + value: 127.0.0.1 + sidecars: + - name: dind + image: docker:17.10-dind + securityContext: + privileged: true + mirrorVolumeMounts: true + - name: deploy-ml-pipeline inputs: parameters: