From 90bab8782c1a3e25c52399dceb1005d60e97902e Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 10:46:27 -0400 Subject: [PATCH 01/28] fix(ci): earthly e2e test issues --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8544b4511f3..b0bc12d2cf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,14 +102,14 @@ jobs: - integration-l1-publisher - e2e-cli - e2e-persistence - # - e2e-browser # TODO failing + - e2e-browser - e2e-card-game - e2e-avm-simulator - e2e-fees - e2e-dapp-subscription - pxe - cli-docs-sandbox - # - e2e-docs-examples # TODO failing + - e2e-docs-examples # cancel if reran on same PR if exists, otherwise if on same commit concurrency: group: ${{ matrix.test }}-${{ github.event.pull_request.number || github.ref_name }}-x86 From 78cbc862d1a44970a5e6e8ad35dfa04976969c54 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 17:09:02 +0000 Subject: [PATCH 02/28] Attempt fix --- yarn-project/end-to-end/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index aadcada263c..f4fa3648e7c 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -163,7 +163,7 @@ cli-docs-sandbox: e2e-docs-examples: ARG e2e_remote=false - DO +E2E_TEST --test=docs_examples --avm_enabled=1 --e2e_remote=$e2e_remote + DO +E2E_TEST --test=docs_examples --e2e_remote=$e2e_remote # all: # for stability, instead of an 'all' target in Earthly, use `make all` From e97d2a1d6e32ad1d339e4e6d254d3b99e4162c88 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 17:34:33 +0000 Subject: [PATCH 03/28] try stabilize test --- .../end-to-end/src/docs_examples.test.ts | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/yarn-project/end-to-end/src/docs_examples.test.ts b/yarn-project/end-to-end/src/docs_examples.test.ts index c09c088bd40..39a86d103cc 100644 --- a/yarn-project/end-to-end/src/docs_examples.test.ts +++ b/yarn-project/end-to-end/src/docs_examples.test.ts @@ -7,40 +7,41 @@ import { Contract } from '@aztec/aztec.js'; // docs:end:import_contract // docs:start:import_token_contract import { TokenContract, TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; - // docs:end:import_token_contract -// docs:start:define_account_vars -const PXE_URL = process.env.PXE_URL || 'http://localhost:8080'; -const encryptionPrivateKey = GrumpkinScalar.random(); -const signingPrivateKey = GrumpkinScalar.random(); -const pxe = createPXEClient(PXE_URL); -// docs:end:define_account_vars +describe('ensure doc examples work', async () => { + // docs:start:define_account_vars + const PXE_URL = process.env.PXE_URL || 'http://localhost:8080'; + const encryptionPrivateKey = GrumpkinScalar.random(); + const signingPrivateKey = GrumpkinScalar.random(); + const pxe = createPXEClient(PXE_URL); + // docs:end:define_account_vars -// docs:start:create_wallet -const wallet = await getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitSetup(); -// docs:end:create_wallet + // docs:start:create_wallet + const wallet = await getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitSetup(); + // docs:end:create_wallet -// docs:start:deploy_contract -const deployedContract = await TokenContract.deploy( - wallet, // wallet instance - wallet.getAddress(), // account - 'TokenName', // constructor arg1 - 'TokenSymbol', // constructor arg2 - 18, -) // constructor arg3 - .send() - .deployed(); -// docs:end:deploy_contract + // docs:start:deploy_contract + const deployedContract = await TokenContract.deploy( + wallet, // wallet instance + wallet.getAddress(), // account + 'TokenName', // constructor arg1 + 'TokenSymbol', // constructor arg2 + 18, + ) // constructor arg3 + .send() + .deployed(); + // docs:end:deploy_contract -// docs:start:get_contract -const contract = await Contract.at(deployedContract.address, TokenContractArtifact, wallet); -// docs:end:get_contract + // docs:start:get_contract + const contract = await Contract.at(deployedContract.address, TokenContractArtifact, wallet); + // docs:end:get_contract -// docs:start:send_transaction -const _tx = await contract.methods.transfer(1, wallet).send().wait(); -// docs:end:send_transaction + // docs:start:send_transaction + const _tx = await contract.methods.transfer(1, wallet).send().wait(); + // docs:end:send_transaction -// docs:start:call_view_function -const _balance = await contract.methods.get_balance(wallet.getAddress()).view(); -// docs:end:call_view_function + // docs:start:call_view_function + const _balance = await contract.methods.get_balance(wallet.getAddress()).view(); + // docs:end:call_view_function +}); \ No newline at end of file From e3d7b747813b6e374c240ba1d545e35335aa7942 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 17:50:03 +0000 Subject: [PATCH 04/28] attempt fix --- .../end-to-end/src/docs_examples.test.ts | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/yarn-project/end-to-end/src/docs_examples.test.ts b/yarn-project/end-to-end/src/docs_examples.test.ts index 39a86d103cc..9427f4484e5 100644 --- a/yarn-project/end-to-end/src/docs_examples.test.ts +++ b/yarn-project/end-to-end/src/docs_examples.test.ts @@ -9,39 +9,41 @@ import { Contract } from '@aztec/aztec.js'; import { TokenContract, TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; // docs:end:import_token_contract -describe('ensure doc examples work', async () => { - // docs:start:define_account_vars - const PXE_URL = process.env.PXE_URL || 'http://localhost:8080'; - const encryptionPrivateKey = GrumpkinScalar.random(); - const signingPrivateKey = GrumpkinScalar.random(); - const pxe = createPXEClient(PXE_URL); - // docs:end:define_account_vars +describe('doc tests', () => { + it('wallet doc examples should work', async () => { + // docs:start:define_account_vars + const PXE_URL = process.env.PXE_URL || 'http://localhost:8080'; + const encryptionPrivateKey = GrumpkinScalar.random(); + const signingPrivateKey = GrumpkinScalar.random(); + const pxe = createPXEClient(PXE_URL); + // docs:end:define_account_vars - // docs:start:create_wallet - const wallet = await getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitSetup(); - // docs:end:create_wallet + // docs:start:create_wallet + const wallet = await getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey).waitSetup(); + // docs:end:create_wallet - // docs:start:deploy_contract - const deployedContract = await TokenContract.deploy( - wallet, // wallet instance - wallet.getAddress(), // account - 'TokenName', // constructor arg1 - 'TokenSymbol', // constructor arg2 - 18, - ) // constructor arg3 - .send() - .deployed(); - // docs:end:deploy_contract + // docs:start:deploy_contract + const deployedContract = await TokenContract.deploy( + wallet, // wallet instance + wallet.getAddress(), // account + 'TokenName', // constructor arg1 + 'TokenSymbol', // constructor arg2 + 18, + ) // constructor arg3 + .send() + .deployed(); + // docs:end:deploy_contract - // docs:start:get_contract - const contract = await Contract.at(deployedContract.address, TokenContractArtifact, wallet); - // docs:end:get_contract + // docs:start:get_contract + const contract = await Contract.at(deployedContract.address, TokenContractArtifact, wallet); + // docs:end:get_contract - // docs:start:send_transaction - const _tx = await contract.methods.transfer(1, wallet).send().wait(); - // docs:end:send_transaction + // docs:start:send_transaction + const _tx = await contract.methods.transfer(1, wallet).send().wait(); + // docs:end:send_transaction - // docs:start:call_view_function - const _balance = await contract.methods.get_balance(wallet.getAddress()).view(); - // docs:end:call_view_function + // docs:start:call_view_function + const _balance = await contract.methods.get_balance(wallet.getAddress()).view(); + // docs:end:call_view_function + }); }); \ No newline at end of file From db61db55b0cd3450ad291f6ef07c9394208d3e9f Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 18:09:57 +0000 Subject: [PATCH 05/28] try fix again --- yarn-project/end-to-end/src/docs_examples.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yarn-project/end-to-end/src/docs_examples.test.ts b/yarn-project/end-to-end/src/docs_examples.test.ts index 9427f4484e5..a05a0138d82 100644 --- a/yarn-project/end-to-end/src/docs_examples.test.ts +++ b/yarn-project/end-to-end/src/docs_examples.test.ts @@ -7,6 +7,8 @@ import { Contract } from '@aztec/aztec.js'; // docs:end:import_contract // docs:start:import_token_contract import { TokenContract, TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; + + // docs:end:import_token_contract describe('doc tests', () => { @@ -44,6 +46,6 @@ describe('doc tests', () => { // docs:start:call_view_function const _balance = await contract.methods.get_balance(wallet.getAddress()).view(); - // docs:end:call_view_function - }); -}); \ No newline at end of file + // docs:end:call_view_functione + }, 50_000); +}, ); \ No newline at end of file From 550538763a6234c256cb55882dd2ebbc9f216153 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 18:23:37 +0000 Subject: [PATCH 06/28] earthly --- yarn-project/Earthfile | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index f9cf5d6302e..0a81ee60173 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -74,29 +74,10 @@ end-to-end: FROM +source # compilation artifacts for end-to-end # TODO encapsulate in bash script for cleanliness - ARG EARTHLY_CI - IF $EARTHLY_CI # Don't cache CI builds. - RUN ./bootstrap.sh && \ - yarn workspace @aztec/end-to-end run build:web && \ - yarn workspaces focus @aztec/end-to-end --production \ - && yarn cache clean - ELSE - ENV YARN_CACHE_FOLDER /yarn_cache - # TODO copy to other targets - # Use a mount for incremental builds locally. - # We cache NPM installs, typescript metadata and dest folders. - # TODO(AD): find safe way to cache noir contracts - RUN --mount type=cache,target=/node_cache \ - --mount type=cache,target=/yarn_cache \ - mkdir -p /node_cache/node_modules && mv /node_cache/node_modules . && \ - cp -r /node_cache/* . >/dev/null || echo "fresh build" && \ - ./bootstrap.sh && \ - yarn workspace @aztec/end-to-end run build:web && \ - yarn workspaces focus @aztec/end-to-end --production && \ - cp -r node_modules /node_cache/node_modules && \ - cp -r --parents */dest /node_cache && \ - find . -name '*.tsbuildinfo' -exec cp --parents {} /node_cache \; - END + RUN ./bootstrap.sh && \ + yarn workspace @aztec/end-to-end run build:web && \ + yarn workspaces focus @aztec/end-to-end --production \ + && yarn cache clean # Build web bundle for browser tests RUN yarn workspace @aztec/end-to-end run build:web RUN yarn workspaces focus @aztec/end-to-end --production && yarn cache clean From 5958957d93bdf91837405be22c954854bed3862c Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 18:25:12 +0000 Subject: [PATCH 07/28] test --- yarn-project/Earthfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index 0a81ee60173..fb4e1b335eb 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -29,18 +29,18 @@ build: # TODO: Replace puppeteer with puppeteer-core to avoid this. # TODO encapsulate in bash script for cleanliness ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true - IF $EARTHLY_CI # Don't cache CI builds. - RUN ./bootstrap.sh && yarn workspaces focus @aztec/cli @aztec/aztec --production && yarn cache clean - ELSE - ENV YARN_CACHE_FOLDER /build/yarn-cache - # Use a mount for incremental builds locally. - RUN --mount type=cache,target=/build/node_modules_cache --mount type=cache,target=/build/yarn-cache \ - mkdir -p node_modules_cache && \ - mv node_modules_cache node_modules && \ - ./bootstrap.sh && \ - yarn workspaces focus @aztec/cli @aztec/aztec --production && \ - cp -r node_modules node_modules_cache - END + # IF $EARTHLY_CI # Don't cache CI builds. + RUN ./bootstrap.sh && yarn workspaces focus @aztec/cli @aztec/aztec --production && yarn cache clean + # ELSE + # ENV YARN_CACHE_FOLDER /build/yarn-cache + # # Use a mount for incremental builds locally. + # RUN --mount type=cache,target=/build/node_modules_cache --mount type=cache,target=/build/yarn-cache \ + # mkdir -p node_modules_cache && \ + # mv node_modules_cache node_modules && \ + # ./bootstrap.sh && \ + # yarn workspaces focus @aztec/cli @aztec/aztec --production && \ + # cp -r node_modules node_modules_cache + # END SAVE ARTIFACT /build # TODO versioning flow at end before publish? From 9291ff896d838542d8f0acc4acc564be8a3e32f7 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 18:37:53 +0000 Subject: [PATCH 08/28] avm --- yarn-project/end-to-end/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index f4fa3648e7c..ef308e8a295 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -163,7 +163,7 @@ cli-docs-sandbox: e2e-docs-examples: ARG e2e_remote=false - DO +E2E_TEST --test=docs_examples --e2e_remote=$e2e_remote + DO +E2E_TEST --test=docs_examples --avm_enabled=true --e2e_remote=$e2e_remote # all: # for stability, instead of an 'all' target in Earthly, use `make all` From 22f3c78df03bb8042a36ffbcffc895de9ea97c7b Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 18:52:00 +0000 Subject: [PATCH 09/28] avm --- yarn-project/end-to-end/Earthfile | 2 +- yarn-project/end-to-end/src/docs_examples.test.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index ef308e8a295..f4fa3648e7c 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -163,7 +163,7 @@ cli-docs-sandbox: e2e-docs-examples: ARG e2e_remote=false - DO +E2E_TEST --test=docs_examples --avm_enabled=true --e2e_remote=$e2e_remote + DO +E2E_TEST --test=docs_examples --e2e_remote=$e2e_remote # all: # for stability, instead of an 'all' target in Earthly, use `make all` diff --git a/yarn-project/end-to-end/src/docs_examples.test.ts b/yarn-project/end-to-end/src/docs_examples.test.ts index a05a0138d82..7c248c84728 100644 --- a/yarn-project/end-to-end/src/docs_examples.test.ts +++ b/yarn-project/end-to-end/src/docs_examples.test.ts @@ -8,7 +8,6 @@ import { Contract } from '@aztec/aztec.js'; // docs:start:import_token_contract import { TokenContract, TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; - // docs:end:import_token_contract describe('doc tests', () => { From f5db53b90f1d19f185c91ff2a43e2bf4aa083796 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 25 Mar 2024 19:06:42 +0000 Subject: [PATCH 10/28] better e2e build flag --- .github/workflows/ci.yml | 2 +- yarn-project/end-to-end/Earthfile | 116 +++++++++--------- .../end-to-end/scripts/docker-compose.yml | 4 + 3 files changed, 63 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0bc12d2cf9..2089a8f7819 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' # We don't do much on arm, just run it on their builder run: - earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_remote=true + earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true # all the end-to-end integration tests for aztec e2e-x86: diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index f4fa3648e7c..c97db2152d1 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -44,9 +44,9 @@ E2E_TEST: ARG compose_file=./scripts/docker-compose.yml ARG avm_enabled="" ARG enable_gas="" - ARG e2e_remote=false + ARG e2e_build=false LOCALLY - IF [ $e2e_remote = true ] + IF [ $e2e_build = true ] DO +E2E_TEST_REMOTE --test=$test --compose_file=$compose_file --avm_enabled=$avm_enabled --enable_gas=$enable_gas ELSE DO +E2E_TEST_LOCAL --test=$test --compose_file=$compose_file --avm_enabled=$avm_enabled --enable_gas=$enable_gas @@ -54,116 +54,116 @@ E2E_TEST: # we could use a parameterized target, but these just print cleaner in earthly log e2e-block-building: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_block_building --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_block_building --e2e_build=$e2e_build e2e-nested-contract: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_nested_contract --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_nested_contract --e2e_build=$e2e_build e2e-static-calls: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_static_calls --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_static_calls --e2e_build=$e2e_build e2e-state-vars: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_state_vars --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_state_vars --e2e_build=$e2e_build e2e-delegate-calls: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_delegate_calls --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_delegate_calls --e2e_build=$e2e_build e2e-non-contract-account: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_non_contract_account --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_non_contract_account --e2e_build=$e2e_build e2e-cross-chain-messaging: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_cross_chain_messaging --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_cross_chain_messaging --e2e_build=$e2e_build e2e-crowdfunding-and-claim: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_crowdfunding_and_claim --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_crowdfunding_and_claim --e2e_build=$e2e_build e2e-public-cross-chain-messaging: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_public_cross_chain_messaging --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_public_cross_chain_messaging --e2e_build=$e2e_build e2e-public-to-private-messaging: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_public_to_private_messaging --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_public_to_private_messaging --e2e_build=$e2e_build e2e-account-contracts: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_account_contracts --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_account_contracts --e2e_build=$e2e_build e2e-escrow-contract: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_escrow_contract --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_escrow_contract --e2e_build=$e2e_build e2e-inclusion-proofs-contract: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_inclusion_proofs_contract --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_inclusion_proofs_contract --e2e_build=$e2e_build e2e-pending-note-hashes-contract: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_pending_note_hashes_contract --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_pending_note_hashes_contract --e2e_build=$e2e_build e2e-ordering: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_ordering --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_ordering --e2e_build=$e2e_build uniswap-trade-on-l1-from-l2: - ARG e2e_remote=false - DO +E2E_TEST --test=uniswap_trade_on_l1_from_l2 --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=uniswap_trade_on_l1_from_l2 --e2e_build=$e2e_build integration-archiver-l1-to-l2: - ARG e2e_remote=false - DO +E2E_TEST --test=integration_archiver_l1_to_l2 --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=integration_archiver_l1_to_l2 --e2e_build=$e2e_build integration-l1-publisher: - ARG e2e_remote=false - DO +E2E_TEST --test=integration_l1_publisher --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=integration_l1_publisher --e2e_build=$e2e_build e2e-cli: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_cli --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_cli --e2e_build=$e2e_build e2e-persistence: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_persistence --compose_file=./scripts/docker-compose-no-sandbox.yml --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_persistence --compose_file=./scripts/docker-compose-no-sandbox.yml --e2e_build=$e2e_build e2e-browser: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_aztec_js_browser --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_aztec_js_browser --e2e_build=$e2e_build e2e-card-game: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_card_game --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_card_game --e2e_build=$e2e_build e2e-avm-simulator: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_avm_simulator --avm_enabled=1 --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_avm_simulator --avm_enabled=1 --e2e_build=$e2e_build e2e-fees: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_fees --enable_gas=1 --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_fees --enable_gas=1 --e2e_build=$e2e_build e2e-dapp-subscription: - ARG e2e_remote=false - DO +E2E_TEST --test=e2e_dapp_subscription --enable_gas=1 --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=e2e_dapp_subscription --enable_gas=1 --e2e_build=$e2e_build pxe: - ARG e2e_remote=false - DO +E2E_TEST --test=pxe_sandbox --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=pxe_sandbox --e2e_build=$e2e_build cli-docs-sandbox: - ARG e2e_remote=false - DO +E2E_TEST --test=cli_docs_sandbox --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=cli_docs_sandbox --e2e_build=$e2e_build e2e-docs-examples: - ARG e2e_remote=false - DO +E2E_TEST --test=docs_examples --e2e_remote=$e2e_remote + ARG e2e_build=false + DO +E2E_TEST --test=docs_examples --avm_enabled=true --e2e_build=$e2e_build # all: # for stability, instead of an 'all' target in Earthly, use `make all` diff --git a/yarn-project/end-to-end/scripts/docker-compose.yml b/yarn-project/end-to-end/scripts/docker-compose.yml index ea58ca1f8aa..f337678f3b6 100644 --- a/yarn-project/end-to-end/scripts/docker-compose.yml +++ b/yarn-project/end-to-end/scripts/docker-compose.yml @@ -11,6 +11,8 @@ services: fi' expose: - '8545' + ports: + - '8545:8545' sandbox: image: aztecprotocol/aztec:latest @@ -29,6 +31,8 @@ services: ENABLE_GAS: ${ENABLE_GAS:-} expose: - '8080' + ports: + - '8080:8080' end-to-end: image: aztecprotocol/end-to-end:latest From 6901e11a5e704406840ef500ee63f855b280a0f8 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 16:13:00 +0000 Subject: [PATCH 11/28] test fixes --- .github/workflows/ci.yml | 1 - yarn-project/end-to-end/Earthfile | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2089a8f7819..7bdbd597676 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,6 @@ jobs: - e2e-pending-note-hashes-contract - e2e-ordering - uniswap-trade-on-l1-from-l2 - - integration-archiver-l1-to-l2 - integration-l1-publisher - e2e-cli - e2e-persistence diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 11810d7b0fc..cf04b71027e 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -112,10 +112,6 @@ uniswap-trade-on-l1-from-l2: ARG e2e_build=false DO +E2E_TEST --test=uniswap_trade_on_l1_from_l2 --e2e_build=$e2e_build -integration-archiver-l1-to-l2: - ARG e2e_build=false - DO +E2E_TEST --test=integration_archiver_l1_to_l2 --e2e_build=$e2e_build - integration-l1-publisher: ARG e2e_build=false DO +E2E_TEST --test=integration_l1_publisher --e2e_build=$e2e_build @@ -150,7 +146,7 @@ e2e-dapp-subscription: pxe: ARG e2e_build=false - DO +E2E_TEST --test=pxe_sandbox --e2e_build=$e2e_build + DO +E2E_TEST --test=pxe --e2e_build=$e2e_build cli-docs-sandbox: ARG e2e_build=false From 352a5f003b489732405a52f473d3f245faf82afd Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 16:16:08 +0000 Subject: [PATCH 12/28] cleaner cloud --- scripts/earthly-cloud | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/earthly-cloud b/scripts/earthly-cloud index d474dd1b533..ff6326f6f19 100755 --- a/scripts/earthly-cloud +++ b/scripts/earthly-cloud @@ -55,14 +55,15 @@ RUNNER=$RUNNER_TYPE-$RUNNER_ID-$ARCH earthly sat --org aztec launch --size $SIZE --platform $PLATFORM $RUNNER || true # --remote-cache=aztecprotocol/cache:bb-native-tests EARTHLY_FLAGS="-P --no-output --org aztec --sat $RUNNER" +OUTPUT_FILE=$(mktemp) # capture output to handle earthly edge cases if $INTERACTIVE ; then # don't play nice with tee if interactive earthly $EARTHLY_FLAGS $@ -elif ! earthly $EARTHLY_FLAGS $@ 2>&1 | tee .output.txt >&2 ; then +elif ! earthly $EARTHLY_FLAGS $@ 2>&1 | tee $OUTPUT_FILE >&2 ; then # we got a failure, handle retries # TODO potentially handle other intermittent errors here - if grep 'failed to get edge: inconsistent graph state' .output.txt >/dev/null ; then + if grep 'failed to get edge: inconsistent graph state' $OUTPUT_FILE >/dev/null ; then # TODO we need to limit earthly parallelism or sometimes get # 'failed to solve: failed to get edge: inconsistent graph state' # so we use arbitrary WAIT statement groups. Pending earthly support. From 84795e5c293fe71ea29645c2cd2b9afa8af80f99 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 17:33:16 +0000 Subject: [PATCH 13/28] Update --- barretenberg/cpp/src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/CMakeLists.txt b/barretenberg/cpp/src/CMakeLists.txt index 7f7b588c58d..57f24f01fdf 100644 --- a/barretenberg/cpp/src/CMakeLists.txt +++ b/barretenberg/cpp/src/CMakeLists.txt @@ -23,7 +23,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18) # We target clang18 and need this, eventually warning should be fixed or this will be unconditional. - add_compile_options(-Wno-vla-cxx-extension) + add_compile_options(-Wno-vla-cxx-extension -pthread) + add_link_options(-Wl,--shared-memory) endif() endif() From bf036f8354f9b2dcee4d8ea66613e5572dbc37e5 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 18:34:56 +0000 Subject: [PATCH 14/28] preset wasm --- .github/workflows/ci.yml | 4 ++- barretenberg/cpp/Earthfile | 26 ++++++++++++++++++-- barretenberg/cpp/scripts/install-wasi-sdk.sh | 3 +-- barretenberg/ts/Earthfile | 4 +-- yarn-project/end-to-end/Earthfile | 8 ++++-- 5 files changed, 36 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bdbd597676..abfb383c062 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,9 @@ jobs: if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' # We don't do much on arm, just run it on their builder run: - earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true + # use locally=false to run docker-in-docker on the ARM runner. + # the default locally=true is better for setups without docker-in-docker. + earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true --locally=false # all the end-to-end integration tests for aztec e2e-x86: diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index a04a862a106..e3d56dc1741 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -47,12 +47,20 @@ build-wasi-sdk: SAVE ARTIFACT wasi-sdk SAVE IMAGE --push aztecprotocol/cache:wasi-sdk-threads-v21.0-$TARGETARCH -get-wasi-sdk: +get-wasi-sdk-threads: ARG TARGETARCH # If this is failing, we need to run earthly --push +build-wasi-sdk FROM aztecprotocol/cache:wasi-sdk-threads-v21.0-$TARGETARCH SAVE ARTIFACT wasi-sdk +get-wasi-sdk-single-threaded: + # NOTE: currently does not work in ARM + ARG TARGETARCH + FROM +source + ./scripts/install-wasi-sdk.sh + # TODO better output name + SAVE ARTIFACT src/wasi-sdk-20 wasi-sdk + wasmtime: RUN curl https://wasmtime.dev/install.sh -sSf | bash SAVE ARTIFACT /root/.wasmtime/bin/wasmtime @@ -81,7 +89,21 @@ preset-debug: SAVE ARTIFACT bin preset-wasm: - ARG BB_WASI_SDK="" + ARG wasm_threads_only=false + FROM +source + IF [ $wasm_threads_only = true ] + FROM +preset-wasm-threads + SAVE ARTIFACT bin + ELSE + # wasi-sdk + COPY +get-wasi-sdk/wasi-sdk-threads src/wasi-sdk-threads + DO +RUN_CMAKE --configure="--preset wasm" --build="--target barretenberg.wasm" + RUN ../src/wasi-sdk/bin/llvm-strip ./bin/barretenberg.wasm + SAVE ARTIFACT bin + SAVE IMAGE --cache-hint + END + +preset-wasm-threads: FROM +source # wasi-sdk COPY +get-wasi-sdk/wasi-sdk src/wasi-sdk diff --git a/barretenberg/cpp/scripts/install-wasi-sdk.sh b/barretenberg/cpp/scripts/install-wasi-sdk.sh index a4469023a7d..22224212170 100755 --- a/barretenberg/cpp/scripts/install-wasi-sdk.sh +++ b/barretenberg/cpp/scripts/install-wasi-sdk.sh @@ -22,7 +22,6 @@ fi # Install the webassembly toolchain. mkdir -p src cd ./src -# TODO(https://github.com/AztecProtocol/barretenberg/issues/865): is this needed? curl -s -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-$OS.tar.gz | tar zxf - if [ "$OS" == "linux" ]; then # Exceptional linux case that provides an llvm build that works on Ubuntu 20. @@ -35,5 +34,5 @@ else # Can remove once future releases are more stable. curl -s -L https://wasi-sdk.s3.eu-west-2.amazonaws.com/yamt-wasi-sysroot-20.0.threads.tgz | tar zxf - fi -# TODO(https://github.com/AztecProtocol/barretenberg/issues/906): in the future this should use eartlhy and a 'SAVE ARTIFACT wasi-sdk AS LOCAL wasi-sdk' +# TODO(https://github.com/AztecProtocol/barretenberg/issues/906): in the future this should use earthly and a 'SAVE ARTIFACT wasi-sdk AS LOCAL wasi-sdk' mv wasi-sdk-20.0+threads wasi-sdk diff --git a/barretenberg/ts/Earthfile b/barretenberg/ts/Earthfile index c7133e4a41f..8382330e373 100644 --- a/barretenberg/ts/Earthfile +++ b/barretenberg/ts/Earthfile @@ -13,10 +13,10 @@ RUN yarn --immutable COPY --dir src *.json *.js *.cjs . # copy over wasm build from cpp folder -COPY ../cpp/+preset-wasm/bin/barretenberg.wasm src/barretenberg_wasm/barretenberg-threads.wasm +COPY ../cpp/+preset-wasm-threads/bin/barretenberg.wasm src/barretenberg_wasm/barretenberg-threads.wasm # TODO for now there is no real single-threaded WASM. See if anyone hits problems. COPY ../cpp/+preset-wasm/bin/barretenberg.wasm src/barretenberg_wasm/barretenberg.wasm -COPY ../cpp/+preset-wasm/bin/barretenberg.wasm dest/node/barretenberg_wasm/barretenberg-threads.wasm +COPY ../cpp/+preset-wasm-threads/bin/barretenberg.wasm dest/node/barretenberg_wasm/barretenberg-threads.wasm COPY ../cpp/+preset-wasm/bin/barretenberg.wasm dest/node-cjs/barretenberg_wasm/barretenberg-threads.wasm esm: diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index cf04b71027e..6f9d5eb3d8b 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -21,10 +21,14 @@ E2E_TEST_FROM_BUILD: ARG test ARG compose_file=./scripts/docker-compose.yml ARG enable_gas="" - FROM earthly/dind:alpine-3.19-docker-25.0.2-r0 + ARG locally="true" + LOCALLY + IF [ $locally != true ] + FROM earthly/dind:alpine-3.19-docker-25.0.2-r0 + COPY $compose_file $compose_file + END ENV ENABLE_GAS=$enable_gas ENV TEST=$test.test.ts - COPY $compose_file $compose_file # For ARM, we do use WITH DOCKER as we don't have many e2e tests, but note E2E_TEST_FROM_DOCKERHUB WITH DOCKER \ --load aztecprotocol/aztec:latest=../+aztec \ From 7666eb51deba4655f59d44f2e555a98ac3c4c0c9 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 18:37:38 +0000 Subject: [PATCH 15/28] fixes --- barretenberg/cpp/Earthfile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index e3d56dc1741..9b5cc7300eb 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -53,11 +53,12 @@ get-wasi-sdk-threads: FROM aztecprotocol/cache:wasi-sdk-threads-v21.0-$TARGETARCH SAVE ARTIFACT wasi-sdk -get-wasi-sdk-single-threaded: +get-wasi-sdk: # NOTE: currently does not work in ARM + # Align with above ARG TARGETARCH FROM +source - ./scripts/install-wasi-sdk.sh + RUN ./scripts/install-wasi-sdk.sh # TODO better output name SAVE ARTIFACT src/wasi-sdk-20 wasi-sdk @@ -95,8 +96,7 @@ preset-wasm: FROM +preset-wasm-threads SAVE ARTIFACT bin ELSE - # wasi-sdk - COPY +get-wasi-sdk/wasi-sdk-threads src/wasi-sdk-threads + COPY +get-wasi-sdk/wasi-sdk src/wasi-sdk DO +RUN_CMAKE --configure="--preset wasm" --build="--target barretenberg.wasm" RUN ../src/wasi-sdk/bin/llvm-strip ./bin/barretenberg.wasm SAVE ARTIFACT bin @@ -105,8 +105,7 @@ preset-wasm: preset-wasm-threads: FROM +source - # wasi-sdk - COPY +get-wasi-sdk/wasi-sdk src/wasi-sdk + COPY +get-wasi-sdk-threads/wasi-sdk src/wasi-sdk DO +RUN_CMAKE --configure="--preset wasm-threads" --build="--target barretenberg.wasm" RUN ../src/wasi-sdk/bin/llvm-strip ./bin/barretenberg.wasm SAVE ARTIFACT bin @@ -154,8 +153,8 @@ bench-client-ivc: build: # default target BUILD +preset-release - BUILD +preset-wasm - + BUILD +preset-wasm-threads +A test: BUILD +test-clang-format FROM +preset-release-assert-all From f2ef478e9c26ef46db3b625de60fce8e2ad86950 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 18:39:58 +0000 Subject: [PATCH 16/28] reduce runners --- scripts/earthly-cloud | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/earthly-cloud b/scripts/earthly-cloud index 2df1fb190d2..e71ccfdff00 100755 --- a/scripts/earthly-cloud +++ b/scripts/earthly-cloud @@ -28,12 +28,12 @@ fi # default sizes for build type if [ "$RUNNER_TYPE" == "build" ] ; then SIZE=4xlarge - NUMBER_OF_RUNNERS=4 + NUMBER_OF_RUNNERS=2 # TODO why cant we set this?? # MAX_PARALLELISM=8 elif [ "$RUNNER_TYPE" == "bench" ] ; then SIZE=2xlarge - NUMBER_OF_RUNNERS=2 + NUMBER_OF_RUNNERS=1 # MAX_PARALLELISM=1 fi From b95c51ff124f1b19d65774fffa8a10640e9360c9 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 18:49:37 +0000 Subject: [PATCH 17/28] e2e browser speculative fix --- barretenberg/cpp/Earthfile | 7 ++++--- barretenberg/ts/Earthfile | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index 9b5cc7300eb..abd5dffa6fc 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -58,9 +58,10 @@ get-wasi-sdk: # Align with above ARG TARGETARCH FROM +source + COPY ./scripts/install-wasi-sdk.sh ./scripts/ RUN ./scripts/install-wasi-sdk.sh - # TODO better output name - SAVE ARTIFACT src/wasi-sdk-20 wasi-sdk + # TODO better output name to mirror wasi-sdk + SAVE ARTIFACT src/wasi-sdk-20.0 wasi-sdk wasmtime: RUN curl https://wasmtime.dev/install.sh -sSf | bash @@ -154,7 +155,7 @@ bench-client-ivc: build: # default target BUILD +preset-release BUILD +preset-wasm-threads -A + test: BUILD +test-clang-format FROM +preset-release-assert-all diff --git a/barretenberg/ts/Earthfile b/barretenberg/ts/Earthfile index 8382330e373..a0dcd619e32 100644 --- a/barretenberg/ts/Earthfile +++ b/barretenberg/ts/Earthfile @@ -14,7 +14,6 @@ COPY --dir src *.json *.js *.cjs . # copy over wasm build from cpp folder COPY ../cpp/+preset-wasm-threads/bin/barretenberg.wasm src/barretenberg_wasm/barretenberg-threads.wasm -# TODO for now there is no real single-threaded WASM. See if anyone hits problems. COPY ../cpp/+preset-wasm/bin/barretenberg.wasm src/barretenberg_wasm/barretenberg.wasm COPY ../cpp/+preset-wasm-threads/bin/barretenberg.wasm dest/node/barretenberg_wasm/barretenberg-threads.wasm COPY ../cpp/+preset-wasm/bin/barretenberg.wasm dest/node-cjs/barretenberg_wasm/barretenberg-threads.wasm From 73fb3359e9cf58ed431ae416f8bacf2b7c1808d4 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 18:54:11 +0000 Subject: [PATCH 18/28] arm fix --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abfb383c062..fa9851072f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,10 +70,12 @@ jobs: working-directory: ./yarn-project/end-to-end/ if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' # We don't do much on arm, just run it on their builder - run: - # use locally=false to run docker-in-docker on the ARM runner. - # the default locally=true is better for setups without docker-in-docker. - earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true --locally=false + run: + # Flags: + # - e2e_build=true to get images from a local build, not a dockerhub registry strategy + # - locally=false to run docker-in-docker on the ARM runner. default locally=true is better for setups without docker-in-docker. + # - wasm-threads-only=true to skip wasm single threaded builds + earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true --locally=false --wasm-threads-only=true # all the end-to-end integration tests for aztec e2e-x86: From 5870d90a3052185a63e4d35a693275f659917ac8 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 18:56:33 +0000 Subject: [PATCH 19/28] always cache node_modules (experimental) --- yarn-project/Earthfile | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index fb4e1b335eb..2e110b4a209 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -29,18 +29,14 @@ build: # TODO: Replace puppeteer with puppeteer-core to avoid this. # TODO encapsulate in bash script for cleanliness ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true - # IF $EARTHLY_CI # Don't cache CI builds. - RUN ./bootstrap.sh && yarn workspaces focus @aztec/cli @aztec/aztec --production && yarn cache clean - # ELSE - # ENV YARN_CACHE_FOLDER /build/yarn-cache - # # Use a mount for incremental builds locally. - # RUN --mount type=cache,target=/build/node_modules_cache --mount type=cache,target=/build/yarn-cache \ - # mkdir -p node_modules_cache && \ - # mv node_modules_cache node_modules && \ - # ./bootstrap.sh && \ - # yarn workspaces focus @aztec/cli @aztec/aztec --production && \ - # cp -r node_modules node_modules_cache - # END + ENV YARN_CACHE_FOLDER /build/yarn-cache + # Use a mount for incremental builds locally. + RUN --mount type=cache,target=/build/node_modules_cache --mount type=cache,target=/build/yarn-cache \ + mkdir -p node_modules_cache && \ + mv node_modules_cache node_modules && \ + ./bootstrap.sh && \ + yarn workspaces focus @aztec/cli @aztec/aztec --production && \ + cp -r node_modules node_modules_cache SAVE ARTIFACT /build # TODO versioning flow at end before publish? From 54ce088bd557490fecc35d31ced8175348b996c4 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 18:59:53 +0000 Subject: [PATCH 20/28] wasm threads --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa9851072f8..4ba1150a023 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: # - e2e_build=true to get images from a local build, not a dockerhub registry strategy # - locally=false to run docker-in-docker on the ARM runner. default locally=true is better for setups without docker-in-docker. # - wasm-threads-only=true to skip wasm single threaded builds - earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true --locally=false --wasm-threads-only=true + earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true --locally=false --wasm_threads_only=true # all the end-to-end integration tests for aztec e2e-x86: From 6b0530e8475cd708e1a956b6f43a146a3ab65114 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 19:19:03 +0000 Subject: [PATCH 21/28] use wasm threads --- .github/workflows/ci.yml | 3 +-- barretenberg/cpp/Earthfile | 18 +++++++++++------- scripts/earthly-cloud | 3 +++ yarn-project/Earthfile | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ba1150a023..2aaa8648349 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,8 +74,7 @@ jobs: # Flags: # - e2e_build=true to get images from a local build, not a dockerhub registry strategy # - locally=false to run docker-in-docker on the ARM runner. default locally=true is better for setups without docker-in-docker. - # - wasm-threads-only=true to skip wasm single threaded builds - earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true --locally=false --wasm_threads_only=true + earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true --locally=false # all the end-to-end integration tests for aztec e2e-x86: diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index abd5dffa6fc..ea363c7d253 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -54,14 +54,18 @@ get-wasi-sdk-threads: SAVE ARTIFACT wasi-sdk get-wasi-sdk: - # NOTE: currently does not work in ARM - # Align with above + # NOTE: currently only works with ARM + # TODO Align with above ARG TARGETARCH FROM +source - COPY ./scripts/install-wasi-sdk.sh ./scripts/ - RUN ./scripts/install-wasi-sdk.sh - # TODO better output name to mirror wasi-sdk - SAVE ARTIFACT src/wasi-sdk-20.0 wasi-sdk + IF [ $TARGETARCH = amd64 ] + COPY ./scripts/install-wasi-sdk.sh ./scripts/ + RUN ./scripts/install-wasi-sdk.sh + # TODO better output name to mirror wasi-sdk + SAVE ARTIFACT src/wasi-sdk-20.0 wasi-sdk + ELSE + FROM +get-wasi-sdk-threads + END wasmtime: RUN curl https://wasmtime.dev/install.sh -sSf | bash @@ -212,7 +216,7 @@ BENCH_WASM: FUNCTION ARG target ARG args - FROM +preset-wasm + FROM +preset-wasm-threads DO +RUN_CMAKE --configure="--preset wasm-threads" --build="--target $target" COPY --dir ./srs_db/+build/. ../srs_db # install diff --git a/scripts/earthly-cloud b/scripts/earthly-cloud index e71ccfdff00..f1027681198 100755 --- a/scripts/earthly-cloud +++ b/scripts/earthly-cloud @@ -29,6 +29,9 @@ fi if [ "$RUNNER_TYPE" == "build" ] ; then SIZE=4xlarge NUMBER_OF_RUNNERS=2 + if [ "$ARCH" = arm ] ; then + NUMBER_OF_RUNNERS=1 + fi # TODO why cant we set this?? # MAX_PARALLELISM=8 elif [ "$RUNNER_TYPE" == "bench" ] ; then diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index 2e110b4a209..958160251d0 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -26,6 +26,7 @@ RUN ln -s /build/yarn-project/node_modules /build/node_modules build: FROM +source ARG EARTHLY_CI + ARG TARGETARCH # TODO: Replace puppeteer with puppeteer-core to avoid this. # TODO encapsulate in bash script for cleanliness ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true From e8c4e3836849c619f89362465a2bb87794db252e Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 19:20:51 +0000 Subject: [PATCH 22/28] threads fix --- barretenberg/cpp/Earthfile | 20 ++++++++------------ yarn-project/Earthfile | 1 - 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/barretenberg/cpp/Earthfile b/barretenberg/cpp/Earthfile index ea363c7d253..6fd5e79b67f 100644 --- a/barretenberg/cpp/Earthfile +++ b/barretenberg/cpp/Earthfile @@ -54,18 +54,13 @@ get-wasi-sdk-threads: SAVE ARTIFACT wasi-sdk get-wasi-sdk: - # NOTE: currently only works with ARM + # NOTE: currently only works with x86 # TODO Align with above - ARG TARGETARCH FROM +source - IF [ $TARGETARCH = amd64 ] - COPY ./scripts/install-wasi-sdk.sh ./scripts/ - RUN ./scripts/install-wasi-sdk.sh - # TODO better output name to mirror wasi-sdk - SAVE ARTIFACT src/wasi-sdk-20.0 wasi-sdk - ELSE - FROM +get-wasi-sdk-threads - END + COPY ./scripts/install-wasi-sdk.sh ./scripts/ + RUN ./scripts/install-wasi-sdk.sh + # TODO better output name to mirror wasi-sdk + SAVE ARTIFACT src/wasi-sdk-20.0 wasi-sdk wasmtime: RUN curl https://wasmtime.dev/install.sh -sSf | bash @@ -95,9 +90,10 @@ preset-debug: SAVE ARTIFACT bin preset-wasm: - ARG wasm_threads_only=false + ARG TARGETARCH FROM +source - IF [ $wasm_threads_only = true ] + IF [ $TARGETARCH = arm64 ] + # Just use threads for now FROM +preset-wasm-threads SAVE ARTIFACT bin ELSE diff --git a/yarn-project/Earthfile b/yarn-project/Earthfile index 958160251d0..2e110b4a209 100644 --- a/yarn-project/Earthfile +++ b/yarn-project/Earthfile @@ -26,7 +26,6 @@ RUN ln -s /build/yarn-project/node_modules /build/node_modules build: FROM +source ARG EARTHLY_CI - ARG TARGETARCH # TODO: Replace puppeteer with puppeteer-core to avoid this. # TODO encapsulate in bash script for cleanliness ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true From f6c01c8c06c78695a21beaeea76c20ad08ded9ed Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 19:50:12 +0000 Subject: [PATCH 23/28] fix arm --- .github/workflows/ci.yml | 3 +-- yarn-project/end-to-end/Earthfile | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2aaa8648349..99a82e46dd0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,8 +73,7 @@ jobs: run: # Flags: # - e2e_build=true to get images from a local build, not a dockerhub registry strategy - # - locally=false to run docker-in-docker on the ARM runner. default locally=true is better for setups without docker-in-docker. - earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true --locally=false + earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true # all the end-to-end integration tests for aztec e2e-x86: diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 6f9d5eb3d8b..ccaf89e9661 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -21,12 +21,6 @@ E2E_TEST_FROM_BUILD: ARG test ARG compose_file=./scripts/docker-compose.yml ARG enable_gas="" - ARG locally="true" - LOCALLY - IF [ $locally != true ] - FROM earthly/dind:alpine-3.19-docker-25.0.2-r0 - COPY $compose_file $compose_file - END ENV ENABLE_GAS=$enable_gas ENV TEST=$test.test.ts # For ARM, we do use WITH DOCKER as we don't have many e2e tests, but note E2E_TEST_FROM_DOCKERHUB From 5a736461af88b68d8f06ecce475e7ef33c994c93 Mon Sep 17 00:00:00 2001 From: ludamad Date: Tue, 26 Mar 2024 20:01:07 +0000 Subject: [PATCH 24/28] Update --- yarn-project/end-to-end/Earthfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index ccaf89e9661..cf04b71027e 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -21,8 +21,10 @@ E2E_TEST_FROM_BUILD: ARG test ARG compose_file=./scripts/docker-compose.yml ARG enable_gas="" + FROM earthly/dind:alpine-3.19-docker-25.0.2-r0 ENV ENABLE_GAS=$enable_gas ENV TEST=$test.test.ts + COPY $compose_file $compose_file # For ARM, we do use WITH DOCKER as we don't have many e2e tests, but note E2E_TEST_FROM_DOCKERHUB WITH DOCKER \ --load aztecprotocol/aztec:latest=../+aztec \ From 1f7b82a36cf3c945866ae46682bf9ed31567a1ba Mon Sep 17 00:00:00 2001 From: ludamad Date: Wed, 27 Mar 2024 16:47:38 -0400 Subject: [PATCH 25/28] Update docker-compose.yml --- yarn-project/end-to-end/scripts/docker-compose.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/yarn-project/end-to-end/scripts/docker-compose.yml b/yarn-project/end-to-end/scripts/docker-compose.yml index 741e19e48bf..8d0c71158a8 100644 --- a/yarn-project/end-to-end/scripts/docker-compose.yml +++ b/yarn-project/end-to-end/scripts/docker-compose.yml @@ -11,8 +11,6 @@ services: fi' expose: - '8545' - ports: - - '8545:8545' sandbox: image: aztecprotocol/aztec:latest @@ -30,8 +28,6 @@ services: ENABLE_GAS: ${ENABLE_GAS:-} expose: - '8080' - ports: - - '8080:8080' end-to-end: image: aztecprotocol/end-to-end:latest From 77d2d267fc24bf9668b5ed8e2bc08bb8163f79af Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 28 Mar 2024 11:00:10 -0400 Subject: [PATCH 26/28] Update ci.yml --- .github/workflows/ci.yml | 74 ++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99a82e46dd0..b73bd4df768 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,43 +37,43 @@ jobs: # push to registry earthly-cloud build x86 --push +build-end-to-end - # all the end-to-end integration tests for aztec - e2e-arm: - runs-on: ubuntu-latest - env: - EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} - strategy: - matrix: - test: - - e2e-card-game - - e2e-crowdfunding-and-claim - # cancel if reran on same PR if exists, otherwise if on same commit - concurrency: - group: ${{ matrix.test }}-${{ github.event.pull_request.number || github.ref_name }}-arm - cancel-in-progress: ${{ github.ref_name != 'master' }} - steps: - - uses: earthly/actions-setup@v1 - with: - version: v0.8.5 - - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - submodules: recursive - - - name: Setup - working-directory: ./scripts - run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }} - - - name: Test - working-directory: ./yarn-project/end-to-end/ - if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' - # We don't do much on arm, just run it on their builder - run: - # Flags: - # - e2e_build=true to get images from a local build, not a dockerhub registry strategy - earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true + # # all the end-to-end integration tests for aztec + # e2e-arm: + # runs-on: ubuntu-latest + # env: + # EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} + # strategy: + # matrix: + # test: + # - e2e-card-game + # - e2e-crowdfunding-and-claim + # # cancel if reran on same PR if exists, otherwise if on same commit + # concurrency: + # group: ${{ matrix.test }}-${{ github.event.pull_request.number || github.ref_name }}-arm + # cancel-in-progress: ${{ github.ref_name != 'master' }} + # steps: + # - uses: earthly/actions-setup@v1 + # with: + # version: v0.8.5 + + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # ref: ${{ github.event.pull_request.head.sha }} + # submodules: recursive + + # - name: Setup + # working-directory: ./scripts + # run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }} + + # - name: Test + # working-directory: ./yarn-project/end-to-end/ + # if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' + # # We don't do much on arm, just run it on their builder + # run: + # # Flags: + # # - e2e_build=true to get images from a local build, not a dockerhub registry strategy + # earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true # all the end-to-end integration tests for aztec e2e-x86: From 2c7e6ed9530c0e65fbba32d6566f1568c78c761b Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 28 Mar 2024 11:02:28 -0400 Subject: [PATCH 27/28] fix: disable bb-native-tests arm for now --- .github/workflows/ci.yml | 77 ++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b73bd4df768..713ba8c7c9b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,43 +37,43 @@ jobs: # push to registry earthly-cloud build x86 --push +build-end-to-end - # # all the end-to-end integration tests for aztec - # e2e-arm: - # runs-on: ubuntu-latest - # env: - # EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} - # strategy: - # matrix: - # test: - # - e2e-card-game - # - e2e-crowdfunding-and-claim - # # cancel if reran on same PR if exists, otherwise if on same commit - # concurrency: - # group: ${{ matrix.test }}-${{ github.event.pull_request.number || github.ref_name }}-arm - # cancel-in-progress: ${{ github.ref_name != 'master' }} - # steps: - # - uses: earthly/actions-setup@v1 - # with: - # version: v0.8.5 - - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # ref: ${{ github.event.pull_request.head.sha }} - # submodules: recursive - - # - name: Setup - # working-directory: ./scripts - # run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }} - - # - name: Test - # working-directory: ./yarn-project/end-to-end/ - # if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' - # # We don't do much on arm, just run it on their builder - # run: - # # Flags: - # # - e2e_build=true to get images from a local build, not a dockerhub registry strategy - # earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true + # all the end-to-end integration tests for aztec + e2e-arm: + runs-on: ubuntu-latest + env: + EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} + strategy: + matrix: + test: + - e2e-card-game + - e2e-crowdfunding-and-claim + # cancel if reran on same PR if exists, otherwise if on same commit + concurrency: + group: ${{ matrix.test }}-${{ github.event.pull_request.number || github.ref_name }}-arm + cancel-in-progress: ${{ github.ref_name != 'master' }} + steps: + - uses: earthly/actions-setup@v1 + with: + version: v0.8.5 + + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + submodules: recursive + + - name: Setup + working-directory: ./scripts + run: ./setup_env.sh ${{ secrets.DOCKERHUB_PASSWORD }} ${{ github.actor }} + + - name: Test + working-directory: ./yarn-project/end-to-end/ + if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' + # We don't do much on arm, just run it on their builder + run: + # Flags: + # - e2e_build=true to get images from a local build, not a dockerhub registry strategy + earthly-cloud build arm --no-output +${{ matrix.test }} --e2e_build=true # all the end-to-end integration tests for aztec e2e-x86: @@ -150,7 +150,8 @@ jobs: runs-on: ubuntu-latest env: EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} - strategy: { matrix: { environment: [x86, arm] } } + strategy: { matrix: { environment: [x86] } } + # strategy: { matrix: { environment: [x86, arm] } } # cancel if reran on same PR if exists, otherwise if on same commit concurrency: group: bb-native-tests-${{ github.event.pull_request.number || github.ref_name }}-${{ matrix.environment }} From 2eb48edc4035bf0908e0f7d3e0a248503811814d Mon Sep 17 00:00:00 2001 From: ludamad Date: Thu, 28 Mar 2024 11:07:38 -0400 Subject: [PATCH 28/28] fix: on for everyone --- .github/workflows/ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 713ba8c7c9b..244f8e06d40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,6 @@ jobs: - name: Test working-directory: ./yarn-project - if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' run: | # push to registry earthly-cloud build x86 --push +build-end-to-end @@ -68,7 +67,6 @@ jobs: - name: Test working-directory: ./yarn-project/end-to-end/ - if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' # We don't do much on arm, just run it on their builder run: # Flags: @@ -132,7 +130,6 @@ jobs: - name: Pull E2E Images working-directory: ./barretenberg/cpp/ - if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' run: | docker pull aztecprotocol/aztec-cache:$(git rev-parse HEAD) docker pull aztecprotocol/end-to-end-cache:$(git rev-parse HEAD) @@ -141,7 +138,6 @@ jobs: - name: Test working-directory: ./yarn-project/end-to-end/ - if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' run: | earthly-cloud build x86 --no-output +${{ matrix.test }} @@ -173,7 +169,6 @@ jobs: - name: Test working-directory: ./barretenberg/cpp/ - if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' run: | earthly-cloud build ${{ matrix.environment }} --no-output +test @@ -207,10 +202,8 @@ jobs: - name: Client IVC Bench working-directory: ./barretenberg/cpp/ - if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' run: earthly-cloud bench x86 --no-output +bench-client-ivc - name: Ultrahonk Bench working-directory: ./barretenberg/cpp/ - if: github.actor == 'ludamad' || github.actor == 'charlielye' || github.actor == 'sklppy88' || github.actor == 'alexghr' || github.actor == 'benesjan' || github.actor == 'spalladino' || github.actor == 'just-mitch' run: earthly-cloud bench x86 --no-output +bench-ultra-honk