Skip to content

Commit

Permalink
chore: Reenable bench summary (#6211)
Browse files Browse the repository at this point in the history
Let's give this another shot...
  • Loading branch information
spalladino authored May 14, 2024
1 parent ea6ccdd commit 713b243
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 45 deletions.
53 changes: 27 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 scratch
COPY scripts /usr/src/scripts
SAVE ARTIFACT /usr/src/scripts scripts
2 changes: 1 addition & 1 deletion build-images/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,4 @@ sysbox:

ARG TARGETARCH
SAVE IMAGE aztecprotocol/sysbox:1.0-$TARGETARCH
SAVE IMAGE aztecprotocol/sysbox:1.0
SAVE IMAGE aztecprotocol/sysbox:1.0
8 changes: 1 addition & 7 deletions scripts/logs/upload_logs_to_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
26 changes: 19 additions & 7 deletions yarn-project/end-to-end/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -49,13 +50,25 @@ UPLOAD_LOGS:
ARG COMMIT_HASH
LOCALLY
LET COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}"
FROM ../../+scripts
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

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 && \
rm -rf aws awscliv2.zip
COPY ../../+scripts/scripts /usr/src/scripts

e2e-2-pxes:
DO +E2E_TEST --test=./src/e2e_2_pxes.test.ts

Expand Down Expand Up @@ -195,26 +208,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
3 changes: 1 addition & 2 deletions yarn-project/scripts/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 713b243

Please sign in to comment.