From fd55f2c3817b162a9fadc74de658b07e0f645ba5 Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 3 May 2024 18:30:25 +0000 Subject: [PATCH 1/2] chore(ci): optimize e2e build --- .github/workflows/ci.yml | 10 +++++-- yarn-project/end-to-end/Earthfile | 50 ++++++++++++++++++++----------- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b49dc2e7410..5261bc3c3d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,11 @@ jobs: - name: Test working-directory: ./yarn-project/end-to-end/ timeout-minutes: 25 - run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} --no-output +${{ matrix.test }} + run: earthly-ci -P \ + --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \ + --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \ + --no-output \ + +${{ matrix.test }} --skip_build=true # bench-summary: # needs: e2e @@ -109,7 +113,7 @@ jobs: # barretenberg (prover) native and AVM (public VM) tests # only ran on x86 for resource reasons (memory intensive) bb-native-tests: - needs: setup + needs: build runs-on: ${{ inputs.username || github.actor }}-x86 steps: - { @@ -213,7 +217,7 @@ jobs: # push benchmarking binaries to dockerhub registry bb-bench-binaries: - needs: setup + needs: build runs-on: ${{ inputs.username || github.actor }}-x86 steps: - { diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 3a9c18ff04b..dd516846445 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -5,7 +5,7 @@ E2E_COMPOSE_TEST: ARG test ARG compose_file=./scripts/docker-compose.yml ARG debug="aztec:*" - ARG EARTHLY_TARGET_NAME + ARG skip_build LOCALLY ENV TEST=$test ENV DEBUG=$debug @@ -15,8 +15,13 @@ E2E_COMPOSE_TEST: ELSE LET CMD="docker-compose" END - WAIT - BUILD ../+export-e2e-test-images + # In CI, we do an optimization to push these images to docker once + # We still want the default code path to work with no faff locally + # To not rebuild unnecessarily, we pass --skip_build=true in CI + IF [ $skip_build != "true" ] + WAIT + BUILD ../+export-e2e-test-images + END END # Let docker compose know about the pushed tags above ENV AZTEC_DOCKER_TAG=$(git rev-parse HEAD) @@ -47,28 +52,36 @@ flakey-e2e-tests: RUN yarn test --passWithNoTests ./src/flakey || true e2e-sandbox-example: - DO +E2E_COMPOSE_TEST --test=e2e_sandbox_example.test.ts + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=e2e_sandbox_example.test.ts --skip_build=$skip_build uniswap-trade-on-l1-from-l2: - DO +E2E_COMPOSE_TEST --test=uniswap_trade_on_l1_from_l2.test.ts + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=uniswap_trade_on_l1_from_l2.test.ts --skip_build=$skip_build integration-l1-publisher: - DO +E2E_COMPOSE_TEST --test=integration_l1_publisher.test.ts + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=integration_l1_publisher.test.ts --skip_build=$skip_build e2e-browser: - DO +E2E_COMPOSE_TEST --test=e2e_aztec_js_browser.test.ts + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=e2e_aztec_js_browser.test.ts --skip_build=$skip_build pxe: - DO +E2E_COMPOSE_TEST --test=pxe.test.ts + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=pxe.test.ts --skip_build=$skip_build e2e-docs-examples: - DO +E2E_COMPOSE_TEST --test=docs_examples.test.ts + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=docs_examples.test.ts --skip_build=$skip_build guides-writing-an-account-contract: - DO +E2E_COMPOSE_TEST --test=guides/writing_an_account_contract.test.ts + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=guides/writing_an_account_contract.test.ts --skip_build=$skip_build guides-dapp-testing: - DO +E2E_COMPOSE_TEST --test=guides/dapp_testing.test.ts + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=guides/dapp_testing.test.ts --skip_build=$skip_build # TODO intermittent failure # guides-sample-dapp: @@ -82,19 +95,22 @@ bench-publish-rollup: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml - DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml --skip_build=$skip_build + DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-process-history: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml - DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml --skip_build=$skip_build + DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-tx-size: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml - DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + ARG skip_build=false + DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml --skip_build=$skip_build + DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH From 401ef39580a2afd2ce0f9313063e670bdda3776a Mon Sep 17 00:00:00 2001 From: ludamad Date: Fri, 3 May 2024 19:29:54 +0000 Subject: [PATCH 2/2] simplify --- yarn-project/end-to-end/Earthfile | 41 +++++++++++-------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index dd516846445..7085b410cc5 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -1,11 +1,11 @@ VERSION 0.8 +ARG --global skip_build=false E2E_COMPOSE_TEST: FUNCTION ARG test ARG compose_file=./scripts/docker-compose.yml ARG debug="aztec:*" - ARG skip_build LOCALLY ENV TEST=$test ENV DEBUG=$debug @@ -52,36 +52,28 @@ flakey-e2e-tests: RUN yarn test --passWithNoTests ./src/flakey || true e2e-sandbox-example: - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=e2e_sandbox_example.test.ts --skip_build=$skip_build + DO +E2E_COMPOSE_TEST --test=e2e_sandbox_example.test.ts uniswap-trade-on-l1-from-l2: - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=uniswap_trade_on_l1_from_l2.test.ts --skip_build=$skip_build + DO +E2E_COMPOSE_TEST --test=uniswap_trade_on_l1_from_l2.test.ts integration-l1-publisher: - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=integration_l1_publisher.test.ts --skip_build=$skip_build + DO +E2E_COMPOSE_TEST --test=integration_l1_publisher.test.ts e2e-browser: - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=e2e_aztec_js_browser.test.ts --skip_build=$skip_build + DO +E2E_COMPOSE_TEST --test=e2e_aztec_js_browser.test.ts pxe: - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=pxe.test.ts --skip_build=$skip_build + DO +E2E_COMPOSE_TEST --test=pxe.test.ts e2e-docs-examples: - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=docs_examples.test.ts --skip_build=$skip_build + DO +E2E_COMPOSE_TEST --test=docs_examples.test.ts guides-writing-an-account-contract: - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=guides/writing_an_account_contract.test.ts --skip_build=$skip_build + DO +E2E_COMPOSE_TEST --test=guides/writing_an_account_contract.test.ts guides-dapp-testing: - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=guides/dapp_testing.test.ts --skip_build=$skip_build + DO +E2E_COMPOSE_TEST --test=guides/dapp_testing.test.ts # TODO intermittent failure # guides-sample-dapp: @@ -95,22 +87,19 @@ bench-publish-rollup: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml --skip_build=$skip_build - DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO +E2E_COMPOSE_TEST --test=benchmarks/bench_publish_rollup.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml + DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-process-history: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml --skip_build=$skip_build - DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO +E2E_COMPOSE_TEST --test=benchmarks/bench_process_history.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --compose_file=./scripts/docker-compose-no-sandbox.yml + DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-tx-size: ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - ARG skip_build=false - DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml --skip_build=$skip_build - DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH + DO +E2E_COMPOSE_TEST --test=benchmarks/bench_tx_size_fees.test.ts --debug="aztec:benchmarks:*,aztec:sequencer,aztec:sequencer:*,aztec:world_state,aztec:merkle_trees" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml + DO +UPLOAD_LOGS --e2e_mode=$e2e_mode --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH