From 3e50d151da1ab5c4d983f0eb77dfe499c183052f Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:13:45 -0400 Subject: [PATCH 1/4] chore: migrate spring 4.x release builds to new release pool --- .kokoro/common.cfg | 2 +- .kokoro/populate-secrets.sh | 5 ++--- .kokoro/trampoline.sh | 9 ++++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.kokoro/common.cfg b/.kokoro/common.cfg index 79daa9131f..969f780ab9 100644 --- a/.kokoro/common.cfg +++ b/.kokoro/common.cfg @@ -9,7 +9,7 @@ build_file: "spring-cloud-gcp/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java17" + value: "us-central1-docker.pkg.dev/cloud-sdk-release-custom-pool/release-images/java17" } before_action { diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh index 0fa3af706c..40abed891e 100755 --- a/.kokoro/populate-secrets.sh +++ b/.kokoro/populate-secrets.sh @@ -20,8 +20,7 @@ function msg { println "$*" >&2 ;} function println { printf '%s\n' "$(now) $*" ;} -# Populates requested secrets set in SECRET_MANAGER_KEYS from service account: -# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com +# Populates requested secrets set in SECRET_MANAGER_KEYS: SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager" msg "Creating folder on disk for secrets: ${SECRET_LOCATION}" mkdir -p ${SECRET_LOCATION} @@ -32,7 +31,7 @@ do --volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \ gcr.io/google.com/cloudsdktool/cloud-sdk \ secrets versions access latest \ - --project cloud-devrel-kokoro-resources \ + --project cloud-sdk-release-custom-pool \ --secret ${key} > \ "${SECRET_LOCATION}/${key}" if [[ $? == 0 ]]; then diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh index d60bbf4bd9..526ecf371d 100755 --- a/.kokoro/trampoline.sh +++ b/.kokoro/trampoline.sh @@ -23,4 +23,11 @@ function cleanup() { trap cleanup EXIT $(dirname $0)/populate-secrets.sh # Secret Manager secrets. -python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" \ No newline at end of file +TRAMPOLINE_HOST=$(echo "${TRAMPOLINE_IMAGE}" | cut -d/ -f1) +if [[ ! "${TRAMPOLINE_HOST}" =~ "gcr.io" ]]; then + # If you need to specify a host other than gcr.io, you have to run on an update version of gcloud. + echo "TRAMPOLINE_HOST: ${TRAMPOLINE_HOST}" + gcloud components update + gcloud auth configure-docker "${TRAMPOLINE_HOST}" +fi +python3 "${KOKORO_GFILE_DIR}/trampoline_release.py" \ No newline at end of file From 7be4e41f9e8fac07c1d9480b2af7bf59febe1ee7 Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:15:43 -0400 Subject: [PATCH 2/4] chore: migrate spring 4.x release builds to new release pool --- .kokoro/trampoline.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh index 526ecf371d..93bf6f1a93 100755 --- a/.kokoro/trampoline.sh +++ b/.kokoro/trampoline.sh @@ -30,4 +30,4 @@ if [[ ! "${TRAMPOLINE_HOST}" =~ "gcr.io" ]]; then gcloud components update gcloud auth configure-docker "${TRAMPOLINE_HOST}" fi -python3 "${KOKORO_GFILE_DIR}/trampoline_release.py" \ No newline at end of file +python3 "${KOKORO_GFILE_DIR}/trampoline_release.py" From b776d233c8bca92470894b4c92fd01aae495950c Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:49:00 -0400 Subject: [PATCH 3/4] add better comment for docker auth logic --- .kokoro/trampoline.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh index 93bf6f1a93..945b6f19ca 100755 --- a/.kokoro/trampoline.sh +++ b/.kokoro/trampoline.sh @@ -25,7 +25,9 @@ trap cleanup EXIT $(dirname $0)/populate-secrets.sh # Secret Manager secrets. TRAMPOLINE_HOST=$(echo "${TRAMPOLINE_IMAGE}" | cut -d/ -f1) if [[ ! "${TRAMPOLINE_HOST}" =~ "gcr.io" ]]; then - # If you need to specify a host other than gcr.io, you have to run on an update version of gcloud. + # You have to run on an update version of gcloud, in order to pass in the host name in configure-docker command. + # This is not necessary for gcr.io because that is a default repository name + # and is not required to specify the repo when running configure-docker. echo "TRAMPOLINE_HOST: ${TRAMPOLINE_HOST}" gcloud components update gcloud auth configure-docker "${TRAMPOLINE_HOST}" From c638a2d999df7643008adacff5e083d731647235 Mon Sep 17 00:00:00 2001 From: ldetmer <1771267+ldetmer@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:19:22 -0400 Subject: [PATCH 4/4] update publish_javadoc.cfg to use new release image --- .kokoro/publish_javadoc.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.kokoro/publish_javadoc.cfg b/.kokoro/publish_javadoc.cfg index 8fe1d0bae0..07a240cca8 100644 --- a/.kokoro/publish_javadoc.cfg +++ b/.kokoro/publish_javadoc.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java17" + value: "us-central1-docker.pkg.dev/cloud-sdk-release-custom-pool/release-images/java17" } env_vars: {