Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): optimize e2e build #6202

Merged
merged 6 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
- {
Expand Down Expand Up @@ -297,7 +301,7 @@ jobs:

# push benchmarking binaries to dockerhub registry
bb-bench-binaries:
needs: setup
needs: build
runs-on: ${{ inputs.username || github.actor }}-x86
steps:
- {
Expand Down
50 changes: 33 additions & 17 deletions yarn-project/end-to-end/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usual ways to implicitly pass this through like ARG --global dont work with functions, and making this a parametric target instead of a function would make logging less nice (show the utility name instead of the test name), so living with a bit of passing this through the targets

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I've been complaining about unclear args rules, but shouldn't global args work with functions? According to their docs a function should be able to access global args.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks! I must have gotten tripped up. I'll try to simplify this

ARG prover_agents=10
LOCALLY
ENV TEST=$test
Expand All @@ -17,8 +17,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)
Expand Down Expand Up @@ -49,28 +54,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:
Expand All @@ -84,19 +97,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
Loading