Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: Benchmark script fixes for master branch #2638

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions scripts/ci/assemble_e2e_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ BENCHMARK_FILE_JSON="benchmark.json"

# Adapted from yarn-project/end-to-end/scripts/upload_logs_to_s3.sh
if [ "${CIRCLE_BRANCH:-}" = "master" ]; then
LOG_SOURCE_FOLDER="logs-v1/master/$COMMIT_HASH/"
LOG_SOURCE_FOLDER="logs-v1/master/$COMMIT_HASH"
BENCHMARK_TARGET_FILE="benchmarks-v1/master/$COMMIT_HASH.json"
BENCHMARK_LATEST_FILE="benchmarks-v1/latest.json"
elif [ -n "${CIRCLE_PULL_REQUEST:-}" ]; then
LOG_SOURCE_FOLDER="logs-v1/pulls/${CIRCLE_PULL_REQUEST##*/}"
BENCHMARK_TARGET_FILE="benchmarks-v1/pulls/${CIRCLE_PULL_REQUEST##*/}.json"
elif [ -n "${CIRCLE_TAG:-}" ]; then
echo "Skipping benchmark run for ${CIRCLE_TAG} tagged release."
exit 0
else
echo "Can only run benchmark aggregation on master or on a PR. Ensure CIRCLE_BRANCH or CIRCLE_PULL_REQUEST are set."
exit 1
echo "Skipping benchmark run on branch ${CIRCLE_BRANCH:-unknown}."
exit 0
fi

# Download benchmark log files from S3 LOG_SOURCE_FOLDER into local LOG_FOLDER
Expand All @@ -36,8 +39,8 @@ aws s3 cp "s3://${BUCKET_NAME}/${LOG_SOURCE_FOLDER}/" $LOG_FOLDER --exclude '*'
# to find the latest log files for the unchanged benchmarks.
EXPECTED_BENCHMARK_COUNT=$(find yarn-project/end-to-end/src -type f -name "bench*.test.ts" | wc -l)
DOWNLOADED_BENCHMARK_COUNT=$(find $LOG_FOLDER -type f -name "*.jsonl" | wc -l)
if [ "$DOWNLOADED_BENCHMARK_COUNT" -lt "$EXPECTED_BENCHMARK_COUNT"]; then
echo Found $DOWNLOADED_BENCHMARK_COUNT out of $EXPECTED_BENCHMARK_COUNT benchmark log files. Exiting.
if [ "$DOWNLOADED_BENCHMARK_COUNT" -lt "$EXPECTED_BENCHMARK_COUNT" ]; then
echo Found $DOWNLOADED_BENCHMARK_COUNT out of $EXPECTED_BENCHMARK_COUNT benchmark log files in s3://${BUCKET_NAME}/${LOG_SOURCE_FOLDER}/. Exiting.
exit 0
fi

Expand Down