-
Notifications
You must be signed in to change notification settings - Fork 2
434 lines (359 loc) · 14.8 KB
/
developer_ci.yml
File metadata and controls
434 lines (359 loc) · 14.8 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
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
name: Developer CI
on:
pull_request:
# CI is disabled if ONLY workflow files are changed
paths-ignore:
- '.github/workflows/**'
env:
QA_TIMEOUT_PER_TEST: 150
# The commit of the PR to embed it in the build tag
RADIOSS_SHA_HEADER: ${{ github.event.pull_request.head.sha }}
jobs:
# This job is a guard to avoid running CI if workflows files are changed (even if they are not the only ones)
guard:
runs-on: developer_ci
container:
# Registry variable can't be a secret but can be a simple variable defined at organization level
image: "${{ vars.DOCKER_REGISTRY }}/gitlab-utils"
credentials:
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
steps:
- name: Detect workflow changes
run: |
echo "AHAHA"
# build-for-qa:
# needs: guard
# if: ${{ github.repository_owner == 'OpenRadioss' }}
# # concurrency:
# # group: ${{ github.ref_name }}
# # cancel-in-progress: true
# # DEV ONLY # runs-on: ["build","dev","dev_ci"]
# runs-on: ["build","developer_ci"]
# env:
# BUILD_NB_THREAD: 2
# strategy:
# # If one job fails othere are canceled
# fail-fast: true
# matrix:
# include:
# - build: starter_linux64_gf
# precision: dp
# os: linux64
# binary: starter
# image_name: rd-linux64-cos8-bld:ompi4.1.1-ts11
# - build: engine_linux64_gf_ompi
# precision: dp
# os: linux64
# binary: engine
# mpi: ompi
# image_name: rd-linux64-cos8-bld:ompi4.1.1-ts11
# container:
# # Registry variable can't be a secret but can be a simple variable defined at organization level
# image: "fr-qafactory.europe.altair.com/${{ matrix.image_name }}"
# # credentials:
# # username: ${{ secrets.DOCKER_REGISTRY_USER }}
# # password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
# volumes:
# - /etc/localtime:/etc/localtime:ro
# steps:
# - name: Clean local exe dir
# run: |
# rm -rf exec
# md5sum exec/* || echo "Nothing in exec/"
# # Get last git modifications, WS is not persistent here
# - uses: actions/checkout@v4
# with:
# lfs: 'false'
# ref: refs/pull/${{ github.event.number }}/merge
# - name: Running build
# run: |
# echo "Running using ref: refs/pull/${{ github.event.number }}/merge"
# mpi_opts=''
# if [ ! -z ${{ matrix.mpi }} ]
# then
# mpi_opts="-mpi=${{ matrix.mpi }}"
# fi
# cmd="./build_script.sh -release -arch=${{ matrix.os }}_gf -prec=${{ matrix.precision }} -nt=${{ env.BUILD_NB_THREAD }} -static-link $mpi_opts"
# echo "========================================="
# echo "-- BUILD ${{ matrix.build }} --"
# echo "-- $cmd --"
# echo "========================================="
# source /root/.bashrc
# chmod 755 Compiling_tools/script/*
# chmod 755 ${{ matrix.binary }}/build_script.sh
# md5sum exec/* || echo "Nothing in exec/"
# mkdir exec
# cd ${{ matrix.binary }}
# eval $cmd
# cd ..
# md5sum exec/* || exit 1
# # Upload artifact (since V4 we can't upload artifact using the same name, each one must be unique)
# - name: Upload built artifacts
# uses: actions/upload-artifact@v4
# with:
# name: bins-${{ matrix.os }}-${{ matrix.precision }}-${{ matrix.build }}
# path: exec
# # We upload extlib only once, arbitrary choice
# - name: Upload extlib artifacts
# uses: actions/upload-artifact@v4
# with:
# name: extlib.zip
# path: extlib.zip
# if: ${{ matrix.build == 'starter_linux64_gf' }}
# build:
# needs: guard
# if: ${{ github.repository_owner == 'OpenRadioss' }}
# # concurrency:
# # group: ${{ github.ref_name }}
# # cancel-in-progress: true
# # DEV ONLY # runs-on: ["build","dev","dev_ci"]
# runs-on: ["build","developer_ci"]
# env:
# BUILD_NB_THREAD: 2
# strategy:
# # If one job fails othere are canceled
# fail-fast: true
# matrix:
# include:
# - build: starter_linux64_gf_sp
# precision: sp
# os: linux64
# binary: starter
# image_name: rd-linux64-cos10-bld:ompi4.1.1-ts15
# - build: engine_linux64_gf_ompi_sp
# precision: sp
# os: linux64
# binary: engine
# mpi: ompi
# image_name: rd-linux64-cos10-bld:ompi4.1.1-ts15
# # Disabled since error would be seen in ompi version
# # - build: engine_linux64_gf
# # precision: dp
# # os: linux64
# # binary: engine
# # image_name: rd-linux64-cos10-bld:ompi4.1.1-ts15
# # - build: engine_linux64_gf_sp
# # precision: sp
# # os: linux64
# # binary: engine
# # image_name: rd-linux64-cos10-bld:ompi4.1.1-ts15
# container:
# # Registry variable can't be a secret but can be a simple variable defined at organization level
# image: "fr-qafactory.europe.altair.com/${{ matrix.image_name }}"
# # credentials:
# # username: ${{ secrets.DOCKER_REGISTRY_USER }}
# # password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
# volumes:
# - /etc/localtime:/etc/localtime:ro
# steps:
# - name: Clean local exe dir
# run: |
# rm -rf exec
# md5sum exec/* || echo "Nothing in exec/"
# # Get last git modifications, WS is not persistent here
# - uses: actions/checkout@v4
# with:
# lfs: 'false'
# ref: refs/pull/${{ github.event.number }}/merge
# - name: Running build
# run: |
# echo "Running using ref: refs/pull/${{ github.event.number }}/merge"
# mpi_opts=''
# if [ ! -z ${{ matrix.mpi }} ]
# then
# mpi_opts="-mpi=${{ matrix.mpi }}"
# fi
# cmd="./build_script.sh -release -arch=${{ matrix.os }}_gf -prec=${{ matrix.precision }} -nt=${{ env.BUILD_NB_THREAD }} -static-link $mpi_opts"
# echo "========================================="
# echo "-- BUILD ${{ matrix.build }} --"
# echo "-- $cmd --"
# echo "========================================="
# source /root/.bashrc
# chmod 755 Compiling_tools/script/*
# chmod 755 ${{ matrix.binary }}/build_script.sh
# md5sum exec/* || echo "Nothing in exec/"
# mkdir exec
# cd ${{ matrix.binary }}
# eval $cmd
# cd ..
# md5sum exec/* || exit 1
# # Upload artifact (since V4 we can't upload artifact using the same name, each one must be unique)
# - name: Upload built artifacts
# uses: actions/upload-artifact@v4
# with:
# name: bins-${{ matrix.os }}-${{ matrix.precision }}-${{ matrix.build }}
# path: exec
# code-analysis:
# needs: guard
# # We execute after all builds (in // with QA)
# if: ${{ github.repository_owner == 'OpenRadioss' }}
# # DEV ONLY # runs-on: ["build","dev_devci"]
# runs-on: ["build","developer_ci"]
# container:
# # Registry variable can't be a secret but can be a simple variable defined at organization level
# image: "fr-qafactory.europe.altair.com/rd-linux64-cos8-bld:ompi4.1.1-ts11"
# # credentials:
# # username: ${{ secrets.DOCKER_REGISTRY_USER }}
# # password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
# volumes:
# - /etc/localtime:/etc/localtime:ro
# env:
# BUILD_NB_THREAD: 2
# strategy:
# # If one job fails othere are canceled
# fail-fast: true
# matrix:
# include:
# - build: starter_linux64_gf
# precision: dp
# os: linux64
# binary: starter
# - build: engine_linux64_gf_ompi
# precision: dp
# os: linux64
# binary: engine
# mpi: ompi
# steps:
# - name: Clean local exe dir
# run: |
# rm -rf exec
# md5sum exec/* || echo "Nothing in exec/"
# # Get last git modifications, WS is not persistent here
# - uses: actions/checkout@v4
# with:
# lfs: 'false'
# ref: refs/pull/${{ github.event.number }}/merge
# - name: Generate Fortran Signatures
# run: |
# source /root/.bashrc
# cd scripts/gcc_plugin
# sh build.sh
# cd -
# - name: Running build with code analysis
# run: |
# echo "Running using ref: refs/pull/${{ github.event.number }}/merge"
# mpi_opts=''
# if [ ! -z ${{ matrix.mpi }} ]
# then
# mpi_opts="-mpi=${{ matrix.mpi }}"
# fi
# cmd="./build_script.sh -debug=analysis -arch=${{ matrix.os }}_gf -prec=${{ matrix.precision }} -nt=${{ env.BUILD_NB_THREAD }} -static-link $mpi_opts"
# echo "========================================="
# echo "-- BUILD & ANALYSE ${{ matrix.build }} --"
# echo "-- $cmd --"
# echo "========================================="
# source /root/.bashrc
# chmod 755 Compiling_tools/script/*
# chmod 755 ${{ matrix.binary }}/build_script.sh
# md5sum exec/* || echo "Nothing in exec/"
# mkdir exec
# cd ${{ matrix.binary }}
# eval $cmd
# qa:
# needs: build-for-qa
# # DEV ONLY # runs-on: ["qa_${{ matrix.os }}","dev"]
# runs-on: ["qa_${{ matrix.os }}","developer_ci"]
# container:
# # Registry variable can't be a secret but can be a simple variable defined at organization level
# image: "fr-qafactory.europe.altair.com/rd-linux64-cos8-qa:ompi4.1.1"
# # credentials:
# # username: ${{ secrets.DOCKER_REGISTRY_USER }}
# # password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
# volumes:
# - /etc/localtime:/etc/localtime:ro
# env:
# hm_reader_extlib: ../../extlib/hm_reader
# hm_reader_cfgfiles: ../../hm_cfg_files
# homeuser: /root
# mpi: ompi
# # DEV ONLY # QA_NB_PROC: 2
# QA_NB_PROC: 4
# QA_NB_THREAD: 2
# strategy:
# # If one job fails othere are canceled
# fail-fast: false
# matrix:
# os: [linux64]
# # precision: [dp,sp]
# precision: [dp]
# steps:
# # Get git related to the commit
# - uses: actions/checkout@v4
# with:
# lfs: 'false'
# ref: refs/pull/${{ github.event.number }}/merge
# - name: Clean local exe dir
# run: |
# rm -rf exec
# # Download artifacts (since V4 we must download all needed artifacts, we could do it using wildcard but it doesn't work ... see https://github.com/actions/download-artifact/issues/337)
# # Using hard name waiting for this issue to be fixed
# # - name: Download artifacts
# # uses: actions/download-artifact@v4
# # with:
# # name: bins-${{ matrix.os }}-${{ matrix.precision }}-*
# # path: exec
# # merge-multiple: true
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# name: bins-${{ matrix.os }}-${{ matrix.precision }}-starter_linux64_gf
# path: exec
# merge-multiple: true
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# name: bins-${{ matrix.os }}-${{ matrix.precision }}-engine_linux64_gf_ompi
# path: exec
# merge-multiple: true
# - name: Download extlib artifact
# uses: actions/download-artifact@v4
# with:
# name: extlib.zip
# - name: Unzip extlib
# run: |
# unzip extlib.zip
# - name: Running qa
# run: |
# md5sum exec/* || echo "Nothing in exec/"
# if [ "${{ matrix.precision }}" = "dp" ]
# then
# precision_ext=""
# else
# precision_ext="_${{ matrix.precision }}"
# fi
# chmod 755 exec/*
# cd qa-tests/scripts
# chmod 755 or_qa_script or_radioss.pl
# rm -f QA.summary
# # Allow root to execute mpi command (we are in docker container as root)
# export OMPI_ALLOW_RUN_AS_ROOT=1
# export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
# source ${{ env.homeuser }}/.bashrc
# export LD_LIBRARY_PATH=${{ env.hm_reader_extlib }}/${{ matrix.os }}:$LD_LIBRARY_PATH
# # cmd="./or_qa_script ../../exec/engine_${{ matrix.os }}_gf_${{ env.mpi }}${precision_ext}_db 1.0 --env:RAD_CFG_PATH=${{ env.hm_reader_cfgfiles }} --system_run --env:OMP_STACKSIZE=400m --exec_script_args='mpiexec -np ${{ env.QA_NB_PROC }}' --env:OMP_NUM_THREADS=${{ env.QA_NB_THREAD }} --output_failures_stdout --env:ASAN_OPTIONS='new_delete_type_mismatch=0:detect_leaks=0' --xtra_args='--timeoutscript=${{ env.QA_TIMEOUT_PER_TEST }}'"
# cmd="./or_qa_script ../../exec/engine_${{ matrix.os }}_gf_${{ env.mpi }}${precision_ext} 1.0 --env:RAD_CFG_PATH=${{ env.hm_reader_cfgfiles }} --system_run --env:OMP_STACKSIZE=400m --exec_script_args='mpiexec -np ${{ env.QA_NB_PROC }}' --env:OMP_NUM_THREADS=${{ env.QA_NB_THREAD }} --output_failures_stdout --xtra_args='--timeoutscript=${{ env.QA_TIMEOUT_PER_TEST }}' "
# echo "========================================="
# echo "-- QA ${{ matrix.os }}_${{ matrix.precision }} --"
# echo "-- $cmd --"
# echo "========================================="
# eval $cmd
# res=$?
# # Getting failed test
# nbtestsfailed=$(grep "# Runs Failed\s*:" QA.summary | tail -n 1 | awk -F' ' '{print $5}')
# # Checking if no test has run at all (maybe exec errors)
# nbtestsok=$(grep "# Runs Successful\s*:" QA.summary | tail -n 1 | awk -F' ' '{print $5}')
# if [ $res -gt 0 ] || [ $nbtestsfailed -gt 0 ] || [ $nbtestsok = 0 ]
# then
# # If at least one test is failed we mark the CI as failed
# echo "All tests are not OK, CI is failed"
# exit 1
# fi
# # DEV ONLY #
# # Delete the artifacts
# # In private repo we are limited to 2Gb so we decided not to keep developer ci artifacts for the moment
# # - uses: geekyeggo/delete-artifact@v2
# # with:
# # name: |
# # bins-${{ matrix.os }}-${{ matrix.precision }}
# # bins-${{ matrix.os }}-sp