From f9cd167ae4735dd46d191b36a085028dc8af6549 Mon Sep 17 00:00:00 2001 From: Weimin Yu Date: Thu, 4 Dec 2025 15:55:19 -0500 Subject: [PATCH] Copy artifacts for schema tests after deployment (#2895) After each deployment in sandbox or production, move the artifacts from the corresponding release to a well-known location so that they can be mapped to Kokoro in presubmit tests. The Kokoro-mapping does not need public access to the GCS bucket. The artifacts include the postgresql schema jar, the nomulus release jar, and the uber jar of the nomulus schema integration test classes. Every jar name consists of a fixed prefix and the environment. Each jar of a new deployment overrides the previous copy. --- release/cloudbuild-deploy-gke.yaml | 9 ++++++++- release/cloudbuild-schema-deploy.yaml | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/release/cloudbuild-deploy-gke.yaml b/release/cloudbuild-deploy-gke.yaml index f0f9e4598..78c770d46 100644 --- a/release/cloudbuild-deploy-gke.yaml +++ b/release/cloudbuild-deploy-gke.yaml @@ -43,7 +43,9 @@ steps: deployCloudSchedulerAndQueue nomulus-config-${_ENV}.yaml cloud-scheduler-tasks-${_ENV}.xml $project_id --gke deployCloudSchedulerAndQueue nomulus-config-${_ENV}.yaml cloud-tasks-queue.xml $project_id --gke # Save the deployed tag for the current environment on GCS, and update the -# mappings from Nomulus releases to deployment timestamp. +# mappings from Nomulus releases to deployment timestamp. Also copy the +# artifacts for schema tests to here. They will be mapped into Kokoro for +# presubmit tests. - name: 'gcr.io/$PROJECT_ID/builder:latest' entrypoint: /bin/bash args: @@ -60,6 +62,11 @@ steps: gs://$PROJECT_ID-deployed-tags/nomulus-gke.${_ENV}.versions \ gs://$PROJECT_ID-deployed-tags/nomulus-gke.${_ENV}.tmp \ gs://$PROJECT_ID-deployed-tags/nomulus-gke.${_ENV}.versions + # Copy the nomulus artifacts for schema test: nomulus foss jars and the uberjar of nomulus test classes. + gcloud storage cp gs://$PROJECT_ID-deploy/${TAG_NAME}/nomulus-public.jar \ + gs://$PROJECT_ID-deployed-tags/schema-test-artifacts/nomulus-public.${_ENV}.jar + gcloud storage cp gs://$PROJECT_ID-deploy/${TAG_NAME}/nomulus-tests-alldeps.jar \ + gs://$PROJECT_ID-deployed-tags/schema-test-artifacts/nomulus-tests-alldeps.${_ENV}.jar timeout: 3600s options: machineType: 'E2_HIGHCPU_32' diff --git a/release/cloudbuild-schema-deploy.yaml b/release/cloudbuild-schema-deploy.yaml index 6d2bc84cf..9e8829f68 100644 --- a/release/cloudbuild-schema-deploy.yaml +++ b/release/cloudbuild-schema-deploy.yaml @@ -75,7 +75,7 @@ steps: # Save the deployed tag for the current environment on GCS to a well-known. # location. Do not use the 'artifacts' section for this since it will # upload an extra metadata file every time and pollute the folder. -# TODO(weiminyu): modify this step so that TAG_NAME may be 'live'. +# Also copy the schema jar here. It will be mapped into Kokoro for presubmit tests. - name: 'gcr.io/$PROJECT_ID/builder:latest' entrypoint: /bin/bash args: @@ -84,6 +84,9 @@ steps: set -e echo ${TAG_NAME} | \ gcloud storage cp - gs://$PROJECT_ID-deployed-tags/sql.${_ENV}.tag\ + # Copy the schema jar here + gcloud storage cp gs://$PROJECT_ID-deploy/${TAG_NAME}/schema.jar \ + gs://$PROJECT_ID-deployed-tags/schema-test-artifacts/schema.${_ENV}.jar timeout: 3600s options: machineType: 'E2_HIGHCPU_32'