forked from nvlukasz/warp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
493 lines (452 loc) · 16.7 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
# 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
# ================================================================
workflow:
rules:
- if: $CI_PROJECT_PATH != "omniverse/warp" # Prevent fork pipelines
when: never
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_TAG # Run for tagged releases
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "web" # Run if triggered from the UI
default:
interruptible: true
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'
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
include:
- project: 'omniverse/devplat/gitlab/templates/runners'
file: '/modules/include.yml'
ref: v1_latest
stages:
- build
- test
- package
# Used to define collapsible sections on Windows runners
.define-get-time: &define-GetTime
- |
function GetTime {
$time = Get-Date -UFormat "%s"
return $time.Substring(0, $time.IndexOf('.'))
}
# ================================================================
# Build Jobs (Release)
# ================================================================
.build_artifacts:
artifacts:
name: $CI_JOB_NAME_SLUG
paths:
- warp/native/exports.h
- warp/bin/**/*.dll
- warp/bin/**/*.so
- warp/bin/**/*.dylib
expire_in: 1 week
.build_common_release:
stage: build
extends:
- .build_artifacts
linux-aarch64 build release:
image: gitlab-master.nvidia.com:5005/jgorski-group/ci/docker_1804_aarch64:latest
services:
- name: docker:dind
extends:
- .build_common_release
script:
- ./tools/ci/building/build-linux-x86_64/build.sh
- mkdir warp/bin/linux-aarch64
- mv warp/bin/*.so warp/bin/linux-aarch64
tags:
- perflab-arm
- cpu/arm
- os/linux-arm
- type/docker
linux-x86_64 build release:
extends:
- .build_common_release
- .omni_nvks_runner_with_docker
script:
- ./tools/ci/building/build-linux-x86_64/build.sh
- mkdir warp/bin/linux-x86_64
- mv warp/bin/*.so warp/bin/linux-x86_64
windows-x86_64 build release:
extends:
- .build_common_release
- .runner-utility-windows-x86_64
script:
- ./tools/ci/building/build-windows-x86_64/build.bat
mac-x86_64 build release:
extends:
- .build_common_release
- .runner-build-macos-universal
script:
- ./tools/ci/building/build-linux-x86_64/build.sh
# ================================================================
# Build Jobs (Debug)
#
# To save shared resources, we don't test debug by default on MR's
# ================================================================
.build_common_debug:
stage: build
extends:
- .build_artifacts
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: never
- when: on_success
# Hide this job for now until debug aarch64 builds work
.linux-aarch64 build debug:
image: gitlab-master.nvidia.com:5005/jgorski-group/ci/docker_1804_aarch64:latest
services:
- name: docker:dind
extends:
- .build_common_debug
script:
- ./tools/ci/building/build-linux-x86_64/build.sh --debug
tags:
- perflab-arm
- cpu/arm
- os/linux-arm
- type/docker
linux-x86_64 build debug:
extends:
- .build_common_debug
- .omni_nvks_runner_with_docker
script:
- ./tools/ci/building/build-linux-x86_64/build.sh --debug
windows-x86_64 build debug:
extends:
- .build_common_debug
- .runner-utility-windows-x86_64
script:
- ./tools/ci/building/build-windows-x86_64/build.bat --debug
mac-x86_64 build debug:
extends:
- .build_common_debug
- .runner-build-macos-universal
script:
- ./tools/ci/building/build-linux-x86_64/build.sh --debug
# ================================================================
# Unit Testing Jobs (Release)
#
# Currently, each job generates coverage reports, which adds to
# the runtime.
# ================================================================
flake8:
stage: test
image: python:3.11-slim
needs: []
extends:
- .runner-utility-linux-x86_64
before_script:
- python -m pip install --upgrade pip
- pip install flake8 flake8-gl-codeclimate black
script:
- flake8 --format=gl-codeclimate --output-file=gl-code-quality-report.json warp/ exts/ examples/ *.py --exit-zero
- flake8 warp/ exts/ examples/ *.py --exit-zero --show-source
- python -m black --diff warp/ examples/ *.py
artifacts:
reports:
codequality: gl-code-quality-report.json
.test_artifacts_release:
artifacts:
when: always
paths:
- rspec.xml
- coverage.xml
reports:
junit: rspec.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml
.test_common_release:
stage: test
extends:
- .test_artifacts_release
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
# PyPI currently only has binary wheels of numpy for Python 3.9+.
linux-aarch64 test release:
image: ubuntu:22.04
needs: [linux-aarch64 build release]
extends:
- .test_common_release
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- apt-get update && apt-get install curl --no-install-recommends -y
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-aarch64/*.so warp/bin/
- tools/packman/packman install -l _build/target-deps/python python 3.9.18+nv1-linux-aarch64
- $PYTHON -m pip install --upgrade pip
- $PYTHON -m pip install coverage[toml]
- $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 --coverage --coverage-xml coverage.xml -s autodetect
tags:
- perflab-arm
- cpu/arm
- os/linux-arm
- type/docker
linux-x86_64 test release:
needs: [linux-x86_64 build release]
extends:
- .omni_nvks_gpu_2x
- .test_common_release
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-x86_64/*.so warp/bin/
- tools/packman/packman install -l _build/target-deps/python python 3.8.18+nv1-linux-x86_64
- export PATH="$CUDA_BIN:$PATH"
- $PYTHON -m pip install --upgrade pip
- $PYTHON -m pip install usd-core coverage[toml]
- $PYTHON -m pip install torch --index-url https://download.pytorch.org/whl/cu118
- $PYTHON -m pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
- $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 --coverage --coverage-xml coverage.xml -s autodetect
windows-x86_64 test release:
stage: test
needs: [windows-x86_64 build release]
extends:
- .runner-test-windows-x86_64-gpu
- .test_common_release
before_script:
- *define-GetTime
- Write-Output "$([char]27)[0Ksection_start:$(GetTime):install_dependencies[collapsed=true]$([char]13)$([char]27)[0KInstalling dependencies"
- tools/packman/packman.cmd install -l _build/target-deps/python python 3.8.18+nv1-windows-x86_64
- $env:PYTHON = "$env:CI_PROJECT_DIR\_build\target-deps\python\python.exe"
- powershell.exe $env:PYTHON -m pip install --upgrade pip
- powershell.exe $env:PYTHON -m pip install usd-core coverage[toml]
- powershell.exe $env:PYTHON -m pip install torch --index-url https://download.pytorch.org/whl/cu118
- powershell.exe $env:PYTHON -m pip install -e .
- Write-Output "$([char]27)[0Ksection_end:$(GetTime):install_dependencies$([char]13)$([char]27)[0K"
script:
- powershell.exe $env:PYTHON -m warp.tests --junit-report-xml rspec.xml --coverage --coverage-xml coverage.xml -s autodetect
mac-x86_64 test release:
stage: test
needs: [mac-x86_64 build release]
extends:
- .runner-test-macos-universal
- .test_common_release
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- tools/packman/packman install -l _build/target-deps/python python 3.7.16+nv1-macos-x86_64
- $PYTHON -m pip install --upgrade pip
- $PYTHON -m pip install matplotlib usd-core coverage[toml]
- $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 --coverage --coverage-xml coverage.xml -s autodetect
# ================================================================
# Unit Testing Jobs (Debug)
#
# To save shared resources, we don't test debug by default on MR's
# ================================================================
.test_artifacts_debug:
artifacts:
reports:
junit: rspec.xml
.test_common_debug:
stage: test
extends:
- .test_artifacts_debug
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
when: never
- when: on_success
# Hide this job for now until debug aarch64 builds work
.linux-aarch64 test debug:
image: ubuntu:22.04
needs: [linux-aarch64 build debug]
extends:
- .test_common_debug
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- apt-get update && apt-get install curl --no-install-recommends -y
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-aarch64/*.so warp/bin/
- tools/packman/packman install -l _build/target-deps/python python 3.9.18+nv1-linux-aarch64
- $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
tags:
- perflab-arm
- cpu/arm
- os/linux-arm
- type/docker
linux-x86_64 test debug:
needs: [linux-x86_64 build debug]
extends:
- .omni_nvks_gpu_2x
- .test_common_debug
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- tools/packman/packman install -l _build/target-deps/python python 3.8.18+nv1-linux-x86_64
- export PATH="$CUDA_BIN:$PATH"
- $PYTHON -m pip install --upgrade pip
- $PYTHON -m pip install usd-core
- $PYTHON -m pip install torch --index-url https://download.pytorch.org/whl/cu118
- $PYTHON -m pip install --upgrade "jax[cuda]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
- $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
windows-x86_64 test debug:
stage: test
needs: [windows-x86_64 build debug]
extends:
- .runner-test-windows-x86_64-gpu
- .test_common_debug
before_script:
- *define-GetTime
- Write-Output "$([char]27)[0Ksection_start:$(GetTime):install_dependencies[collapsed=true]$([char]13)$([char]27)[0KInstalling dependencies"
- tools/packman/packman.cmd install -l _build/target-deps/python python 3.8.18+nv1-windows-x86_64
- $env:PYTHON = "$env:CI_PROJECT_DIR\_build\target-deps\python\python.exe"
- powershell.exe $env:PYTHON -m pip install --upgrade pip
- powershell.exe $env:PYTHON -m pip install usd-core
- powershell.exe $env:PYTHON -m pip install torch --index-url https://download.pytorch.org/whl/cu118
- powershell.exe $env:PYTHON -m pip install -e .
- Write-Output "$([char]27)[0Ksection_end:$(GetTime):install_dependencies$([char]13)$([char]27)[0K"
script:
- powershell.exe $env:PYTHON -m warp.tests --junit-report-xml rspec.xml -s autodetect
mac-x86_64 test debug:
stage: test
needs: [mac-x86_64 build debug]
extends:
- .runner-test-macos-universal
- .test_common_debug
before_script:
- echo -e "\\e[0Ksection_start:`date +%s`:install_dependencies[collapsed=true]\\r\\e[0KInstalling dependencies"
- tools/packman/packman install -l _build/target-deps/python python 3.7.16+nv1-macos-x86_64
- $PYTHON -m pip install --upgrade pip
- $PYTHON -m pip install matplotlib usd-core
- $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
# ================================================================
# Packaging Jobs
#
# Documentation is only built and deployed on the default branch pipeline
# Kit and PyPI jobs only run for tag pipelines
# ================================================================
.build_docs_common:
stage: package
image: python:3.11-slim
needs: []
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"
- apt-get update && apt-get install make --no-install-recommends -y
- 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"
- cd docs && make clean
- cd ..
script:
- python build_docs.py
- mv docs/_build/html/ ./public/
# Merge requests: Build documentation and save as an artifact
merge request docs:
extends:
- .build_docs_common
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
environment:
name: review/$CI_MERGE_REQUEST_IID
url: https://omniverse.gitlab-master-pages.nvidia.com/-/warp/-/jobs/$CI_JOB_ID/artifacts/public/index.html
after_script:
- echo "You can view the website at https://omniverse.gitlab-master-pages.nvidia.com/-/warp/-/jobs/$CI_JOB_ID/artifacts/public/index.html"
# Build documentation and publish on gitlab-master
# This only runs in the default branch pipeline
pages:
extends:
- .build_docs_common
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
environment:
name: staging
url: https://omniverse.gitlab-master-pages.nvidia.com/warp/
# Creates wheel files for PyPI
# This only runs in tag pipelines
create pypi wheels:
stage: package
image: python:3.11-slim
needs:
- linux-aarch64 build release
- linux-x86_64 build release
- windows-x86_64 build release
- mac-x86_64 build release
extends:
- .runner-utility-linux-x86_64
rules:
- if: $CI_COMMIT_TAG
before_script:
# Move binaries into platform-specific folders. Already done in the build jobs for Linux.
- mkdir warp/bin/windows-x86_64
- mv warp/bin/*.dll warp/bin/windows-x86_64/
- mkdir warp/bin/macos-universal
- mv warp/bin/*.dylib warp/bin/macos-universal/
- python -m pip install --upgrade pip
- pip install build
script:
- python -m build --wheel -C--build-option=-Pwindows-x86_64
- python -m build --wheel -C--build-option=-Plinux-x86_64
- python -m build --wheel -C--build-option=-Plinux-aarch64
- python -m build --wheel -C--build-option=-Pmacos-universal
- find . -type f -exec chmod 664 {} +
- find . -type d -exec chmod 775 {} +
artifacts:
name: $CI_JOB_NAME_SLUG
paths:
- dist/
# Creates an artifact suitable for publishing the Kit extensions
# This only runs in tag pipelines
create kit artifacts:
stage: package
image: python:3.10-alpine
needs:
- linux-x86_64 build release
- windows-x86_64 build release
extends:
- .runner-utility-linux-x86_64
rules:
- if: $CI_COMMIT_TAG
before_script:
# Move compiled binaries out of platform-specific directory
- mv warp/bin/linux-x86_64/*.so warp/bin/
- rm -r warp/bin/linux-x86_64/
- rm exts/omni.warp.core/warp
- rm -rf warp/native/cutlass
script:
- python tools/ci/publishing/build_nodes_info.py
- mv warp exts/omni.warp.core/
- find . -type f -exec chmod 664 {} +
- find . -type d -exec chmod 775 {} +
artifacts:
name: $CI_JOB_NAME_SLUG
paths:
- exts
exclude:
- "**/.gitignore"
- "**/.gitattributes"