-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
488 lines (431 loc) · 14.9 KB
/
.gitlab-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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# default settings based on standard Docker image for reproducible build:
# see https://github.com/Algebraic-Programming/ReproducibleBuilds
default:
tags:
- docker
image: ${CI_REGISTRY}/${CI_PROJECT_PATH}/lpf-ubuntu-20.04-gcc
variables:
EXTRA_TESTS_ENABLED:
value: "no"
options:
- "yes"
- "no"
description: "Enable extra tests: build with debug symbols, performance tests"
LPF_TESTS_ENABLED:
value: "no"
options:
- "yes"
- "no"
description: "Enable LPF-based tests"
MULTIPLE_COMPILERS_ENABLED:
value: "no"
options:
- "yes"
- "no"
description: "Enable compilation using multiple compilers"
SLURM_TESTS_ENABLED:
value: "no"
options:
- "yes"
- "no"
description: "Enable test on the Slurm cluster"
CI_SLURM_PARTITION:
value: "Zen3"
description: "Partition to use (if using Slurm)"
CI_SLURM_NNODES:
value: "1"
description: "Number of nodes to request (if using Slurm)"
CI_SLURM_NTASKS:
value: "1"
description: "Number of tasks to request (if using Slurm)"
CI_SLURM_CPUS_PER_TASK:
value: "64"
description: "Number of CPUs per task (if using Slurm)"
CI_SLURM_MEM_PER_NODE:
value: "64G"
description: "Memory per node (if using Slurm)"
CI_SLURM_TIMELIMIT:
value: "00-10:00:00" # 10 hours
description: "Time limit for the job (if using Slurm)"
SLURM_JOB_START_TIMEOUT_SECONDS:
value: "3600" # 1 hour timeout to switch from PENDING to RUNNING
description: "Allowed time for the job to switch from PENDING to RUNNING (if using Slurm)"
SLURM_DATASETS_DIR_PATH:
value: "/storage/datasets/graphs-and-sparse-matrices"
description: "Path to the datasets directory (if using Slurm)"
COVERAGE_ENABLED:
value: "no"
options:
- "yes"
- "no"
description: "Execute coverage build and tests, then exports XML and HTML reports"
GENERATE_COVERAGE_PAGES:
value: "no"
options:
- "yes"
- "no"
description: "Generate coverage report for Gitlab Pages"
workflow:
rules:
# run all jobs if a commit is merged on master, develop or a version/rc branch
- if: $CI_COMMIT_BRANCH == "master"
variables:
EXTRA_TESTS_ENABLED: "yes"
LPF_TESTS_ENABLED: "yes"
MULTIPLE_COMPILERS_ENABLED: "yes"
COVERAGE_ENABLED: "yes"
- if: $CI_COMMIT_BRANCH == "develop"
variables:
EXTRA_TESTS_ENABLED: "yes"
LPF_TESTS_ENABLED: "yes"
MULTIPLE_COMPILERS_ENABLED: "yes"
COVERAGE_ENABLED: "yes"
GENERATE_COVERAGE_PAGES: "yes"
- if: $CI_COMMIT_BRANCH =~ /^v.*-rc.*$/
variables:
EXTRA_TESTS_ENABLED: "yes"
LPF_TESTS_ENABLED: "yes"
MULTIPLE_COMPILERS_ENABLED: "yes"
# "manual" execution strategies are allowed to force run
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_PIPELINE_SOURCE != "push"
# do not run pipeline if the merge request is draft (case insensitive) and execution was automatically invoked
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TITLE =~ /^draft:/i
when: never
# run if the pipeline comes from a merge request
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
variables:
COVERAGE_ENABLED: "yes"
# default: don't run
# factored out command to strip symbols from test binaries
.strip_symbols: &strip_symbols
- strip -s $(find tests/unit/ -type f -executable -print)
$(find tests/smoke/ -type f -executable -print)
$(find tests/performance/ -type f -executable -print)
# Build / test / install on CentOS 8, only for main branches
#build_centos_8:
# image: centos:8
# rules:
# - if: $EXTRA_TESTS_ENABLED == "yes"
# before_script:
# - yum -y update && yum -y groupinstall "Development Tools" && yum -y install make autoconf cmake numactl-devel
# script:
# - rm -rf build install && mkdir -p install build && cd ./build && ../bootstrap.sh --prefix=../install && make -j$(nproc) && make -j$(nproc) build_tests_all
# - *strip_symbols
# artifacts:
# paths:
# - build/
# exclude:
# - build/**/*.o
# - build/**/*.o.d
# expire_in: 2 hours
#build_debug_centos_8:
# image: centos:8
# before_script:
# - yum -y update && yum -y groupinstall "Development Tools" && yum -y install make autoconf cmake numactl-devel
# script:
# - mkdir -p install build && cd ./build && ../bootstrap.sh --prefix=../install --debug-build && make -j$(nproc) && make -j$(nproc) build_tests_all
# rules:
# - if: $EXTRA_TESTS_ENABLED == "yes"
#test_centos_8_unit:
# image: centos:8
# needs: [build_centos_8]
# rules:
# - if: $EXTRA_TESTS_ENABLED == "yes"
# before_script:
# - yum -y update && yum -y groupinstall "Development Tools" && yum -y install make autoconf cmake numactl-devel
# script:
# - cd ./build && make -j$(nproc) tests_unit &> unittests.log
# - ../tests/summarise.sh unittests.log
#test_centos_8_smoke:
# image: centos:8
# needs: [build_centos_8]
# rules:
# - if: $EXTRA_TESTS_ENABLED == "yes"
# before_script:
# - yum -y update && yum -y groupinstall "Development Tools" && yum -y install make autoconf cmake numactl-devel
# script:
# - cd ./build && make -j$(nproc) tests_smoke &> smoketests.log
# - ../tests/summarise.sh smoketests.log
#test_centos_8_performance:
# image: centos:8
# needs: [build_centos_8]
# rules:
# - if: $EXTRA_TESTS_ENABLED == "yes"
# before_script:
# - yum -y update && yum -y groupinstall "Development Tools" && yum -y install make autoconf cmake numactl-devel
# script:
# - cd ./build && make -j$(nproc) tests_performance &> performancetests.log
# - ../tests/summarise.sh performancetests.log tests/performance/output/benchmarks tests/performance/output/scaling
#test_centos_8_installation:
# image: centos:8
# needs: [build_centos_8]
# rules:
# - if: $EXTRA_TESTS_ENABLED == "yes"
# before_script:
# - yum -y update && yum -y groupinstall "Development Tools" && yum -y install make autoconf cmake numactl-devel
# script:
# - cd ./build && make -j$(nproc) install
# Main testing on Ubuntu, all branches
build_test:
script:
- mkdir -p install build && cd ./build && ../bootstrap.sh --prefix=../install --with-datasets=${ALP_DATASETS}
&& make -j$(nproc) build_tests_all
- *strip_symbols
artifacts:
paths:
- build/
exclude:
- build/**/*.o
- build/**/*.o.d
- build/**/CMakeFiles
- build/**/*.dir
expire_in: 2 hours
build_tests_buildtype_debug_sym_debug:
script:
- mkdir -p install build && cd build && cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_FLAGS=-D_DEBUG
-DCMAKE_C_FLAGS=-D_DEBUG -DCMAKE_BUILD_TYPE=Debug ../ && make -j$(nproc) build_tests_all
build_tests_sym_debug:
rules:
- if: $EXTRA_TESTS_ENABLED == "yes"
script:
- mkdir -p install build && cd build && cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_FLAGS=-D_DEBUG
-DCMAKE_C_FLAGS=-D_DEBUG -DLPF_INSTALL_PATH=${LPF_PATH} -DCMAKE_BUILD_TYPE=Release ../ && make -j$(nproc) build_tests_all
tests_unit:
needs: [build_test]
script:
- cd ./build && make -j$(nproc) tests_unit &> unittests.log
- ../tests/summarise.sh unittests.log
artifacts:
paths: [ build/*.log ]
expire_in: 1 day
tests_smoke:
needs: [build_test]
script:
- cd ./build && make -j$(nproc) tests_smoke &> smoketests.log
- ../tests/summarise.sh smoketests.log
test_installation:
needs: [build_test]
script:
- cd ./build && make -j$(nproc) install
build_test_buildtype_debug:
script:
- mkdir -p install build && cd ./build && ../bootstrap.sh --prefix=../install --with-datasets=${ALP_DATASETS}
--debug-build && make -j$(nproc) && make -j$(nproc) build_tests_all
- *strip_symbols
artifacts:
paths:
- build/
exclude:
- build/**/*.o
- build/**/*.o.d
expire_in: 2 hours
test_smoke_build_type_debug:
needs: [build_test_buildtype_debug]
script:
- cd ./build && make -j$(nproc) smoketests &> smoketests.log
- ../tests/summarise.sh smoketests.log
test_installation_build_type_debug:
needs: [build_test_buildtype_debug]
script:
- cd ./build && make -j$(nproc) install
gitleaks:
image:
name: "zricethezav/gitleaks:v8.0.6"
entrypoint: [""]
script: gitleaks detect -v --source .
## Jobs running on Slurm cluster
# factored out command to download the datasets, cmake, and build in non-debug mode
.setup_and_build_ndebug_slurm: &setup_and_build_ndebug_slurm
- mkdir -p install build && cd ./build
- ../bootstrap.sh --prefix=../install --with-datasets=${SLURM_DATASETS_DIR_PATH} --no-hyperdags
- make -j$(nproc)
tests_performance_slurm:
rules:
- if: $SLURM_TESTS_ENABLED == "yes"
tags:
- slurm
script:
- *setup_and_build_ndebug_slurm
- make -j$(nproc) performancetests |& tee performancetests.log
- ../tests/summarise.sh performancetests.log tests/performance/output/benchmarks tests/performance/output/scaling
artifacts:
paths: [ build/*.log ]
expire_in: 1 month
## Additional tests specific to main branches only
tests_performance:
rules:
- if: $EXTRA_TESTS_ENABLED == "yes"
needs: [build_test]
script:
- cd ./build && make -j$(nproc) performancetests &> performancetests.log
- ../tests/summarise.sh performancetests.log tests/performance/output/benchmarks tests/performance/output/scaling
tests_unit_buildtype_debug:
rules:
- if: $EXTRA_TESTS_ENABLED == "yes"
needs: [build_test_buildtype_debug]
script:
- cd ./build && make -j$(nproc) unittests &> unittests.log
- ../tests/summarise.sh unittests.log
artifacts:
paths: [ build/*.log ]
expire_in: 1 day
## Additional tests for LPF (on main branches only)
build_test_lpf:
rules:
- if: $LPF_TESTS_ENABLED == "yes"
script:
# build only LPF-related tests
- mkdir -p install build && cd ./build && ../bootstrap.sh --with-lpf=${LPF_PATH} --no-nonblocking --no-reference
--no-hyperdags --prefix=../install --with-datasets=${ALP_DATASETS} && make -j$(nproc) build_tests_all
- *strip_symbols
artifacts:
paths:
- build/
exclude:
- build/**/*.o
- build/**/*.o.d
- build/**/CMakeFiles
- build/**/*.dir
expire_in: 2 hours
# common sections for LPF unit tests
.tests_unit_lpf:
needs: [build_test_lpf]
script:
- cd ./build && make -j$(nproc) tests_unit &> unittests.log
- ../tests/summarise.sh unittests.log
artifacts:
paths: [ build/*.log ]
expire_in: 1 day
# this job triggers in internal CI, where LPF tests run better on runners
# with a given tag $LPF_PREFERRED_RUNNERS_TAG
tests_unit_lpf_preferred:
rules:
- if: $LPF_TESTS_ENABLED == "yes" && $LPF_PREFERRED_RUNNERS == "yes"
tags:
- docker
- $LPF_PREFERRED_RUNNERS_TAG
extends: .tests_unit_lpf
# if runners with a specific tag are not present, run this job
# attention: it may timeout
tests_unit_lpf_generic:
rules:
- if: $LPF_TESTS_ENABLED == "yes" && $LPF_PREFERRED_RUNNERS != "yes"
extends: .tests_unit_lpf
tests_smoke_lpf:
rules:
- if: $LPF_TESTS_ENABLED == "yes"
needs: [build_test_lpf]
script:
- cd ./build && make -j$(nproc) tests_smoke &> smoketests.log
- ../tests/summarise.sh smoketests.log
test_installation_lpf:
rules:
- if: $LPF_TESTS_ENABLED == "yes"
needs: [build_test_lpf]
script:
- cd ./build && make -j$(nproc) install
## Additional jobs to build againt multiple compilers (on main branches only)
build_test_gcc_versions:
rules:
- if: $MULTIPLE_COMPILERS_ENABLED == "yes"
image: ${CI_REGISTRY}/${CI_PROJECT_PATH}/lpf-ubuntu-22.04-gcc-clang
parallel:
matrix:
- CXX_COMPILER: g++
CC_COMPILER: gcc
VER: [9,10,11,12]
# - CXX_COMPILER: clang++
# CC_COMPILER: clang
# VER: [11,12,13,14]
script:
- mkdir -p install build && cd ./build &&
CXX=${CXX_COMPILER}-${VER} CC=${CC_COMPILER}-${VER} ../bootstrap.sh
--prefix=../install --with-datasets=${ALP_DATASETS}
--with-lpf=${LPF_BASE_PATH}/build_mpich_${CC_COMPILER}_${VER}/install &&
make -j$(nproc) build_tests_all
# Coverage build + tests for each backend
coverage_matrix:
rules:
- if: $COVERAGE_ENABLED == "yes" || $GENERATE_COVERAGE_PAGES == "yes"
needs: [build_test]
parallel:
matrix:
# ________: HYPERDAGS REFERENCE REFERENCE_OMP NONBLOCKING
- BACKENDS: OFF ON OFF OFF # REFERENCE
- BACKENDS: OFF OFF ON OFF # REFERENCE_OMP
- BACKENDS: ON OFF OFF OFF # HYPERDAGS (reference_omp)
- BACKENDS: OFF OFF OFF ON # NONBLOCKING
script:
- read -a backends_array <<< "$BACKENDS"
- echo "-- HYPERDAGS=${backends_array[0]}"
- echo "-- REFERENCE=${backends_array[1]}"
- echo "-- REFERENCE_OMP=${backends_array[2]}"
- echo "-- NONBLOCKING=${backends_array[3]}"
- rm -rf build install && mkdir -p install build && cd build
- cmake -DCMAKE_INSTALL_PREFIX='../install'
-DCMAKE_BUILD_TYPE=Coverage
-DDATASETS_DIR=${ALP_DATASETS}
-DWITH_HYPERDAGS_BACKEND=${backends_array[0]}
-DWITH_REFERENCE_BACKEND=${backends_array[1]}
-DWITH_OMP_BACKEND=${backends_array[2]}
-DWITH_NONBLOCKING_BACKEND=${backends_array[3]} ..
- make -j$(nproc)
- make -j$(nproc) unittests
# for each job (i.e., each backend), generate a separate JSON to me merged later
# (gcovr merges only JSON files)
- python3 -m gcovr --json
--print-summary
--exclude-directories "/usr/*"
--root ${CI_PROJECT_DIR}
--output ${CI_PROJECT_DIR}/COVERAGE_${CI_JOB_ID}.json
artifacts:
paths:
- COVERAGE_${CI_JOB_ID}.json
expire_in: 4 weeks
cobertura_coverage_report:
rules:
- if: $COVERAGE_ENABLED == "yes" || $GENERATE_COVERAGE_PAGES == "yes"
needs: [coverage_matrix]
script:
# merge JSON files from multiple backends into single Cobertura report for the CI
- python3 -m gcovr --xml-pretty
--add-tracefile "COVERAGE_*.json"
--print-summary
--root ${CI_PROJECT_DIR}
--output coverage.xml
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in: 4 weeks
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
html_coverage_report:
rules:
- if: $COVERAGE_ENABLED == "yes" || $GENERATE_COVERAGE_PAGES == "yes"
needs: [coverage_matrix]
script:
- mkdir -p public
# merge JSON files from multiple backends into single HTNL report for the CI
- python3 -m gcovr --html-details
--add-tracefile "COVERAGE_*.json"
--print-summary
--sort-percentage
--html-title "Branch ${CI_COMMIT_BRANCH}, commit ${CI_COMMIT_SHA}"
--root ${CI_PROJECT_DIR}
--output public/index.html
artifacts:
expire_in: 4 weeks
paths:
- public
## GitLab Pages update job
pages:
rules:
- if: $GENERATE_COVERAGE_PAGES == "yes"
needs: [html_coverage_report]
script:
- mkdir -p public
artifacts:
paths:
- public