Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
Set timeout for cloud build and upgrade goland version (#70)
Browse files Browse the repository at this point in the history
1. `gcloud build submit` by default has 10m timeout. If dependency is large or overlay is slow, it’s possible build timeout. Create a new argument with default 30m timeout

2. Remove vendor copy since it’s build on top of go modules

3. Upgrade Dockerfile golang version to match version in go.mod

Signed-off-by: Jiaxin Shan <[email protected]>
  • Loading branch information
Jeffwan authored May 14, 2020
1 parent 337c1d5 commit 78f8cf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.11.4 as builder
FROM golang:1.12.17 as builder

ENV GO111MODULE=on

Expand All @@ -8,7 +8,6 @@ WORKDIR /go/src/github.com/kubeflow/xgboost-operator

COPY go.mod .
COPY go.sum .
# COPY vendor/ vendor/

RUN go mod download

Expand Down
3 changes: 2 additions & 1 deletion build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ set -ex
DOCKERFILE=$1
CONTEXT_DIR=$(dirname "$DOCKERFILE")
IMAGE=$2
TIMEOUT=30m

cd $CONTEXT_DIR
TAG=$(git describe --tags --always --dirty)

gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}

echo "Building ${IMAGE} using gcloud build"
gcloud builds submit --tag=${IMAGE}:${TAG} --project=${GCP_PROJECT} .
gcloud builds submit --tag=${IMAGE}:${TAG} --project=${GCP_PROJECT} --timeout=${TIMEOUT} .
echo "Finished building ${IMAGE}:${TAG}"

0 comments on commit 78f8cf5

Please sign in to comment.