From d7b5be4ca943b31e8750d55e4499d05a300ded55 Mon Sep 17 00:00:00 2001 From: Igor Borodin Date: Wed, 25 Oct 2023 12:55:08 +0200 Subject: [PATCH] ci: zk-env publish workflow fix, zk-env rust naming fix (#311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What ❔ Subj ## Checklist - [x] 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. - [x] Code has been formatted via `zk fmt` and `zk lint`. --- .github/workflows/zk-environment.publish.yml | 33 ++++++++++---------- docker-compose-runner-nightly.yml | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/zk-environment.publish.yml b/.github/workflows/zk-environment.publish.yml index 18f2ff561f27..fcb78810af3d 100644 --- a/.github/workflows/zk-environment.publish.yml +++ b/.github/workflows/zk-environment.publish.yml @@ -121,27 +121,28 @@ jobs: runs-on: ubuntu-latest steps: - name: Login to DockerHub - if: github.event_name == 'push' && github.ref == 'refs/heads/main' uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 with: username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Create and push multi-arch zk-environment lightweight manifest - run: | - docker pull matterlabs/zk-environment:${{ needs.get_short_sha.outputs.short_sha }}-lightweight-amd64 --platform linux/amd64 - docker pull matterlabs/zk-environment:${{ needs.get_short_sha.outputs.short_sha }}-lightweight-arm64 --platform linux/arm64 - docker manifest create matterlabs/zk-environment:latest2.0-lightweight \ - --amend matterlabs/zk-environment:${{ needs.get_short_sha.outputs.short_sha }}-lightweight-amd64 \ - --amend matterlabs/zk-environment:${{ needs.get_short_sha.outputs.short_sha }}-lightweight-arm64 - docker manifest push matterlabs/zk-environment:latest2.0-lightweight - - name: Create and push multi-arch zk-environment Rust nightly manifest + + - name: Create and push multi-arch zk-environment lightweight manifests run: | - docker pull matterlabs/zk-environment:${{ needs.get_short_sha.outputs.short_sha }}-nightly-amd64 --platform linux/amd64 - docker pull matterlabs/zk-environment:${{ needs.get_short_sha.outputs.short_sha }}-nightly-arm64 --platform linux/arm64 - docker manifest create matterlabs/zksync_rust:nightly \ - --amend matterlabs/zk-environment:${{ needs.get_short_sha.outputs.short_sha }}-nightly-amd64 \ - --amend matterlabs/zk-environment:${{ needs.get_short_sha.outputs.short_sha }}-nightly-arm64 - docker manifest push matterlabs/zksync_rust:nightly + images=("lightweight" "lightweight-nightly") + archs=("amd64" "arm64") + + for img in "${images[@]}"; do + multiarch_tag="matterlabs/zk-environment:latest2.0-${img}" + individual_images=() + + for arch in "${archs[@]}"; do + TAG="${{ needs.get_short_sha.outputs.short_sha }}-${img}-${arch}" + docker pull matterlabs/zk-environment:${TAG} --platform linux/${arch} + individual_images+=("matterlabs/zk-environment:${TAG}") + done + + docker buildx imagetools create --tag "${multiarch_tag}" "${individual_images[@]}" + done zk_environment_cuda_12: if: needs.changed_files.outputs.zk_environment_cuda_12 == 'true' diff --git a/docker-compose-runner-nightly.yml b/docker-compose-runner-nightly.yml index 2d60a0325f63..0ea8f7d0764f 100644 --- a/docker-compose-runner-nightly.yml +++ b/docker-compose-runner-nightly.yml @@ -1,7 +1,7 @@ version: '3.2' services: zk: - image: matterlabs/zksync_rust:nightly + image: matterlabs/zk-environment:latest2.0-lightweight-nightly extends: file: docker-compose-runner.yml service: zk