From 766ab29410ff0bc9bf13097dea10abb894c23b0a Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Fri, 3 May 2024 18:46:41 -0300 Subject: [PATCH 1/7] chore: Reenable bench summary --- .github/workflows/ci.yml | 53 ++++++++++++++++--------------- Earthfile | 3 +- build-images/Earthfile | 2 +- foundry/foundry-repo | 1 + scripts/logs/upload_logs_to_s3.sh | 8 +---- yarn-project/end-to-end/Earthfile | 12 +++---- yarn-project/scripts/Earthfile | 3 +- 7 files changed, 38 insertions(+), 44 deletions(-) create mode 160000 foundry/foundry-repo diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a097d4b70fe..8e198a745f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,32 +119,33 @@ jobs: --no-output \ +${{ matrix.test }} - # # bench-summary: - # # needs: e2e - # # runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 - # # steps: - # # - uses: actions/checkout@v4 - # # with: - # # fetch-depth: 100 # Downloading base benchmark from master requires access to history - # # ref: "${{ env.GIT_COMMIT }}" - # # - uses: ./.github/ci-setup-action - # # with: - # # concurrency_key: build-${{ github.event.pull_request.user.login || github.actor }}-x86 - # # - name: "Build and upload bench aggregate file" - # # working-directory: ./yarn-project/scripts - # # run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} +bench-aggregate - # # - name: "Download base benchmark" - # # if: ${{ github.event_name == 'pull_request' }} - # # run: scripts/logs/download_base_benchmark_from_s3.sh - # # env: - # # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - # # BENCH_FOLDER: ./yarn-project/scripts/bench - # # PULL_REQUEST: "${{ github.event.pull_request.number }}" - # # - name: "Generate summary comment if pull request" - # # if: ${{ github.event_name == 'pull_request' }} - # # working-directory: ./yarn-project/scripts - # # run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} --secret AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} +bench-comment + bench-summary: + needs: bench-e2e + runs-on: ${{ inputs.username || github.actor }}-x86 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 100 # Downloading base benchmark from master requires access to history + ref: "${{ github.event.pull_request.head.sha }}" + - uses: ./.github/ci-setup-action + with: + dockerhub_password: "${{ secrets.DOCKERHUB_PASSWORD }}" + concurrency_key: build-${{ inputs.username || github.actor }}-x86 + - name: "Build and upload bench aggregate file" + working-directory: ./yarn-project/scripts + run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} +bench-aggregate + - name: "Download base benchmark" + if: ${{ github.event_name == 'pull_request' }} + run: scripts/logs/download_base_benchmark_from_s3.sh + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BENCH_FOLDER: ./yarn-project/scripts/bench + PULL_REQUEST: "${{ github.event.pull_request.number }}" + - name: "Generate summary comment if pull request" + if: ${{ github.event_name == 'pull_request' }} + working-directory: ./yarn-project/scripts + run: earthly-ci -P --secret AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --secret AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} --secret AZTEC_BOT_COMMENTER_GITHUB_TOKEN=${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} +bench-comment noir-format: needs: setup diff --git a/Earthfile b/Earthfile index 5a42a251dfd..6293d2081fe 100644 --- a/Earthfile +++ b/Earthfile @@ -31,7 +31,6 @@ release-meta: SAVE ARTIFACT /usr/src /usr/src scripts: - FROM ubuntu:lunar - RUN apt-get update && apt-get install -y awscli + FROM ./build-images+build COPY scripts /usr/src/scripts SAVE ARTIFACT /usr/src/scripts scripts \ No newline at end of file diff --git a/build-images/Earthfile b/build-images/Earthfile index 7bdc6934d84..df86c82cc8a 100644 --- a/build-images/Earthfile +++ b/build-images/Earthfile @@ -409,4 +409,4 @@ sysbox: ARG TARGETARCH SAVE IMAGE aztecprotocol/sysbox:1.0-$TARGETARCH - SAVE IMAGE aztecprotocol/sysbox:1.0 \ No newline at end of file + SAVE IMAGE aztecprotocol/sysbox:1.0 diff --git a/foundry/foundry-repo b/foundry/foundry-repo new file mode 160000 index 00000000000..de33b6af530 --- /dev/null +++ b/foundry/foundry-repo @@ -0,0 +1 @@ +Subproject commit de33b6af53005037b463318d2628b5cfcaf39916 diff --git a/scripts/logs/upload_logs_to_s3.sh b/scripts/logs/upload_logs_to_s3.sh index a5e46f5a968..4a2c77c22d8 100755 --- a/scripts/logs/upload_logs_to_s3.sh +++ b/scripts/logs/upload_logs_to_s3.sh @@ -11,20 +11,14 @@ set -eu LOG_FOLDER=$1 BUCKET_NAME="aztec-ci-artifacts" COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" -E2E_MODE="${E2E_MODE:-local}" -echo "Uploading logs to S3 in mode $E2E_MODE for commit $COMMIT_HASH in branch ${BRANCH:-} at pull request ${PULL_REQUEST:-none}" +echo "Uploading logs to S3 for commit $COMMIT_HASH in branch ${BRANCH:-} at pull request ${PULL_REQUEST:-none}" if [ ! -d "$LOG_FOLDER" ] || [ -z "$(ls -A "$LOG_FOLDER")" ]; then echo "No logs in folder $LOG_FOLDER to upload" exit 0 fi -if [ "$E2E_MODE" == "local" ]; then - echo "Skipping upload since running in local mode" - exit 0 -fi - # Paths used in scripts/ci/assemble_e2e_benchmark.sh if [ "${BRANCH:-}" = "master" ]; then TARGET_FOLDER="logs-v1/master/$COMMIT_HASH/" diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index fe4f40f20ec..c0368f20027 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -24,6 +24,7 @@ E2E_COMPOSE_TEST: END END # Run our docker compose, ending whenever sandbox ends, filtering out noisy eth_getLogs + ENV JOB_NAME=$project_name RUN $CMD -p $project_name -f $compose_file up --exit-code-from=end-to-end --force-recreate E2E_TEST: @@ -195,26 +196,25 @@ bench-publish-rollup: 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 + 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 + 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 + DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH bench-proving: - ARG e2e_mode=local ARG PULL_REQUEST ARG BRANCH ARG COMMIT_HASH - DO +E2E_COMPOSE_TEST --test=bench_proving --debug="aztec:benchmarks:*,aztec:prover*,aztec:bb*" --e2e_mode=$e2e_mode --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 + DO +E2E_COMPOSE_TEST --test=bench_proving --debug="aztec:benchmarks:*,aztec:prover*,aztec:bb*" --enable_gas=1 --compose_file=./scripts/docker-compose-no-sandbox.yml + DO +UPLOAD_LOGS --PULL_REQUEST=$PULL_REQUEST --BRANCH=$BRANCH --COMMIT_HASH=$COMMIT_HASH diff --git a/yarn-project/scripts/Earthfile b/yarn-project/scripts/Earthfile index 37aba4bda90..3fcddf19798 100644 --- a/yarn-project/scripts/Earthfile +++ b/yarn-project/scripts/Earthfile @@ -2,8 +2,7 @@ VERSION 0.8 FROM node:18.19.0 build: - FROM ../+scripts-prod - RUN apt-get update && apt-get install awscli -y + FROM ../+build COPY ../../+scripts/scripts /usr/src/scripts WORKDIR /usr/src From 626e752dbc7c9467bab6b28e3260d67f8c64f945 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 13 May 2024 12:18:48 -0300 Subject: [PATCH 2/7] Remove subrepo --- foundry/foundry-repo | 1 - 1 file changed, 1 deletion(-) delete mode 160000 foundry/foundry-repo diff --git a/foundry/foundry-repo b/foundry/foundry-repo deleted file mode 160000 index de33b6af530..00000000000 --- a/foundry/foundry-repo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit de33b6af53005037b463318d2628b5cfcaf39916 From 040a61551cba9f9338f72e5b862f789428102d46 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 13 May 2024 14:35:55 -0300 Subject: [PATCH 3/7] Upload logs from ubuntu noble --- yarn-project/end-to-end/Earthfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index c0368f20027..e3559a04023 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -50,13 +50,23 @@ UPLOAD_LOGS: ARG COMMIT_HASH LOCALLY LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM ../../+scripts + FROM +log-uploader COPY ./log /usr/var/log ENV PULL_REQUEST=$PULL_REQUEST ENV BRANCH=$BRANCH ENV COMMIT_HASH=$COMMIT_HASH RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log +log-uploader: + # Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs + # Note that we cannot do this LOCALLY because Earthly does not support using secrets locally + FROM ubuntu:noble + RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \ + unzip awscliv2.zip && \ + ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \ + rm -rf aws awscliv2.zip + COPY ../../scripts /usr/src/scripts + e2e-2-pxes: DO +E2E_TEST --test=./src/e2e_2_pxes.test.ts From 939ef8e6dc19e455f540417fd75be3e8d6548fd2 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 13 May 2024 14:50:00 -0300 Subject: [PATCH 4/7] Copy scripts from artifact, not from local copy --- Earthfile | 2 +- yarn-project/end-to-end/Earthfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Earthfile b/Earthfile index 6293d2081fe..5b3ca0e08ce 100644 --- a/Earthfile +++ b/Earthfile @@ -31,6 +31,6 @@ release-meta: SAVE ARTIFACT /usr/src /usr/src scripts: - FROM ./build-images+build + FROM scratch COPY scripts /usr/src/scripts SAVE ARTIFACT /usr/src/scripts scripts \ No newline at end of file diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index e3559a04023..97425b4ab4b 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -65,7 +65,7 @@ log-uploader: unzip awscliv2.zip && \ ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \ rm -rf aws awscliv2.zip - COPY ../../scripts /usr/src/scripts + COPY ../../scripts+scripts /usr/src/scripts e2e-2-pxes: DO +E2E_TEST --test=./src/e2e_2_pxes.test.ts From 7952bbc0a09ccc60e42a2c96243316aff101445b Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 13 May 2024 14:51:47 -0300 Subject: [PATCH 5/7] Log uploader is not an e2e test --- yarn-project/end-to-end/Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn-project/end-to-end/Earthfile b/yarn-project/end-to-end/Earthfile index 97425b4ab4b..33d739a22aa 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -50,14 +50,14 @@ UPLOAD_LOGS: ARG COMMIT_HASH LOCALLY LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" - FROM +log-uploader + FROM +base-log-uploader COPY ./log /usr/var/log ENV PULL_REQUEST=$PULL_REQUEST ENV BRANCH=$BRANCH ENV COMMIT_HASH=$COMMIT_HASH RUN --secret AWS_ACCESS_KEY_ID --secret AWS_SECRET_ACCESS_KEY /usr/src/scripts/logs/upload_logs_to_s3.sh /usr/var/log -log-uploader: +base-log-uploader: # Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs # Note that we cannot do this LOCALLY because Earthly does not support using secrets locally FROM ubuntu:noble From 53872928991b09d017b184273417baf224e91a2c Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Mon, 13 May 2024 15:04:20 -0300 Subject: [PATCH 6/7] Fix me not remembering earthly syntax --- 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 33d739a22aa..50b4ebc323e 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -65,7 +65,7 @@ base-log-uploader: unzip awscliv2.zip && \ ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \ rm -rf aws awscliv2.zip - COPY ../../scripts+scripts /usr/src/scripts + COPY ../../+scripts/scripts /usr/src/scripts e2e-2-pxes: DO +E2E_TEST --test=./src/e2e_2_pxes.test.ts From d1ff1ed09d49ec4e337039799a43e06829b869fc Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 14 May 2024 10:21:06 -0300 Subject: [PATCH 7/7] Add missing packages to log uploader --- 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 50b4ebc323e..b6b8ea93dff 100644 --- a/yarn-project/end-to-end/Earthfile +++ b/yarn-project/end-to-end/Earthfile @@ -61,6 +61,8 @@ base-log-uploader: # Install awscli on a fresh ubuntu, and copy the repo "scripts" folder, which we'll use to upload logs # Note that we cannot do this LOCALLY because Earthly does not support using secrets locally FROM ubuntu:noble + RUN apt update && \ + apt install -y curl git jq unzip RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \ unzip awscliv2.zip && \ ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update && \