forked from markusbattarbee/vlasiator-public
-
Notifications
You must be signed in to change notification settings - Fork 0
251 lines (234 loc) · 9.69 KB
/
github-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Github-CI
on:
# Dispatch this workflow whenever master or dev get a PR or commit
push:
branches : ["dev","master"]
pull_request:
branches: ["dev","master"]
# ... or when the workflow is started manually
workflow_dispatch:
jobs:
build_libraries:
# Build libraries for the current version of the docker image
# (to be used in any subsequent compilation and run jobs on said image)
runs-on: ubuntu-latest
container: ursg/vlasiator_ci:20230220_1
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Run library build script
run: ./build_libraries.sh
- name: Build libraries tar
run: tar --zstd -cvf libraries.tar.zstd libraries/
- name: Upload libraries as artifact
uses: actions/upload-artifact@v3
with:
name: libraries
path: libraries.tar.zstd
retention-days: 5
if-no-files-found: error
build_libraries_riscv:
# Build libraries for the current version of the docker image
# (to be used in any subsequent compilation and run jobs on said image)
runs-on: risc-v
steps:
- name: Submit library job
run: |
srun --interactive -p arriesgado-jammy -J vlasiator-libs -n 1 -c 4 --pty -t 01:00:00 bash -lc 'module load openmpi; cp ~/vlasiator/build_libraries.sh .; ./build_libraries.sh arriesgado'
- name: Build libraries tar
run: tar -czvf libraries-arriesgado.tar.gz libraries-arriesgado/
- name: Upload libraries as artifact
uses: actions/upload-artifact@v3
with:
name: libraries-arriesgado
path: libraries-arriesgado.tar.gz
retention-days: 5
if-no-files-found: error
build_production:
# Build Vlasiator with production flags
runs-on: ubuntu-latest
container: ursg/vlasiator_ci:20230220_1
needs: build_libraries
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: true
- name: Download libraries
uses: actions/download-artifact@v3
with:
name: libraries
- name: Unpack libraries
run: tar --zstd -xvf libraries.tar.zstd
- uses: ursg/gcc-problem-matcher@master
- name: Compile vlasiator (Release build)
run: |
VLASIATOR_ARCH=github_actions make clean
VLASIATOR_ARCH=github_actions make -j 3
# - name: Compile vlasiator (Release build)
# run: |
# srun -M carrington --job-name release_compile --interactive --nodes=1 -n 1 -c 16 --mem=40G -p short -t 0:10:0 bash -c 'module purge; module load GCC/11.2.0; module load OpenMPI/4.1.1-GCC-11.2.0 ; module load PMIx/4.1.0-GCCcore-11.2.0; module load PAPI/6.0.0.1-GCCcore-11.2.0; export VLASIATOR_ARCH=carrington_gcc_openmpi; make clean; make -j 16'
build_testpackage:
# Build Vlasiator with testpackage flags, on the carrington cluster
# (for subsequent running of the integration test package)
runs-on: carrington
steps:
- name: Clean workspace
run: |
rm -rf libraries library-build testpackage
rm -f libraries.tar.zst dtestpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt
rm -f *.xml
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: true
- name: Make clean
run: VLASIATOR_ARCH=carrington_gcc_openmpi make clean
- uses: ursg/gcc-problem-matcher@master
- name: Compile vlasiator (Testpackage build)
run: |
export VLASIATOR_ARCH=carrington_gcc_openmpi
srun -M carrington --job-name tp_compile --interactive --nodes=1 -n 1 -c 16 --mem=40G -p short -t 0:10:0 bash -c 'module purge; module load GCC/11.2.0; module load OpenMPI/4.1.1-GCC-11.2.0 ; module load PMIx/4.1.0-GCCcore-11.2.0; module load PAPI/6.0.0.1-GCCcore-11.2.0; export VLASIATOR_ARCH=carrington_gcc_openmpi; make -j 16 testpackage; sleep 10s'
- name: Sleep for 10 seconds
run: sleep 10s
shell: bash
- name: Upload testpackage binary
uses: actions/upload-artifact@v3
with:
name: vlasiator-testpackage
path: vlasiator
if-no-files-found: error
#- name: Upload build log
# uses: actions/upload-artifact@v3
# with:
# name: Testpackage build log
# path: build.log
build_riscv:
runs-on: risc-v
needs: build_libraries_riscv
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: true
- name: Download libraries
uses: actions/download-artifact@v3
with:
name: libraries-arriesgado
- name: Unpack libraries
run: tar -xzvf libraries-arriesgado.tar.gz
- name: STOPGAP remove conflicting submoduled header libraries from the tarball extract
run: rm ./libraries-arriesgado/include/fsgrid.hpp ./libraries-arriesgado/include/dccrg.hpp
- name: Make clean
run: VLASIATOR_ARCH=arriesgado make clean
- name: Compile vlasiator (RISC-V)
run: |
srun --interactive -p arriesgado-jammy -J vlasiator_build -n 1 -c 4 --pty -t 01:00:00 bash -lc 'module load boost papi openmpi; export VLASIATOR_ARCH=arriesgado; make -j4'
- name: Upload riscv binary
uses: actions/upload-artifact@v3
with:
name: vlasiator-riscv
path: vlasiator
if-no-files-found: error
build_tools:
# Build vlsvdiff and vlsvextract for testpackage use
runs-on: carrington
steps:
- name: Clean workspace
run: |
rm -rf libraries library-build testpackage
rm -f libraries.tar.zst dtestpackage_check_description.txt testpackage-output.tar.gz metrics.txt stdout.txt stderr.txt testpackage_output_variables.txt
rm -f *.xml
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: true
- uses: ursg/gcc-problem-matcher@master
- name: Make clean
run: VLASIATOR_ARCH=carrington_gcc_openmpi make clean
- name: Compile tools
run: |
export VLASIATOR_ARCH=carrington_gcc_openmpi
srun -M carrington --job-name tp_compile --interactive --nodes=1 -n 1 -c 16 --mem=40G -p short -t 0:10:0 bash -c 'module purge; module load GCC/11.2.0; module load OpenMPI/4.1.1-GCC-11.2.0 ; module load PMIx/4.1.0-GCCcore-11.2.0; module load PAPI/6.0.0.1-GCCcore-11.2.0; export VLASIATOR_ARCH=carrington_gcc_openmpi; make -j 16 vlsvextract vlsvdiff'
- name: Upload tools binaries
uses: actions/upload-artifact@v3
with:
name: vlasiator-tools
path: |
vlsvextract_DP
vlsvdiff_DP
if-no-files-found: error
run_testpackage:
# Run the testpackage on the carrington cluster
runs-on: carrington
needs: [build_testpackage, build_tools]
continue-on-error: true
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: true
- name: Download testpackage binary
uses: actions/download-artifact@v3
with:
name: vlasiator-testpackage
- name: Download tools
uses: actions/download-artifact@v3
with:
name: vlasiator-tools
- name: Run testpackage
id: run
run: |
chmod +x $GITHUB_WORKSPACE/vlasiator
chmod +x $GITHUB_WORKSPACE/vlsv*_DP
cd testpackage
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/libraries/lib
#srun -M carrington -t 01:30:00 --job-name CI_testpackage --interactive --nodes=1 -c 4 -n 16 --mem-per-cpu=5G -p short ./small_test_carrington_github_ci.sh
sbatch -W -o testpackage_run_output.txt ./small_test_carrington_github_ci.sh
cat testpackage_run_output.txt
cat $GITHUB_STEP_SUMMARY > $GITHUB_WORKSPACE/testpackage_check_description.txt
cd $GITHUB_WORKSPACE
tar -czvf testpackage-output.tar.gz testpackage_check_description.txt testpackage_output_variables.txt
if [ -f $GITHUB_WORKSPACE/testpackage_failed ]; then
# Fail this step if any test failed.
exit 1
fi
- name: Upload testpackage output
uses: actions/upload-artifact@v3
if: always()
with:
name: testpackage-output
path: testpackage-output.tar.gz
# Note: Testpackage output is further processed in the pr_report.yml workflow
# (to produce Checks against pull requests)
build_ionosphereTests:
# Build IonosphereSolverTests miniApp (currently broken)
runs-on: carrington
#container: ursg/vlasiator_ci:20230220_1
needs: [build_libraries]
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: true
# - name: Download libraries
# uses: actions/download-artifact@v3
# with:
# name: libraries
# - name: Unpack libraries
# run: tar --zstd -xvf libraries.tar.zstd
# - uses: ursg/gcc-problem-matcher@master
- name: Compile ionosphereSolverTests
run: |
cd mini-apps/ionosphereSolverTests/
srun -M carrington --job-name iST_compile --interactive --nodes=1 -n 1 -c 3 --mem=40G -p short -t 0:10:0 bash -c 'module purge; module load GCC/11.2.0; module load OpenMPI/4.1.1-GCC-11.2.0 ; module load PMIx/4.1.0-GCCcore-11.2.0; module load PAPI/6.0.0.1-GCCcore-11.2.0; export VLASIATOR_ARCH=carrington_gcc_openmpi; make -j 3 main differentialFlux sigmaProfiles'
# VLASIATOR_ARCH=carrington_gcc_openmpi make -j 3 main differentialFlux sigmaProfiles
- name: Upload ionosphereTest binaries
uses: actions/upload-artifact@v3
with:
name: vlasiator-tools
path: |
mini-apps/ionosphereSolverTests/main
mini-apps/ionosphereSolverTests/differentialFlux
mini-apps/ionosphereSolverTests/sigmaProfiles
if-no-files-found: error