Skip to content

Commit

Permalink
ci: add europe GAR registry for publish (#297)
Browse files Browse the repository at this point in the history
# What ❔
Add EU GAR registry for publish images

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
  • Loading branch information
otani88 authored Oct 24, 2023
1 parent 33174aa commit 5488a2e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: |
ci_run docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }}
ci_run gcloud auth configure-docker us-docker.pkg.dev,asia-docker.pkg.dev -q
ci_run gcloud auth configure-docker us-docker.pkg.dev,asia-docker.pkg.dev,europe-docker.pkg.dev -q
- name: update-images
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-docker-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
setup_keys_id: 4989f12
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
push_asia: true
push_europe: true

build-gar-prover-fri-gpu:
name: Build GAR prover FRI GPU
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/build-gar-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:
required: false
default: false
type: boolean
push_europe:
description: "Push images to EU GAR"
required: false
default: false
type: boolean

jobs:
build-gar-prover:
Expand Down Expand Up @@ -79,3 +84,15 @@ jobs:
docker buildx imagetools create \
--tag asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-v2-gar:2.0-${{ inputs.image_tag_suffix }}-prover-${{ matrix.setup_keys.prover_id }}-${{ inputs.setup_keys_id }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-v2-gar:2.0-${{ inputs.image_tag_suffix }}-prover-${{ matrix.setup_keys.prover_id }}-${{ inputs.setup_keys_id }}
- name: Login to EU GAR
if: "${{ inputs.push_europe }}"
run: |
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://europe-docker.pkg.dev
- name: Push image to EU
if: "${{ inputs.push_europe }}"
run: |
docker buildx imagetools create \
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-v2-gar:2.0-${{ inputs.image_tag_suffix }}-prover-${{ matrix.setup_keys.prover_id }}-${{ inputs.setup_keys_id }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/prover-v2-gar:2.0-${{ inputs.image_tag_suffix }}-prover-${{ matrix.setup_keys.prover_id }}-${{ inputs.setup_keys_id }}
2 changes: 1 addition & 1 deletion .github/workflows/build-prover-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
run: |
ci_run docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }}
ci_run gcloud auth configure-docker us-docker.pkg.dev,asia-docker.pkg.dev -q
ci_run gcloud auth configure-docker us-docker.pkg.dev,asia-docker.pkg.dev,europe-docker.pkg.dev -q
# We need to run this only when ERA_BELLMAN_CUDA_RELEASE is not available
# In our case it happens only when PR is created from fork
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
setup_keys_id: 4989f12
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
push_asia: false
push_europe: false

build-gar-prover-fri-gpu:
name: Build GAR prover FRI GPU
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/zk/src/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ async function _push(image: string, tagList: string[], publishPublic: boolean =
await utils.spawn(
`docker tag us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${image}:${tag} asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${image}:${tag}`
);
await utils.spawn(
`docker tag us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${image}:${tag} europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${image}:${tag}`
);
await utils.spawn(`docker push asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${image}:${tag}`);
await utils.spawn(`docker push europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${image}:${tag}`);
}
if (image == 'external-node' && publishPublic) {
await utils.spawn(`docker push matterlabs/${image}-public:${tag}`);
Expand Down

0 comments on commit 5488a2e

Please sign in to comment.