From ce3704217c97db1d327161aa84580e8e6e1c3820 Mon Sep 17 00:00:00 2001 From: k8s-infra-cherrypick-robot <90416843+k8s-infra-cherrypick-robot@users.noreply.github.com> Date: Sun, 11 Aug 2024 01:00:26 -0700 Subject: [PATCH] Cloud Build: Some chores. (#11756) * Cloud Build: Remove comment. * Cloud Build: Add newlines at EOF. * Cloud Build: Align comment. * Cloud Build: Remove trailing slash. * Cloud Build: Remove quotes. * Cloud Build: Align indentation. * Cloud Build: Improve quotes. * Cloud Build: Put arguments in one line. * Cloud Build: Bump image. * Cloud Build: Reorder entrypoint. * Cloud Build: Adjust timeouts. * Cloud Build: Remove useless files. * Cloud Build: Remove `substitution_option`. --------- Co-authored-by: Marco Ebert --- cloudbuild.yaml | 29 ++++-------- images/cfssl/cloudbuild.yaml | 17 ++----- images/custom-error-pages/README.md | 3 -- images/custom-error-pages/TAG | 2 +- images/custom-error-pages/cloudbuild.yaml | 18 +++----- images/e2e-test-echo/TAG | 2 +- images/ext-auth-example-authsvc/TAG | 2 +- .../ext-auth-example-authsvc/cloudbuild.yaml | 19 ++------ images/fastcgi-helloserver/TAG | 2 +- images/fastcgi-helloserver/cloudbuild.yaml | 18 +++----- images/go-grpc-greeter-server/TAG | 2 +- images/go-grpc-greeter-server/cloudbuild.yaml | 19 ++------ images/httpbun/TAG | 2 +- images/httpbun/cloudbuild.yaml | 20 +++------ images/kube-webhook-certgen/cloudbuild.yaml | 33 +++----------- images/nginx-1.25/cloudbuild.yaml | 17 +++---- images/nginx/cloudbuild.yaml | 17 +++---- images/nginx/rc.yaml | 44 ------------------- images/opentelemetry/README.md | 5 --- images/opentelemetry/cloudbuild.yaml | 22 +++------- images/test-runner/cloudbuild.yaml | 18 +++----- 21 files changed, 71 insertions(+), 240 deletions(-) delete mode 100644 images/custom-error-pages/README.md delete mode 100644 images/nginx/rc.yaml delete mode 100644 images/opentelemetry/README.md diff --git a/cloudbuild.yaml b/cloudbuild.yaml index d3f1eed62..265947b8b 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,25 +1,14 @@ -# See https://cloud.google.com/cloud-build/docs/build-config - -timeout: 18000s -options: - substitution_option: ALLOW_LOOSE +substitutions: + _PULL_BASE_SHA: "12345" steps: - - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90' - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - REPO_INFO=https://github.com/kubernetes/ingress-nginx - - COMMIT_SHA=$_PULL_BASE_SHA - - BUILD_ID=$BUILD_ID - - HOME=/root - - USER=root + - COMMIT_SHA=${_PULL_BASE_SHA} + - BUILD_ID=${BUILD_ID} + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && make release -substitutions: - _GIT_TAG: "12345" - _PULL_BASE_REF: "main" - _PULL_BASE_SHA: '12345' + - -c + - gcloud auth configure-docker && make release +timeout: 1800s diff --git a/images/cfssl/cloudbuild.yaml b/images/cfssl/cloudbuild.yaml index 32d91ca83..8ddb22013 100644 --- a/images/cfssl/cloudbuild.yaml +++ b/images/cfssl/cloudbuild.yaml @@ -1,17 +1,8 @@ -timeout: 600s -options: - substitution_option: ALLOW_LOOSE steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images && make NAME=cfssl push + - -c + - gcloud auth configure-docker && cd images && make NAME=cfssl push diff --git a/images/custom-error-pages/README.md b/images/custom-error-pages/README.md deleted file mode 100644 index cd6df3e0a..000000000 --- a/images/custom-error-pages/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# custom-error-pages - -Example of Custom error pages for the Ingress-Nginx Controller diff --git a/images/custom-error-pages/TAG b/images/custom-error-pages/TAG index 8ce995b80..f9cece58d 100644 --- a/images/custom-error-pages/TAG +++ b/images/custom-error-pages/TAG @@ -1 +1 @@ -v0.0.3 \ No newline at end of file +v0.0.3 diff --git a/images/custom-error-pages/cloudbuild.yaml b/images/custom-error-pages/cloudbuild.yaml index bb74da6b8..bc1a3dc91 100644 --- a/images/custom-error-pages/cloudbuild.yaml +++ b/images/custom-error-pages/cloudbuild.yaml @@ -1,17 +1,9 @@ -timeout: 1800s -options: - substitution_option: ALLOW_LOOSE steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/ && make NAME=custom-error-pages push + - -c + - gcloud auth configure-docker && cd images && make NAME=custom-error-pages push +timeout: 3600s diff --git a/images/e2e-test-echo/TAG b/images/e2e-test-echo/TAG index 8ce995b80..f9cece58d 100644 --- a/images/e2e-test-echo/TAG +++ b/images/e2e-test-echo/TAG @@ -1 +1 @@ -v0.0.3 \ No newline at end of file +v0.0.3 diff --git a/images/ext-auth-example-authsvc/TAG b/images/ext-auth-example-authsvc/TAG index 8ce995b80..f9cece58d 100644 --- a/images/ext-auth-example-authsvc/TAG +++ b/images/ext-auth-example-authsvc/TAG @@ -1 +1 @@ -v0.0.3 \ No newline at end of file +v0.0.3 diff --git a/images/ext-auth-example-authsvc/cloudbuild.yaml b/images/ext-auth-example-authsvc/cloudbuild.yaml index 506e20111..4ce8d75d3 100644 --- a/images/ext-auth-example-authsvc/cloudbuild.yaml +++ b/images/ext-auth-example-authsvc/cloudbuild.yaml @@ -1,19 +1,8 @@ -timeout: 1200s -options: - substitution_option: ALLOW_LOOSE - # job builds a multi-arch docker image for amd64,arm,arm64 and s390x. - machineType: E2_HIGHCPU_8 steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/ && make NAME=ext-auth-example-authsvc push \ No newline at end of file + - -c + - gcloud auth configure-docker && cd images && make NAME=ext-auth-example-authsvc push diff --git a/images/fastcgi-helloserver/TAG b/images/fastcgi-helloserver/TAG index 8ce995b80..f9cece58d 100644 --- a/images/fastcgi-helloserver/TAG +++ b/images/fastcgi-helloserver/TAG @@ -1 +1 @@ -v0.0.3 \ No newline at end of file +v0.0.3 diff --git a/images/fastcgi-helloserver/cloudbuild.yaml b/images/fastcgi-helloserver/cloudbuild.yaml index e3ab3b375..a74fcfddc 100644 --- a/images/fastcgi-helloserver/cloudbuild.yaml +++ b/images/fastcgi-helloserver/cloudbuild.yaml @@ -1,17 +1,9 @@ -timeout: 1800s -options: - substitution_option: ALLOW_LOOSE steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/ && make NAME=fastcgi-helloserver push \ No newline at end of file + - -c + - gcloud auth configure-docker && cd images && make NAME=fastcgi-helloserver push +timeout: 3600s diff --git a/images/go-grpc-greeter-server/TAG b/images/go-grpc-greeter-server/TAG index 8ce995b80..f9cece58d 100644 --- a/images/go-grpc-greeter-server/TAG +++ b/images/go-grpc-greeter-server/TAG @@ -1 +1 @@ -v0.0.3 \ No newline at end of file +v0.0.3 diff --git a/images/go-grpc-greeter-server/cloudbuild.yaml b/images/go-grpc-greeter-server/cloudbuild.yaml index b690ffbec..4ae3139bd 100644 --- a/images/go-grpc-greeter-server/cloudbuild.yaml +++ b/images/go-grpc-greeter-server/cloudbuild.yaml @@ -1,19 +1,8 @@ -timeout: 1200s -options: - substitution_option: ALLOW_LOOSE - # job builds a multi-arch docker image for amd64,arm,arm64 and s390x. - machineType: E2_HIGHCPU_8 steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/ && make NAME=go-grpc-greeter-server push \ No newline at end of file + - -c + - gcloud auth configure-docker && cd images && make NAME=go-grpc-greeter-server push diff --git a/images/httpbun/TAG b/images/httpbun/TAG index 8ce995b80..f9cece58d 100644 --- a/images/httpbun/TAG +++ b/images/httpbun/TAG @@ -1 +1 @@ -v0.0.3 \ No newline at end of file +v0.0.3 diff --git a/images/httpbun/cloudbuild.yaml b/images/httpbun/cloudbuild.yaml index c532a3908..e718d319f 100644 --- a/images/httpbun/cloudbuild.yaml +++ b/images/httpbun/cloudbuild.yaml @@ -1,19 +1,9 @@ -timeout: 1200s -options: - substitution_option: ALLOW_LOOSE - # job builds a multi-arch docker image for amd64,arm,arm64 and s390x. - machineType: E2_HIGHCPU_8 steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/ && make NAME=httpbun push \ No newline at end of file + - -c + - gcloud auth configure-docker && cd images && make NAME=httpbun push +timeout: 3600s diff --git a/images/kube-webhook-certgen/cloudbuild.yaml b/images/kube-webhook-certgen/cloudbuild.yaml index 690f13126..33f181add 100644 --- a/images/kube-webhook-certgen/cloudbuild.yaml +++ b/images/kube-webhook-certgen/cloudbuild.yaml @@ -1,32 +1,9 @@ - -# Copyright 2021 The Kubernetes Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -timeout: 10800s -options: - substitution_option: ALLOW_LOOSE steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/ && make NAME=kube-webhook-certgen push + - -c + - gcloud auth configure-docker && cd images && make NAME=kube-webhook-certgen push +timeout: 1800s diff --git a/images/nginx-1.25/cloudbuild.yaml b/images/nginx-1.25/cloudbuild.yaml index c94539165..c03425a5a 100644 --- a/images/nginx-1.25/cloudbuild.yaml +++ b/images/nginx-1.25/cloudbuild.yaml @@ -1,17 +1,12 @@ -timeout: 10800s options: - substitution_option: ALLOW_LOOSE - # job builds a multi-arch docker image for amd64,arm,arm64 + # Increase machine type for multi-arch builds. machineType: E2_HIGHCPU_32 steps: - - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90' - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/nginx-1.25 && make push \ No newline at end of file + - -c + - gcloud auth configure-docker && cd images/nginx-1.25 && make push +timeout: 7200s diff --git a/images/nginx/cloudbuild.yaml b/images/nginx/cloudbuild.yaml index 71051f26d..871110162 100644 --- a/images/nginx/cloudbuild.yaml +++ b/images/nginx/cloudbuild.yaml @@ -1,17 +1,12 @@ -timeout: 10800s options: - substitution_option: ALLOW_LOOSE - # job builds a multi-arch docker image for amd64,arm,arm64 and s390x. + # Increase machine type for multi-arch builds. machineType: E2_HIGHCPU_32 steps: - - name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90' - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/nginx && make push + - -c + - gcloud auth configure-docker && cd images/nginx && make push +timeout: 7200s diff --git a/images/nginx/rc.yaml b/images/nginx/rc.yaml deleted file mode 100644 index bcf2b0274..000000000 --- a/images/nginx/rc.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: nginx - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx -spec: - type: NodePort - ports: - - port: 80 - protocol: TCP - name: http - - port: 443 - protocol: TCP - name: https - selector: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx ---- -apiVersion: v1 -kind: ReplicationController -metadata: - name: nginx - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx -spec: - replicas: 1 - selector: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx - template: - metadata: - labels: - app.kubernetes.io/name: ingress-nginx - app.kubernetes.io/part-of: ingress-nginx - spec: - containers: - - name: nginx - image: registry.k8s.io/ingress-nginx/nginx:c5766dc011965f22fac2f4437e86d0fd9960a50c@sha256:94ff9b435a5f3f4570bbdaed4a3a523f63a54ce2ad6b132b5640bae2af5d9d90 - ports: - - containerPort: 80 - - containerPort: 443 diff --git a/images/opentelemetry/README.md b/images/opentelemetry/README.md deleted file mode 100644 index f5c3d90de..000000000 --- a/images/opentelemetry/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# OpenTelemetry library builder - -**How to use this image:** -This image only contains the necessary files in /usr/local and /etc/nginx/opentelemetry to -be copied to Ingress Controller deployment when OpenTelemetry is enabled diff --git a/images/opentelemetry/cloudbuild.yaml b/images/opentelemetry/cloudbuild.yaml index bc48a93f4..95fdabac9 100644 --- a/images/opentelemetry/cloudbuild.yaml +++ b/images/opentelemetry/cloudbuild.yaml @@ -1,20 +1,12 @@ -timeout: 10800s options: - substitution_option: ALLOW_LOOSE - # job builds a multi-arch docker image for amd64,arm,arm64 and s390x. - machineType: E2_HIGHCPU_32 + # Increase machine type for multi-arch builds. + machineType: E2_HIGHCPU_8 steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/opentelemetry && make NGINX_VERSION=1.25.3 push \ - && make NGINX_VERSION=1.21.6 push + - -c + - gcloud auth configure-docker && cd images/opentelemetry && make NGINX_VERSION=1.21.6 push && make NGINX_VERSION=1.25.3 push +timeout: 3600s diff --git a/images/test-runner/cloudbuild.yaml b/images/test-runner/cloudbuild.yaml index b17de9b31..cd8d73e98 100644 --- a/images/test-runner/cloudbuild.yaml +++ b/images/test-runner/cloudbuild.yaml @@ -1,17 +1,9 @@ -timeout: 3600s -options: - substitution_option: ALLOW_LOOSE steps: - - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90 - entrypoint: bash + - name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20240523-a15ad90fc9 env: - - DOCKER_CLI_EXPERIMENTAL=enabled - REGISTRY=gcr.io/k8s-staging-ingress-nginx - # default cloudbuild has HOME=/builder/home and docker buildx is in /root/.docker/cli-plugins/docker-buildx - # set the home to /root explicitly to if using docker buildx - - HOME=/root + entrypoint: bash args: - - -c - - | - gcloud auth configure-docker \ - && cd images/test-runner && make push + - -c + - gcloud auth configure-docker && cd images/test-runner && make push +timeout: 1800s