-
Notifications
You must be signed in to change notification settings - Fork 127
603 lines (550 loc) · 34.9 KB
/
test.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
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
name: Test
# Edit the `test.yml` in `.github/workflows/templates` and run `make_workflows.py` to update the
# workflow.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
types: [opened, labeled, reopened, synchronize]
# Trigger on pushes to the trunk branches. This prevents building commits twice when the pull
# request source branch is in the same repository.
push:
branches:
- "trunk-*"
# Trigger on request.
workflow_dispatch:
env:
# prevent deadlocked MPI tests from causing the job to cancel
MPIEXEC_TIMEOUT: 3000
# allow mpirun to execute as root in the tests
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
# allow openmpi to oversubscribe cores
OMPI_MCA_rmaps_base_oversubscribe: 1
# prevent errors from mis-configured openib systems
OMPI_MCA_btl: "vader,self"
# skip running the CPU tests in GPU builds
_HOOMD_SKIP_CPU_TESTS_WHEN_GPUS_PRESENT_: 1
# Require GPU tests in GPU builds.
_HOOMD_REQUIRE_GPU_TESTS_IN_GPU_BUILDS_: 1
# import HOOMD out of the build directory
PYTHONPATH: ${{ github.workspace }}/install
# Use multiple jobs to reduce the amount of time spent on GPU runners. Use CPU runners for
# compiling all tests configurations (GPU and CPU), then upload the build directory (sans object
# files) as an artifact. Test jobs depend on the build job, download the install directory, and run
# the tests. Upload each build configuration to a separate artifact.
# Github Actions does not support any form of templating at this time, not even YAML anchors.
# To minimize the number of duplicated lines, encode the job configuration as an array in config:
# [image, (mpi), (tbb)]
jobs:
start_action_runners:
name: Start action runners
runs-on: ubuntu-latest
steps:
- name: Use jetstream2-admin/start
uses: glotzerlab/jetstream2-admin/start@v1.2.5
with:
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
build:
name: Build [${{ join(matrix.config, '_') }}]
runs-on: ${{ matrix.build_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
strategy:
matrix:
include:
- {config: [clang14_py311, mpi, tbb, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nomd], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nohpmc], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nomd, nohpmc], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda120_gcc11_py310, mpi, llvm, debug], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda120_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda120_gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [gcc9_py39], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
steps:
- name: Set Werror on recent compilers
run: |
echo "CXXFLAGS=-Werror" >> $GITHUB_ENV
if: ${{ !startsWith(matrix.config[0], 'gcc7') }}
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@v4.1.4
with:
path: code
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
if [[ ${BUILD_DEBUG} == "true" ]]; then BUILD_TYPE="Debug"; else BUILD_TYPE="Release"; fi
echo "BUILD_TYPE=${BUILD_TYPE}"
cmake ../code -GNinja \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_GPU=${ENABLE_GPU:-"OFF"} \
-DENABLE_MPI=${ENABLE_MPI:-"OFF"} \
-DENABLE_TBB=${ENABLE_TBB:-"OFF"} \
-DENABLE_LLVM=${ENABLE_LLVM:-"OFF"} \
-DBUILD_MD=${BUILD_MD:-"ON"} \
-DBUILD_MPCD=${BUILD_MD:-"ON"} \
-DBUILD_METAL=${BUILD_MD:-"ON"} \
-DBUILD_HPMC=${BUILD_HPMC:-"ON"} \
-DCUDA_ARCH_LIST="60;70" \
-DENABLE_DEBUG_JIT=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DPLUGINS=""
env:
ENABLE_GPU: ${{ contains(matrix.config[0], 'cuda') }}
ENABLE_MPI: ${{ contains(matrix.config, 'mpi') }}
ENABLE_TBB: ${{ contains(matrix.config, 'tbb') }}
ENABLE_LLVM: ${{ contains(matrix.config, 'llvm') }}
BUILD_MD: ${{ !contains(matrix.config, 'nomd') }}
BUILD_HPMC: ${{ !contains(matrix.config, 'nohpmc') }}
BUILD_DEBUG: ${{ contains(matrix.config, 'debug') }}
shell: bash
- name: Build
run: ninja install -j $(($(getconf _NPROCESSORS_ONLN) + 2))
working-directory: build
- name: Configure plugins
run : |
mkdir -p build-example-plugins
cd build-example-plugins
if [[ ${BUILD_DEBUG} == "true" ]]; then BUILD_TYPE="Debug"; else BUILD_TYPE="Release"; fi
echo "BUILD_TYPE=${BUILD_TYPE}"
CMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install cmake ../code/example_plugins -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
env:
BUILD_DEBUG: ${{ contains(matrix.config, 'debug') }}
shell: bash
- name: Build plugins
run: ninja install -j $(($(getconf _NPROCESSORS_ONLN) + 2))
working-directory: build-example-plugins
- name: Remove object files
run: find build -type f -name '*.o' -delete
# Tar the build directory to preserve permissions and reduce HTTP requests on upload.
- name: 'Tar build'
run: tar --use-compress-program='zstd -10 -T0' -cvf build.tar build
- name: 'Tar install'
run: tar --use-compress-program='zstd -10 -T0' -cvf install.tar install
# Upload the tarballs. Retain the file for a limited time in case developers need to download
# and run tests locally for further debugging.
- name: 'Upload build'
uses: actions/upload-artifact@v4.3.3
with:
name: build-${{ join(matrix.config, '_') }}-${{ github.sha }}
path: build.tar
retention-days: 7
- name: 'Upload install'
uses: actions/upload-artifact@v4.3.3
with:
name: install-${{ join(matrix.config, '_') }}-${{ github.sha }}
path: install.tar
retention-days: 7
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash
pytest:
name: Run pytest [${{ join(matrix.config, '_') }}]
needs: build
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
include:
- {config: [clang14_py311, mpi, tbb, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nomd], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nohpmc], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nomd, nohpmc], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda120_gcc11_py310, mpi, llvm, debug], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda120_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda120_gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [gcc9_py39], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@v4.1.4
with:
path: code
submodules: true
- name: Download install
uses: actions/download-artifact@v4.1.7
with:
name: install-${{ join(matrix.config, '_') }}-${{ github.sha }}
- name: Untar install
run: tar --use-compress-program='zstd -10 -T0' -xvf install.tar
- name: Run pytest (serial)
run: python3 -m pytest --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1
- name: Run pytest (mpi)
if: ${{ contains(matrix.config, 'mpi') }}
run: mpirun -n 2 ${GITHUB_WORKSPACE}/install/hoomd/pytest/pytest-openmpi.sh --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 || (( cat pytest.out.1 && exit 1 ))
- name: Run pytest (serial without cupy)
if: ${{ contains(matrix.config[0], 'cuda') }}
run: python3 -m pytest --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -m cupy_optional
env:
_HOOMD_DISALLOW_CUPY_: 1
- name: Run pytest (mpi without cupy)
if: ${{ contains(matrix.config[0], 'cuda') && contains(matrix.config, 'mpi') }}
run: mpirun -n 2 ${GITHUB_WORKSPACE}/install/hoomd/pytest/pytest-openmpi.sh --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -m cupy_optional || (( cat pytest.out.1 && exit 1 ))
env:
_HOOMD_DISALLOW_CUPY_: 1
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash
ctest:
name: Run ctest [${{ join(matrix.config, '_') }}]
needs: build
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
include:
- {config: [clang14_py311, mpi, tbb, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nomd], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nohpmc], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312, nomd, nohpmc], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda120_gcc11_py310, mpi, llvm, debug], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda120_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda120_gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [gcc9_py39], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@v4.1.4
with:
path: code
submodules: true
- name: Download build
uses: actions/download-artifact@v4.1.7
with:
name: build-${{ join(matrix.config, '_') }}-${{ github.sha }}
- name: Untar build
run: tar --use-compress-program='zstd -10 -T0' -xvf build.tar
- name: Run tests
run: >-
ctest
-T test
--output-on-failure
--test-output-size-failed 1048576
--test-output-size-passed 1048576
working-directory: build
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash
validate:
name: Validate [${{ join(matrix.config, '_') }}]
needs: build
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
include:
- {config: [clang14_py311, mpi, tbb, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc13_py312], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda120_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda120_gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
if: ${{ contains(github.event.pull_request.labels.*.name, 'validate') }}
steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@v4.1.4
with:
path: code
submodules: true
- name: Download install
uses: actions/download-artifact@v4.1.7
with:
name: install-${{ join(matrix.config, '_') }}-${{ github.sha }}
- name: Untar install
run: tar --use-compress-program='zstd -10 -T0' -xvf install.tar
- name: Run pytest (serial)
if: ${{ !contains(matrix.config, 'mpi') }}
run: python3 -m pytest --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -p hoomd.pytest_plugin_validate -m validate --validate
- name: Run pytest (mpi)
if: ${{ contains(matrix.config, 'mpi') }}
run: mpirun -n 2 ${GITHUB_WORKSPACE}/install/hoomd/pytest/pytest-openmpi.sh --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -p hoomd.pytest_plugin_validate -m validate --validate || (( cat pytest.out.1 && exit 1 ))
- name: Run howto guides (serial)
if: ${{ contains(matrix.config, 'llvm') }} # some examples require LLVM
run: 'for i in *.py; do echo "Running howto: $i" && python3 $i || exit 1; done'
working-directory: code/sphinx-doc/howto
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash
build_release:
name: Build [${{ join(matrix.config, '_') }}]
runs-on: ${{ matrix.build_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
strategy:
matrix:
include:
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang13_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang12_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang11_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc10_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda118_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda117_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda116_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda115_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda114_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda113_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda112_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda111_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [clang10_py38, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@v4.1.4
with:
path: code
submodules: true
- name: Configure
run: |
mkdir -p build
cd build
if [[ ${BUILD_DEBUG} == "true" ]]; then BUILD_TYPE="Debug"; else BUILD_TYPE="Release"; fi
echo "BUILD_TYPE=${BUILD_TYPE}"
cmake ../code -GNinja \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_GPU=${ENABLE_GPU:-"OFF"} \
-DENABLE_MPI=${ENABLE_MPI:-"OFF"} \
-DENABLE_TBB=${ENABLE_TBB:-"OFF"} \
-DENABLE_LLVM=${ENABLE_LLVM:-"OFF"} \
-DBUILD_MD=${BUILD_MD:-"ON"} \
-DBUILD_MPCD=${BUILD_MD:-"ON"} \
-DBUILD_METAL=${BUILD_MD:-"ON"} \
-DBUILD_HPMC=${BUILD_HPMC:-"ON"} \
-DCUDA_ARCH_LIST="60;70" \
-DENABLE_DEBUG_JIT=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install \
-DPLUGINS=""
env:
ENABLE_GPU: ${{ contains(matrix.config[0], 'cuda') }}
ENABLE_MPI: ${{ contains(matrix.config, 'mpi') }}
ENABLE_TBB: ${{ contains(matrix.config, 'tbb') }}
ENABLE_LLVM: ${{ contains(matrix.config, 'llvm') }}
BUILD_MD: ${{ !contains(matrix.config, 'nomd') }}
BUILD_HPMC: ${{ !contains(matrix.config, 'nohpmc') }}
BUILD_DEBUG: ${{ contains(matrix.config, 'debug') }}
shell: bash
- name: Build
run: ninja install -j $(($(getconf _NPROCESSORS_ONLN) + 2))
working-directory: build
- name: Configure plugins
run : |
mkdir -p build-example-plugins
cd build-example-plugins
if [[ ${BUILD_DEBUG} == "true" ]]; then BUILD_TYPE="Debug"; else BUILD_TYPE="Release"; fi
echo "BUILD_TYPE=${BUILD_TYPE}"
CMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install cmake ../code/example_plugins -GNinja -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
env:
BUILD_DEBUG: ${{ contains(matrix.config, 'debug') }}
shell: bash
- name: Build plugins
run: ninja install -j $(($(getconf _NPROCESSORS_ONLN) + 2))
working-directory: build-example-plugins
- name: Remove object files
run: find build -type f -name '*.o' -delete
# Tar the build directory to preserve permissions and reduce HTTP requests on upload.
- name: 'Tar build'
run: tar --use-compress-program='zstd -10 -T0' -cvf build.tar build
- name: 'Tar install'
run: tar --use-compress-program='zstd -10 -T0' -cvf install.tar install
# Upload the tarballs. Retain the file for a limited time in case developers need to download
# and run tests locally for further debugging.
- name: 'Upload build'
uses: actions/upload-artifact@v4.3.3
with:
name: build-${{ join(matrix.config, '_') }}-${{ github.sha }}
path: build.tar
retention-days: 7
- name: 'Upload install'
uses: actions/upload-artifact@v4.3.3
with:
name: install-${{ join(matrix.config, '_') }}-${{ github.sha }}
path: install.tar
retention-days: 7
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash
pytest_release:
name: Run pytest [${{ join(matrix.config, '_') }}]
needs: build_release
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
include:
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang13_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang12_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang11_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc10_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda118_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda117_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda116_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda115_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda114_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda113_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda112_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda111_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [clang10_py38, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@v4.1.4
with:
path: code
submodules: true
- name: Download install
uses: actions/download-artifact@v4.1.7
with:
name: install-${{ join(matrix.config, '_') }}-${{ github.sha }}
- name: Untar install
run: tar --use-compress-program='zstd -10 -T0' -xvf install.tar
- name: Run pytest (serial)
run: python3 -m pytest --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1
- name: Run pytest (mpi)
if: ${{ contains(matrix.config, 'mpi') }}
run: mpirun -n 2 ${GITHUB_WORKSPACE}/install/hoomd/pytest/pytest-openmpi.sh --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 || (( cat pytest.out.1 && exit 1 ))
- name: Run pytest (serial without cupy)
if: ${{ contains(matrix.config[0], 'cuda') }}
run: python3 -m pytest --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -m cupy_optional
env:
_HOOMD_DISALLOW_CUPY_: 1
- name: Run pytest (mpi without cupy)
if: ${{ contains(matrix.config[0], 'cuda') && contains(matrix.config, 'mpi') }}
run: mpirun -n 2 ${GITHUB_WORKSPACE}/install/hoomd/pytest/pytest-openmpi.sh --pyargs hoomd -x -v -ra --durations=0 --durations-min=0.1 -m cupy_optional || (( cat pytest.out.1 && exit 1 ))
env:
_HOOMD_DISALLOW_CUPY_: 1
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash
ctest_release:
name: Run ctest [${{ join(matrix.config, '_') }}]
needs: build_release
runs-on: ${{ matrix.test_runner }}
container:
image: glotzerlab/ci:2024.03.01-${{ matrix.config[0] }}
options: ${{ matrix.test_docker_options }} -e CUDA_VISIBLE_DEVICES
strategy:
matrix:
include:
- {config: [gcc12_py311], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang16_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang15_py311, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang13_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang12_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [clang11_py310, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc11_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [gcc10_py310], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
- {config: [cuda118_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda117_gcc11_py310, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda116_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda115_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda114_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda113_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda112_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [cuda111_gcc9_py38, mpi, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: [self-hosted,GPU], test_docker_options: '--gpus=all --device /dev/nvidia0 --device /dev/nvidia1 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidiactl' }
- {config: [clang10_py38, llvm], build_runner: [self-hosted,jetstream2,CPU], test_runner: ubuntu-latest, test_docker_options: '' }
if: ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
steps:
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Checkout
uses: actions/checkout@v4.1.4
with:
path: code
submodules: true
- name: Download build
uses: actions/download-artifact@v4.1.7
with:
name: build-${{ join(matrix.config, '_') }}-${{ github.sha }}
- name: Untar build
run: tar --use-compress-program='zstd -10 -T0' -xvf build.tar
- name: Run tests
run: >-
ctest
-T test
--output-on-failure
--test-output-size-failed 1048576
--test-output-size-passed 1048576
working-directory: build
- name: Clean workspace
run: ( shopt -s dotglob nullglob; rm -rf ./* )
shell: bash
- name: Clean HOME
run: ( shopt -s dotglob nullglob; rm -rf $HOME/* )
shell: bash
# This job is used to provide a single requirement for branch merge conditions. GitHub considers
# the check passing even if it is skipped, so this job raises errors when required jobs were not
# run.
unit_tests_complete:
name: Unit test
needs: [pytest, ctest, validate]
if: ${{ always() && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Error if pytest did not succeed
if: needs.pytest.result != 'success'
run: echo "::error ::pytest tests failed." && exit 1
- name: Error if ctest did not succeed
if: needs.ctest.result != 'success'
run: echo "::error ::ctest tests failed." && exit 1
- name: Warn if validate did not run
if: needs.validate.result == 'skipped'
run: echo "::warning ::Skipped validation tests." && exit 1
- name: Error if validate did not succeed
if: needs.validate.result != 'success'
run: echo "::error ::Validation tests failed." && exit 1
- run: echo "Done!"