-
Notifications
You must be signed in to change notification settings - Fork 158
Report ASV information to the workflow summary page #2829
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
Changes from all commits
63f3a5d
9ead8aa
ea3f9fe
73d0a32
31cbf51
d557850
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,6 +161,8 @@ jobs: | |
|
|
||
| - name: Configure sccache | ||
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Extra envs | ||
| shell: bash -l {0} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,8 @@ jobs: | |
|
|
||
| - name: Configure sccache | ||
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Extra envs | ||
| shell: bash -l {0} | ||
|
|
@@ -122,16 +124,22 @@ jobs: | |
|
|
||
| - name: Benchmark given commit | ||
| if: github.event_name != 'pull_request_target' || inputs.run_all_benchmarks == true | ||
| shell: bash -el {0} | ||
| shell: bash -l {0} | ||
| run: | | ||
| git config --global --add safe.directory . | ||
| python -m asv run -v --show-stderr --bench $SUITE ${{ inputs.commit }}^! | ||
|
|
||
| python -m asv run --show-stderr --durations all --bench $SUITE ${{ inputs.commit }}^! | ||
| exit_code=$? | ||
| python build_tooling/summarize_asv_run.py --commit-hash ${{ inputs.commit }} | ||
| exit $exit_code | ||
|
|
||
| - name: Benchmark against master | ||
| if: github.event_name == 'pull_request_target' && inputs.run_all_benchmarks == false | ||
| shell: bash -el {0} | ||
| shell: bash -l {0} | ||
| run: | | ||
| python -m asv continuous -v --show-stderr --bench $SUITE origin/master HEAD -f 1.15 | ||
| python -m asv continuous --show-stderr --bench $SUITE origin/master HEAD -f 1.15 | ||
| exit_code=$? | ||
| python build_tooling/summarize_asv_run.py --commit-hash $(git rev-parse HEAD) | ||
| exit $exit_code | ||
|
|
||
| - name: Add results to ArcticDB database | ||
| shell: bash -el {0} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Get number of CPU cores | ||
| uses: SimenB/[email protected] | ||
|
|
@@ -150,6 +151,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Get number of CPU cores | ||
| uses: SimenB/[email protected] | ||
|
|
@@ -213,6 +215,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Get number of CPU cores | ||
| uses: SimenB/[email protected] | ||
|
|
@@ -278,6 +281,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Free Disk Space (Ubuntu) | ||
| uses: jlumbroso/[email protected] | ||
|
|
@@ -363,6 +367,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Free Disk Space (Ubuntu) | ||
| uses: jlumbroso/[email protected] | ||
|
|
@@ -448,6 +453,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@v4 | ||
|
|
@@ -538,6 +544,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@v4 | ||
|
|
@@ -676,6 +683,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@v4 | ||
|
|
@@ -810,6 +818,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Download build artifacts | ||
| uses: actions/download-artifact@v4 | ||
|
|
@@ -941,6 +950,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Get number of CPU cores | ||
| uses: SimenB/[email protected] | ||
|
|
@@ -1022,6 +1032,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Install Conda environment from environment-dev.yml | ||
| uses: mamba-org/[email protected] | ||
|
|
@@ -1122,6 +1133,7 @@ jobs: | |
| uses: mozilla-actions/[email protected] | ||
| with: | ||
| version: v0.12.0 | ||
| disable_annotations: 'true' # supress noisy report that pollutes the summary page | ||
|
|
||
| - name: Install Conda environment from environment-dev.yml | ||
| uses: mamba-org/[email protected] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| """ | ||
| Copyright 2025 Man Group Operations Limited | ||
|
|
||
| Use of this software is governed by the Business Source License 1.1 included in the file licenses/BSL.txt. | ||
|
|
||
| As of the Change Date specified in that file, in accordance with the Business Source License, use of this software will be governed by the Apache License, version 2.0. | ||
| """ | ||
|
|
||
| import json | ||
| import os | ||
| import glob | ||
| import sys | ||
| from argparse import ArgumentParser | ||
|
|
||
|
|
||
| def main(commit_hash: str): | ||
| assert commit_hash, "commit_hash must be provided but was blank" | ||
| shortened_hash = commit_hash[:8] | ||
| failures = [] | ||
| # Search for all result files in the asv results directory | ||
| results_pattern = f"*/.asv/results/*/{shortened_hash}*-*.json" | ||
| result_files = glob.glob(results_pattern, recursive=True) | ||
| assert len(result_files) == 1, f"Expected one result file matching pattern {results_pattern} but found {result_files}" | ||
| result_file = result_files[0] | ||
| with open(result_file, 'r') as f: | ||
| data = json.load(f) | ||
| # Results are stored in a dictionary; failed ones are null | ||
| for bench_name, result in data.get('results', {}).items(): | ||
| if result[0] is None: | ||
| failures.append(bench_name) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a benchmark regresses will it also be Would be good to run a manual test to verify this.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This field is the benchmark value (eg time to run, memory used). Its None if and only if the benchmark failed to execute. The regression reporting is done separately, using these files as input data.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's some testing from a scratch project I created, the commit 8616e7 caused a big regression |
||
|
|
||
| # Write to GitHub Step Summary | ||
| with open(os.environ['GITHUB_STEP_SUMMARY'], 'a') as summary: | ||
| summary.write("### 🚀 ASV Benchmark Report\n") | ||
| if failures: | ||
| summary.write("❌ **The following benchmarks failed:**\n\n") | ||
| summary.write("| Benchmark Name |\n") | ||
| summary.write("| :--- |\n") | ||
| for f in sorted(set(failures)): | ||
| summary.write(f"| `{f}` |\n") | ||
| summary.write("\n> Check the 'Benchmark given commit' step logs for specific tracebacks.") | ||
| else: | ||
| summary.write("✅ All benchmarks passed successfully!\n") | ||
|
|
||
| if failures: | ||
| print("Check the workflow Summary page for a report on ASV failures.") | ||
| sys.exit(1) | ||
| else: | ||
| print("There were no ASV failures to report.") | ||
| sys.exit(0) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| parser = ArgumentParser() | ||
| parser.add_argument( | ||
| "--commit-hash", | ||
| help="Commit hash to summarize results for", | ||
| required=True | ||
| ) | ||
| args = parser.parse_args() | ||
| main(args.commit_hash) | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My custom timing script seems to underestimate how long it takes to run some benchmarks (although the ordering looks correct, which is still useful). I've since discovered ASV's built in
--durations allwhich will be good to compare against.I've removed the
-vas otherwise the logs are just too hard to comprehend.