-
Notifications
You must be signed in to change notification settings - Fork 491
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
1073 lines (1010 loc) · 36.5 KB
/
.gitlab-ci.yml
File metadata and controls
1073 lines (1010 loc) · 36.5 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
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
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# ==============================================================================
# CI/CD Pipeline Configuration
# ==============================================================================
include:
- /.gitlab/ci/common.yml
- project: "omniverse/warp-gitlab-ci"
ref: "main"
file: "/.gitlab-ci.yml"
workflow:
rules:
- if: $CI_PROJECT_ROOT_NAMESPACE != "omniverse" # Prevent pipelines that can't access the runners
when: never
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_SHA
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
auto_cancel:
on_new_commit: none
on_job_failure: none
- if: $CI_COMMIT_TAG # Run for tagged releases
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- if: $CI_PIPELINE_SOURCE == "web" # Run if triggered from the UI
variables:
PM_PACKAGES_ROOT: "$CI_PROJECT_DIR/packman-repo"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
WARP_CACHE_ROOT: "$CI_PROJECT_DIR/.cache/warp" # Used by the parallel test runner
GIT_DEPTH: 1
PYTHONFAULTHANDLER: "1" # Dump tracebacks on fatal signals (SIGSEGV, SIGABRT, etc.)
UV_LINK_MODE: copy
UV_HTTP_TIMEOUT: 120
UV_PYTHON_PREFERENCE: only-managed
# Standard container images (pinned with SHA256 for supply chain security)
UV_TRIXIE_IMAGE: "ghcr.io/astral-sh/uv:0.10.0-trixie@sha256:b6fa78dd57c8a1a6c5da74a36a13e309f67f0e925bc89bbd16d6f0628475e052"
UV_TRIXIE_SLIM_IMAGE: "ghcr.io/astral-sh/uv:0.10.0-trixie-slim@sha256:ea4142f234c115bda9927e49c63efc8a5a7c1db35b2355dc8bc45080fa299bf5"
UV_TRIXIE_SLIM_ARM_IMAGE: "ghcr.io/astral-sh/uv:0.10.0-trixie-slim@sha256:12c27f31bbaec60e4e98900bcad6bc775a3dc182ef1a79bc1a3ed6248d3f2fb5"
MINIFORGE_IMAGE: "condaforge/miniforge3:25.11.0-0@sha256:d2fadb08950045962fd1cfb1eeb6224442027f03095862e725f4c1c7b17a3caf"
WARP_BUILDER_IMAGE_CU12: "${CI_REGISTRY_IMAGE}/warp-builder:cuda12.9.1-llvm21-latest"
WARP_BUILDER_IMAGE_CU13: "${CI_REGISTRY_IMAGE}/warp-builder:cuda13.0.2-llvm21-latest"
UV_PYTHON:
value: "3.12"
options:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
description: "The default UV Python version used in the main testing jobs."
stages:
- build
- quality
- test
- child pipelines
- package
- deploy
# ==============================================================================
# Build Jobs
#
# Compiles Warp binaries for all platforms (Linux, Windows, macOS) using CUDA 12
# by default. Also includes CUDA 13 build for compatibility testing.
# ==============================================================================
linux-aarch64 build:
stage: build
image: $WARP_BUILDER_IMAGE_CU12
extends:
- .lnx-aarch64-cpu-medium
- .save_warp_bin_artifact
before_script:
- gcc --version
script:
- uv run build_lib.py --cuda-path=/usr/local/cuda
- mkdir -p warp/bin/linux-aarch64
- mv warp/bin/warp.so warp/bin/linux-aarch64
- mv warp/bin/warp-clang.so warp/bin/linux-aarch64
linux-x86_64 build:
stage: build
image: $WARP_BUILDER_IMAGE_CU12
extends:
- .save_warp_bin_artifact
- .ipp_lnx_x86_64_cpu_medium
before_script:
- gcc --version
script:
- uv run build_lib.py --cuda-path=/usr/local/cuda
- mkdir -p warp/bin/linux-x86_64
- mv warp/bin/warp.so warp/bin/linux-x86_64
- mv warp/bin/warp-clang.so warp/bin/linux-x86_64
windows-x86_64 build:
stage: build
extends:
- .save_warp_bin_artifact
- .runner-build-windows-x86_64
before_script:
- !reference [.snippets, install-uv-windows]
- !reference [.snippets, setup-packman-config-windows]
- tools\packman\packman pull --platform windows-x86_64 deps\cuda-toolkit-deps.packman.xml --verbose --include-tag "cuda-12"
- tools\packman\packman install -l _build\host-deps\winsdk winsdk 10.17763
- tools\packman\packman install -l _build\host-deps\msvc msvc 2019-16.11.24
script:
- |
$env:PATH = "$env:CI_PROJECT_DIR\_uv;$env:PATH"
uv run build_lib.py --msvc-path=_build\host-deps\msvc\VC\Tools\MSVC\14.29.30133 --sdk-path=_build\host-deps\winsdk --cuda-path=_build\target-deps\cuda
mac-aarch64 build:
stage: build
extends:
- .save_warp_bin_artifact
- .runner-build-macos-universal
- .macos_warp_tags
before_script:
- df -h
- curl -LsSf https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="$CI_PROJECT_DIR/_uv" sh
- export PATH="$CI_PROJECT_DIR/_uv/bin:$PATH"
script:
- uv run build_lib.py
linux-x86_64 cuda 13 build:
stage: build
image: $WARP_BUILDER_IMAGE_CU13
extends:
- .save_warp_bin_artifact
- .ipp_lnx_x86_64_cpu_medium
script:
- uv run build_lib.py --cuda-path=/usr/local/cuda
- mkdir -p warp/bin/linux-x86_64
- mv warp/bin/warp.so warp/bin/linux-x86_64
- mv warp/bin/warp-clang.so warp/bin/linux-x86_64
# ==============================================================================
# Code Quality and Documentation Checks
#
# Linting, static analysis, documentation testing, and symbol validation.
# Most jobs run independently without waiting for builds (except those that
# need compiled binaries for testing or validation).
# ==============================================================================
pre-commit checks:
stage: quality
image: $UV_TRIXIE_IMAGE
needs: []
extends:
- .ipp_lnx_x86_64_cpu_micro
script:
- uvx pre-commit run --all-files --show-diff-on-failure
type-check stubs:
stage: quality
image: $UV_TRIXIE_IMAGE
needs: []
timeout: 5m
variables:
GIT_LFS_SKIP_SMUDGE: "1"
GIT_DEPTH: "1"
extends:
- .ipp_lnx_x86_64_cpu_micro
script:
- uvx pyright warp/__init__.pyi
- uvx mypy warp/__init__.pyi --follow-imports=silent
# This job tests code snippets in the documentation
doctest:
stage: quality
image: $UV_TRIXIE_IMAGE
needs: [linux-x86_64 build]
extends:
- .ipp_lnx_x86_64_gpu
before_script:
- df -h
- !reference [.snippets, move-linux-x86_64-binaries]
script:
- uv run --extra docs build_docs.py --doctest --no-html
# The only purpose of this job is to make sure documentation can be built on Windows.
# The output does not get published anywhere, but the website can be viewed in the
# artifacts.
windows-x86_64 docs:
stage: quality
needs: [windows-x86_64 build]
extends:
- .runner-utility-windows-x86_64
artifacts:
paths:
- public
before_script:
- !reference [.snippets, define-powershell-GetTime]
- !reference [.snippets, powershell-section-start-install-deps]
- !reference [.snippets, install-uv-windows]
- !reference [.snippets, powershell-section-end-install-deps]
script:
- |
$env:PATH = "$env:CI_PROJECT_DIR\_uv;$env:PATH"
uv run --extra docs build_docs.py
- mv docs/_build/html/ ./public/
after_script:
- echo "View the website at https://$CI_PROJECT_ROOT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html"
check un-namespaced symbols linux-x86_64:
stage: quality
image: python:3.12-bullseye
needs: [linux-x86_64 build]
extends:
- .ipp_lnx_x86_64_cpu_micro
script:
- |
echo "Checking for un-namespaced symbols..."
LIBRARIES_TO_CHECK="warp/bin/linux-x86_64/warp.so warp/bin/linux-x86_64/warp-clang.so"
found_symbols=""
for lib in $LIBRARIES_TO_CHECK; do
echo "--> Checking $lib"
if [ ! -f "$lib" ]; then
echo "ERROR: $lib not found"
found_symbols="true"
continue
fi
output=$(readelf -Ws "$lib" | awk '$7 ~ /^[0-9]+$/ && $8 !~ /^(_?wp_|PyInit__warp_)/ {print $8}' | grep -Ev '^(_Z|__|\.)' || true)
if [ -n "$output" ]; then
echo "ERROR: Found un-namespaced symbols in $lib:"
echo "$output"
found_symbols="true"
fi
done
if [ -n "$found_symbols" ]; then
echo "FAIL: Un-namespaced symbols detected. Please prefix them with 'wp_' or '_wp_'."
exit 1
fi
echo "SUCCESS: All symbols are correctly namespaced."
cppcheck:
stage: quality
image: $MINIFORGE_IMAGE
needs: []
extends:
- .ipp_lnx_x86_64_cpu_medium
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- df -h
- conda install cppcheck --channel conda-forge
- python -m pip install -U cppcheck-codequality
- mkdir -p _build/.cppcheck
- cppcheck --version
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
# Pass 1: For the CI log and job failure.
- cppcheck_exit_code=0
- >-
cppcheck
--inline-suppr
--cppcheck-build-dir=_build/.cppcheck
--enable=warning
--quiet
--error-exitcode=1
-j $(nproc)
--suppress=*:warp/native/nanovdb/*
--suppress=*:warp/native/cuBQL/*
--suppress=normalCheckLevelMaxBranches
warp
|| cppcheck_exit_code=$?
# Pass 2: For the Code Quality report.
- >-
cppcheck
--inline-suppr
--cppcheck-build-dir=_build/.cppcheck
--enable=warning
--quiet
--xml
--xml-version=2
-j $(nproc)
--suppress=*:warp/native/nanovdb/*
--suppress=*:warp/native/cuBQL/*
--suppress=normalCheckLevelMaxBranches
warp
2> cppcheck-report.xml
- cppcheck-codequality --input-file=cppcheck-report.xml --output-file=gl-code-quality-report.json
- exit $cppcheck_exit_code
artifacts:
when: always
reports:
codequality: gl-code-quality-report.json
paths:
- cppcheck-report.xml
# ==============================================================================
# Unit Testing Jobs
#
# Comprehensive test suite across multiple platforms (Linux x86_64/aarch64,
# Windows, specialized hardware like Orin/Thor/Blackwell), Python versions
# (3.10-3.14), and optional integrations (MuJoCo, JAX, PyTorch). Some jobs
# compute code coverage, others focus on compatibility and performance (ASV).
# ==============================================================================
.test_common_with_coverage:
stage: test
extends:
- .basic_test_changes_rules
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
when: always
paths:
- rspec.xml
- coverage.xml
reports:
junit: rspec.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
linux-aarch64 test:
image: $UV_TRIXIE_SLIM_ARM_IMAGE
needs: [linux-aarch64 build]
extends:
- .test_common_with_coverage
before_script:
- df -h
- !reference [.snippets, move-linux-aarch64-binaries]
script:
- uv run --extra dev -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
tags:
- lnx-aarch64-gpu-1x-580.95.05
- gpu/L40
- gpu/rtx
linux-aarch64 test orin:
needs: [linux-aarch64 build]
image: $UV_TRIXIE_SLIM_ARM_IMAGE
extends:
- .save_test_report_artifact
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- if: $CI_PIPELINE_SOURCE == "web"
- when: manual # Can be triggered in all other scenarios
allow_failure: true
before_script:
- !reference [.snippets, section-start-install-deps]
- df -h
- !reference [.snippets, move-linux-aarch64-binaries]
- uv sync --extra dev --no-install-package psutil
- !reference [.snippets, section-end-install-deps]
script:
- uv run -m warp.tests --maxjobs 4 --junit-report-xml rspec.xml -s autodetect --failfast
tags:
- gpu/orin
linux-aarch64 test thor:
needs: [linux-aarch64 build]
image: $UV_TRIXIE_SLIM_ARM_IMAGE
extends:
- .save_test_report_artifact
- .basic_test_changes_rules
before_script:
- !reference [.snippets, section-start-install-deps]
- df -h
- !reference [.snippets, move-linux-aarch64-binaries]
- uv sync --extra dev
- !reference [.snippets, section-end-install-deps]
script:
- uv run --extra dev -m warp.tests --junit-report-xml rspec.xml -s autodetect --failfast
tags:
- gpu/thor
linux-aarch64 test dgx spark:
needs: [linux-aarch64 build]
image: $UV_TRIXIE_SLIM_ARM_IMAGE
extends:
- .save_test_report_artifact
- .basic_test_changes_rules
before_script:
- !reference [.snippets, section-start-install-deps]
- df -h
- !reference [.snippets, move-linux-aarch64-binaries]
- uv sync --extra dev
- !reference [.snippets, section-end-install-deps]
script:
- uv run --extra dev -m warp.tests --junit-report-xml rspec.xml -s autodetect --failfast
tags:
- os/linux
- arch/arm
- gpu/GB10
linux-x86_64 test:
needs: [linux-x86_64 build]
image: $UV_TRIXIE_IMAGE
extends:
- .ipp_lnx_x86_64_gpu_2x
- .test_common_with_coverage
before_script:
- df -h
- !reference [.snippets, move-linux-x86_64-binaries]
# HACK: disable P2P tests due to misbehaving agents
- export WARP_DISABLE_P2P_TESTS=1
script:
- uv run --extra dev --extra torch-cu12 --with "jax[cuda12]" -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
# Upload report to Codecov
- git config --global --add safe.directory $CI_PROJECT_DIR
- uvx --from codecov-cli codecovcli --verbose upload-process --git-service github --disable-search -t $CODECOV_TOKEN -r NVIDIA/warp --plugin pycoverage -F unittests -f coverage.xml
- uvx --from codecov-cli codecovcli --verbose upload-process --git-service github --disable-search -t $CODECOV_TOKEN -r NVIDIA/warp --report-type test_results -f rspec.xml
# A temporary job for testing on Blackwell until more runners are available
linux-x86_64-blackwell test:
needs: [linux-x86_64 build]
image: $UV_TRIXIE_SLIM_IMAGE
extends:
- .test_common_with_coverage
before_script:
- df -h
- !reference [.snippets, move-linux-x86_64-binaries]
script:
- uv run --extra dev --extra torch-cu12 --with "jax[cuda12]" -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
tags:
- arch/x86_64
- gpu/B40
- os/linux
- platform/horde
linux-x86_64 test debug mode:
stage: test
needs: [linux-x86_64 build]
image: $UV_TRIXIE_SLIM_IMAGE
extends:
- .ipp_lnx_x86_64_gpu
- .save_test_report_artifact
- .basic_test_changes_rules
timeout: 45m
before_script:
- df -h
- !reference [.snippets, move-linux-x86_64-binaries]
script:
- uv run --extra dev -m warp.tests --junit-report-xml rspec.xml --suite debug --warp-debug --failfast
# Note that for throughput reasons this runs on a single-GPU runner
windows-x86_64 test:
stage: test
needs: [windows-x86_64 build]
timeout: 75m
extends:
- .runner-test-windows-x86_64-gpu
- .test_common_with_coverage
before_script:
- !reference [.snippets, define-powershell-GetTime]
- !reference [.snippets, powershell-section-start-install-deps]
- !reference [.snippets, install-uv-windows]
- !reference [.snippets, powershell-section-end-install-deps]
script:
# Locking usd-core to 25.5.1 to work around a frequent loading crash
- |
$env:PATH = "$env:CI_PROJECT_DIR\_uv;$env:PATH"
uv run --extra dev --extra torch-cu12 --with usd-core==25.5.1 -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
# Upload report to Codecov
- git config --global --add safe.directory $env:CI_PROJECT_DIR
- |
& "$env:CI_PROJECT_DIR\_uv\uvx.exe" --from codecov-cli codecovcli --verbose upload-process --git-service github --disable-search -t $CODECOV_TOKEN -r NVIDIA/warp --plugin pycoverage -F unittests -f coverage.xml
- |
& "$env:CI_PROJECT_DIR\_uv\uvx.exe" --from codecov-cli codecovcli --verbose upload-process --git-service github --disable-search -t $CODECOV_TOKEN -r NVIDIA/warp --report-type test_results -f rspec.xml
# Optional multi-GPU Windows job (likely longer queue time)
windows-x86_64 test mgpu:
stage: test
needs: [windows-x86_64 build]
extends:
- .save_test_report_artifact
timeout: 75m
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_TAG
- when: manual # Can be triggered in all other scenarios
allow_failure: true
allow_failure: true # GitLab runners are too unstable to run this job
before_script:
- !reference [.snippets, define-powershell-GetTime]
- !reference [.snippets, powershell-section-start-install-deps]
- !reference [.snippets, install-uv-windows]
- !reference [.snippets, powershell-section-end-install-deps]
script:
# Locking usd-core to 25.5.1 to work around a frequent loading crash
- |
$env:PATH = "$env:CI_PROJECT_DIR\_uv;$env:PATH"
uv run --extra dev --extra torch-cu12 --with usd-core==25.5.1 -m warp.tests --junit-report-xml rspec.xml -s autodetect --failfast
tags:
- win-x86_64-gpu-2x-573.42
# Note: This will no longer be needed once Warp auto-initializes upon import
linux-x86_64 test warp-init:
stage: test
image: $UV_TRIXIE_SLIM_IMAGE
needs: [linux-x86_64 build]
extends:
- .ipp_lnx_x86_64_gpu
- .save_test_report_artifact
- .basic_test_changes_rules
timeout: 10m
before_script:
- df -h
- !reference [.snippets, move-linux-x86_64-binaries]
script:
- uv run --extra dev -m warp.tests --junit-report-xml rspec.xml -s autodetect --disable-process-pooling --disable-concurrent-futures --level test -p 'test_implicit_init.py'
# Optional job to test MuJoCo Warp
linux-x86_64 test mujoco warp:
stage: test
needs: [linux-x86_64 build]
image: $UV_TRIXIE_IMAGE
extends:
- .ipp_lnx_x86_64_gpu
- .save_test_report_artifact
variables:
UV_PYTHON: "3.12"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
- .gitlab-ci.yml
- .gitlab/ci/*
- warp/**/*
- pyproject.toml
- tools/**/*
- deps/*
- build_lib.py
- build_llvm.py
allow_failure: true # Don't want to block MRs
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true # Don't want to block MRs
before_script:
- !reference [.snippets, move-linux-x86_64-binaries]
# Python environment
- uv venv
- uv pip install -e .
- uv pip install mujoco
- uv pip install "git+https://github.com/google-deepmind/mujoco_warp@main"
- uv pip install pytest pytest-xdist "jax[cuda12]"
- source .venv/bin/activate
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- pytest -n 4 --pyargs mujoco_warp --junit-xml=rspec.xml
# Serial counterpart to help diagnose multi-process failures
linux-x86_64 test mujoco warp serial:
stage: test
needs: [linux-x86_64 build]
image: $UV_TRIXIE_IMAGE
extends:
- .ipp_lnx_x86_64_gpu
- .save_test_report_artifact
variables:
UV_PYTHON: "3.12"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- when: manual
allow_failure: true
before_script:
- !reference [.snippets, move-linux-x86_64-binaries]
# Python environment
- uv venv
- uv pip install -e .
- uv pip install mujoco
- uv pip install "git+https://github.com/google-deepmind/mujoco_warp@main"
- uv pip install pytest
- source .venv/bin/activate
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- pytest --pyargs mujoco_warp --junit-xml=rspec.xml
# Optional job to test Newton (https://pypi.org/project/newton/)
linux-x86_64 test newton:
stage: test
needs: [linux-x86_64 build]
image: $UV_TRIXIE_IMAGE
extends:
- .ipp_lnx_x86_64_gpu
- .save_test_report_artifact
variables:
UV_PYTHON: "3.12"
rules:
- when: manual
allow_failure: true
before_script:
- !reference [.snippets, move-linux-x86_64-binaries]
# Python environment
- uv venv
- uv pip install -e .
- uv pip install --prerelease allow "newton[dev]"
- source .venv/bin/activate
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- python -m newton.tests --junit-report-xml rspec.xml
# Ensure minimum and maximum Python versions are supported
linux-x86_64 python matrix test:
stage: test
image: $UV_TRIXIE_SLIM_IMAGE
needs: [linux-x86_64 build]
extends:
- .ipp_lnx_x86_64_gpu
- .save_test_report_artifact
- .basic_test_changes_rules
parallel:
matrix:
- UV_PYTHON: "3.10"
- UV_PYTHON: "3.13"
- UV_PYTHON: "3.14"
before_script:
- !reference [.snippets, section-start-install-deps]
- df -h
# Python 3.14 requires a C compiler for some dependencies
- if [ "$UV_PYTHON" = "3.14" ]; then apt-get update && apt-get install build-essential --no-install-recommends -y; fi
- !reference [.snippets, move-linux-x86_64-binaries]
- !reference [.snippets, section-end-install-deps]
script:
- uv run --extra dev -m warp.tests --junit-report-xml rspec.xml -s autodetect --failfast
# Build Warp for ASV benchmarks on a CPU runner to avoid wasting GPU time
# on compilation. The benchmark job downloads the build cache artifact.
# This is a build-stage job placed here alongside its companion benchmark
# job for readability.
linux-x86_64 asv build:
stage: build
needs: []
image: $WARP_BUILDER_IMAGE_CU12
extends:
- .ipp_lnx_x86_64_cpu_medium
variables:
GIT_DEPTH: "50"
CUDA_HOME: "/usr/local/cuda"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
- .gitlab-ci.yml
- asv/**/*
- asv.conf.json
- warp/**/*
- pyproject.toml
- deps/*
- build_lib.py
- build_llvm.py
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- df -h
# Remove /shared/local/bin from PATH - contains musl-linked binaries from the ephemeral
# runner (v1.5.1+) that are incompatible with this glibc-based container
- export PATH=$(echo "$PATH" | sed 's|:/shared/local/bin||g; s|/shared/local/bin:||g')
# Make sure the comparison ref can be checked out by asv
- COMPARE_REF="${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-main}}"
- 'echo "COMPARE_REF value: ${COMPARE_REF}"'
- git config --global --add safe.directory $CI_PROJECT_DIR
- git fetch origin $COMPARE_REF
- git checkout -f $COMPARE_REF
- git checkout -f $CI_COMMIT_SHA
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- uvx asv machine --machine asv-build --yes
- rc=0; uvx asv continuous --quick -b PythonBuiltins $COMPARE_REF $CI_COMMIT_SHA || rc=$?; if [ $rc -gt 1 ]; then exit $rc; fi
# Strict gate: discovery or import errors in the benchmark suite must fail
# the pipeline. The `asv continuous` call above returns 1 for both true
# regressions and hard errors, so a standalone `asv check` is needed.
# asv check resolves `main^{commit}` from asv.conf.json's `branches`, but
# the CI checkout leaves us on a detached HEAD with no local `main`, so
# pin one at the current commit first.
- git branch -f main $CI_COMMIT_SHA
- uvx asv check --verbose
artifacts:
paths:
- asv/env/
expire_in: 1 week
# Benchmark this commit with the current main branch using Airspeed Velocity
# Only runs on merge requests
linux-x86_64 asv:
stage: test
needs: ["linux-x86_64 asv build"]
image: $WARP_BUILDER_IMAGE_CU12
extends:
- .ipp_lnx_x86_64_gpu
variables:
GIT_DEPTH: "50"
CUDA_HOME: "/usr/local/cuda"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
- .gitlab-ci.yml
- asv/**/*
- asv.conf.json
- warp/**/*
- pyproject.toml
- deps/*
- build_lib.py
- build_llvm.py
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- df -h
# Remove /shared/local/bin from PATH - contains musl-linked binaries from the ephemeral
# runner (v1.5.1+) that are incompatible with this glibc-based container
- export PATH=$(echo "$PATH" | sed 's|:/shared/local/bin||g; s|/shared/local/bin:||g')
# Make sure the comparison ref can be checked out by asv
- COMPARE_REF="${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-main}}"
- 'echo "COMPARE_REF value: ${COMPARE_REF}"'
- git config --global --add safe.directory $CI_PROJECT_DIR
- git fetch origin $COMPARE_REF
- git checkout -f $COMPARE_REF
- git checkout -f $CI_COMMIT_SHA
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- uvx asv machine --machine asv-bench --yes
- uvx asv continuous -e --interleave-rounds --append-samples --no-only-changed -f 1.10 --bench '^(?!api)' $COMPARE_REF $CI_COMMIT_SHA 2>&1 || (asv compare --split $COMPARE_REF $CI_COMMIT_SHA 2>&1 && exit 2)
allow_failure: True
artifacts:
paths:
- asv/results/
expire_in: 1 week
when: always
# Ensure cpp examples compile and run
linux-x86_64 cpp examples test:
stage: test
image: ${CI_REGISTRY_IMAGE}/warp-cpp-test-env:12.9.1-ubuntu24.04
needs: [linux-x86_64 build]
extends:
- .ipp_lnx_x86_64_gpu
- .basic_test_changes_rules
before_script:
- df -h
- !reference [.snippets, move-linux-x86_64-binaries]
- ls -lh warp/bin/*.so # Verify binaries exist
script:
- cd warp/examples/cpp
- bash test_examples.sh
# ==============================================================================
# Child Pipeline Triggers
#
# Triggers for specialized build/test configurations (debug builds, CUDA 13,
# Clang compilation). These run conditionally based on schedule,
# tags, or manual trigger. Most developers don't need to worry about these.
# ==============================================================================
# Trigger debug build and test (no code coverage) pipelines
# Workaround from https://gitlab.com/gitlab-org/gitlab/-/issues/284086
trigger debug build and test pipeline:
stage: test
image: busybox
extends:
- .ipp_lnx_x86_64_cpu_micro
needs: []
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- when: manual # Can be triggered in all other scenarios
allow_failure: true
variables:
GIT_STRATEGY: none
script:
- echo "Run this job to test Warp compiled in debug mode."
# Uses the same Python version as the main pipeline.
debug build and test:
stage: child pipelines
needs: [trigger debug build and test pipeline]
trigger:
include: /.gitlab/ci/debug-build-and-test.yml
extends:
- .trigger_common
# Trigger CUDA 13 pipelines
# Workaround from https://gitlab.com/gitlab-org/gitlab/-/issues/284086
trigger cuda 13 pipeline:
stage: test
image: busybox
extends:
- .ipp_lnx_x86_64_cpu_micro
needs: [linux-x86_64 cuda 13 build]
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- when: manual # Can be triggered in all other scenarios
allow_failure: true
variables:
GIT_STRATEGY: none
script:
- echo "Run this job to test Warp compiled with CUDA 13."
# Uses the same Python version as the main pipeline.
cuda 13 build:
stage: child pipelines
needs: [trigger cuda 13 pipeline]
trigger:
include: /.gitlab/ci/cuda-13-build.yml
extends:
- .trigger_common
# Test Warp compilation with Clang instead of GCC and NVCC
clang compilation:
stage: child pipelines
trigger:
include: /.gitlab/ci/clang-build-and-test.yml
needs: []
extends:
- .basic_test_changes_rules
- .trigger_common
# ==============================================================================
# Packaging Jobs
#
# Creates Python wheels for PyPI distribution across all platforms. Produces both
# release wheels (with CUDA variants) and nightly development builds. Typically
# runs on schedules, tags, or manual trigger rather than every merge request.
# ==============================================================================
# Creates wheel files for PyPI
create pypi wheels:
stage: package
image: $UV_TRIXIE_SLIM_IMAGE
needs:
- linux-aarch64 build
- linux-x86_64 build
- windows-x86_64 build
- mac-aarch64 build
extends:
- .ipp_lnx_x86_64_cpu_micro
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
- pyproject.toml
- setup.py
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true
before_script:
# Move binaries into platform-specific folders. Already done in the build jobs for Linux.
- !reference [.snippets, move-windows-binaries-to-platform-dir]
- !reference [.snippets, move-macos-binaries-to-platform-dir]
script:
- printf '%s+cu12\n' "$(head -n1 VERSION.md | tr -d '\n\r')" > VERSION.md # Modify VERSION.md with +cu12
- uv build --wheel -C--build-option=-Pwindows-x86_64
- uv build --wheel -C--build-option=-Plinux-x86_64
- uv build --wheel -C--build-option=-Plinux-aarch64 -C--build-option=-Mmanylinux_2_34
- printf '%s+cpu\n' "$(head -n1 VERSION.md | sed 's/+cu12$//' | tr -d '\n\r')" > VERSION.md # Modify VERSION.md with +cu12 replaced by +cpu
- uv build --wheel -C--build-option=-Pmacos-aarch64
- printf '%s\n' "$(head -n1 VERSION.md | sed 's/+cpu$//' | tr -d '\n\r')" > VERSION.md # Revert VERSION.md changes
- mv dist dist-github
# Now make the wheels meant for PyPI publishing
- uv build --wheel -C--build-option=-Pwindows-x86_64
- uv build --wheel -C--build-option=-Plinux-x86_64
- uv build --wheel -C--build-option=-Plinux-aarch64 -C--build-option=-Mmanylinux_2_34
- uv build --wheel -C--build-option=-Pmacos-aarch64
- find . -type f -exec chmod 664 {} +
- find . -type d -exec chmod 775 {} +
artifacts:
name: $CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA
expose_as: "Python Wheels"
paths:
- "dist/"
- "dist-github/"
when: always
create dev wheels:
stage: package
image: $UV_TRIXIE_SLIM_IMAGE
needs:
- linux-aarch64 build
- linux-x86_64 build
- windows-x86_64 build
- mac-aarch64 build
extends:
- .ipp_lnx_x86_64_cpu_micro
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
before_script:
# Move binaries into platform-specific folders. Already done in the build jobs for Linux.
- !reference [.snippets, move-windows-binaries-to-platform-dir]
- !reference [.snippets, move-macos-binaries-to-platform-dir]
script:
# Version files (VERSION.md, config.py, version.h) are already updated from build artifacts
- uv build --wheel -C--build-option=-Pwindows-x86_64
- uv build --wheel -C--build-option=-Plinux-x86_64
- uv build --wheel -C--build-option=-Plinux-aarch64 -C--build-option=-Mmanylinux_2_34
- uv build --wheel -C--build-option=-Pmacos-aarch64
- find . -type f -exec chmod 664 {} +
- find . -type d -exec chmod 775 {} +
- cp VERSION.md dist/
artifacts:
name: $CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA-dev
paths:
- "dist/"
# ==============================================================================
# Deployment Jobs
#
# Publishes Python wheels to PyPI (test and production), GitLab registries,
# and GitHub releases. Also builds and deploys documentation to GitLab Pages
# for merge requests and the main branch.
# ==============================================================================
publish wheels to testpypi registry:
stage: deploy
image: $UV_TRIXIE_SLIM_IMAGE
needs: ["create pypi wheels"]
extends:
- .ipp_lnx_x86_64_cpu_micro
rules:
- if: $CI_COMMIT_BRANCH =~ /release-.*/ || $CI_COMMIT_TAG
when: manual
allow_failure: true
environment:
name: staging
url: https://test.pypi.org/project/warp-lang/
script:
- uv publish --verbose --index testpypi -t $TESTPYPI_DEPLOY_KEY dist/*
publish wheels to pypi registry:
stage: deploy
image: $UV_TRIXIE_SLIM_IMAGE
needs: ["create pypi wheels"]
extends:
- .ipp_lnx_x86_64_cpu_micro
rules:
- if: $CI_COMMIT_TAG
when: manual
allow_failure: true
environment:
name: production
url: https://pypi.org/project/warp-lang/
script:
- uv publish --verbose -t $PYPI_DEPLOY_KEY dist/*
publish wheels to gitlab pypi registry:
stage: deploy
image: $UV_TRIXIE_IMAGE
needs: ["create pypi wheels"]
extends:
- .ipp_lnx_x86_64_cpu_micro
rules:
- if: $CI_COMMIT_BRANCH =~ /^release-.*/ || $CI_COMMIT_TAG
when: manual
allow_failure: true
script:
- uv publish --verbose -u gitlab-ci-token -p ${CI_JOB_TOKEN} --publish-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi --check-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi/simple dist-github/*
# Uploads the wheels to the internal GitLab package registry in the Warp project
# Generated files will be in a branch/tag-specific folder
publish wheels to gitlab package registry:
stage: deploy
needs: ["create pypi wheels"]
image: $UV_TRIXIE_IMAGE
extends:
- .ipp_lnx_x86_64_cpu_micro
rules:
- if: $CI_COMMIT_TAG
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true
script:
- |
# Fail if no wheels found
wheels=$(find dist -name '*.whl')
if [ -z "$wheels" ]; then
echo "ERROR: No wheel files found in dist/"
exit 1
fi
for file in $wheels; do
filename=$(basename -- "$file")
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "$file" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/warp/${CI_COMMIT_REF_SLUG}/${filename}"
done
- echo "See the published files at $CI_PROJECT_URL/-/packages"
publish wheels to github release:
stage: deploy
image: $MINIFORGE_IMAGE
needs: ["create pypi wheels"]
extends:
- .ipp_lnx_x86_64_cpu_micro
rules:
- if: $CI_COMMIT_TAG
before_script:
- conda install gh --channel conda-forge
script:
- gh release upload $CI_COMMIT_TAG ./dist-github/*.whl
.build-docs-common: