-
Notifications
You must be signed in to change notification settings - Fork 241
/
.gitlab-ci.yml
787 lines (741 loc) · 29.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
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
# 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"
- "3.7.17+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/sw-cuda-math-mathdx-generic-local/cicd/libmathdx/sandbox/PostMerge/15/libmathdx_build_aarch64_rockylinux8_cuda12.0.0_release.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-0.1.0-Linux"
- 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/sw-cuda-math-mathdx-generic-local/cicd/libmathdx/sandbox/PostMerge/15/libmathdx_build_x86_64_rockylinux8_cuda12.0.0_release.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-0.1.0-Linux"
- 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-0-2/libmathdx-0.1.0-win64.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-0.1.0-win64"
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 --upgrade ruff==0.6.8
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 --upgrade ruff==0.6.8
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]
- 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
- 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
- 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"
# ==============================================================================
# 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.7 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.7.17+nv1"
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
# ==============================================================================
# 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_BRANCH =~ /release-.*/ || $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"
.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
- 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