Skip to content

Commit d691b4b

Browse files
Merge branch 'master' into 151-update-kub-benchmarks
2 parents 5be0462 + df85dd5 commit d691b4b

File tree

220 files changed

+7572
-20730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+7572
-20730
lines changed

.github/workflows/benchmark.yml

Lines changed: 87 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ on:
99
machines_config:
1010
description: 'Machine related configurations'
1111
required: True
12+
default: 67504e9a4c9ccbdde21a46fe
1213
benchmark_config:
1314
description: 'Applcation related configuration'
1415
required: True
15-
girder_folder_id:
16-
description: 'ID of the folder to upload to'
16+
default: 67504e9a4c9ccbdde21a4701
17+
plots_config:
18+
description: 'Plots related configuration'
1719
required: True
20+
default: 675053424c9ccbdde21a470a
21+
upload_id:
22+
description: 'ID to upload the website to'
23+
required: False
24+
default: ""
1825

1926
jobs:
2027

@@ -24,7 +31,7 @@ jobs:
2431
if: "!contains(github.event.head_commit.message, 'code skip')"
2532
steps:
2633
- uses: actions/checkout@v4
27-
- name: Build Ktirio Cases wheel
34+
- name: Build wheel
2835
run: |
2936
npm install
3037
npx downdoc README.adoc
@@ -68,29 +75,28 @@ jobs:
6875
girder-download -gid $machine_cfg_id -o ./tmp/ -fn "machines_config.json"
6976
env:
7077
GIRDER_API_KEY: ${{secrets.GIRDER}}
71-
- id: hpc-systems
72-
name: Set HPC systems matrix
73-
run: |
74-
source .venv/bin/activate
75-
matrix=$(hpc-dispatch -mp ./tmp/machines_config.json -o ./tmp/machines/)
76-
echo $matrix
77-
echo "matrix={ include : $matrix }" >> $GITHUB_OUTPUT
7878
- name: Donwload benchmark configuration
7979
run: |
8080
source .venv/bin/activate
8181
8282
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
8383
bench_cfg_id=${{ github.event.inputs.benchmark_config }};
84+
plots_cfg_id=${{ github.event.inputs.plots_config }};
8485
elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then
8586
bench_cfg_id=${{ github.event.client_payload.benchmark_config }};
87+
plots_cfg_id=${{ github.event.client_payload.plots_config }};
8688
fi
8789
girder-download -gid $bench_cfg_id -o ./tmp/ -fn "benchmark_config.json"
90+
girder-download -gid $plots_cfg_id -o ./tmp/ -fn "plots.json"
8891
env:
8992
GIRDER_API_KEY: ${{secrets.GIRDER}}
90-
- name: pull_images
93+
- id: hpc-systems
94+
name: Set HPC systems matrix
9195
run: |
9296
source .venv/bin/activate
93-
#ONLY IF NEEDED
97+
matrix=$(hpc-dispatch -mcp ./tmp/machines_config.json -mod ./tmp/machines/)
98+
echo $matrix
99+
echo "matrix={ include : $matrix }" >> $GITHUB_OUTPUT
94100
- name: Gather arguments
95101
id: gather_arguments
96102
run: |
@@ -102,6 +108,7 @@ jobs:
102108
name: config-artifacts
103109
path: |
104110
./tmp/benchmark_config.json
111+
./tmp/plots.json
105112
./tmp/machines/
106113
107114
benchmark:
@@ -113,6 +120,7 @@ jobs:
113120
timeout-minutes: 7200
114121
name: ${{matrix.machine}}
115122
steps:
123+
- uses: actions/checkout@v4
116124
- name: Download wheel
117125
uses: actions/download-artifact@v4
118126
with:
@@ -123,33 +131,35 @@ jobs:
123131
with:
124132
name: config-artifacts
125133
path: ./tmp/
126-
- name: Create Virtual Environment
127-
run: |
128-
python3 -m venv .venv
129-
source .venv/bin/activate
130-
pip3 install -r requirements.txt
134+
- name: Setup machine and env
135+
run: ${{matrix.submit_command}}
131136
- name: Execute benchmarks
132137
run: |
133138
source .venv/bin/activate
134-
execute-benchmark -ec ./${{matrix.machine_cfg}} --config ./tmp/benchmark_config.json --move_results ./tmp/results/ -v
139+
execute-benchmark \
140+
-mc ${{matrix.machine_cfg}} \
141+
-bc ./tmp/benchmark_config.json \
142+
-pc ./tmp/plots.json \
143+
-v
135144
- name: Upload reframe report
136145
uses: actions/upload-artifact@v4
137146
with:
138-
name: benchmark-results
139-
path: ./tmp/results/
147+
name: benchmark-results-${{matrix.machine}}
148+
path: ${{matrix.reports_path}}
140149

141-
results:
150+
deploy:
142151
runs-on: self-ubuntu-22.04
143152
needs: [benchmark,factory]
144153
name: Handle results and trigger rendering
145-
154+
if: ${{ github.event.inputs.upload_id == '' && github.event.client_payload.upload_id == '' }}
146155
steps:
147156
- uses: actions/checkout@v4
148157
- name: Download results
149158
uses: actions/download-artifact@v4
150159
with:
151-
name: benchmark-results
160+
pattern: benchmark-results-*
152161
path: ./tmp/results/
162+
merge-multiple: false
153163
- name: Create Virtual Environment
154164
run: |
155165
python3 -m venv .venv
@@ -158,38 +168,69 @@ jobs:
158168
- name: Upload to girder
159169
run: |
160170
source .venv/bin/activate
161-
new_foldername=./tmp/$(date +"%Y_%m_%dT%H_%M_%S")
162-
mv ./tmp/results/ $new_foldername
163-
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
164-
girder_upload_id=${{ github.event.inputs.girder_folder_id }};
165-
elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then
166-
girder_upload_id=${{ github.event.client_payload.girder_folder_id }};
167-
fi
168-
girder-upload --directory $new_foldername --girder_id $girder_upload_id
169-
rm -r $new_foldername
171+
source ./girder_deploy_config.sh
172+
girder-upload --item "./tmp/results/*" --girder_id $staging_folder_id
170173
env:
171174
GIRDER_API_KEY: ${{ secrets.GIRDER }}
172-
- name: Reset reports
173-
run: |
174-
rm -r ./docs/modules/ROOT/pages/applications/
175-
rm -r ./docs/modules/ROOT/pages/machines/
176-
rm -r ./docs/modules/ROOT/pages/reports/
177-
rm -r ./docs/modules/ROOT/pages/use_cases/
178-
rm -r ./reports/
179-
- name: Render reports
175+
- name: Update Index Date
180176
run: |
181-
source .venv/bin/activate
182-
render-benchmarks
183-
env:
184-
GIRDER_API_KEY: ${{ secrets.GIRDER }}
185-
177+
sed -i "s/^:docdatetime: .*/:docdatetime: $(date +'%Y-%m-%dT%H:%M:%S')/" "docs/modules/ROOT/pages/index.adoc"
186178
- name: Create Pull Request
187179
uses: peter-evans/create-pull-request@v7
188180
with:
189181
title: "Add benchmark for ${{ needs.factory.outputs.executable_name }} - ${{ needs.factory.outputs.use_case }}"
182+
commit-message: "Add benchmark for ${{ needs.factory.outputs.executable_name }} - ${{ needs.factory.outputs.use_case }}"
190183
body: |
184+
Generating reports from staging directory.
191185
Auto-generated by [create-pull-request][1]
192186
[1]: https://github.com/peter-evans/create-pull-request
193187
reviewers: JavierCladellas
188+
labels: new-benchmark
189+
branch: new-benchmark
194190
env:
195-
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
191+
GITHUB_TOKEN: ${{ secrets.CR_PAT }}
192+
193+
user-results:
194+
runs-on: self-ubuntu-22.04
195+
needs: [benchmark,factory]
196+
name: Deploy the website to a specific folder
197+
if: ${{ github.event.inputs.upload_id != '' || github.event.client_payload.upload_id != '' }}
198+
steps:
199+
- uses: actions/checkout@v4
200+
- name: Download results
201+
uses: actions/download-artifact@v4
202+
with:
203+
pattern: benchmark-results-*
204+
path: ./tmp/results/
205+
merge-multiple: false
206+
- name: Create Virtual Environment
207+
run: |
208+
python3 -m venv .venv
209+
source .venv/bin/activate
210+
pip3 install -r requirements.txt
211+
- name: Merge website configs
212+
run: |
213+
source .venv/bin/activate
214+
merge-json-configs -fp "./tmp/**/website_config.json" -o ./tmp/website_config.json -u
215+
- name: Render docs
216+
run: |
217+
source .venv/bin/activate
218+
render-benchmarks --config_file=./tmp/website_config.json
219+
- name: Compile docs
220+
run: |
221+
source .venv/bin/activate
222+
npm install
223+
npm run antora
224+
- name: Upload
225+
run: |
226+
source .venv/bin/activate
227+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
228+
upload_id=${{ github.event.inputs.upload_id }};
229+
elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then
230+
upload_id=${{ github.event.client_payload.upload_id }};
231+
fi
232+
girder-upload --item "./tmp/results/*" --girder_id $upload_id
233+
girder-upload --item "./public/" --girder_id $upload_id
234+
env:
235+
GIRDER_API_KEY: ${{secrets.GIRDER}}
236+
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Benchmark Deploy
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
build_wheel:
9+
runs-on: self-ubuntu-22.04
10+
name: Build wheel package
11+
if: contains(github.event.pull_request.labels.*.name, 'new-benchmark')
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Build wheel
15+
run: |
16+
npm install
17+
npx downdoc README.adoc
18+
pip3 wheel --no-deps --wheel-dir dist .
19+
env:
20+
CXX: clang++
21+
- name: Upload Artifact
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: wheel-artifacts
25+
path: dist/*.whl
26+
27+
accepted:
28+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'new-benchmark')
29+
runs-on: self-ubuntu-22.04
30+
name: Move to production
31+
needs: build_wheel
32+
steps:
33+
- name: Download wheel
34+
uses: actions/download-artifact@v4
35+
with:
36+
name: wheel-artifacts
37+
path: dist
38+
39+
- name: Create Virtual Environment
40+
run: |
41+
python3 -m venv .venv
42+
source .venv/bin/activate
43+
pip3 install -r requirements.txt
44+
- name: Download stage reports
45+
run: |
46+
source .venv/bin/activate
47+
source ./girder_deploy_config.sh
48+
girder-download -gid $staging_folder_id -o ./tmp/ -d
49+
env:
50+
GIRDER_API_KEY: ${{ secrets.GIRDER }}
51+
- name: Download Production config
52+
run: |
53+
source .venv/bin/activate
54+
source ./girder_deploy_config.sh
55+
girder-download -gid $production_website_config_id -o ./configs_tmp/ -fn production_config.json
56+
env:
57+
GIRDER_API_KEY: ${{ secrets.GIRDER }}
58+
- name: Merge stage configs
59+
run: |
60+
source .venv/bin/activate
61+
merge-json-configs -fp "./tmp/**/website_config.json" -o ./configs_tmp/stage_config.json -u
62+
- name: Update Stage Config
63+
run: |
64+
source .venv/bin/activate
65+
source ./girder_deploy_config.sh
66+
update-stage-config -stag ./configs_tmp/stage_config.json -prod ./configs_tmp/production_config.json -prodid $production_folder_id
67+
env:
68+
GIRDER_API_KEY: ${{ secrets.GIRDER }}
69+
- name: Merge stage and prod configs
70+
run: |
71+
source .venv/bin/activate
72+
merge-json-configs -fp "./configs_tmp/**/*.json" -o ./configs_tmp/website_config.json
73+
- name: Upload New Website config
74+
run: |
75+
source .venv/bin/activate
76+
source ./girder_deploy_config.sh
77+
girder-upload --item ./configs_tmp/website_config.json --girder_id $production_folder_id
78+
env:
79+
GIRDER_API_KEY: ${{ secrets.GIRDER }}
80+
- name: Cleanup stage folder
81+
run: |
82+
echo "Moving all folders from staging/ to merged/"
83+
source .venv/bin/activate
84+
source ./girder_deploy_config.sh
85+
girder-move -oid $staging_folder_id -nid $accepted_folder_id
86+
env:
87+
GIRDER_API_KEY: ${{ secrets.GIRDER }}
88+
denied:
89+
if: github.event.pull_request.merged == false && contains(github.event.pull_request.labels.*.name, 'new-benchmark')
90+
runs-on: self-ubuntu-22.04
91+
name: Move to denied
92+
needs: build_wheel
93+
steps:
94+
- name: Download wheel
95+
uses: actions/download-artifact@v4
96+
with:
97+
name: wheel-artifacts
98+
path: dist
99+
- name: Create Virtual Environment
100+
run: |
101+
python3 -m venv .venv
102+
source .venv/bin/activate
103+
pip3 install -r requirements.txt
104+
- name: Cleanup stage folder
105+
run: |
106+
echo "Moving all folders from staging/ to denied/"
107+
source .venv/bin/activate
108+
source ./girder_deploy_config.sh
109+
girder-move -oid $staging_folder_id -nid $denied_folder_id
110+
env:
111+
GIRDER_API_KEY: ${{ secrets.GIRDER }}

0 commit comments

Comments
 (0)