From 5e4684c174e7f9c03503ede314b3b01d38bfc9f9 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Wed, 14 Aug 2024 20:05:05 +0100 Subject: [PATCH 1/4] feat: build for arm --- .github/workflows/devnet-deploys.yml | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/.github/workflows/devnet-deploys.yml b/.github/workflows/devnet-deploys.yml index e56f4d8837b..291467392c5 100644 --- a/.github/workflows/devnet-deploys.yml +++ b/.github/workflows/devnet-deploys.yml @@ -90,6 +90,13 @@ jobs: runner_type: builder-x86 secrets: inherit + setup-arm: + uses: ./.github/workflows/setup-runner.yml + with: + username: ${{ github.actor }} + runner_type: builder-arm + secrets: inherit + # Set network specific variables as outputs from this job to be referenced in later jobs set-network: needs: setup @@ -234,6 +241,41 @@ jobs: docker tag aztecprotocol/aztec:${{ env.DEPLOY_TAG }} aztecprotocol/aztec:${{ github.sha }} docker push aztecprotocol/aztec:${{ github.sha }} + build-aztec-arm: + needs: [set-network, setup-arm] + env: + BRANCH_NAME: ${{ needs.set-network.outputs.branch_name }} + DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }} + TF_VAR_DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }} + API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }} + TF_VAR_API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }} + API_KEY_NAME: ${{ needs.set-network.outputs.network_api_key }} + runs-on: ${{ github.actor }}-arm + steps: + - uses: actions/checkout@v4 + with: + ref: "${{ env.GIT_COMMIT }}" + fetch-depth: 0 + - uses: ./.github/ci-setup-action + with: + concurrency_key: build-aztec-${{ github.actor }} + dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}" + - name: "Build & Push aztec images" + timeout-minutes: 40 + if: ${{ github.event.inputs.no_rebuild_images == 'false' }} + run: | + env + earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=linux/arm64 + earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ github.sha }} --ARCH=linux/arm64 + + - name: "Re-tag Aztec image" + if: ${{ github.event.inputs.no_rebuild_images == 'true' }} + run: | + env + docker pull aztecprotocol/aztec:${{ env.DEPLOY_TAG }} + docker tag aztecprotocol/aztec:${{ env.DEPLOY_TAG }} aztecprotocol/aztec:${{ github.sha }} + docker push aztecprotocol/aztec:${{ github.sha }} + build-aztec-nargo: needs: [set-network, build-aztec] env: @@ -260,6 +302,32 @@ jobs: earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }} earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }} + build-aztec-nargo-arm: + needs: [set-network, setup-arm, build-aztec-arm] + env: + BRANCH_NAME: ${{ needs.set-network.outputs.branch_name }} + DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }} + TF_VAR_DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }} + API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }} + TF_VAR_API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }} + API_KEY_NAME: ${{ needs.set-network.outputs.network_api_key }} + runs-on: ${{ github.actor }}-arm + steps: + - uses: actions/checkout@v4 + with: + ref: "${{ env.GIT_COMMIT }}" + fetch-depth: 0 + - uses: ./.github/ci-setup-action + with: + concurrency_key: build-aztec-nargo-${{ github.actor }} + dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}" + + - name: Build & push aztec nargo image + if: ${{ github.event.inputs.no_rebuild_images == 'false' }} + run: | + earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=linux/arm64 + earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }} --ARCH=linux/arm64 + build-faucet: needs: [set-network, build-aztec] env: @@ -327,10 +395,12 @@ jobs: needs: [ build-aztec, + build-aztec-arm, build-faucet, build-cli-wallet, build-mainnet-fork, build-aztec-nargo, + build-aztec-nargo-arm, set-network, ] env: From 7c4eb71b7196d868c9f3c738caf313960c67c79d Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 21 Aug 2024 17:10:58 +0100 Subject: [PATCH 2/4] create multi-arch manifests --- .github/workflows/devnet-deploys.yml | 73 ++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/.github/workflows/devnet-deploys.yml b/.github/workflows/devnet-deploys.yml index a032e449d95..4f77a79e366 100644 --- a/.github/workflows/devnet-deploys.yml +++ b/.github/workflows/devnet-deploys.yml @@ -244,16 +244,16 @@ jobs: if: ${{ github.event.inputs.no_rebuild_images == 'false' }} run: | env - earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }} - earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ github.sha }} + earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ github.sha }} --ARCH=amd64 + earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=amd64 - name: "Re-tag Aztec image" if: ${{ github.event.inputs.no_rebuild_images == 'true' }} run: | env - docker pull aztecprotocol/aztec:${{ env.DEPLOY_TAG }} - docker tag aztecprotocol/aztec:${{ env.DEPLOY_TAG }} aztecprotocol/aztec:${{ github.sha }} - docker push aztecprotocol/aztec:${{ github.sha }} + docker pull aztecprotocol/aztec:${{ env.DEPLOY_TAG }}-amd64 + docker tag aztecprotocol/aztec:${{ env.DEPLOY_TAG }}-amd64 aztecprotocol/aztec:${{ github.sha }}-amd64 + docker push aztecprotocol/aztec:${{ github.sha }}-amd64 build-aztec-arm: needs: [set-network, setup-arm] @@ -279,16 +279,16 @@ jobs: if: ${{ github.event.inputs.no_rebuild_images == 'false' }} run: | env - earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=linux/arm64 - earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ github.sha }} --ARCH=linux/arm64 + earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ github.sha }} --ARCH=arm64 + earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=arm64 - name: "Re-tag Aztec image" if: ${{ github.event.inputs.no_rebuild_images == 'true' }} run: | env - docker pull aztecprotocol/aztec:${{ env.DEPLOY_TAG }} - docker tag aztecprotocol/aztec:${{ env.DEPLOY_TAG }} aztecprotocol/aztec:${{ github.sha }} - docker push aztecprotocol/aztec:${{ github.sha }} + docker pull aztecprotocol/aztec:${{ env.DEPLOY_TAG }}-arm64 + docker tag aztecprotocol/aztec:${{ env.DEPLOY_TAG }}-arm64 aztecprotocol/aztec:${{ github.sha }}-arm64 + docker push aztecprotocol/aztec:${{ github.sha }}-arm64 build-aztec-nargo: needs: [set-network, build-aztec] @@ -313,8 +313,8 @@ jobs: - name: Build & push aztec nargo image if: ${{ github.event.inputs.no_rebuild_images == 'false' }} run: | - earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }} - earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }} + earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }} --ARCH=amd64 + earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=amd64 build-aztec-nargo-arm: needs: [set-network, setup-arm, build-aztec-arm] @@ -339,8 +339,53 @@ jobs: - name: Build & push aztec nargo image if: ${{ github.event.inputs.no_rebuild_images == 'false' }} run: | - earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=linux/arm64 - earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }} --ARCH=linux/arm64 + earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }} --ARCH=arm64 + earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=arm64 + + publish-aztec-manifests: + needs: + [build-aztec, build-aztec-arm, build-aztec-nargo, build-aztec-nargo-arm] + runs-on: ${{ github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: + ref: "${{ env.GIT_COMMIT }}" + fetch-depth: 0 + - uses: ./.github/ci-setup-action + with: + dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}" + + - name: "Publish aztec manifests" + run: | + env + docker pull aztecprotocol/aztec:${{ github.sha }}-amd64 + docker pull aztecprotocol/aztec:${{ github.sha }}-arm64 + + docker manifest create aztecprotocol/aztec:${{ env.DEPLOY_TAG }} \ + aztecprotocol/aztec:${{ github.sha }}-amd64 \ + aztecprotocol/aztec:${{ github.sha }}-arm64 + docker manifest create aztecprotocol/aztec:${{ github.sha }} \ + aztecprotocol/aztec:${{ github.sha }}-amd64 \ + aztecprotocol/aztec:${{ github.sha }}-arm64 + + docker manifest push aztecprotocol/aztec:${{ env.DEPLOY_TAG }} + docker manifest push aztecprotocol/aztec:${{ github.sha }} + + - name: "Publish aztec-nargo manifests" + if: ${{ github.event.inputs.no_rebuild_images == 'false' }} + run: | + docker pull aztecprotocol/aztec-nargo:${{ env.DEPLOY_TAG }}-amd64 + docker pull aztecprotocol/aztec-nargo:${{ env.DEPLOY_TAG }}-arm64 + + docker manifest create aztecprotocol/aztec-nargo:${{ env.DEPLOY_TAG }} \ + aztecprotocol/aztec-nargo:${{ github.sha }}-amd64 \ + aztecprotocol/aztec-nargo:${{ github.sha }}-arm64 + docker manifest create aztecprotocol/aztec-nargo:${{ github.sha }} \ + aztecprotocol/aztec-nargo:${{ github.sha }}-amd64 \ + aztecprotocol/aztec-nargo:${{ github.sha }}-arm64 + + docker manifest push aztecprotocol/aztec-nargo:${{ env.DEPLOY_TAG }} + docker manifest push aztecprotocol/aztec-nargo:${{ github.sha }} build-faucet: needs: [set-network, build-aztec] From 7302e85c1afe584dfa51adfaec2bc3ae5b323de4 Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 21 Aug 2024 17:14:48 +0100 Subject: [PATCH 3/4] condense steps needed for end --- .github/workflows/devnet-deploys.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/devnet-deploys.yml b/.github/workflows/devnet-deploys.yml index 4f77a79e366..780189e207e 100644 --- a/.github/workflows/devnet-deploys.yml +++ b/.github/workflows/devnet-deploys.yml @@ -453,14 +453,11 @@ jobs: runs-on: ubuntu-latest needs: [ - build-aztec, - build-aztec-arm, build-faucet, build-cli-wallet, build-mainnet-fork, - build-aztec-nargo, - build-aztec-nargo-arm, set-network, + publish-aztec-manifests, ] env: BRANCH_NAME: ${{ needs.set-network.outputs.branch_name }} From e6458305f1e1960ee51d50013f5125f7406168bd Mon Sep 17 00:00:00 2001 From: spypsy Date: Wed, 21 Aug 2024 17:27:34 +0100 Subject: [PATCH 4/4] cli wallet multi-arch --- .github/workflows/devnet-deploys.yml | 92 ++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 18 deletions(-) diff --git a/.github/workflows/devnet-deploys.yml b/.github/workflows/devnet-deploys.yml index 780189e207e..11b1b8c5e67 100644 --- a/.github/workflows/devnet-deploys.yml +++ b/.github/workflows/devnet-deploys.yml @@ -244,16 +244,16 @@ jobs: if: ${{ github.event.inputs.no_rebuild_images == 'false' }} run: | env - earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ github.sha }} --ARCH=amd64 - earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=amd64 + earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ github.sha }} --ARCH=x86_64 + earthly-ci --no-output --push ./yarn-project+export-aztec-arch --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=x86_64 - name: "Re-tag Aztec image" if: ${{ github.event.inputs.no_rebuild_images == 'true' }} run: | env - docker pull aztecprotocol/aztec:${{ env.DEPLOY_TAG }}-amd64 - docker tag aztecprotocol/aztec:${{ env.DEPLOY_TAG }}-amd64 aztecprotocol/aztec:${{ github.sha }}-amd64 - docker push aztecprotocol/aztec:${{ github.sha }}-amd64 + docker pull aztecprotocol/aztec:${{ env.DEPLOY_TAG }}-x86_64 + docker tag aztecprotocol/aztec:${{ env.DEPLOY_TAG }}-x86_64 aztecprotocol/aztec:${{ github.sha }}-x86_64 + docker push aztecprotocol/aztec:${{ github.sha }}-x86_64 build-aztec-arm: needs: [set-network, setup-arm] @@ -313,8 +313,8 @@ jobs: - name: Build & push aztec nargo image if: ${{ github.event.inputs.no_rebuild_images == 'false' }} run: | - earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }} --ARCH=amd64 - earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=amd64 + earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }} --ARCH=x86_64 + earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=x86_64 build-aztec-nargo-arm: needs: [set-network, setup-arm, build-aztec-arm] @@ -358,14 +358,14 @@ jobs: - name: "Publish aztec manifests" run: | env - docker pull aztecprotocol/aztec:${{ github.sha }}-amd64 + docker pull aztecprotocol/aztec:${{ github.sha }}-x86_64 docker pull aztecprotocol/aztec:${{ github.sha }}-arm64 docker manifest create aztecprotocol/aztec:${{ env.DEPLOY_TAG }} \ - aztecprotocol/aztec:${{ github.sha }}-amd64 \ + aztecprotocol/aztec:${{ github.sha }}-x86_64 \ aztecprotocol/aztec:${{ github.sha }}-arm64 docker manifest create aztecprotocol/aztec:${{ github.sha }} \ - aztecprotocol/aztec:${{ github.sha }}-amd64 \ + aztecprotocol/aztec:${{ github.sha }}-x86_64 \ aztecprotocol/aztec:${{ github.sha }}-arm64 docker manifest push aztecprotocol/aztec:${{ env.DEPLOY_TAG }} @@ -374,14 +374,14 @@ jobs: - name: "Publish aztec-nargo manifests" if: ${{ github.event.inputs.no_rebuild_images == 'false' }} run: | - docker pull aztecprotocol/aztec-nargo:${{ env.DEPLOY_TAG }}-amd64 - docker pull aztecprotocol/aztec-nargo:${{ env.DEPLOY_TAG }}-arm64 + docker pull aztecprotocol/aztec-nargo:${{ github.sha }}-x86_64 + docker pull aztecprotocol/aztec-nargo:${{ github.sha }}-arm64 docker manifest create aztecprotocol/aztec-nargo:${{ env.DEPLOY_TAG }} \ - aztecprotocol/aztec-nargo:${{ github.sha }}-amd64 \ + aztecprotocol/aztec-nargo:${{ github.sha }}-x86_64 \ aztecprotocol/aztec-nargo:${{ github.sha }}-arm64 docker manifest create aztecprotocol/aztec-nargo:${{ github.sha }} \ - aztecprotocol/aztec-nargo:${{ github.sha }}-amd64 \ + aztecprotocol/aztec-nargo:${{ github.sha }}-x86_64 \ aztecprotocol/aztec-nargo:${{ github.sha }}-arm64 docker manifest push aztecprotocol/aztec-nargo:${{ env.DEPLOY_TAG }} @@ -446,18 +446,74 @@ jobs: if: ${{ github.event.inputs.no_rebuild_images == 'false' }} run: | env - earthly-ci --no-output --push ./yarn-project+export-cli-wallet --DIST_TAG=${{ env.DEPLOY_TAG }} - earthly-ci --no-output --push ./yarn-project+export-cli-wallet --DIST_TAG=${{ github.sha }} + earthly-ci --no-output --push ./yarn-project+export-cli-wallet --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=x86_64 + earthly-ci --no-output --push ./yarn-project+export-cli-wallet --DIST_TAG=${{ github.sha }} --ARCH=x86_64 + + build-cli-wallet-arm: + needs: [set-network, build-aztec-arm] + env: + BRANCH_NAME: ${{ needs.set-network.outputs.branch_name }} + DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }} + TF_VAR_DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }} + API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }} + TF_VAR_API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }} + API_KEY_NAME: ${{ needs.set-network.outputs.network_api_key }} + runs-on: ${{ github.actor }}-arm + steps: + - uses: actions/checkout@v4 + with: + ref: "${{ env.GIT_COMMIT }}" + fetch-depth: 0 + - uses: ./.github/ci-setup-action + with: + concurrency_key: build-cli-wallet-${{ github.actor }} + dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}" + - name: "Build & Push aztec images" + timeout-minutes: 40 + if: ${{ github.event.inputs.no_rebuild_images == 'false' }} + run: | + env + earthly-ci --no-output --push ./yarn-project+export-cli-wallet --DIST_TAG=${{ env.DEPLOY_TAG }} --ARCH=arm64 + earthly-ci --no-output --push ./yarn-project+export-cli-wallet --DIST_TAG=${{ github.sha }} --ARCH=arm64 + + publish-cli-wallet-manifest: + if: ${{ github.event.inputs.no_rebuild_images == 'false' }} + needs: [build-cli-wallet, build-cli-wallet-arm] + runs-on: ${{ github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: + ref: "${{ env.GIT_COMMIT }}" + fetch-depth: 0 + - uses: ./.github/ci-setup-action + with: + dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}" + + - name: "Publish aztec CLI wallet manifests" + run: | + env + docker pull aztecprotocol/aztec-cli-wallet:${{ github.sha }}-x86_64 + docker pull aztecprotocol/aztec-cli-wallet:${{ github.sha }}-arm64 + + docker manifest create aztecprotocol/aztec-cli-wallet:${{ env.DEPLOY_TAG }} \ + aztecprotocol/aztec-cli-wallet:${{ github.sha }}-x86_64 \ + aztecprotocol/aztec-cli-wallet:${{ github.sha }}-arm64 + docker manifest create aztecprotocol/aztec-cli-wallet:${{ github.sha }} \ + aztecprotocol/aztec-cli-wallet:${{ github.sha }}-x86_64 \ + aztecprotocol/aztec-cli-wallet:${{ github.sha }}-arm64 + + docker manifest push aztecprotocol/aztec-cli-wallet:${{ env.DEPLOY_TAG }} + docker manifest push aztecprotocol/aztec-cli-wallet:${{ github.sha }} build-end: runs-on: ubuntu-latest needs: [ + set-network, build-faucet, - build-cli-wallet, build-mainnet-fork, - set-network, publish-aztec-manifests, + publish-cli-wallet-manifest, ] env: BRANCH_NAME: ${{ needs.set-network.outputs.branch_name }}