From cf819b40badf0627a2cc3e222f7957eecec2fa10 Mon Sep 17 00:00:00 2001 From: Mitch Date: Wed, 4 Sep 2024 09:59:53 -0400 Subject: [PATCH] chore: move spartan network tests to nightly --- .github/workflows/ci.yml | 31 ----- .github/workflows/spartan-test.yml | 175 +++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/spartan-test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b033f5c559c4..f3420cf23b21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,37 +161,6 @@ jobs: export FORCE_COLOR=1 ../../scripts/earthly-ci -P --no-output +${{ matrix.test }} - network-e2e: - needs: [build, changes] - if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }} - runs-on: ubuntu-20.04 - strategy: - matrix: - values_file: ["default.yaml", "3-validators.yaml"] - steps: - - uses: actions/checkout@v4 - with: { ref: "${{ env.GIT_COMMIT }}" } - - uses: ./.github/ci-setup-action - - name: Setup and Test - uses: ./.github/ensure-tester-with-images - timeout-minutes: 45 - with: - runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-tester-x86' }} - builder_type: builder-x86 - # these are copied to the tester and expected by the earthly command below - # if they fail to copy, it will try to build them on the tester and fail - builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} - # command to produce the images in case they don't exist - builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images - tester_ttl: 40 - run: | - set -eux - cd ./yarn-project/end-to-end/ - ./scripts/setup_local_k8s.sh - export FORCE_COLOR=1 - export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" - ../../scripts/earthly-ci --exec-stats -P --no-output ./+network-transfer --values-file=${{ matrix.values_file }} - # all the benchmarking end-to-end integration tests for aztec (not required to merge) bench-e2e: needs: [build, changes] diff --git a/.github/workflows/spartan-test.yml b/.github/workflows/spartan-test.yml new file mode 100644 index 000000000000..902c032b647b --- /dev/null +++ b/.github/workflows/spartan-test.yml @@ -0,0 +1,175 @@ +name: Run spartan network tests +on: + workflow_dispatch: + schedule: + - cron: "00 08 * * 1-5" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + GIT_COMMIT: ${{ github.sha }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + +jobs: + setup: + uses: ./.github/workflows/setup-runner.yml + with: + username: ${{ github.event.pull_request.user.login || github.actor }} + runner_type: builder-x86 + secrets: inherit + + changes: + runs-on: ubuntu-20.04 + # Required permissions. + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + avm-transpiler: ${{ steps.filter.outputs.avm-transpiler }} + build-images: ${{ steps.filter.outputs.build-images }} + barretenberg: ${{ steps.filter.outputs.barretenberg }} + barretenberg-cpp: ${{ steps.filter.outputs.barretenberg-cpp }} + noir: ${{ steps.filter.outputs.noir }} + noir-projects: ${{ steps.filter.outputs.noir-projects }} + l1-contracts: ${{ steps.filter.outputs.l1-contracts }} + non-docs: ${{ steps.filter.outputs.non-docs }} + non-misc-ci: ${{ steps.filter.outputs.non-misc-ci }} + non-barretenberg-cpp: ${{ steps.filter.outputs.non-barretenberg-cpp }} + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 + id: filter + with: + filters: | + barretenberg: + - 'barretenberg/**' + barretenberg-cpp: + - 'barretenberg/cpp/**' + build-images: + - 'build-images/**' + noir: + - 'noir/**' + avm-transpiler: + - 'avm-transpiler/**' + l1-contracts: + - 'l1-contracts/**' + noir-projects: + - 'noir-projects/**' + non-barretenberg-cpp: + - '!(barretenberg/cpp/**)' + # don't consider AVM stuff 'core bb' + - barretenberg/cpp/pil/** + - barretenberg/cpp/src/barretenberg/vm/** + - barretenberg/cpp/src/barretenberg/**/generated/* + - barretenberg/cpp/src/barretenberg/client_ivc.{hpp,cpp} + non-docs: + - '!(docs/**)' + non-misc-ci: + - '!(.github/**)' + # Always rebuild when this file changes + - .github/workflows/ci.yml + + build-images: + needs: [setup, changes] + # Note we don't but the 'if' here as that would also apply to dependent jobs, instead we just copy it into each step + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + if: ${{ needs.changes.outputs.build-images == 'true' }} + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + if: ${{ needs.changes.outputs.build-images == 'true' }} + with: + concurrency_key: build-images-x86 + - name: "Push Build Images If Changed" + if: ${{ needs.changes.outputs.build-images == 'true' }} + timeout-minutes: 40 + run: | + earthly-ci --push ./build-images/+build + + build: + needs: [build-images, changes] + if: ${{ needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true' && needs.changes.outputs.non-barretenberg-cpp == 'true' }} + runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 + outputs: + e2e_list: ${{ steps.e2e_list.outputs.list }} + bench_list: ${{ steps.bench_list.outputs.list }} + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + with: + concurrency_key: build-x86 + # prepare images locally, tagged by commit hash + - name: "Build E2E Image" + timeout-minutes: 40 + run: | + earthly-ci ./yarn-project+export-e2e-test-images + + network-e2e: + needs: [build, changes] + if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }} + runs-on: ubuntu-20.04 + strategy: + matrix: + values_file: ["default.yaml", "3-validators.yaml"] + steps: + - uses: actions/checkout@v4 + with: { ref: "${{ env.GIT_COMMIT }}" } + - uses: ./.github/ci-setup-action + - name: Setup and Test + uses: ./.github/ensure-tester-with-images + timeout-minutes: 45 + with: + runner_type: ${{ contains(matrix.test, 'prover') && '64core-tester-x86' || '16core-tester-x86' }} + builder_type: builder-x86 + # these are copied to the tester and expected by the earthly command below + # if they fail to copy, it will try to build them on the tester and fail + builder_images_to_copy: aztecprotocol/aztec:${{ env.GIT_COMMIT }} aztecprotocol/end-to-end:${{ env.GIT_COMMIT }} + # command to produce the images in case they don't exist + builder_command: scripts/earthly-ci ./yarn-project+export-e2e-test-images + tester_ttl: 40 + run: | + set -eux + cd ./yarn-project/end-to-end/ + ./scripts/setup_local_k8s.sh + export FORCE_COLOR=1 + export EARTHLY_BUILD_ARGS="${{ env.EARTHLY_BUILD_ARGS }}" + ../../scripts/earthly-ci --exec-stats -P --no-output ./+network-transfer --values-file=${{ matrix.values_file }} + + success-check: + runs-on: ubuntu-20.04 + needs: + - build-and-test + if: always() + steps: + - name: Report overall success + env: + # We treat any skipped or failing jobs as a failure for the workflow as a whole. + FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + run: | + if [[ $FAIL == true ]]; then + echo "Test failed." + exit 1 + fi + + notify: + needs: + - success-check + runs-on: ubuntu-20.04 + if: ${{ github.ref == 'refs/heads/master' && failure() }} + steps: + - name: Send notification to aztec3-ci channel if workflow failed on master + uses: slackapi/slack-github-action@v1.25.0 + with: + payload: | + { + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_NOTIFY_WORKFLOW_TRIGGER_URL }}