forked from nanoporetech/dorado
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
475 lines (414 loc) · 12.3 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
include:
- local: .gitlab/sanitizers-ci.yml
stages:
- pre-flight
- build
- test
- deploy
variables:
BUILD_DIR: build
GIT_SUBMODULE_STRATEGY: recursive
CUDA: "11.8"
WIN_CUDA_TOOLKIT: "/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v${CUDA}"
# Build stage components
.macos_m1_runner: &macos_m1_runner
tags:
- xcode-13.3.1
- m1
variables:
MACOSX_DEPLOYMENT_TARGET: "12.3"
.macos_x64_runner: &macos_x64_runner
tags:
- osx_x86
variables:
MACOSX_DEPLOYMENT_TARGET: "10.15"
.linux_runner: &linux_runner
tags:
- linux
- nvidia-docker
.linux_arm64_runner: &linux_arm64_runner
tags:
- linux_aarch64
- docker-arm
.linux_tegra_runner: &linux_tegra_runner
tags:
- nvidia-docker-tegra-gpu
.linux_orin_runner: &linux_orin_runner
tags:
- linux-arm64-gpu
- nvidia-docker
.windows_runner: &windows_runner
tags:
- windows-10
- VS2019
- cuda-${CUDA}
.linux_dependencies: &linux_dependencies
before_script:
- echo Dorado dependency stage
- apt-get update && apt-get install -y --no-install-recommends samtools curl libhdf5-dev libssl-dev libzstd-dev libsz2
.build_dorado: &build_dorado
stage: build
script:
- echo Dorado build stage
- cmake ${BUILD_OPTIONS} -S . -B ${BUILD_DIR}
- cmake --build ${BUILD_DIR} --config Release --target install -j 8
- ctest -C Release --test-dir ${BUILD_DIR} --output-on-failure --verbose
artifacts:
paths:
- dist
- tests/*.sh
- tests/*.bat
- tests/data
expire_in: 1 day
interruptible: true
.build_dorado_archive: &build_dorado_archive
stage: build
script:
- cmake ${BUILD_OPTIONS} -S . -B ${BUILD_DIR}
- cmake --build ${BUILD_DIR} --config Release -j 8
- cpack --config ${BUILD_DIR}/CPackConfig.cmake
artifacts:
paths:
- archive
expire_in: 1 day
interruptible: true
.build_dorado_lib_only: &build_dorado_lib_only
stage: build
script:
- cmake ${BUILD_OPTIONS} -S . -B ${BUILD_DIR} -DDORADO_LIB_ONLY=1
- cmake --build ${BUILD_DIR} -j 8
interruptible: true
# Pre-flight stages
pre-commit:
image: ${DORADO_PRECOMMIT}
variables:
GIT_SUBMODULE_STRATEGY: none
stage: pre-flight
script:
- pip install pre-commit
- pre-commit run --all-files
tags:
- linux
interruptible: true
# Build stages
build:linux:x86:focal:install_deps:
image: ${DORADO_DOCKER_ROOT}/dorado-no-deps-20.04-cuda-${CUDA}.0:1.0
<<: *linux_dependencies
<<: *linux_runner
<<: *build_dorado
when: manual
build:linux:x86:focal:
image: ${DORADO_DOCKER_ROOT}/dorado-deps-20.04-cuda-${CUDA}.0:1.1
variables:
BUILD_OPTIONS: "-DBUILD_KOI_FROM_SOURCE=ON -DGITLAB_CI_TOKEN=${CI_JOB_TOKEN}"
<<: *linux_runner
<<: *build_dorado
build:linux:arm64:bionic:
image: ${DORADO_DOCKER_ROOT}/dorado-l4t-r32.4.3-deps:1.1
<<: *linux_arm64_runner
<<: *build_dorado
build:linux:arm64:focal:
image: nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.13-py3
<<: *linux_dependencies
<<: *linux_arm64_runner
<<: *build_dorado
build:linux:x86:focal_koi_download:
image: ${DORADO_DOCKER_ROOT}/dorado-deps-20.04-cuda-${CUDA}.0:1.1
<<: *linux_runner
<<: *build_dorado
build:windows:
<<: *windows_runner
<<: *build_dorado
before_script:
- export PATH=${PATH}:${PWD}/dist/bin
- export CUDA_TOOLKIT=$(cygpath -u $(cygpath -d "${WIN_CUDA_TOOLKIT}"))
- export BUILD_OPTIONS="-A x64 -T cuda=${CUDA} -DCUDAToolkit_ROOT=${CUDA_TOOLKIT} -DBUILD_KOI_FROM_SOURCE=ON -DGITLAB_CI_TOKEN=${CI_JOB_TOKEN}"
- echo BUILD_OPTIONS is ${BUILD_OPTIONS}
build:windows_koi_download:
<<: *windows_runner
<<: *build_dorado
before_script:
- export PATH=${PATH}:${PWD}/dist/bin
- export CUDA_TOOLKIT=$(cygpath -u $(cygpath -d "${WIN_CUDA_TOOLKIT}"))
- export BUILD_OPTIONS="-A x64 -T cuda=${CUDA} -DCUDAToolkit_ROOT=${CUDA_TOOLKIT}"
- echo BUILD_OPTIONS is ${BUILD_OPTIONS}
build:macos:m1:
variables:
<<: *macos_m1_runner
<<: *build_dorado
build:macos:x64:
variables:
<<: *macos_x64_runner
<<: *build_dorado
build:ios:m1:
variables:
BUILD_OPTIONS: "-DCMAKE_TOOLCHAIN_FILE=cmake/ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64 -DSKIP_HDF_PLUGINS=1 -DDEPLOYMENT_TARGET=16.0"
<<: *macos_m1_runner
<<: *build_dorado_lib_only
build_archive:linux:x86:focal:
image: ${DORADO_DOCKER_ROOT}/dorado-deps-20.04-cuda-${CUDA}.0:1.1
variables:
BUILD_OPTIONS: "-DBUILD_KOI_FROM_SOURCE=ON -DGITLAB_CI_TOKEN=${CI_JOB_TOKEN}"
<<: *linux_runner
<<: *build_dorado_archive
when: manual
build_archive:linux:x86:cuda12:
image: nvcr.io/nvidia/pytorch:23.01-py3
variables:
BUILD_OPTIONS: "-DDORADO_LIBTORCH_DIR=/usr/local/lib/python3.8/dist-packages/torch"
<<: *linux_dependencies
<<: *linux_runner
<<: *build_dorado_archive
when: manual
build_archive:linux:arm64:bionic:
image: ${DORADO_DOCKER_ROOT}/dorado-l4t-r32.4.3-deps:1.1
<<: *linux_arm64_runner
<<: *build_dorado_archive
when: manual
build_archive:linux:arm64:focal:
image: nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.13-py3
<<: *linux_dependencies
<<: *linux_arm64_runner
<<: *build_dorado_archive
when: manual
build_archive:linux:x86:centos7:
image: ${DORADO_DOCKER_ROOT}/dorado-deps-centos7-cuda-${CUDA}.0:1.1
variables:
BUILD_OPTIONS: "-DBUILD_KOI_FROM_SOURCE=ON -DGITLAB_CI_TOKEN=${CI_JOB_TOKEN} -DDORADO_USING_OLD_CPP_ABI=ON -DDYNAMIC_HDF=ON"
<<: *linux_runner
<<: *build_dorado_archive
when: manual
build_archive:windows:
before_script:
- export CUDA_TOOLKIT=$(cygpath -u $(cygpath -d "${WIN_CUDA_TOOLKIT}"))
- export BUILD_OPTIONS="-A x64 -T cuda=${CUDA} -DCUDAToolkit_ROOT=${CUDA_TOOLKIT} -DBUILD_KOI_FROM_SOURCE=ON -DGITLAB_CI_TOKEN=${CI_JOB_TOKEN}"
- echo BUILD_OPTIONS is ${BUILD_OPTIONS}
<<: *windows_runner
<<: *build_dorado_archive
when: manual
build_archive:macos:m1:
variables:
<<: *macos_m1_runner
<<: *build_dorado_archive
when: manual
build_archive:macos:x64:
variables:
<<: *macos_x64_runner
<<: *build_dorado_archive
when: manual
# Test stage components
.test_dorado: &test_dorado
stage: test
variables:
GIT_STRATEGY: none
MODEL: [email protected]
BATCH: 384
script:
- bash ./tests/test_simple_basecaller_execution.sh ./dist/bin/dorado ${MODEL} ${BATCH}
- bash ./tests/test_expected_logging.sh ./dist/bin/dorado ${MODEL} ${BATCH}
interruptible: true
.test_dorado_windows: &test_dorado_windows
stage: test
variables:
GIT_STRATEGY: none
script:
- .\\tests\\test_simple_basecaller_execution.bat .\\dist\\bin\\dorado.exe
interruptible: true
.test_archive: &test_archive
stage: test
variables:
GIT_STRATEGY: none
script:
- tar -xzf archive/dorado-*.gz
- ldd ./dorado-*/bin/dorado
- if [ -e ./dorado-*/lib/libdorado_torch_lib.so ]; then ldd ./dorado-*/lib/libdorado_torch_lib.so; fi
# We just want to check that dorado will run here, so simply display the verbose version info
- ./dorado-*/bin/dorado -vv
interruptible: true
# Test stages
test:windows:
<<: *windows_runner
<<: *test_dorado_windows
needs:
- build:windows
test:linux:x86:focal:
image: ${DORADO_DOCKER_ROOT}/dorado-deps-20.04-cuda-${CUDA}.0:1.1
<<: *linux_dependencies
<<: *linux_runner
<<: *test_dorado
needs:
- build:linux:x86:focal
test:linux:arm64:bionic:
image: ${DORADO_DOCKER_ROOT}/dorado-l4t-r32.4.3-deps:1.1
<<: *linux_dependencies
<<: *linux_tegra_runner
<<: *test_dorado
variables:
GIT_STRATEGY: none
MODEL: [email protected]
BATCH: 0
needs:
- build:linux:arm64:bionic
test:linux:arm64:focal:
image: nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.13-py3
<<: *linux_dependencies
<<: *linux_orin_runner
<<: *test_dorado
needs:
- build:linux:arm64:focal
test:macos:m1:
<<: *macos_m1_runner
<<: *test_dorado
needs:
- build:macos:m1
test:macos:x64:
<<: *macos_x64_runner
<<: *test_dorado
needs:
- build:macos:x64
variables:
GIT_STRATEGY: none
MODEL: [email protected]
BATCH: 0
# Test that you can run dorado in a clean cuda 20.04 environment
test_archive:linux:x86:20.04_nvidia:
image: nvidia/cuda:${CUDA}.0-devel-ubuntu20.04
<<: *linux_runner
<<: *test_archive
needs:
- build_archive:linux:x86:centos7
# Test that you can run dorado in a clean cpu 18.04 environment
test_archive:linux:x86:18.04:
image: ${DORADO_DOCKER_EXT}/ubuntu:18.04
<<: *linux_runner
<<: *test_archive
needs:
- build_archive:linux:x86:centos7
# Test that you can run dorado in a clean cpu 20.04 environment
test_archive:linux:x86:20.04:
image: ${DORADO_DOCKER_EXT}/ubuntu:20.04
<<: *linux_runner
<<: *test_archive
needs:
- build_archive:linux:x86:centos7
# Test that you can run dorado in a clean l4t environment
test_archive:linux:arm64:18.04:
image: nvcr.io/nvidia/l4t-base:r32.4.3
<<: *linux_tegra_runner
<<: *test_archive
needs:
- build_archive:linux:arm64:bionic
test_archive:linux:arm64:20.04:
image: nvcr.io/nvidia/l4t-pytorch:r35.1.0-pth1.13-py3
<<: *linux_dependencies
<<: *linux_orin_runner
<<: *test_archive
needs:
- build_archive:linux:arm64:focal
# MLHub
.mlhub: &mlhub
stage: test
when: manual
image: ${TRIGGER_IMAGE}
needs: []
variables:
GIT_STRATEGY: none
interruptible: true
# MLHub - Single read eval
.mlhub_sre:
<<: *mlhub
script:
- echo ${MODELS}
- |
curl -i --header "Content-Type: application/json" \
--request POST \
--data '{
"key": "'${MLHUB_TRIGGER_SRE}'",
"job_name": "Dorado SRE: '${CONDITION}' '${CI_COMMIT_REF_NAME}' - '"$CI_COMMIT_TITLE"' ",
"script_parameters": {
"models":'${MODELS}',
"duplex_models":'${DUPLEX_MODELS}',
"sre_output":"'${SRE_OUTPUT_ROOT}'/'${CI_COMMIT_SHA}'/",
"sre_config":"${projectDir}/configs/'${SRE_CONFIG}'",
"dorado_branch":"'${CI_COMMIT_SHA}'",
"dorado_exe":""
}
}' \
${MLHUB_TRIGGER_URL}
mlhub:sre_4k_260bps:
extends:
.mlhub_sre
variables:
CONDITION: '4k_260bps'
SRE_CONFIG: "dna_r10.4.1-e8.2-4khz-260bps-prom.json"
DUPLEX_MODELS: '[]'
mlhub:sre_4k_400bps:
extends:
.mlhub_sre
variables:
CONDITION: '4k_400bps'
SRE_CONFIG: "dna_r10.4.1-e8.2-4khz-400bps-prom.json"
DUPLEX_MODELS: '[]'
mlhub:sre_5k_400bps:
extends:
.mlhub_sre
variables:
CONDITION: '5k_400bps'
SRE_CONFIG: "dna_r10.4.1-e8.2-5khz-400bps-prom.json"
DUPLEX_MODELS: '[]'
mlhub:sre_5k_400bps_duplex:
extends:
.mlhub_sre
variables:
CONDITION: '5k_400bps_duplex'
SRE_CONFIG: "dna_r10.4.2-e8.2-5khz-400bps-prom.json"
MODELS: '["[email protected]","[email protected]"]'
DUPLEX_MODELS: '["[email protected]"]'
# MLHub - Remora
mlhub:remora-validate:
<<: *mlhub
script:
- |
curl --header "Content-Type: application/json" \
--request POST \
--data '{
"key": "'${MLHUB_TRIGGER_KEY_REMORA}'",
"job_name": "Dorado Remora: '${CI_COMMIT_REF_NAME}' - '"$CI_COMMIT_TITLE"' ",
"script_parameters": {
"dorado_branch":"'${CI_COMMIT_SHA}'",
"dorado_build_options":"",
"dorado_build_threads":"-- -j 8",
"dorado_device":"'${DEVICE}'",
"dorado_model":"[email protected]",
"dorado_modbase_model":"[email protected]_5mCG_5hmCG@v2",
"remora_model":"/media/groups/machine_learning/active/rharris/shared/nf-dorado-remora-analysis_datasets/dna_r10.4.1_e8.2_400bps_hac_v4.0.0_5hmc_5mc_CG_v2.pt"
}
}' \
${MLHUB_TRIGGER_URL}
parallel:
matrix:
- DEVICE:
- "cuda:all"
- "cpu"
# Deploy
deploy:all:
stage: deploy
variables:
GIT_STRATEGY: none
script:
- ls -lh archive
when: manual
artifacts:
paths:
- archive
expire_in: 1 day
needs:
- build_archive:linux:x86:centos7
- build_archive:linux:arm64:bionic
- build_archive:linux:arm64:focal
- build_archive:macos:m1
- build_archive:macos:x64
- build_archive:windows