From d58d5b74e8e4c707452efed18af322f971d1c822 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Mon, 6 Feb 2023 05:19:13 +0200 Subject: [PATCH 1/4] Use official Bazel container image with Cloud Build --- etcd-manager/cloudbuild-master.yaml | 14 +++++++------- etcd-manager/cloudbuild.yaml | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/etcd-manager/cloudbuild-master.yaml b/etcd-manager/cloudbuild-master.yaml index 7c8a78b4a..1c744a40d 100644 --- a/etcd-manager/cloudbuild-master.yaml +++ b/etcd-manager/cloudbuild-master.yaml @@ -1,34 +1,34 @@ steps: -- name: gcr.io/cloud-builders/bazel +- name: gcr.io/bazel-public/bazel:5.4.0 args: ['version'] -- name: gcr.io/cloud-builders/bazel +- name: gcr.io/bazel-public/bazel:5.4.0 args: ['build', '//cmd/...', '//images:etcd-manager', '//images:etcd-manager-slim', '//images:etcd-backup', '//images:etcd-dump'] # To build with GCS cache #args: ['build', '--google_default_credentials', '--spawn_strategy=remote', '--genrule_strategy=remote', '--strategy=Javac=remote', '--strategy=Closure=remote', '--remote_http_cache=https://storage.googleapis.com/cache-bucket', '//cmd/...'] -- name: gcr.io/cloud-builders/bazel +- name: gcr.io/bazel-public/bazel:5.4.0 args: ['test', '//test/...', '--test_output=streamed', '--local_test_jobs=1'] -- name: gcr.io/cloud-builders/bazel +- name: gcr.io/bazel-public/bazel:5.4.0 args: ['run', '//images:push-etcd-manager'] env: - 'DOCKER_REGISTRY=${_DOCKER_REGISTRY}' - 'DOCKER_IMAGE_PREFIX=${_DOCKER_IMAGE_PREFIX}' - 'DOCKER_TAG=${COMMIT_SHA}' -- name: gcr.io/cloud-builders/bazel +- name: gcr.io/bazel-public/bazel:5.4.0 args: ['run', '//images:push-etcd-manager-slim'] env: - 'DOCKER_REGISTRY=${_DOCKER_REGISTRY}' - 'DOCKER_IMAGE_PREFIX=${_DOCKER_IMAGE_PREFIX}' - 'DOCKER_TAG=${COMMIT_SHA}' -- name: gcr.io/cloud-builders/bazel +- name: gcr.io/bazel-public/bazel:5.4.0 args: ['run', '//images:push-etcd-dump'] env: - 'DOCKER_REGISTRY=${_DOCKER_REGISTRY}' - 'DOCKER_IMAGE_PREFIX=${_DOCKER_IMAGE_PREFIX}' - 'DOCKER_TAG=${COMMIT_SHA}' -- name: gcr.io/cloud-builders/bazel +- name: gcr.io/bazel-public/bazel:5.4.0 args: ['run', '//images:push-etcd-backup'] env: - 'DOCKER_REGISTRY=${_DOCKER_REGISTRY}' diff --git a/etcd-manager/cloudbuild.yaml b/etcd-manager/cloudbuild.yaml index 66081d491..eacbe8460 100644 --- a/etcd-manager/cloudbuild.yaml +++ b/etcd-manager/cloudbuild.yaml @@ -1,15 +1,15 @@ steps: -- name: gcr.io/cloud-marketplace-containers/google/bazel:3.5.0 +- name: gcr.io/bazel-public/bazel:5.4.0 entrypoint: bazel args: ['version'] -- name: gcr.io/cloud-marketplace-containers/google/bazel:3.5.0 +- name: gcr.io/bazel-public/bazel:5.4.0 entrypoint: bazel args: ['build', '//cmd/...', '//images:etcd-manager', '//images:etcd-manager-slim', '//images:etcd-backup', '//images:etcd-dump'] # To build with GCS cache #args: ['build', '--google_default_credentials', '--spawn_strategy=remote', '--genrule_strategy=remote', '--strategy=Javac=remote', '--strategy=Closure=remote', '--remote_http_cache=https://storage.googleapis.com/cache-bucket', '//cmd/...'] -- name: gcr.io/cloud-marketplace-containers/google/bazel:3.5.0 +- name: gcr.io/bazel-public/bazel:5.4.0 entrypoint: bazel args: ['test', '//test/...', '--test_output=streamed', '--local_test_jobs=1'] From cf06e108e14831ed65073d9b590818eda1f6d545 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Mon, 6 Feb 2023 05:19:58 +0200 Subject: [PATCH 2/4] Update Bazelisk to v1.16.0 --- .github/workflows/main.yml | 8 ++++---- dev/staging/push-etcdmanager.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d0f3c8af..5ab778c71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: - name: Install bazelisk run: | - curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64" + curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64" mkdir -p "${GITHUB_WORKSPACE}/bin/" mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" chmod +x "${GITHUB_WORKSPACE}/bin/bazel" @@ -31,7 +31,7 @@ jobs: - name: Install bazelisk run: | - curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64" + curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64" mkdir -p "${GITHUB_WORKSPACE}/bin/" mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" chmod +x "${GITHUB_WORKSPACE}/bin/bazel" @@ -49,7 +49,7 @@ jobs: - name: Install bazelisk run: | - curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64" + curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64" mkdir -p "${GITHUB_WORKSPACE}/bin/" mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" chmod +x "${GITHUB_WORKSPACE}/bin/bazel" @@ -67,7 +67,7 @@ jobs: - name: Install bazelisk run: | - curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64" + curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64" mkdir -p "${GITHUB_WORKSPACE}/bin/" mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel" chmod +x "${GITHUB_WORKSPACE}/bin/bazel" diff --git a/dev/staging/push-etcdmanager.sh b/dev/staging/push-etcdmanager.sh index 887b0081c..cd4e07940 100755 --- a/dev/staging/push-etcdmanager.sh +++ b/dev/staging/push-etcdmanager.sh @@ -43,7 +43,7 @@ if [[ "${ARTIFACT_LOCATION}" != */ ]]; then fi if [[ -n "${INSTALL_BAZELISK:-}" ]]; then - DOWNLOAD_URL="https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64" + DOWNLOAD_URL="https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64" echo "Downloading bazelisk from $DOWNLOAD_URL" curl -L --output "/tmp/bazelisk" "${DOWNLOAD_URL}" chmod +x "/tmp/bazelisk" From c6334401bd52afcc2c33cbf2b0a0afe3ccdeddfc Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Mon, 6 Feb 2023 07:14:07 +0200 Subject: [PATCH 3/4] Use golang:1:19 instead of k8s-testimages/krte:latest-master --- dev/staging/cloudbuild.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dev/staging/cloudbuild.yaml b/dev/staging/cloudbuild.yaml index f14154900..2891346ec 100644 --- a/dev/staging/cloudbuild.yaml +++ b/dev/staging/cloudbuild.yaml @@ -5,16 +5,15 @@ options: machineType: 'N1_HIGHCPU_8' steps: -- name: gcr.io/k8s-testimages/krte:latest-master +- name: golang:1.19 env: - PULL_BASE_REF=$_PULL_BASE_REF - VERSION=$_GIT_TAG - DOCKER_REGISTRY=$_DOCKER_REGISTRY - DOCKER_IMAGE_PREFIX=$_DOCKER_IMAGE_PREFIX - ARTIFACT_LOCATION=$_ARTIFACT_LOCATION - - INSTALL_BAZELISK=y entrypoint: dev/staging/push-etcdadm.sh -- name: gcr.io/k8s-testimages/krte:latest-master +- name: golang:1.19 env: - PULL_BASE_REF=$_PULL_BASE_REF # We don't pass version; we want to use our own version tagging from git From b3a9a901c148931ec20bfabe173933b327494929 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Mon, 6 Feb 2023 06:09:46 +0200 Subject: [PATCH 4/4] Build etcdadm with -buildvcs=false --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 50558179e..9d09f21de 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ container-build: docker run --rm -e VERSION_OVERRIDE=${VERSION_OVERRIDE} -e GOPROXY -v $(PWD):$(PACKAGE_GOPATH) -w $(PACKAGE_GOPATH) $(GIT_STORAGE_MOUNT) ${GO_IMAGE} /bin/bash -c "make" $(BIN): - GO111MODULE=on go build -ldflags "$(LDFLAGS)" + go build -buildvcs=false -ldflags "$(LDFLAGS)" clean: rm -f $(BIN) plantuml.jar