-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
306 lines (274 loc) · 9.34 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
306 lines (274 loc) · 9.34 KB
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
# this include allows us to reference defaults in anl/ci-resource/defaults
include:
- project: 'anl/ci-resources/defaults'
ref: main
file:
- '/runners.yml'
workflow:
# The name is how the GitHub Action finds this PR's earlier pipelines to cancel.
# It must be set here: the trigger endpoint silently drops a "name" form field,
# and reading GITHUB_PR_NUMBER back needs a Maintainer token.
name: 'PR-$GITHUB_PR_NUMBER'
rules:
- if: $CI_PIPELINE_SOURCE == "trigger" # triggered from GitHub via /run-aurora-ci
variables:
PROJ: "chipStar_test"
QUEUE: "capacity"
TIME: "0:30:00"
WRK_DIR: "/lus/flare/projects/${PROJ}/chipStar/pipeline_${CI_PIPELINE_ID}"
ANL_AURORA_SCHEDULER_PARAMETERS: "-q ${QUEUE} -l select=1,walltime=${TIME},filesystems=home -A ${PROJ}"
GENESIS_CI_PROJECT_DIR: "/home/bertoni/projects/p01.chipStar/GENESIS-Share-CI/"
CHIP_MODULE_CACHE_DIR: ""
BUILD_JOBS: "20"
# app driver
RUN_APPS: "${WRK_DIR}/chipStar/tests/apps/run_apps.sh
-w ${WRK_DIR} -M ${WRK_DIR}/modulefiles -m chipStar/llvm21 -j ${BUILD_JOBS}"
stages:
- .pre
- build
- test
- app_build
- app_run
- app_report
- report
- cleanup
default:
after_script:
# One file per job
- if test "${CI_JOB_STATUS}" = success; then
rm -f ${WRK_DIR}/failed_${CI_JOB_NAME};
else
mkdir -p ${WRK_DIR};
echo "${CI_JOB_NAME}$(cat ${WRK_DIR}/reason_${CI_JOB_NAME} 2>/dev/null)" > ${WRK_DIR}/failed_${CI_JOB_NAME};
fi
setup:
stage: .pre
extends: .aurora-shell-runner
script:
# Remove pipeline directories older than 7 days. -prune keeps find out of the trees
# it is deleting, and the || true absorbs a directory another pipeline's cleanup
# removes between the listing and the visit.
- find /lus/flare/projects/${PROJ}/chipStar -maxdepth 1 -name "pipeline_*" -mtime +7 -prune -exec rm -rf {} + || true
- mkdir -p ${WRK_DIR}
- cd ${WRK_DIR}
# setup chipStar
- git clone https://github.com/CHIP-SPV/chipStar.git
- cd chipStar
- |
if [ -n "${GITHUB_PR_NUMBER}" ]; then
git fetch origin pull/${GITHUB_PR_NUMBER}/head
git checkout FETCH_HEAD
else
git checkout ${GITHUB_SHA}
fi
- git submodule update --init --recursive
- git fetch origin main
- git checkout origin/main -- tests/apps/run_apps.sh install_chipstar.py scripts/check.py
- module list
#
# Toolchain builds
#
chipStar_script_install_llvm22:
stage: build
extends: .aurora-shell-runner
# wave 1
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- cp -r ${WRK_DIR}/chipStar ${WRK_DIR}/chipStar_llvm22
- cd ${WRK_DIR}/chipStar_llvm22
- module use /soft/modulefiles
- module load cmake chipStar/.llvm22/20260311-22/release
- sed -i '/name="chipstar",/a\ cmake_flags=["-DCHIP_LZ_API_QUERY_QUEUE_EMPTY=ON"],' ./install_chipstar.py
- ./install_chipstar.py --all --jobs ${BUILD_JOBS} --install-dir ${WRK_DIR}/install/ --staging-dir $PWD/stage
# testing with install script.
chipStar_aurora_script_test:
stage: build
extends: .aurora-shell-runner
# wave 1
variables:
MAKEFLAGS: "-j${BUILD_JOBS}"
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- mkdir ${WRK_DIR}/script_llvm21
- cp -r ${WRK_DIR}/chipStar ${WRK_DIR}/script_llvm21
- NO_FRESH_CHIPSTAR_PULL=true temp=${WRK_DIR}/script_llvm21 MODULE_INSTALL_DIR=${WRK_DIR}/modulefiles CHIPSTAR_INSTALL_DIR=${WRK_DIR}/latest_llvm21/ /lus/flare/projects/Aurora_deployment/bertoni/projects/p02.chipStar/chip-star-patch.sh release chipStar/.llvm21/20260808-21/release
- cd ${WRK_DIR}/modulefiles/chipStar
- echo 'module_version("llvm21", "default")' > .modulerc.lua
chipStar_aurora_script_test_llvm22:
stage: build
extends: .aurora-shell-runner
# wave 2
needs: [chipStar_aurora_script_test, chipStar_script_install_llvm22]
variables:
MAKEFLAGS: "-j${BUILD_JOBS}"
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- mkdir ${WRK_DIR}/script_llvm_22
- cp -r ${WRK_DIR}/chipStar ${WRK_DIR}/script_llvm_22
- NO_FRESH_CHIPSTAR_PULL=true llvm_version=22 temp=${WRK_DIR}/script_llvm_22/ MODULE_INSTALL_DIR=${WRK_DIR}/modulefiles CHIPSTAR_INSTALL_DIR=${WRK_DIR}/latest_llvm22/ LLVM_INSTALL_DIR=${WRK_DIR}/llvm22 /lus/flare/projects/Aurora_deployment/bertoni/projects/p02.chipStar/chip-star-patch.sh release
#
# Unit tests
#
chipStar_script_test_llvm22:
stage: test
resource_group: aurora_slot_1
extends: .aurora-batch-runner
needs: [chipStar_script_install_llvm22]
script:
- cd ${WRK_DIR}/chipStar_llvm22/build
- module use /soft/modulefiles
- module load cmake chipStar/.llvm22/20260311-22/release
- CHIP_BE=level0 make build_tests -j
- ZE_AFFINITY_MASK=0.0 ../scripts/check.py ./ dgpu level0 --timeout 60 --num-tries=1 --num-threads=1
chipStar_aurora_script_test_run:
stage: test
resource_group: aurora_slot_2
extends: .aurora-batch-runner
needs: [chipStar_aurora_script_test]
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- cd ${WRK_DIR}/script_llvm21/chipStar/build
- module load cmake
- CHIP_BE=level0 make build_tests -j
- ZE_AFFINITY_MASK=0.0 ../scripts/check.py ./ dgpu level0 --timeout 60 --num-tries=1 --num-threads=1
chipStar_aurora_script_test_llvm22_run:
stage: test
resource_group: aurora_slot_3
extends: .aurora-batch-runner
needs: [chipStar_aurora_script_test_llvm22]
script:
- hostname
- echo "Running on $(hostname) with setuid shell runner"
- cd ${WRK_DIR}/script_llvm_22/chipStar/build
- module load cmake
- CHIP_BE=level0 make build_tests -j
- ZE_AFFINITY_MASK=0.0 ../scripts/check.py ./ dgpu level0 --timeout 60 --num-tries=1 --num-threads=1
#
# Application builds
#
zeroRK_build:
stage: app_build
extends: .aurora-shell-runner
# wave 2
needs: [chipStar_aurora_script_test, chipStar_script_install_llvm22]
variables:
MAKEFLAGS: "-j${BUILD_JOBS}"
script:
- ${RUN_APPS} --phases build zerork
opensn_build:
stage: app_build
extends: .aurora-shell-runner
# wave 2
needs: [chipStar_aurora_script_test, chipStar_script_install_llvm22]
script:
- ${RUN_APPS} --phases build opensn
#
# Application runs
#
hoMusic:
stage: app_run
resource_group: aurora_slot_1
extends: .aurora-batch-runner
needs: [chipStar_aurora_script_test, chipStar_aurora_script_test_run]
variables:
MAKEFLAGS: "-j${BUILD_JOBS}"
script:
- ${RUN_APPS} --phases build,run homusic
zeroRK_run:
stage: app_run
resource_group: aurora_slot_2
extends: .aurora-batch-runner
needs: [zeroRK_build, chipStar_aurora_script_test_run]
script:
- ${RUN_APPS} --phases run zerork
opensn_run:
stage: app_run
resource_group: aurora_slot_3
extends: .aurora-batch-runner
needs: [opensn_build, chipStar_aurora_script_test_run]
variables:
CHIP_MODULE_CACHE_DIR: "${WRK_DIR}/module_cache"
script:
- ${RUN_APPS} --phases run opensn
#
# Performance analysis
#
.app_report:
stage: app_report
extends: .aurora-shell-runner
script:
- set -o pipefail
- |
# report_github_status reads reason_* for the one-line PR description
LOG=${WRK_DIR}/report_${CI_JOB_NAME}.log
rc=0
${RUN_APPS} --phases report ${APP} |& tee ${LOG} || rc=1
if [ $rc -ne 0 ]; then
sed -n 's/^performance check failed//p' ${LOG} | head -1 > ${WRK_DIR}/reason_${CI_JOB_NAME}
fi
exit $rc
hoMusic_performance:
extends: .app_report
needs: [hoMusic]
variables:
APP: homusic
zeroRK_performance:
extends: .app_report
needs: [zeroRK_run]
variables:
APP: zerork
opensn_performance:
extends: .app_report
needs: [opensn_run]
variables:
APP: opensn
cleanup:
stage: cleanup
extends: .aurora-shell-runner
when: on_success
script:
- rm -rf ${WRK_DIR}
.report_github_status:
stage: report
extends: .aurora-shell-runner
script:
- |
# No failed_* files on a red pipeline is possible: a cancelled or killed job
# never runs after_script. Deriving the text from GITHUB_STATUS keeps the two
# agreeing.
# || true: with no failed_* files the glob stays literal and cat exits 1,
# which under set -e would kill this job on a fully green pipeline.
FAILED=$(cat ${WRK_DIR}/failed_* 2>/dev/null | sort -u | sed ':a;N;$!ba;s/\n/; /g' || true)
if [ -n "${FAILED}" ]; then
DESC="failed: ${FAILED}"
elif [ "${GITHUB_STATUS}" = success ]; then
DESC="all jobs passed"
else
DESC="pipeline failed; no job recorded a reason"
fi
DESC=$(echo "${DESC}" | cut -c1-140)
echo "status=${GITHUB_STATUS} description=${DESC}"
if [ -z "${GITHUB_SHA}" ]; then
echo "No GITHUB_SHA set, skipping GitHub status report"
exit 0
fi
curl -X POST \
--fail \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/CHIP-SPV/chipStar/statuses/${GITHUB_SHA} \
-d "{\"state\":\"${GITHUB_STATUS}\",\"context\":\"aurora-ci\",\"description\":\"${DESC}\",\"target_url\":\"${CI_PIPELINE_URL}\"}"
report_success:
extends: .report_github_status
when: on_success
variables:
GITHUB_STATUS: "success"
report_failure:
extends: .report_github_status
when: on_failure
variables:
GITHUB_STATUS: "failure"