Skip to content

Commit

Permalink
ci: migrate docker from tag workflow to new templates (#3250)
Browse files Browse the repository at this point in the history
## What ❔
Update workflows

## Why ❔
For optimize CI/CD time

## Checklist

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

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.
  • Loading branch information
otani88 authored Nov 12, 2024
1 parent 6e3c36e commit 8be0c65
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build-docker-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ jobs:
build-push-core-images:
name: Build and push image
needs: [ setup ]
uses: ./.github/workflows/build-core-template.yml
uses: ./.github/workflows/new-build-core-template.yml
if: contains(github.ref_name, 'core')
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
en_alpha_release: true
action: "push"

build-push-tee-prover-images:
name: Build and push images
Expand All @@ -73,37 +74,40 @@ jobs:
build-push-contract-verifier:
name: Build and push image
needs: [ setup ]
uses: ./.github/workflows/build-contract-verifier-template.yml
uses: ./.github/workflows/new-build-contract-verifier-template.yml
if: contains(github.ref_name, 'contract_verifier')
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
action: "push"

build-push-prover-images:
name: Build and push image
needs: [ setup ]
uses: ./.github/workflows/build-prover-template.yml
uses: ./.github/workflows/new-build-prover-template.yml
if: contains(github.ref_name, 'prover')
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
CUDA_ARCH: "60;70;75;80;89"
action: "push"
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

build-push-witness-generator-image-avx512:
name: Build and push image
needs: [ setup ]
uses: ./.github/workflows/build-witness-generator-template.yml
uses: ./.github/workflows/new-build-witness-generator-template.yml
if: contains(github.ref_name, 'prover')
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}-avx512
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
CUDA_ARCH: "60;70;75;80;89"
WITNESS_GENERATOR_RUST_FLAGS: "-Ctarget_feature=+avx512bw,+avx512cd,+avx512dq,+avx512f,+avx512vl"
action: push
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ jobs:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}-avx512
action: "build"
WITNESS_GENERATOR_RUST_FLAGS: "-Ctarget_feature=+avx512bw,+avx512cd,+avx512dq,+avx512f,+avx512vl"
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
secrets:
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/new-build-prover-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ jobs:
SCCACHE_GCS_BUCKET=matterlabs-infra-sccache-storage
SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com
SCCACHE_GCS_RW_MODE=READ_WRITE
ERA_BELLMAN_CUDA_RELEASE=${{ inputs.ERA_BELLMAN_CUDA_RELEASE }}
RUSTC_WRAPPER=sccache
file: docker/${{ matrix.components }}/Dockerfile
tags: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/new-build-witness-generator-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
description: "DOCKERHUB_TOKEN"
required: true
inputs:
ERA_BELLMAN_CUDA_RELEASE:
description: "ERA_BELLMAN_CUDA_RELEASE"
type: string
required: true
image_tag_suffix:
description: "Optional suffix to override tag name generation"
type: string
Expand Down Expand Up @@ -127,6 +131,8 @@ jobs:
SCCACHE_GCS_SERVICE_ACCOUNT=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com
SCCACHE_GCS_RW_MODE=READ_WRITE
RUSTC_WRAPPER=sccache
ERA_BELLMAN_CUDA_RELEASE=${{ inputs.ERA_BELLMAN_CUDA_RELEASE }}
RUST_FLAGS=${{ inputs.WITNESS_GENERATOR_RUST_FLAGS }}
file: docker/${{ matrix.components }}/Dockerfile
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.components }}:2.0-${{ env.PROTOCOL_VERSION }}-${{ env.IMAGE_TAG_SHA_TS }}
Expand Down

0 comments on commit 8be0c65

Please sign in to comment.