Skip to content

Benchmark

Benchmark #78

Workflow file for this run

name: Benchmark
on:
repository_dispatch:
types: [execute-benchmark]
workflow_dispatch:
inputs:
machines_config:
description: 'Machine related configurations'
required: True
default: 67504e9a4c9ccbdde21a46fe
benchmark_config:
description: 'Applcation related configuration'
required: True
default: 67504e9a4c9ccbdde21a4701
plots_config:
description: 'Plots related configuration'
required: True
default: 675053424c9ccbdde21a470a
upload_id:
description: 'ID to upload the website to'
required: False
default: ""
jobs:
build_wheel:
runs-on: self-ubuntu-22.04
name: Build wheel package
if: "!contains(github.event.head_commit.message, 'code skip')"
steps:
- uses: actions/checkout@v4
- name: Build wheel
run: |
npm install
npx downdoc README.adoc
pip3 wheel --no-deps --wheel-dir dist .
env:
CXX: clang++
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: wheel-artifacts
path: dist/*.whl
factory:
name: HPC Systems Factory
needs: build_wheel
runs-on: self-ubuntu-22.04
outputs:
matrix: ${{ steps.hpc-systems.outputs.matrix }}
executable_name: ${{ steps.gather_arguments.outputs.executable_name }}
use_case: ${{ steps.gather_arguments.outputs.use_case }}
steps:
- name: Download wheel
uses: actions/download-artifact@v4
with:
name: wheel-artifacts
path: dist
- name: Create Virtual Environment
run: |
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
- name: Download machines configuration
run: |
source .venv/bin/activate
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
machine_cfg_id=${{ github.event.inputs.machines_config }};
elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then
machine_cfg_id=${{ github.event.client_payload.machines_config }};
fi
girder-download -gid $machine_cfg_id -o ./tmp/ -fn "machines_config.json"
env:
GIRDER_API_KEY: ${{secrets.GIRDER}}
- name: Donwload benchmark configuration
run: |
source .venv/bin/activate
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
bench_cfg_id=${{ github.event.inputs.benchmark_config }};
plots_cfg_id=${{ github.event.inputs.plots_config }};
elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then
bench_cfg_id=${{ github.event.client_payload.benchmark_config }};
plots_cfg_id=${{ github.event.client_payload.plots_config }};
fi
girder-download -gid $bench_cfg_id -o ./tmp/ -fn "benchmark_config.json"
girder-download -gid $plots_cfg_id -o ./tmp/ -fn "plots.json"
env:
GIRDER_API_KEY: ${{secrets.GIRDER}}
- id: hpc-systems
name: Set HPC systems matrix
run: |
source .venv/bin/activate
matrix=$(hpc-dispatch -mcp ./tmp/machines_config.json -mod ./tmp/machines/ -bcp ./tmp/benchmark_config.json -pcp ./tmp/plots.json)
echo $matrix
echo "matrix={ include : $matrix }" >> $GITHUB_OUTPUT
- name: pull_images
run: |
source .venv/bin/activate
#ONLY IF NEEDED
- name: Gather arguments
id: gather_arguments
run: |
echo "executable_name=$(jq -r '.executable' ./tmp/benchmark_config.json)" >> $GITHUB_OUTPUT
echo "use_case=$(jq -r '.use_case_name' ./tmp/benchmark_config.json)" >> $GITHUB_OUTPUT
- name: Upload configs
uses: actions/upload-artifact@v4
with:
name: config-artifacts
path: |
./tmp/benchmark_config.json
./tmp/plots.json
./tmp/machines/
benchmark:
needs: factory
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.factory.outputs.matrix) }}
runs-on: ${{matrix.runner}}
timeout-minutes: 7200
name: ${{matrix.machine}}
steps:
- uses: actions/checkout@v4
- name: Download wheel
uses: actions/download-artifact@v4
with:
name: wheel-artifacts
path: dist
- name: Download configs
uses: actions/download-artifact@v4
with:
name: config-artifacts
path: ./tmp/
- name: Execute benchmarks
run: ${{matrix.submit_command}}
- name: Upload reframe report
uses: actions/upload-artifact@v4
with:
name: benchmark-results-${{matrix.machine}}
path: ${{matrix.reports_path}}
deploy:
runs-on: self-ubuntu-22.04
needs: [benchmark,factory]
name: Handle results and trigger rendering
if: ${{ github.event.inputs.upload_id == '' && github.event.client_payload.upload_id == '' }}
steps:
- uses: actions/checkout@v4
- name: Download results
uses: actions/download-artifact@v4
with:
pattern: benchmark-results-*
path: ./tmp/results/
merge-multiple: false
- name: Create Virtual Environment
run: |
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
- name: Upload to girder
run: |
source .venv/bin/activate
source ./girder_deploy_config.sh
girder-upload --item "./tmp/results/*" --girder_id $staging_folder_id
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
- name: Update Index Date
run: |
sed -i "s/^:docdatetime: .*/:docdatetime: $(date +'%Y-%m-%dT%H:%M:%S')/" "docs/modules/ROOT/pages/index.adoc"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: "Add benchmark for ${{ needs.factory.outputs.executable_name }} - ${{ needs.factory.outputs.use_case }}"
body: |
Generating reports from staging directory.
Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
reviewers: JavierCladellas
labels: new-benchmark
branch: new-benchmark-${{needs.factory.outputs.executable_name}}
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
user-results:
runs-on: self-ubuntu-22.04
needs: [benchmark,factory]
name: Deploy the website to a specific folder
if: ${{ github.event.inputs.upload_id != '' || github.event.client_payload.upload_id != '' }}
steps:
- uses: actions/checkout@v4
- name: Download results
uses: actions/download-artifact@v4
with:
pattern: benchmark-results-*
path: ./tmp/results/
merge-multiple: false
- name: Create Virtual Environment
run: |
python3 -m venv .venv
source .venv/bin/activate
pip3 install -r requirements.txt
- name: Merge website configs
run: |
source .venv/bin/activate
merge-json-configs -fp "./tmp/**/website_config.json" -o ./tmp/website_config.json -u
- name: Render docs
run: |
source .venv/bin/activate
render-benchmarks --config_file=./tmp/website_config.json
- name: Compile docs
run: |
source .venv/bin/activate
npm install
npm run antora
- name: Upload
run: |
source .venv/bin/activate
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
upload_id=${{ github.event.inputs.upload_id }};
elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then
upload_id=${{ github.event.client_payload.upload_id }};
fi
girder-upload --item "./tmp/results/*" --girder_id $upload_id
girder-upload --item "./public/" --girder_id $upload_id
env:
GIRDER_API_KEY: ${{secrets.GIRDER}}