From 8b4f0857ea07180cf902d10e07852d85301b747d Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Fri, 17 Feb 2023 11:24:00 +0000 Subject: [PATCH 01/24] Modified the script to be compatible with new K8S version --- cloudbuild/run-presubmit-on-k8s.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 26429bb51..d8197c572 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -14,7 +14,6 @@ LOGS_SINCE_TIME=$(date --iso-8601=seconds) kubectl run "${POD_NAME}" \ --image="${IMAGE}" \ - --requests='cpu=750m,memory=2Gi,ephemeral-storage=2Gi' \ --restart=Never \ --env="COMMIT_SHA=${COMMIT_SHA}" \ --env="IMAGE_VERSION=${DATAPROC_IMAGE_VERSION}" \ @@ -23,6 +22,8 @@ kubectl run "${POD_NAME}" \ # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT +kubectl set resources deployment ${POD_NAME} --limits=cpu=750m,memory=2Gi,ephemeral-storage=2Gi --requests=cpu=750m,memory=2Gi,ephemeral-storage=2Gi + kubectl wait --for=condition=Ready "pod/${POD_NAME}" --timeout=15m while ! kubectl describe "pod/${POD_NAME}" | grep -q Terminated; do @@ -30,6 +31,7 @@ while ! kubectl describe "pod/${POD_NAME}" | grep -q Terminated; do LOGS_SINCE_TIME=$(date --iso-8601=seconds) done + EXIT_CODE=$(kubectl get pod "${POD_NAME}" \ -o go-template="{{range .status.containerStatuses}}{{.state.terminated.exitCode}}{{end}}") From 2f3972ad0d510c4da282bf13c4d54d05abe9f573 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Fri, 17 Feb 2023 11:30:05 +0000 Subject: [PATCH 02/24] Modified the script to be compatible with new K8S version --- cloudbuild/run-presubmit-on-k8s.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index d8197c572..ffc89702b 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -22,8 +22,6 @@ kubectl run "${POD_NAME}" \ # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT -kubectl set resources deployment ${POD_NAME} --limits=cpu=750m,memory=2Gi,ephemeral-storage=2Gi --requests=cpu=750m,memory=2Gi,ephemeral-storage=2Gi - kubectl wait --for=condition=Ready "pod/${POD_NAME}" --timeout=15m while ! kubectl describe "pod/${POD_NAME}" | grep -q Terminated; do From 266830ce1a888d784025143d6761837c11c50792 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 04:19:45 +0000 Subject: [PATCH 03/24] updated to new k8s apis and implemented Deployment Spec --- cloudbuild/Dockerfile | 2 +- cloudbuild/cloudbuild.yaml | 174 ++++++++++++++--------------- cloudbuild/deployment.yaml | 41 +++++++ cloudbuild/run-presubmit-on-k8s.sh | 18 ++- 4 files changed, 141 insertions(+), 94 deletions(-) create mode 100644 cloudbuild/deployment.yaml diff --git a/cloudbuild/Dockerfile b/cloudbuild/Dockerfile index e191e8cf5..ee57f4f1b 100644 --- a/cloudbuild/Dockerfile +++ b/cloudbuild/Dockerfile @@ -11,6 +11,6 @@ COPY --chown=ia-tests:ia-tests . /init-actions # https://docs.bazel.build/versions/master/install-ubuntu.html RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add - -RUN apt-get update && apt-get install -y openjdk-8-jdk python3-setuptools bazel +RUN apt-get update && apt-get install -y openjdk-8-jdk python3-setuptools bazel getext-base USER ia-tests diff --git a/cloudbuild/cloudbuild.yaml b/cloudbuild/cloudbuild.yaml index c3ac41836..e8d671d8b 100644 --- a/cloudbuild/cloudbuild.yaml +++ b/cloudbuild/cloudbuild.yaml @@ -9,39 +9,39 @@ steps: id: 'gcr-push' args: ['push', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID'] - # Run presubmit tests in parallel for 1.5 Debian image - - name: 'gcr.io/cloud-builders/kubectl' - id: 'dataproc-1.5-debian10-tests' - waitFor: ['gcr-push'] - entrypoint: 'bash' - args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '1.5-debian10'] - env: - - 'COMMIT_SHA=$COMMIT_SHA' - - 'CLOUDSDK_COMPUTE_REGION=us-central1' - - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' - - # Run presubmit tests in parallel for 1.5 Rocky Linux image - - name: 'gcr.io/cloud-builders/kubectl' - id: 'dataproc-1.5-rocky8-tests' - waitFor: ['gcr-push'] - entrypoint: 'bash' - args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '1.5-rocky8'] - env: - - 'COMMIT_SHA=$COMMIT_SHA' - - 'CLOUDSDK_COMPUTE_REGION=us-central1' - - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' - - # Run presubmit tests in parallel for 1.5 Ubuntu image - - name: 'gcr.io/cloud-builders/kubectl' - id: 'dataproc-1.5-ubuntu18-tests' - waitFor: ['gcr-push'] - entrypoint: 'bash' - args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '1.5-ubuntu18'] - env: - - 'COMMIT_SHA=$COMMIT_SHA' - - 'CLOUDSDK_COMPUTE_REGION=us-central1' - - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' - +# # Run presubmit tests in parallel for 1.5 Debian image +# - name: 'gcr.io/cloud-builders/kubectl' +# id: 'dataproc-1.5-debian10-tests' +# waitFor: ['gcr-push'] +# entrypoint: 'bash' +# args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '1.5-debian10'] +# env: +# - 'COMMIT_SHA=$COMMIT_SHA' +# - 'CLOUDSDK_COMPUTE_REGION=us-central1' +# - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' +# +# # Run presubmit tests in parallel for 1.5 Rocky Linux image +# - name: 'gcr.io/cloud-builders/kubectl' +# id: 'dataproc-1.5-rocky8-tests' +# waitFor: ['gcr-push'] +# entrypoint: 'bash' +# args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '1.5-rocky8'] +# env: +# - 'COMMIT_SHA=$COMMIT_SHA' +# - 'CLOUDSDK_COMPUTE_REGION=us-central1' +# - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' +# +# # Run presubmit tests in parallel for 1.5 Ubuntu image +# - name: 'gcr.io/cloud-builders/kubectl' +# id: 'dataproc-1.5-ubuntu18-tests' +# waitFor: ['gcr-push'] +# entrypoint: 'bash' +# args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '1.5-ubuntu18'] +# env: +# - 'COMMIT_SHA=$COMMIT_SHA' +# - 'CLOUDSDK_COMPUTE_REGION=us-central1' +# - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' +# # Run presubmit tests in parallel for 2.0 Debian image - name: 'gcr.io/cloud-builders/kubectl' id: 'dataproc-2.0-debian10-tests' @@ -53,60 +53,60 @@ steps: - 'CLOUDSDK_COMPUTE_REGION=us-central1' - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' - # Run presubmit tests in parallel for 2.0 Rocky Linux image - - name: 'gcr.io/cloud-builders/kubectl' - id: 'dataproc-2.0-rocky8-tests' - waitFor: ['gcr-push'] - entrypoint: 'bash' - args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.0-rocky8'] - env: - - 'COMMIT_SHA=$COMMIT_SHA' - - 'CLOUDSDK_COMPUTE_REGION=us-central1' - - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' - - # Run presubmit tests in parallel for 2.0 Ubuntu image - - name: 'gcr.io/cloud-builders/kubectl' - id: 'dataproc-2.0-ubuntu18-tests' - waitFor: ['gcr-push'] - entrypoint: 'bash' - args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.0-ubuntu18'] - env: - - 'COMMIT_SHA=$COMMIT_SHA' - - 'CLOUDSDK_COMPUTE_REGION=us-central1' - - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' - -# Run presubmit tests in parallel for 2.1 Debian image - - name: 'gcr.io/cloud-builders/kubectl' - id: 'dataproc-2.1-debian11-tests' - waitFor: ['gcr-push'] - entrypoint: 'bash' - args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.1-debian11'] - env: - - 'COMMIT_SHA=$COMMIT_SHA' - - 'CLOUDSDK_COMPUTE_REGION=us-central1' - - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' - -# Run presubmit tests in parallel for 2.1 Rocky Linux image - - name: 'gcr.io/cloud-builders/kubectl' - id: 'dataproc-2.1-rocky8-tests' - waitFor: ['gcr-push'] - entrypoint: 'bash' - args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.1-rocky8'] - env: - - 'COMMIT_SHA=$COMMIT_SHA' - - 'CLOUDSDK_COMPUTE_REGION=us-central1' - - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' - -# Run presubmit tests in parallel for 2.1 Ubuntu image - - name: 'gcr.io/cloud-builders/kubectl' - id: 'dataproc-2.1-ubuntu20-tests' - waitFor: ['gcr-push'] - entrypoint: 'bash' - args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.1-ubuntu20'] - env: - - 'COMMIT_SHA=$COMMIT_SHA' - - 'CLOUDSDK_COMPUTE_REGION=us-central1' - - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' +# # Run presubmit tests in parallel for 2.0 Rocky Linux image +# - name: 'gcr.io/cloud-builders/kubectl' +# id: 'dataproc-2.0-rocky8-tests' +# waitFor: ['gcr-push'] +# entrypoint: 'bash' +# args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.0-rocky8'] +# env: +# - 'COMMIT_SHA=$COMMIT_SHA' +# - 'CLOUDSDK_COMPUTE_REGION=us-central1' +# - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' +# +# # Run presubmit tests in parallel for 2.0 Ubuntu image +# - name: 'gcr.io/cloud-builders/kubectl' +# id: 'dataproc-2.0-ubuntu18-tests' +# waitFor: ['gcr-push'] +# entrypoint: 'bash' +# args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.0-ubuntu18'] +# env: +# - 'COMMIT_SHA=$COMMIT_SHA' +# - 'CLOUDSDK_COMPUTE_REGION=us-central1' +# - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' +# +## Run presubmit tests in parallel for 2.1 Debian image +# - name: 'gcr.io/cloud-builders/kubectl' +# id: 'dataproc-2.1-debian11-tests' +# waitFor: ['gcr-push'] +# entrypoint: 'bash' +# args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.1-debian11'] +# env: +# - 'COMMIT_SHA=$COMMIT_SHA' +# - 'CLOUDSDK_COMPUTE_REGION=us-central1' +# - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' +# +## Run presubmit tests in parallel for 2.1 Rocky Linux image +# - name: 'gcr.io/cloud-builders/kubectl' +# id: 'dataproc-2.1-rocky8-tests' +# waitFor: ['gcr-push'] +# entrypoint: 'bash' +# args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.1-rocky8'] +# env: +# - 'COMMIT_SHA=$COMMIT_SHA' +# - 'CLOUDSDK_COMPUTE_REGION=us-central1' +# - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' +# +## Run presubmit tests in parallel for 2.1 Ubuntu image +# - name: 'gcr.io/cloud-builders/kubectl' +# id: 'dataproc-2.1-ubuntu20-tests' +# waitFor: ['gcr-push'] +# entrypoint: 'bash' +# args: ['cloudbuild/run-presubmit-on-k8s.sh', 'gcr.io/$PROJECT_ID/init-actions-image:$BUILD_ID', '$BUILD_ID', '2.1-ubuntu20'] +# env: +# - 'COMMIT_SHA=$COMMIT_SHA' +# - 'CLOUDSDK_COMPUTE_REGION=us-central1' +# - 'CLOUDSDK_CONTAINER_CLUSTER=init-actions-presubmit' # Delete Docker image from GCR - name: 'gcr.io/cloud-builders/gcloud' diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml new file mode 100644 index 000000000..e5d2d6e7d --- /dev/null +++ b/cloudbuild/deployment.yaml @@ -0,0 +1,41 @@ +apiVersion: v1 +kind: Deployment +metadata: + labels: + run: ${IMAGE_NAME} + name: ${IMAGE_NAME} + namespace: default +spec: + replicas: 1 + template: + spec: + containers: + - command: + - bash + - /init-actions/cloudbuild/presubmit.sh + env: + - name: COMMIT_SHA + value: ${COMMIT_SHA} + - name: IMAGE_VERSION + value:${IMAGE_VERSION} + image: gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} + name: ${IMAGE_NAME} + resources: + limits: + cpu: 500m + ephemeral-storage: 1Gi + memory: 2Gi + requests: + cpu: 500m + ephemeral-storage: 1Gi + memory: 2Gi + securityContext: + capabilities: + drop: + - NET_RAW + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: kube-api-access-9ltw8 + readOnly: true diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index ffc89702b..e89f570df 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -12,12 +12,18 @@ gcloud container clusters get-credentials "${CLOUDSDK_CONTAINER_CLUSTER}" LOGS_SINCE_TIME=$(date --iso-8601=seconds) -kubectl run "${POD_NAME}" \ - --image="${IMAGE}" \ - --restart=Never \ - --env="COMMIT_SHA=${COMMIT_SHA}" \ - --env="IMAGE_VERSION=${DATAPROC_IMAGE_VERSION}" \ - --command -- bash /init-actions/cloudbuild/presubmit.sh +#kubectl run "${POD_NAME}" \ +# --image="${IMAGE}" \ +# --restart=Never \ +# --env="COMMIT_SHA=${COMMIT_SHA}" \ +# --env="IMAGE_VERSION=${DATAPROC_IMAGE_VERSION}" \ +# --command -- bash /init-actions/cloudbuild/presubmit.sh +export IMAGE_NAME=${POD_NAME} +export COMMIT_SHA=${COMMIT_SHA} +export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} +export BUILD_ID=${BUILD_ID} + +envsubst < /init-actions/cloudbuild/deployment.yaml | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT From ec0bb1c6fb370c127c3c5b29b7fc8f5e257ea826 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 04:35:43 +0000 Subject: [PATCH 04/24] fix --- cloudbuild/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/Dockerfile b/cloudbuild/Dockerfile index ee57f4f1b..39ce55ec5 100644 --- a/cloudbuild/Dockerfile +++ b/cloudbuild/Dockerfile @@ -11,6 +11,6 @@ COPY --chown=ia-tests:ia-tests . /init-actions # https://docs.bazel.build/versions/master/install-ubuntu.html RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add - -RUN apt-get update && apt-get install -y openjdk-8-jdk python3-setuptools bazel getext-base +RUN apt-get update && apt-get install -y openjdk-8-jdk python3-setuptools bazel gettext-base USER ia-tests From c1281f1e1299191c26ae496154322a5414c94e06 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 04:38:48 +0000 Subject: [PATCH 05/24] Fix Error --- cloudbuild/deployment.yaml | 2 +- cloudbuild/run-presubmit-on-k8s.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml index e5d2d6e7d..3b3ee256e 100644 --- a/cloudbuild/deployment.yaml +++ b/cloudbuild/deployment.yaml @@ -18,7 +18,7 @@ spec: value: ${COMMIT_SHA} - name: IMAGE_VERSION value:${IMAGE_VERSION} - image: gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} + image: gcr.io/cloud-dataproc-ci/init-actions-image:${IMAGE_BUILD_ID} name: ${IMAGE_NAME} resources: limits: diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index e89f570df..d8ccc1e7f 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -21,7 +21,7 @@ LOGS_SINCE_TIME=$(date --iso-8601=seconds) export IMAGE_NAME=${POD_NAME} export COMMIT_SHA=${COMMIT_SHA} export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} -export BUILD_ID=${BUILD_ID} +export IMAGE_BUILD_ID=${BUILD_ID} envsubst < /init-actions/cloudbuild/deployment.yaml | kubectl apply -f - From 9d8fc5397b07079e8aa3aeb691e61958a5ae7f00 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 04:49:03 +0000 Subject: [PATCH 06/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index d8ccc1e7f..8d5330163 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -23,6 +23,10 @@ export COMMIT_SHA=${COMMIT_SHA} export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} +echo ls +echo pwd +echo ls -lrth /init-actions/cloudbuild + envsubst < /init-actions/cloudbuild/deployment.yaml | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful From 81550b16d57e52e6c9686ec5bcc6bb4b3e99faf9 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 04:52:02 +0000 Subject: [PATCH 07/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 8d5330163..4d0a4676a 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -23,9 +23,9 @@ export COMMIT_SHA=${COMMIT_SHA} export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} -echo ls -echo pwd -echo ls -lrth /init-actions/cloudbuild +ls +pwd +ls -lrth /init-actions/cloudbuild envsubst < /init-actions/cloudbuild/deployment.yaml | kubectl apply -f - From 72002423a577cc2515cc101671235ba6bc09a4ad Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 04:55:04 +0000 Subject: [PATCH 08/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 4d0a4676a..8b017ba55 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -25,9 +25,9 @@ export IMAGE_BUILD_ID=${BUILD_ID} ls pwd -ls -lrth /init-actions/cloudbuild +ls -lrth /init-actions/cloudbuild/workspace/cloudbuild -envsubst < /init-actions/cloudbuild/deployment.yaml | kubectl apply -f - +envsubst < cloudbuild/deployment.yaml | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT From f036cea3e8fa44f60232a20ed3395df9fa9c97d8 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 04:57:05 +0000 Subject: [PATCH 09/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 8b017ba55..0ee97e76d 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -24,9 +24,6 @@ export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} ls -pwd -ls -lrth /init-actions/cloudbuild/workspace/cloudbuild - envsubst < cloudbuild/deployment.yaml | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful From 214e91b03ccb67eca6366fd99265e3a776e4a076 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 05:20:33 +0000 Subject: [PATCH 10/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 0ee97e76d..6ba017bfa 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -5,6 +5,7 @@ set -euxo pipefail readonly IMAGE=$1 readonly BUILD_ID=$2 readonly DATAPROC_IMAGE_VERSION=$3 +apt-get install -y gettext-base readonly POD_NAME=presubmit-${DATAPROC_IMAGE_VERSION//./-}-${BUILD_ID//_/-} From d8cf6e6d64fb4fa9eb17331c1c16d8070479939e Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 05:50:22 +0000 Subject: [PATCH 11/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 6ba017bfa..8e7506415 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -5,7 +5,7 @@ set -euxo pipefail readonly IMAGE=$1 readonly BUILD_ID=$2 readonly DATAPROC_IMAGE_VERSION=$3 -apt-get install -y gettext-base +apt-get install -y gettext readonly POD_NAME=presubmit-${DATAPROC_IMAGE_VERSION//./-}-${BUILD_ID//_/-} From 6ab210e6c19c24b2ce8b829ac7fc1ce0b8f560e7 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 05:58:50 +0000 Subject: [PATCH 12/24] debug --- cloudbuild/deployment.yaml | 10 +++++----- cloudbuild/run-presubmit-on-k8s.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml index 3b3ee256e..82a194bb3 100644 --- a/cloudbuild/deployment.yaml +++ b/cloudbuild/deployment.yaml @@ -2,8 +2,8 @@ apiVersion: v1 kind: Deployment metadata: labels: - run: ${IMAGE_NAME} - name: ${IMAGE_NAME} + run: {{IMAGE_NAME}} + name: {{IMAGE_NAME}} namespace: default spec: replicas: 1 @@ -15,10 +15,10 @@ spec: - /init-actions/cloudbuild/presubmit.sh env: - name: COMMIT_SHA - value: ${COMMIT_SHA} + value: {{COMMIT_SHA}} - name: IMAGE_VERSION - value:${IMAGE_VERSION} - image: gcr.io/cloud-dataproc-ci/init-actions-image:${IMAGE_BUILD_ID} + value:{{IMAGE_VERSION}} + image: gcr.io/cloud-dataproc-ci/init-actions-image:{{IMAGE_BUILD_ID}} name: ${IMAGE_NAME} resources: limits: diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 8e7506415..9b9e948a2 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -25,7 +25,7 @@ export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} ls -envsubst < cloudbuild/deployment.yaml | kubectl apply -f - +cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}/${IMAGE_BUILD_ID}/g" | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT From 876c5987746b254c0909d690eb026254c252823c Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 06:15:30 +0000 Subject: [PATCH 13/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 9b9e948a2..8d090fa79 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -5,7 +5,6 @@ set -euxo pipefail readonly IMAGE=$1 readonly BUILD_ID=$2 readonly DATAPROC_IMAGE_VERSION=$3 -apt-get install -y gettext readonly POD_NAME=presubmit-${DATAPROC_IMAGE_VERSION//./-}-${BUILD_ID//_/-} @@ -24,7 +23,6 @@ export COMMIT_SHA=${COMMIT_SHA} export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} -ls cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}/${IMAGE_BUILD_ID}/g" | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful From ad3f97b3707e497bc0afb7eec4af99a957a7a371 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 06:20:28 +0000 Subject: [PATCH 14/24] debug --- cloudbuild/deployment.yaml | 2 +- cloudbuild/run-presubmit-on-k8s.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml index 82a194bb3..1c8401857 100644 --- a/cloudbuild/deployment.yaml +++ b/cloudbuild/deployment.yaml @@ -18,7 +18,7 @@ spec: value: {{COMMIT_SHA}} - name: IMAGE_VERSION value:{{IMAGE_VERSION}} - image: gcr.io/cloud-dataproc-ci/init-actions-image:{{IMAGE_BUILD_ID}} + image: {{IMAGE_BUILD_ID}} name: ${IMAGE_NAME} resources: limits: diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 8d090fa79..c3b8ff4b4 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -22,6 +22,7 @@ export IMAGE_NAME=${POD_NAME} export COMMIT_SHA=${COMMIT_SHA} export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} +export IMAGE_BUILD_ID=gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}/${IMAGE_BUILD_ID}/g" | kubectl apply -f - From a4b0a40120ba96fea82020bb27228e2484dd6007 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 06:25:57 +0000 Subject: [PATCH 15/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index c3b8ff4b4..1d08e97ca 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -24,6 +24,8 @@ export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} export IMAGE_BUILD_ID=gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} +cat cloudbuild/deployment.yaml + cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}/${IMAGE_BUILD_ID}/g" | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful From a46549a2abb81d8449f38c0b5da8f3e029957c0b Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 06:38:28 +0000 Subject: [PATCH 16/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 1d08e97ca..84fca05f2 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -26,7 +26,7 @@ export IMAGE_BUILD_ID=gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} cat cloudbuild/deployment.yaml -cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}/${IMAGE_BUILD_ID}/g" | kubectl apply -f - +cat cloudbuild/deployment.yaml |sed 's/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}/${IMAGE_BUILD_ID}/g' | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT From 798e5fa67b7c0675fe3083f614c50f63cd5844da Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 06:53:43 +0000 Subject: [PATCH 17/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 84fca05f2..a69d040f7 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -26,7 +26,7 @@ export IMAGE_BUILD_ID=gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} cat cloudbuild/deployment.yaml -cat cloudbuild/deployment.yaml |sed 's/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}/${IMAGE_BUILD_ID}/g' | kubectl apply -f - +cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}|${IMAGE_BUILD_ID}/g" | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT From 5dcfd9ad6ce0b7c71ebd1eccab7c039eabfe69c5 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 06:58:42 +0000 Subject: [PATCH 18/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index a69d040f7..7eec2b323 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -26,7 +26,7 @@ export IMAGE_BUILD_ID=gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} cat cloudbuild/deployment.yaml -cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s/{{IMAGE_BUILD_ID}}|${IMAGE_BUILD_ID}/g" | kubectl apply -f - +cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s|{{IMAGE_BUILD_ID}}|${IMAGE_BUILD_ID}|g" | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT From 7f6d0c99e49eafeb877787b4aeefaaf9174ede0d Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 07:02:05 +0000 Subject: [PATCH 19/24] debug --- cloudbuild/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml index 1c8401857..4d78541ef 100644 --- a/cloudbuild/deployment.yaml +++ b/cloudbuild/deployment.yaml @@ -19,7 +19,7 @@ spec: - name: IMAGE_VERSION value:{{IMAGE_VERSION}} image: {{IMAGE_BUILD_ID}} - name: ${IMAGE_NAME} + name: {{IMAGE_NAME}} resources: limits: cpu: 500m From 3a9cda43a3d0a3243817d59e6e610103fad3def4 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 08:02:11 +0000 Subject: [PATCH 20/24] debug --- cloudbuild/deployment.yaml | 2 +- cloudbuild/run-presubmit-on-k8s.sh | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml index 4d78541ef..6f3ec9c8f 100644 --- a/cloudbuild/deployment.yaml +++ b/cloudbuild/deployment.yaml @@ -18,7 +18,7 @@ spec: value: {{COMMIT_SHA}} - name: IMAGE_VERSION value:{{IMAGE_VERSION}} - image: {{IMAGE_BUILD_ID}} +# image: {{IMAGE_BUILD_ID}} name: {{IMAGE_NAME}} resources: limits: diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 7eec2b323..42b1fa8fc 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -24,9 +24,7 @@ export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} export IMAGE_BUILD_ID=gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} -cat cloudbuild/deployment.yaml - -cat cloudbuild/deployment.yaml |sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s|{{IMAGE_BUILD_ID}}|${IMAGE_BUILD_ID}|g" | kubectl apply -f - +cat cloudbuild/deployment.yaml | sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s|{{IMAGE_BUILD_ID}}|${IMAGE_BUILD_ID}|g" | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT From db32872aef5853b9e4b71e5b10c695918c298824 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 08:04:34 +0000 Subject: [PATCH 21/24] debug --- cloudbuild/deployment.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml index 6f3ec9c8f..1f17a04c3 100644 --- a/cloudbuild/deployment.yaml +++ b/cloudbuild/deployment.yaml @@ -18,7 +18,6 @@ spec: value: {{COMMIT_SHA}} - name: IMAGE_VERSION value:{{IMAGE_VERSION}} -# image: {{IMAGE_BUILD_ID}} name: {{IMAGE_NAME}} resources: limits: From 5a5ae6db4629a0edd767f965ae488af8ea65c520 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 08:11:19 +0000 Subject: [PATCH 22/24] debug --- cloudbuild/run-presubmit-on-k8s.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cloudbuild/run-presubmit-on-k8s.sh b/cloudbuild/run-presubmit-on-k8s.sh index 42b1fa8fc..9302b3cb9 100644 --- a/cloudbuild/run-presubmit-on-k8s.sh +++ b/cloudbuild/run-presubmit-on-k8s.sh @@ -24,7 +24,10 @@ export IMAGE_VERSION=${DATAPROC_IMAGE_VERSION} export IMAGE_BUILD_ID=${BUILD_ID} export IMAGE_BUILD_ID=gcr.io/cloud-dataproc-ci/init-actions-image:${BUILD_ID} -cat cloudbuild/deployment.yaml | sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s|{{IMAGE_BUILD_ID}}|${IMAGE_BUILD_ID}|g" | kubectl apply -f - +template=`cat cloudbuild/deployment.yaml | sed "s/{{IMAGE_NAME}}/${IMAGE_NAME}/g;s/{{COMMIT_SHA}}/${COMMIT_SHA}/g;s/{{IMAGE_VERSION}}/${IMAGE_VERSION}/g;s|{{IMAGE_BUILD_ID}}|${IMAGE_BUILD_ID}|g" ` +echo "$template" + +echo "$template" | kubectl apply -f - # Delete POD on exit and describe it before deletion if exit was unsuccessful trap '[[ $? != 0 ]] && kubectl describe "pod/${POD_NAME}"; kubectl delete pods "${POD_NAME}"' EXIT From 6c8a440d38be68a82d6fe9ab2c0e441a6b19cd9f Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 08:16:25 +0000 Subject: [PATCH 23/24] debug --- cloudbuild/deployment.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml index 1f17a04c3..0fb1df42a 100644 --- a/cloudbuild/deployment.yaml +++ b/cloudbuild/deployment.yaml @@ -17,8 +17,9 @@ spec: - name: COMMIT_SHA value: {{COMMIT_SHA}} - name: IMAGE_VERSION - value:{{IMAGE_VERSION}} + value: {{IMAGE_VERSION}} name: {{IMAGE_NAME}} + image: {{IMAGE_BUILD_ID}} resources: limits: cpu: 500m From 1cdaf4bbdf32edd3fb71db9ad3ab9920a9ac2270 Mon Sep 17 00:00:00 2001 From: jjayadeep Date: Tue, 21 Feb 2023 08:32:00 +0000 Subject: [PATCH 24/24] Fix Deployment.yaml file --- cloudbuild/deployment.yaml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/cloudbuild/deployment.yaml b/cloudbuild/deployment.yaml index 0fb1df42a..fed57c233 100644 --- a/cloudbuild/deployment.yaml +++ b/cloudbuild/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: v1 +apiVersion: apps/v1 kind: Deployment metadata: labels: @@ -7,7 +7,13 @@ metadata: namespace: default spec: replicas: 1 + selector: + matchLabels: + app: {{IMAGE_NAME}} template: + metadata: + labels: + app: {{IMAGE_NAME}} spec: containers: - command: @@ -28,14 +34,4 @@ spec: requests: cpu: 500m ephemeral-storage: 1Gi - memory: 2Gi - securityContext: - capabilities: - drop: - - NET_RAW - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - volumeMounts: - - mountPath: /var/run/secrets/kubernetes.io/serviceaccount - name: kube-api-access-9ltw8 - readOnly: true + memory: 2Gi \ No newline at end of file