-
Notifications
You must be signed in to change notification settings - Fork 256
/
Copy path.gitlab-ci.yml
955 lines (906 loc) · 36.2 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
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
# Copyright (c) 2023 NVIDIA CORPORATION. All rights reserved.
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
# ==============================================================================
# CI/CD Pipeline Configuration
# ==============================================================================
include:
- local: /.gitlab/ci/common.yml
- project: "omniverse/devplat/gitlab/templates/common/compliance"
file: "modules/omniverse-repo-compliance.gitlab-ci.yml"
ref: v1_latest
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'
CUDA_BIN: '$CI_PROJECT_DIR/_build/target-deps/cuda/bin'
CUDA: '$CI_PROJECT_DIR/_build/target-deps/cuda'
CUDA_HOME: '$CI_PROJECT_DIR/_build/target-deps/cuda'
PYTHON: '$CI_PROJECT_DIR/_build/target-deps/python/python'
LINBUILD: '$CI_PROJECT_DIR/_build/host-deps/linbuild/linbuild.sh'
WARP_CACHE_ROOT: '$CI_PROJECT_DIR/.cache/warp' # Used by the parallel test runner
GIT_DEPTH: 1
DEFAULT_PYTHON:
value: "3.9.18+nv1"
options:
- "3.11.8+nv1"
- "3.10.13+nv3"
- "3.9.18+nv1"
- "3.8.18+nv1"
description: "The default Python version used in the main testing jobs."
stages:
- build
- test
- child pipelines
- package
- deploy
# ==============================================================================
# Build Jobs (Release)
# ==============================================================================
linux-aarch64 build:
stage: build
image: ubuntu:20.04
extends:
- .save_warp_bin_artifact
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- apt-get update && apt-get install build-essential curl --no-install-recommends -y
- >
curl -k -H "Authorization: Bearer $ARTIFACTORY_ACCESS_TOKEN"
$ARTIFACTORY_BASE_URL/$ARTIFACTORY_LIBMATHDX_PATH/libmathdx-Linux-aarch64-0.1.1.tar.gz
-o libmathdx.tar.gz
- mkdir -p _build/target-deps
- tar -xzf libmathdx.tar.gz -C _build/target-deps
- export LIBMATHDX_HOME="$CI_PROJECT_DIR/_build/target-deps/libmathdx"
- gcc --version
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- ./tools/ci/building/build-linux-aarch64/build.sh --no-docker
- 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
tags:
- arch/arm
linux-x86_64 build:
stage: build
image: ubuntu:20.04
extends:
- .save_warp_bin_artifact
- .runner-build-linux-x86_64
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- apt-get update && apt-get install build-essential curl --no-install-recommends -y
- >
curl -k -H "Authorization: Bearer $ARTIFACTORY_ACCESS_TOKEN"
$ARTIFACTORY_BASE_URL/$ARTIFACTORY_LIBMATHDX_PATH/libmathdx-Linux-x86_64-0.1.1.tar.gz
-o libmathdx.tar.gz
- mkdir -p _build/target-deps
- tar -xzf libmathdx.tar.gz -C _build/target-deps
- export LIBMATHDX_HOME="$CI_PROJECT_DIR/_build/target-deps/libmathdx"
- gcc --version
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- ./tools/ci/building/build-linux-x86_64/build.sh --no-docker
- 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:
- powershell -command "Get-Volume | Format-Table -AutoSize"
- |
$headers = @{
"Authorization" = "Basic $([Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("warp-cicd:${env:LIBMATHDX_REGISTRY_TOKEN}")))"
}
$url = "${CI_API_V4_URL}/projects/141992/packages/generic/libmathdx/0-1-1-0/libmathdx-win64-x86_64-0.1.1.zip"
$output = "libmathdx.zip"
Invoke-WebRequest -Uri $url -Headers $headers -OutFile $output -ErrorAction Stop
- Expand-Archive -Path libmathdx.zip -DestinationPath _build/target-deps -Force
- Get-ChildItem -Path "${env:CI_PROJECT_DIR}\_build\target-deps"
- $env:LIBMATHDX_HOME = "${env:CI_PROJECT_DIR}\_build\target-deps\libmathdx"
script:
- ./tools/ci/building/build-windows-x86_64/build.bat
mac-x86_64 build:
stage: build
extends:
- .save_warp_bin_artifact
- .runner-build-macos-universal
- .macos_warp_tags
script:
- ./tools/ci/building/build-linux-x86_64/build.sh
# ==============================================================================
# Linting Jobs
#
# The jobs here are meant to assist with code quality analysis.
# They can run immediately without waiting for the build jobs to complete.
# ==============================================================================
ruff lint:
stage: test
image: python:3.11-slim
needs: []
extends:
- .runner-utility-linux-x86_64
before_script:
- python -m pip install --upgrade pip
- pip install ruff --constraint docs/requirements.txt
script:
- ruff check --output-format full --exit-zero # Just to get something in the log
- ruff check --output-format gitlab > gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json
ruff format:
stage: test
image: python:3.11-slim
needs: []
extends:
- .runner-utility-linux-x86_64
before_script:
- python -m pip install --upgrade pip
- pip install ruff --constraint docs/requirements.txt
script:
- ruff format --diff
osec:sonarqube:
variables:
# Disable C/C++ analyzer until project specific work is done to enable it.
# See: https://confluence.nvidia.com/display/OMNIVERSE/SonarQube+Gitlab+CI+Integration#C+Project+Enablement+Additions
SONAR_EXTRA_ARGS: "-Dsonar.c.file.suffixes=- -Dsonar.cpp.file.suffixes=- -Dsonar.objc.file.suffixes=-"
# ==============================================================================
# Main Unit Testing Jobs
#
# The jobs here will always be run when the pipeline is triggered. The jobs that
# compute code coverage run slower than jobs that do not. The minimal jobs were
# added to test the user experience without any optional Python packages.
# ==============================================================================
.test_common_main:
stage: test
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
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/*
- warp/**/*
- pyproject.toml
- tools/**/*
- deps/*
- build_lib.py
- build_llvm.py
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true
linux-aarch64 test:
image: ubuntu:22.04
needs: [linux-aarch64 build]
extends:
- .test_common_main
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- !reference [.snippets, install-python+warp-aarch64]
- python -m pip install coverage[toml]
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- python -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
tags:
- arch/arm
linux-aarch64 test jetson:
image: ubuntu:22.04
needs: [linux-aarch64 build]
extends:
- .test_common_main
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true # Unsure of stability of Jetson runner for now
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- !reference [.snippets, install-python+warp-aarch64]
- python -m pip install coverage[toml]
- python -m pip install -U "jax[cuda12]"
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- python -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
tags:
- gpu/orin
linux-x86_64 test:
needs: [linux-x86_64 build]
extends:
- .omni_nvks_gpu_2x
- .test_common_main
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- df -h
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-x86_64/warp.so warp/bin/
- mv warp/bin/linux-x86_64/warp-clang.so warp/bin/
- tools/packman/packman install -l _build/target-deps/python python ${DEFAULT_PYTHON}-linux-x86_64
- export PATH="$CUDA_BIN:$PATH"
- $PYTHON -m venv _venv
- source _venv/bin/activate
- python -m pip install --upgrade pip
- python -m pip install --upgrade usd-core coverage[toml] blosc
- python -m pip install --upgrade torch --extra-index-url https://download.pytorch.org/whl/cu121
- python -m pip install -U "jax[cuda12]"
- python -m pip install -e .
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
# HACK: disable P2P tests due to misbehaving agents
- export WARP_DISABLE_P2P_TESTS=1
script:
- python -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
# Note that for throughput reasons this runs on a single-GPU runner
windows-x86_64 test:
stage: test
needs: [windows-x86_64 build]
extends:
- .runner-test-windows-x86_64-gpu
- .test_common_main
before_script:
- !reference [.snippets, define-powershell-GetTime]
- Write-Output "$([char]27)[0Ksection_start:$(GetTime):install_dependencies[collapsed=true]$([char]13)$([char]27)[0KInstalling dependencies"
- powershell -command "Get-Volume | Format-Table -AutoSize"
- $python_name = $DEFAULT_PYTHON + "-windows-x86_64"
- tools/packman/packman.cmd install -l _build/target-deps/python python $python_name
- '& $env:CI_PROJECT_DIR\_build\target-deps\python\python.exe -m venv _venv'
- .\_venv\Scripts\Activate.ps1
- python -m pip install --upgrade pip
- python -m pip install --upgrade usd-core coverage[toml] numpy blosc
- python -m pip install --upgrade torch --extra-index-url https://download.pytorch.org/whl/cu121
- python -m pip install -e .
- Write-Output "$([char]27)[0Ksection_end:$(GetTime):install_dependencies$([char]13)$([char]27)[0K"
script:
- python -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
mac-x86_64 test:
stage: test
needs: [mac-x86_64 build]
extends:
- .runner-test-macos-universal
- .test_common_main
- .macos_warp_tags
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- !reference [.snippets, install-python+warp-macos]
- python -m pip install --upgrade usd-core coverage[toml]
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- python -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect --failfast
# Test the Linux release build in an environment with minimal Python dependencies installed
linux-x86_64 test minimal:
stage: test
needs: [linux-x86_64 build]
extends:
- .omni_nvks_gpu_2x
- .save_test_report_artifact
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/*
- warp/**/*
- pyproject.toml
- tools/**/*
- deps/*
- build_lib.py
- build_llvm.py
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- df -h
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-x86_64/warp.so warp/bin/
- mv warp/bin/linux-x86_64/warp-clang.so warp/bin/
- tools/packman/packman install -l _build/target-deps/python python ${DEFAULT_PYTHON}-linux-x86_64
- $PYTHON -m venv _venv
- source _venv/bin/activate
- python -m pip install --upgrade pip
- python -m pip install -e .
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
# HACK: disable P2P tests due to misbehaving agents
- export WARP_DISABLE_P2P_TESTS=1
script:
- python -m warp.tests --junit-report-xml rspec.xml -s autodetect --failfast
# 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
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_TAG
- when: manual # Can be triggered in all other scenarios
allow_failure: true
before_script:
- !reference [.snippets, define-powershell-GetTime]
- Write-Output "$([char]27)[0Ksection_start:$(GetTime):install_dependencies[collapsed=true]$([char]13)$([char]27)[0KInstalling dependencies"
- powershell -command "Get-Volume | Format-Table -AutoSize"
- $python_name = $DEFAULT_PYTHON + "-windows-x86_64"
- tools/packman/packman.cmd install -l _build/target-deps/python python $python_name
- '& $env:CI_PROJECT_DIR\_build\target-deps\python\python.exe -m venv _venv'
- .\_venv\Scripts\Activate.ps1
- python -m pip install --upgrade pip
- python -m pip install --upgrade usd-core numpy
- python -m pip install --upgrade torch --extra-index-url https://download.pytorch.org/whl/cu121
- python -m pip install -e .
- Write-Output "$([char]27)[0Ksection_end:$(GetTime):install_dependencies$([char]13)$([char]27)[0K"
script:
- python -m warp.tests --junit-report-xml rspec.xml -s autodetect --failfast
tags:
- os/windows
- gpu/2x-A5000
# Note: This will no longer be needed once Warp auto-initializes upon import
linux-x86_64 test warp-init:
stage: test
needs: [linux-x86_64 build]
extends:
- .omni_nvks_gpu
- .save_test_report_artifact
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/*
- warp/**/*
- pyproject.toml
- tools/**/*
- deps/*
- build_lib.py
- build_llvm.py
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true
timeout: 10m
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- df -h
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-x86_64/warp.so warp/bin/
- mv warp/bin/linux-x86_64/warp-clang.so warp/bin/
- tools/packman/packman install -l _build/target-deps/python python ${DEFAULT_PYTHON}-linux-x86_64
- $PYTHON -m venv _venv
- source _venv/bin/activate
- python -m pip install --upgrade pip
- python -m pip install -e .
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- python -m warp.tests --junit-report-xml rspec.xml -s autodetect --disable-process-pooling --disable-concurrent-futures --level test -p 'test_implicit_init.py'
# 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: test
needs: [windows-x86_64 build]
extends:
- .runner-utility-windows-x86_64
artifacts:
paths:
- public
before_script:
- !reference [.snippets, define-powershell-GetTime]
- Write-Output "$([char]27)[0Ksection_start:$(GetTime):install_dependencies[collapsed=true]$([char]13)$([char]27)[0KInstalling dependencies"
- powershell -command "Get-Volume | Format-Table -AutoSize"
- $python_name = "3.12.6+nv1-windows-x86_64"
- tools/packman/packman.cmd install -l _build/target-deps/python python $python_name
- '& $env:CI_PROJECT_DIR\_build\target-deps\python\python.exe -m venv _venv'
- .\_venv\Scripts\Activate.ps1
- python -m pip install --upgrade pip
- python -m pip install -r docs/requirements.txt
- Write-Output "$([char]27)[0Ksection_end:$(GetTime):install_dependencies$([char]13)$([char]27)[0K"
script:
- python build_docs.py --no_doctest
- 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"
# This job tests code snippets in the documentation
doctest:
stage: test
image: python:3.11-slim
needs: [linux-x86_64 build]
extends:
- .omni_nvks_gpu
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KSet up docs environment"
- df -h
- apt-get update && apt-get install make --no-install-recommends -y
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-x86_64/warp.so warp/bin/
- mv warp/bin/linux-x86_64/warp-clang.so warp/bin/
- python -m pip install --upgrade pip
- python -m pip install -r docs/requirements.txt
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- sphinx-build -b doctest docs docs/_build/doctest
# Benchmark this commit with the current main branch using Airspeed Velocity
# Only runs on merge requests
linux-x86_64 asv:
stage: test
needs: []
image: ubuntu:22.04
extends:
- .omni_nvks_gpu
variables:
GIT_DEPTH: "50"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
changes:
- .gitlab-ci.yml
- benchmarks/**/*
- 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
- apt-get update && apt-get install python3 python3.10-venv git-lfs build-essential curl ca-certificates --no-install-recommends -y
- tools/packman/packman pull --platform linux-x86_64 deps/cuda-toolkit-deps.packman.xml --verbose --include-tag "cuda-11"
- export PATH="$CUDA_BIN:$PATH"
- python3 -m venv _venv
- source _venv/bin/activate
- python -m pip install --upgrade pip
- python -m pip install asv
- export GIT_LFS_SKIP_SMUDGE=1
- git config --global --add safe.directory '*'
- git fetch origin main
# Make sure the main branch can be checked out by asv
- git checkout -f main
- git checkout -f $CI_COMMIT_SHA
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- cd benchmarks
- asv machine --yes
- asv continuous --interleave-rounds --append-samples --no-only-changed -f 1.15 main $CI_COMMIT_SHA
allow_failure: True # Can make success required after we have tested this job more
# ==============================================================================
# Child pipelines
#
# The child pipelines defined here are only run in specific
# circumstances. Most developers don't need to worry about the
# jobs in this section.
# ==============================================================================
# Trigger additional (no code coverage) pipelines testing more Python versions
# Workaround from https://gitlab.com/gitlab-org/gitlab/-/issues/284086
trigger python 3.X test pipelines:
stage: test
image: busybox
extends:
- .runner-utility-linux-x86_64
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 additional Python versions."
python 3.8 test:
stage: child pipelines
needs: [trigger python 3.X test pipelines]
trigger:
include: /.gitlab/ci/additional-tests.yml
extends:
- .trigger_common
variables:
DEFAULT_PYTHON: "3.8.18+nv1"
# 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:
- .runner-utility-linux-x86_64
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 11 pipelines
# Workaround from https://gitlab.com/gitlab-org/gitlab/-/issues/284086
trigger cuda 11 pipeline:
stage: test
image: busybox
extends:
- .runner-utility-linux-x86_64
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 with CUDA 11."
# Uses the same Python version as the main pipeline.
cuda 11 build and test:
stage: child pipelines
needs: [trigger cuda 11 pipeline]
trigger:
include: /.gitlab/ci/cuda-11-build-and-test.yml
extends:
- .trigger_common
# ==============================================================================
# Packaging Jobs
#
# Kit and PyPI jobs produce deployment artifacts and are not run in MRs unless
# manually started.
# ==============================================================================
# Creates wheel files for PyPI
create pypi wheels:
stage: package
needs:
- linux-aarch64 build
- linux-x86_64 build
- windows-x86_64 build
- mac-x86_64 build
extends:
- .runner-utility-linux-x86_64
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.
- mkdir -p warp/bin/windows-x86_64
- mv warp/bin/warp.dll warp/bin/windows-x86_64/
- mv warp/bin/warp-clang.dll warp/bin/windows-x86_64/
- mkdir -p warp/bin/macos-universal
- mv warp/bin/libwarp.dylib warp/bin/macos-universal/
- mv warp/bin/libwarp-clang.dylib warp/bin/macos-universal/
- python3 -m pip install --upgrade pip
- python3 -m pip install build
script:
- sed -i "s/^\(.*\)$/\1+cu12/" VERSION.md # Modify VERSION.md with +cu12
- python3 -m build --wheel -C--build-option=-Pwindows-x86_64
- python3 -m build --wheel -C--build-option=-Plinux-x86_64
- python3 -m build --wheel -C--build-option=-Plinux-aarch64
- sed -i "s/^\(.*\)+cu12$/\1+cpu/" VERSION.md # Modify VERSION.md with +cu12 replaced by +cpu
- python3 -m build --wheel -C--build-option=-Pmacos-universal
- sed -i "s/^\(.*\)+cpu$/\1/" VERSION.md # Revert VERSION.md changes
- mv dist dist-github
# Now make the wheels meant for PyPI publishing
- python3 -m build --wheel -C--build-option=-Pwindows-x86_64
- python3 -m build --wheel -C--build-option=-Plinux-x86_64
- python3 -m build --wheel -C--build-option=-Plinux-aarch64
- python3 -m build --wheel -C--build-option=-Pmacos-universal
- 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
needs:
- linux-aarch64 build
- linux-x86_64 build
- windows-x86_64 build
extends:
- .runner-utility-linux-x86_64
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- when: never
before_script:
# Move binaries into platform-specific folders. Already done in the build jobs for Linux.
- mkdir -p warp/bin/windows-x86_64
- mv warp/bin/warp.dll warp/bin/windows-x86_64/
- mv warp/bin/warp-clang.dll warp/bin/windows-x86_64/
- python3 -m pip install --upgrade pip
- python3 -m pip install build
script:
- python3 tools/ci/publishing/set_nightly_version.py # Modify VERSION.md with dev version
- python3 -m build --wheel -C--build-option=-Pwindows-x86_64
- python3 -m build --wheel -C--build-option=-Plinux-x86_64
- python3 -m build --wheel -C--build-option=-Plinux-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
#
# This section currently contains jobs that publish files to the internal
# GitLab service.
# ==============================================================================
publish wheels to testpypi registry:
stage: deploy
image: python:3.11-slim
needs: ["create pypi wheels"]
extends:
- .runner-utility-linux-x86_64
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/
before_script:
- python3 -m pip install --upgrade pip
- python3 -m pip install --upgrade build twine
script:
- python3 -m twine upload --verbose --skip-existing --non-interactive --repository testpypi dist/* -u __token__ -p $TESTPYPI_DEPLOY_KEY
publish wheels to pypi registry:
stage: deploy
image: python:3.11-slim
needs: ["create pypi wheels"]
extends:
- .runner-utility-linux-x86_64
rules:
- if: $CI_COMMIT_TAG
when: manual
allow_failure: true
environment:
name: production
url: https://pypi.org/project/warp-lang/
before_script:
- python3 -m pip install --upgrade pip
- python3 -m pip install --upgrade build twine
script:
- python3 -m twine upload --verbose --skip-existing --non-interactive dist/* -u __token__ -p $PYPI_DEPLOY_KEY
publish wheels to gitlab pypi registry:
stage: deploy
image: python:3.11-slim
needs: ["create pypi wheels"]
extends:
- .runner-utility-linux-x86_64
rules:
- if: $CI_COMMIT_BRANCH =~ /^release-.*/ || $CI_COMMIT_TAG
when: manual
allow_failure: true
before_script:
- python3 -m pip install --upgrade pip
- python3 -m pip install --upgrade build twine
script:
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python3 -m twine upload --verbose --skip-existing --non-interactive --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi 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"]
extends:
- .runner-utility-linux-x86_64
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH =~ /^release-.*/
- when: manual # If not auto-triggered, allow any pipeline to run this job manually
allow_failure: true
before_script:
- apt-get update && apt-get install curl --no-install-recommends -y
script:
- |
for file in $(find . -name '*.whl'); 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 dev wheels to artifactory:
stage: deploy
image: releases-docker.jfrog.io/jfrog/jfrog-cli-v2-jf
needs:
- job: create dev wheels
optional: true
extends:
- .runner-utility-linux-x86_64
rules: # Should be consistent with create dev wheels
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
allow_failure: true
before_script:
- export VERSION=$(head -n 1 dist/VERSION.md)
script:
- cd dist
- >
jf rt u --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
--target-props 'component_name=warp-lang;release_approver=ershi;release_status=ready'
'*.whl' sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/
# Set build-specific properties on individual artifacts
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*-win_amd64.whl
'arch=x86_64;os=windows'
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*-manylinux2014_aarch64.whl
'arch=aarch64;os=linux'
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*-manylinux2014_x86_64.whl
'arch=x86_64;os=linux'
# Set additional common properties on all artifacts
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*.whl
version=$VERSION
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*.whl
branch=$CI_COMMIT_REF_NAME
publish tag wheels to artifactory:
stage: deploy
image: releases-docker.jfrog.io/jfrog/jfrog-cli-v2-jf
needs: ["create pypi wheels"]
extends:
- .runner-utility-linux-x86_64
rules:
- if: $CI_COMMIT_TAG
allow_failure: true
before_script:
- export VERSION=$(head -n 1 VERSION.md)
script:
- cd dist
- >
jf rt u --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
--target-props 'component_name=warp-lang;release_approver=ershi;release_status=ready'
'*.whl' sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/
# Set build-specific properties on individual artifacts
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*-win_amd64.whl
'arch=x86_64;os=windows'
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*-manylinux2014_aarch64.whl
'arch=aarch64;os=linux'
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*-manylinux2014_x86_64.whl
'arch=x86_64;os=linux'
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*-macosx_*_universal2.whl
'arch=universal;os=macosx'
# Set additional common properties on all artifacts
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*.whl
version=$VERSION
- >
jf rt sp --fail-no-op --url=$ARTIFACTORY_BASE_URL --access-token $ARTIFACTORY_SVC_ACCESS_TOKEN
sw-warp-pypi-local/warp/$CI_COMMIT_REF_NAME/$VERSION/*.whl
branch=$CI_COMMIT_REF_NAME
.build-docs-common:
stage: deploy
image: python:3.11-slim
needs: [linux-x86_64 build]
extends:
- .runner-utility-linux-x86_64
artifacts:
paths:
- public
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KSet up docs environment"
- df -h
- apt-get update && apt-get install make --no-install-recommends -y
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-x86_64/warp.so warp/bin/
- mv warp/bin/linux-x86_64/warp-clang.so warp/bin/
- python -m pip install --upgrade pip
- python -m pip install -r docs/requirements.txt
- echo -e "\\e[0Ksection_end:`date +%s`:install_dependencies\\r\\e[0K"
script:
- python build_docs.py --no_doctest
- mv docs/_build/html/ ./public/
# Merge requests: Build documentation and save as an artifact
# A link to the generated documentation is added to the merge request.
merge request docs:
extends:
- .build-docs-common
artifacts:
paths:
- warp/stubs.py
- docs/modules/functions.rst
- public
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
timeout: 10m
environment:
name: review/$CI_MERGE_REQUEST_IID
url: https://$CI_PROJECT_ROOT_NAMESPACE.$CI_PAGES_DOMAIN/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/public/index.html
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"
# Merge requests: Ensure that exports.h, stubs.py, functions.rst have been
# manually added to the MR if they are changed
check generated files:
needs:
- job: linux-x86_64 build
- job: merge request docs
optional: true
stage: deploy
artifacts:
when: on_failure
expose_as: 'Generated source files'
paths:
- warp/native/exports.h
- warp/stubs.py
- docs/modules/functions.rst
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
timeout: 10m
extends:
- .runner-utility-linux-x86_64
script:
- >
git diff --exit-code warp/stubs.py docs/modules/functions.rst ||
(echo "Please run build_docs.py (or download from $CI_JOB_URL/artifacts/browse) and add modified files to your merge request." && false)
- >
git diff --exit-code warp/native/exports.h ||
(echo "Please run build_lib.py (or download from $CI_JOB_URL/artifacts/browse) and add warp/native/exports.h to your merge request." && false)
# Build documentation and publish on gitlab-master
# This only runs in the default branch pipeline. The "pages" name is special for GitLab.
pages:
extends:
- .build-docs-common
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
timeout: 10m
environment:
name: GitLab Pages
deployment_tier: staging
url: $CI_PAGES_URL