-
Notifications
You must be signed in to change notification settings - Fork 597
chore(ci): Run benchmarks on Earthly #6089
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
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
542fb7f
chore(ci): Run benchmarks on Earthly
spalladino 9dee49d
Fixes
spalladino fd8c348
Fixes
spalladino 86d3d84
Earthly doesnt support secrets when running LOCALLY
spalladino 48f3488
"base" is a reserved target name in Earthly
spalladino 537c2a6
Fixes
spalladino 913870c
Just upload logs for bench jobs
spalladino 2ec821f
Try to get branch and pr info into script
spalladino e3ac4b8
Try fix download logs script
spalladino 6f6b5d0
Try get PR properly into args
spalladino 6cd640a
Fixes
spalladino 97518fc
Try get job name into e2e test
spalladino a226be1
Create bench folder even if no benchs created
spalladino d75216a
Need to declare global args before using them
spalladino 36a3343
Fix bench-comment
spalladino f8fd1ae
Try fix bench-comment
spalladino 5ff1719
Get to bench-summary faster for testing
spalladino 1e406f6
Earthly local secrets do not work
spalladino 78213bd
Bypass "lock is currently held by..." so I can test bench summary fast
spalladino db81331
Global args are not good for cache it seems
spalladino e3a4e7c
Non-global args in end-to-end earthfile as well
spalladino 14ba1c5
Remove references to use_local_builds
spalladino be8fffa
Place if before run in steps
spalladino a6dff34
Pass pull request number to download base bench script
spalladino 7962205
Log bench folder contents
spalladino 6b2951e
Checkout history for bench summary
spalladino f297f39
Bench comment expects PR_NUMBER variable
spalladino 6dfc3b8
Try fix gh creds
spalladino 79e9f5b
Remove unnecessary secrets from script run
spalladino 02978e4
Would be nice if ga warned of missing secrets, wouldnt it?
spalladino 9d1195a
Revert "Bypass "lock is currently held by..." so I can test bench sum…
spalladino 5991327
Revert "Get to bench-summary faster for testing"
spalladino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,7 @@ cmake-build-debug | |
| .DS_Store | ||
|
|
||
| **/*.dockerignore | ||
|
|
||
| # Earthly | ||
| .arg | ||
| .secret | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env bash | ||
| # Checks that all logs needed for assembling aggregate benchmarks have been retrieved. | ||
|
|
||
| [ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace | ||
| set -eu | ||
|
|
||
| LOG_FOLDER="${LOG_FOLDER:-log}" | ||
| E2E_SRC_FOLDER=/usr/src/yarn-project/end-to-end/src | ||
|
|
||
| echo "Checking log files in $LOG_FOLDER" | ||
|
|
||
| # Only generate the aggregated benchmark if we've managed to retrieve all the needed log files | ||
| # If these runs were skipped due to no changes in their rebuild-patterns, then there's no need | ||
| # to recompute the aggregated benchmark. Note that if one benchmark did run but others didn't, | ||
| # this skips the whole aggregation. For now, that's fine because all benchmark files have the | ||
| # same rebuild pattern rules. But if that changes, then we'd need to go up in the commit history | ||
| # to find the latest log files for the unchanged benchmarks. | ||
| EXPECTED_LOGS_COUNT=$(find $E2E_SRC_FOLDER -type f -name "bench*.test.ts" | wc -l) | ||
| DOWNLOADED_LOGS_COUNT=$(find $LOG_FOLDER -type f -name "*.jsonl" | wc -l) | ||
| if [ "$DOWNLOADED_LOGS_COUNT" -lt "$EXPECTED_LOGS_COUNT" ]; then | ||
| echo Found only $DOWNLOADED_LOGS_COUNT out of $EXPECTED_LOGS_COUNT benchmark log files in S3. | ||
| echo Files found: $(find $LOG_FOLDER -type f -name "*.jsonl") | ||
| exit 1 | ||
| fi | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #!/usr/bin/env bash | ||
| # Downloads base benchmarks from S3 to compare with the current benchmarks via bench-comment | ||
|
|
||
| [ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace | ||
| set -eu | ||
|
|
||
| BUCKET_NAME="aztec-ci-artifacts" | ||
| BENCH_FOLDER="${BENCH_FOLDER:-bench}" | ||
| COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" | ||
| BASE_BENCHMARK_FILE_JSON="${BENCH_FOLDER}/base-benchmark.json" | ||
|
|
||
| # If on a pull request, get the data from the most recent commit on master where it's available to generate a comment comparing them | ||
| if [ -n "${PULL_REQUEST:-}" ]; then | ||
| MASTER_COMMIT_HASH=$(curl -s "https://api.github.com/repos/AztecProtocol/aztec-packages/pulls/${PULL_REQUEST##*/}" | jq -r '.base.sha') | ||
| MASTER_COMMIT_HASHES=($(git log $MASTER_COMMIT_HASH --format="%H" -n 50)) | ||
|
|
||
| mkdir -p $BENCH_FOLDER | ||
|
|
||
| set +e | ||
| echo "Searching for base benchmark data starting from commit $MASTER_COMMIT_HASH" | ||
| for commit_hash in "${MASTER_COMMIT_HASHES[@]}"; do | ||
| aws s3 cp "s3://${BUCKET_NAME}/benchmarks-v1/master/$commit_hash.json" $BASE_BENCHMARK_FILE_JSON | ||
| if [ $? -eq 0 ]; then | ||
| echo "Downloaded base data from commit $commit_hash" | ||
| exit 0 | ||
| fi | ||
| done | ||
| set -e | ||
|
|
||
| echo "No base commit data found" | ||
| else | ||
| echo "Not on a pull request, skipping download of base benchmark data" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/usr/bin/env bash | ||
| # Downloads the log files uploaded in upload_logs_to_s3 | ||
|
|
||
| set -eu | ||
|
|
||
| BUCKET_NAME="aztec-ci-artifacts" | ||
| LOG_FOLDER="${LOG_FOLDER:-log}" | ||
| COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}" | ||
|
|
||
| echo "Downloading logs from S3 for commit $COMMIT_HASH in branch ${BRANCH:-} at pull request ${PULL_REQUEST:-none}" | ||
|
|
||
| # Paths from upload_logs_to_s3 | ||
| if [ "${BRANCH:-}" = "master" ]; then | ||
| LOG_SOURCE_FOLDER="logs-v1/master/$COMMIT_HASH" | ||
| BARRETENBERG_BENCH_SOURCE_FOLDER="barretenberg-bench-v1/master/$COMMIT_HASH" | ||
| BENCHMARK_TARGET_FILE="benchmarks-v1/master/$COMMIT_HASH.json" | ||
| BENCHMARK_LATEST_FILE="benchmarks-v1/latest.json" | ||
| elif [ -n "${PULL_REQUEST:-}" ]; then | ||
| LOG_SOURCE_FOLDER="logs-v1/pulls/${PULL_REQUEST##*/}" | ||
| BARRETENBERG_BENCH_SOURCE_FOLDER="barretenberg-bench-v1/pulls/${PULL_REQUEST##*/}" | ||
| BENCHMARK_TARGET_FILE="benchmarks-v1/pulls/${PULL_REQUEST##*/}.json" | ||
| else | ||
| echo "Skipping benchmark run on branch ${BRANCH:-unknown}." | ||
| exit 0 | ||
| fi | ||
|
|
||
| mkdir -p $LOG_FOLDER | ||
|
|
||
| # Download benchmark log files from S3 LOG_SOURCE_FOLDER into local LOG_FOLDER | ||
| echo "Downloading benchmark log files from $BUCKET_NAME/$LOG_SOURCE_FOLDER to $LOG_FOLDER" | ||
| aws s3 cp "s3://${BUCKET_NAME}/${LOG_SOURCE_FOLDER}/" $LOG_FOLDER --exclude '*' --include 'bench*.jsonl' --recursive | ||
|
|
||
| # Download barretenberg log files, these are direct benchmarks and separate from the above | ||
| aws s3 cp "s3://${BUCKET_NAME}/${BARRETENBERG_BENCH_SOURCE_FOLDER}/" $LOG_FOLDER --exclude '*' --include '*_bench.json' --recursive | ||
|
|
||
| echo "Downloaded log files $(ls $LOG_FOLDER)" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.