From 1456fe1b02d80a8652f0e5d7f6a38a5cbb87aea6 Mon Sep 17 00:00:00 2001 From: Volo Kluev Date: Wed, 24 Apr 2024 09:04:23 -0700 Subject: [PATCH] Revert "Revert "ref: dual-write docker image to artifact registry (#5798)"" This reverts commit b69f85f538a1a3b216439601d6b5c66265715e84. --- .github/workflows/ci.yml | 4 ++-- cloudbuild.yaml | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f264d1610..ff4b43b984 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -433,7 +433,7 @@ jobs: - name: Pull the test image id: image_pull env: - IMAGE_URL: us.gcr.io/sentryio/snuba:${{ github.sha }} + IMAGE_URL: us-central1-docker.pkg.dev/sentryio/snuba/image:${{ github.sha }} shell: bash run: | echo "We poll for the Docker image that the GCB/GHA build produces until it succeeds or this job times out." @@ -454,7 +454,7 @@ jobs: shell: bash env: SHORT_SHA: ${{ steps.short_sha.outputs.sha }} - IMAGE_URL: us.gcr.io/sentryio/snuba:${{ github.sha }} + IMAGE_URL: us-central1-docker.pkg.dev/sentryio/snuba/image:${{ github.sha }} run: | # only login if the password is set if [[ "${{ secrets.DOCKER_HUB_RW_TOKEN }}" ]]; then echo "${{ secrets.DOCKER_HUB_RW_TOKEN }}" | docker login --username=sentrybuilder --password-stdin; fi diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 47180d2df2..2243884629 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -9,6 +9,7 @@ steps: "--build-arg", "SOURCE_COMMIT=$COMMIT_SHA", "--destination=us.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA", + "--destination=us-central1-docker.pkg.dev/$PROJECT_ID/snuba/image:$COMMIT_SHA", "--target=application", "-f", "./Dockerfile", @@ -20,10 +21,14 @@ steps: # https://github.com/GoogleCloudPlatform/cloud-builders-community/issues/212#issuecomment-1478828752 - name: docker args: [pull, "us.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA"] - + - name: docker + args: [pull, "us-central1-docker.pkg.dev/$PROJECT_ID/snuba/image:$COMMIT_SHA"] # This is needed for Freight to find matching builds -images: ['us.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA'] +images: [ + 'us.gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA', + 'us-central1-docker.pkg.dev/$PROJECT_ID/snuba/image:$COMMIT_SHA', +] timeout: 2640s options: # We need more memory for Webpack builds & e2e self-hosted tests