diff --git a/images/Makefile b/images/Makefile index 3f26cd51731..c0c899075db 100755 --- a/images/Makefile +++ b/images/Makefile @@ -52,17 +52,17 @@ push-latest: push # Build the GCB workflow build-gcb-spec: - rm -rf ./build - mkdir -p build + rm -rf ./gcb_build + mkdir -p gcb_build jsonnet ./image_build.jsonnet --ext-str imageBase=$(IMG) \ --ext-str gitVersion=$(GIT_VERSION) --ext-str tag=$(TAG) \ --ext-str useImageCache=$(USE_IMAGE_CACHE) \ - > ./build/image_build.json + > ./gcb_build/image_build.json # Build using GCB. This is useful if we are on a slow internet connection # and don't want to pull images locally. # Its also used to build from our CI system. build-gcb: build-gcb-spec gcloud builds submit --machine-type=n1-highcpu-32 --project=kubeflow-ci \ - --config=./build/image_build.json \ + --config=./gcb_build/image_build.json \ --timeout=3600 . diff --git a/images/build/image_build.json b/images/gcb_build/image_build.json similarity index 60% rename from images/build/image_build.json rename to images/gcb_build/image_build.json index 1b5daa1557f..6512394be12 100644 --- a/images/build/image_build.json +++ b/images/gcb_build/image_build.json @@ -1,13 +1,13 @@ { "images": [ - "gcr.io/kubeflow-ci/test-worker/test-worker:v20190116-b7abb8d-e3b0c4", - "gcr.io/kubeflow-ci/test-worker/test-worker:latest" + "gcr.io/kubeflow-ci/test-worker:v20190205-5209779-dirty-7cce9b", + "gcr.io/kubeflow-ci/test-worker:latest" ], "steps": [ { "args": [ "pull", - "gcr.io/kubeflow-ci/test-worker/test-worker:latest" + "gcr.io/kubeflow-ci/test-worker:latest" ], "id": "pull-test-worker", "name": "gcr.io/cloud-builders/docker", @@ -19,10 +19,10 @@ "args": [ "build", "-t", - "gcr.io/kubeflow-ci/test-worker/test-worker:v20190116-b7abb8d-e3b0c4", + "gcr.io/kubeflow-ci/test-worker:v20190205-5209779-dirty-7cce9b", "--label=git-versions=", "--file=./Dockerfile", - "--cache-from=gcr.io/kubeflow-ci/test-worker/test-worker:latest", + "--cache-from=gcr.io/kubeflow-ci/test-worker:latest", "." ], "id": "build-test-worker", @@ -34,8 +34,8 @@ { "args": [ "tag", - "gcr.io/kubeflow-ci/test-worker/test-worker:v20190116-b7abb8d-e3b0c4", - "gcr.io/kubeflow-ci/test-worker/test-worker:latest" + "gcr.io/kubeflow-ci/test-worker:v20190205-5209779-dirty-7cce9b", + "gcr.io/kubeflow-ci/test-worker:latest" ], "id": "tag-test-worker", "name": "gcr.io/cloud-builders/docker", diff --git a/images/image_build.jsonnet b/images/image_build.jsonnet index db4de778efe..fa90ad798ec 100644 --- a/images/image_build.jsonnet +++ b/images/image_build.jsonnet @@ -33,18 +33,18 @@ local template = self, + local image = std.extVar("imageBase") + ":" + std.extVar("tag"), + local imageLatest = std.extVar("imageBase") + ":latest", + local pullStep = if useImageCache then [ { id: "pull-" + template.name, name: "gcr.io/cloud-builders/docker", - args: ["pull", std.extVar("imageBase") + "/" + template.name + ":latest"], + args: ["pull", imageLatest], waitFor: ["-"], }, ] else [], - local image = std.extVar("imageBase") + "/" + template.name + ":" + std.extVar("tag"), - local imageLatest = std.extVar("imageBase") + "/" + template.name + ":latest", - images: [image, imageLatest], steps: pullStep + [