Skip to content

Commit

Permalink
fix gcb issue (kubeflow#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
lluunn authored and k8s-ci-robot committed Feb 6, 2019
1 parent ac0cfd5 commit 049ba45
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions images/image_build.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
[
Expand Down

0 comments on commit 049ba45

Please sign in to comment.