Skip to content

Commit

Permalink
Merge pull request #183 from feelpp/181-handle-report-deployment
Browse files Browse the repository at this point in the history
resolves: 181 handle report deployment
  • Loading branch information
vincentchabannes authored Dec 13, 2024
2 parents 6df3d44 + 236d194 commit 282233a
Show file tree
Hide file tree
Showing 12 changed files with 321 additions and 154 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ on:
description: 'Plots related configuration'
required: True
default: 675053424c9ccbdde21a470a
girder_folder_id:
description: 'ID of the folder to upload to'
required: True
default: 67504ecd4c9ccbdde21a4704

jobs:

Expand All @@ -31,7 +27,7 @@ jobs:
if: "!contains(github.event.head_commit.message, 'code skip')"
steps:
- uses: actions/checkout@v4
- name: Build Ktirio Cases wheel
- name: Build wheel
run: |
npm install
npx downdoc README.adoc
Expand Down Expand Up @@ -164,14 +160,23 @@ jobs:
- name: Upload to girder
run: |
source .venv/bin/activate
new_foldername=./tmp/$(date +"%Y_%m_%dT%H_%M_%S")
mv ./tmp/results/ $new_foldername
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
girder_upload_id=${{ github.event.inputs.girder_folder_id }};
elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then
girder_upload_id=${{ github.event.client_payload.girder_folder_id }};
fi
girder-upload --directory $new_foldername --girder_id $girder_upload_id
rm -r $new_foldername
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:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
111 changes: 111 additions & 0 deletions .github/workflows/benchmark_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Benchmark Deploy

on:
pull_request:
types: [closed]

jobs:
build_wheel:
runs-on: self-ubuntu-22.04
name: Build wheel package
if: contains(github.event.pull_request.labels.*.name, 'new-benchmark')
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

accepted:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'new-benchmark')
runs-on: self-ubuntu-22.04
name: Move to production
needs: build_wheel
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 stage reports
run: |
source .venv/bin/activate
source ./girder_deploy_config.sh
girder-download -gid $staging_folder_id -o ./tmp/ -d
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
- name: Download Production config
run: |
source .venv/bin/activate
source ./girder_deploy_config.sh
girder-download -gid $production_website_config_id -o ./configs_tmp/ -fn production_config.json
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
- name: Merge stage configs
run: |
source .venv/bin/activate
merge-json-configs -fp "./tmp/**/website_config.json" -o ./configs_tmp/stage_config.json -u
- name: Update Stage Config
run: |
source .venv/bin/activate
source ./girder_deploy_config.sh
update-stage-config -stag ./configs_tmp/stage_config.json -prod ./configs_tmp/production_config.json -prodid $production_folder_id
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
- name: Merge stage and prod configs
run: |
source .venv/bin/activate
merge-json-configs -fp "./configs_tmp/**/*.json" -o ./configs_tmp/website_config.json
- name: Upload New Website config
run: |
source .venv/bin/activate
source ./girder_deploy_config.sh
girder-upload --item ./configs_tmp/website_config.json --girder_id $production_folder_id
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
- name: Cleanup stage folder
run: |
echo "Moving all folders from staging/ to merged/"
source .venv/bin/activate
source ./girder_deploy_config.sh
girder-move -oid $staging_folder_id -nid $accepted_folder_id
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
denied:
if: github.event.pull_request.merged == false && contains(github.event.pull_request.labels.*.name, 'new-benchmark')
runs-on: self-ubuntu-22.04
name: Move to denied
needs: build_wheel
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: Cleanup stage folder
run: |
echo "Moving all folders from staging/ to denied/"
source .venv/bin/activate
source ./girder_deploy_config.sh
girder-move -oid $staging_folder_id -nid $denied_folder_id
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,17 @@ jobs:
pip3 install -I -r requirements.txt
pip3 install dist/*.whl
tree .venv
- name: Download website config
run: |
source .venv/bin/activate
source ./girder_deploy_config.sh
girder-download --girder_id=$production_website_config_id --output_dir=./tmp/ --filename=website_config.json
env:
GIRDER_API_KEY: ${{secrets.GIRDER}}
- name: Render reports
run: |
source .venv/bin/activate
render-benchmarks
render-benchmarks --config_file=./tmp/website_config.json
env:
GIRDER_API_KEY: ${{ secrets.GIRDER }}
- name: Build Antora Site
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,9 @@ reports/
#Test Outputs
tests/data/outputs/


tmp/
tmp.ipynb

#Executables
tests/data/parallelSum
tests/data/parallelSum
3 changes: 2 additions & 1 deletion docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
ifdef::env-github,env-browser,env-vscode[:imagesprefix: ../images/]
= Benchmarking
:page-layout: toolboxes
:page-tags: catalog, catalog-index
:page-tags: catalog, catalog-index
:docdatetime: 2024-12-12T09:10:54
7 changes: 7 additions & 0 deletions girder_deploy_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

production_website_config_id=6752f0734c9ccbdde21a48ca
staging_folder_id=6752b5194c9ccbdde21a48b8
production_folder_id=6752efed4c9ccbdde21a48c7
accepted_folder_id=67580d534c9ccbdde21a4a75
denied_folder_id=6752b66d4c9ccbdde21a48b9
11 changes: 10 additions & 1 deletion netlify-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,14 @@ pip3 install -r requirements.txt
pip3 wheel --no-deps --wheel-dir dist .
pip3 install dist/*.whl
npm i
render-benchmarks
source ./girder_deploy_config.sh
if [[ $HEAD == *"new-benchmark"* ]]; then
echo "Downloading Staging benchmarks"
girder-download -gid $staging_folder_id -o ./tmp/ -d
merge-json-configs -fp "./tmp/**/website_config.json" -o ./tmp/website_config.json -u
else
echo "Downloading Production benchmarks"
girder-download -gid $production_website_config_id -o ./tmp/ -fn website_config.json
fi
render-benchmarks --config_file=./tmp/website_config.json
npx antora --stacktrace generate --cache-dir cache --clean --html-url-extension-style=indexify site.yml
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ render-benchmarks = "feelpp.benchmarking.report.__main__:main_cli"
execute-benchmark = "feelpp.benchmarking.reframe.__main__:main_cli"
girder-download = "feelpp.benchmarking.scripts.girder:download_cli"
girder-upload = "feelpp.benchmarking.scripts.girder:upload_cli"
girder-move = "feelpp.benchmarking.scripts.girder:move_cli"
hpc-dispatch = "feelpp.benchmarking.scripts.hpcSystems:hpcSystemDispatcher_cli"
merge-json-configs = "feelpp.benchmarking.scripts.misc:jsonConfigMerge_cli"
update-stage-config = "feelpp.benchmarking.scripts.misc:upldateStageConfig_cli"

[tool.pytest.ini_options]
minversion = "6.0"
Expand Down
128 changes: 0 additions & 128 deletions src/feelpp/benchmarking/report/config/config.json

This file was deleted.

Loading

0 comments on commit 282233a

Please sign in to comment.