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

feat: Continous Benchmarking #269

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
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
68 changes: 68 additions & 0 deletions .github/workflows/Benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
# This will
# TODO rather than store on tutorial better to have different branch and main MaCh3 should use it
name: MaCh3 Benchmark

on:
pull_request:
branches: [ develop ]
push:
branches: [ develop ]

permissions:
# Required permissions for GitHub Pages deployment and content updates
deployments: write
contents: write

jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
container:
image: ghcr.io/mach3-software/mach3:alma9v1.3.0
steps:
- name: Get MaCh3 Validations
run: |
cd /opt/
# Clone the MaCh3Tutorial repository with the current branch
git clone --branch main https://github.com/mach3-software/MaCh3Tutorial.git MaCh3Validations
cd MaCh3Validations
mkdir build
cd build
# Configure the project with benchmark support enabled
if [ "${{ github.event_name }}" == 'pull_request' ]; then
cmake ../ -DMaCh3_Branch=${{ github.head_ref }} -DMaCh3Tutorial_Benchmark_ENABLED=TRUE
else
cmake ../ -DMaCh3Tutorial_Benchmark_ENABLED=TRUE
fi

- name: Build MaCh3 Validations
run: |
cd /opt/MaCh3Validations/build
make -j4 install # Build and install the project

- name: Run benchmark
run: |
# Source environment setup scripts
source /opt/MaCh3Validations/build/bin/setup.MaCh3.sh
source /opt/MaCh3Validations/build/bin/setup.MaCh3Tutorial.sh
source /opt/MaCh3Validations/build/bin/setup.NuOscillator.sh
cd /opt/MaCh3Validations/build/
# Run the benchmark and store the output in a file
./CIValidations/Benchmark/MaCh3Benchmark | tee output.txt

- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'catch2' # Specify that the benchmark tool is Catch2
github-token: ${{ secrets.GITHUB_TOKEN }} # Use GitHub token for authentication
output-file-path: /opt/MaCh3Validations/build/output.txt # Path to the benchmark output file
alert-threshold: 200% # Alert threshold for performance degradation
comment-on-alert: true
gh-pages-branch: gh-pages # Branch to store benchmark results
gh-repository: github.com/mach3-software/MaCh3Tutorial # Repository for benchmark results
summary-always: true # Always show summary in job logs
fail-on-alert: false # Do not fail the workflow on alert
benchmark-data-dir-path: "" # Use ROOT directory
# Push and deploy GitHub pages branch automatically, only if type isn't PR
auto-push: ${{ github.event_name != 'pull_request' }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Based on several test here are recommended version:
- [Mailing lists](https://www.jiscmail.ac.uk/cgi-bin/webadmin?A0=MACH3)
- [Slack](https://t2k-experiment.slack.com/archives/C06EM0C6D7W/p1705599931356889)
- [Discussions](https://github.com/mach3-software/MaCh3/discussions)
- [Benchmark](https://mach3-software.github.io/MaCh3Tutorial/)

## Plotting and Diagnostic
Example of chain diagnostic utils can be found [here](https://github.com/mach3-software/MaCh3/tree/develop/Diagnostics) with example of config.
Expand Down
Loading