-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
294 lines (265 loc) · 10.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
# ==============================================================================================================
# kit-app-template pipeline
#
# Goal
# ----
# * Publish usd_viewer / usd_explorer / usd_composer to the internal Launcher. The extension versions of all apps
# are locked by the shared version lock `templates/omni.all.template.extensions.kit`.
# * Publish extensions defined in `templates/omni.all.template.extensions.kit` to the Integ/Public registry.
#
#
# How it works
# ------------
# Split the pipeline into four independent lines: usd_{viewer, explorer, composer} and others.
# The first goal is achieved by "Publish to Launcher" job of each app, and the second goal is achieved by the "others"
# build job.
#
#
# Build:
#
# * Always run the four jobs: usd_viewer, usd_explorer, usd_composer, others.
# * The job usd_X locks the extension versions via omni.all.template.extensions.kit and packages the app X.
# * The job "others" locks extension versions via omni.all.template.extensions.kit and publish extensions to
# Integ/Public registry.
#
#
# Test:
#
# * One test job for one build job.
#
#
# Publish to Launcher:
#
# * One publish-to-launcher job for each app following the test job.
# * All apps use fat packages to simplify the process; otherwise, we need to publish the generated extensions to the
# internal registry as well.
# * Users have to manually bump the version file of the target app to trigger the job. The job is run automatically
# in the main branch. In the MR or release branches, manually click the job to run it.
#
#
# How to test it locally
# ----------------------
#
# Build:
#
# ```
# APP=usd_viewer ./repo.sh ci build
# ```
#
# Publish to Launcher:
#
# ```
# GITLAB_AUTH_TOKEN=some_gitlab_token_with_read_repo_permission APP=usd_viewer ./repo.sh ci publish_to_launcher
# ```
# ( package.windows-x86_64.packman` in package.toml has to be removed when running on Linux. )
#
# ==============================================================================================================
include:
# CI pipeline is versioned with tags and maintained here:
# https://gitlab-master.nvidia.com/omniverse/devplat/gitlab/templates/common/kit-extension/
- project: 'omniverse/devplat/gitlab/templates/common/kit-extension'
file: 'modules/complete-pipeline.yml'
ref: v1_latest
# Compliance
# See gitlab project environment `Variables` config to see the value of OSEC (compliance) job control booleans.
# For example OSEC_SONARQUBE_ENABLED, which causes the "osec:sonarqube" job to show up in the pipeline (or not).
- project: "omniverse/devplat/gitlab/templates/common/compliance"
file: "modules/omniverse-repo-compliance.gitlab-ci.yml"
ref: v1_latest
# ==============================================================================================================
# Variables to modify if needed - used in complete-pipeline.yml
variables:
ALLOW_PUBLISH_DOCS:
value: "true"
description: "Set to true to publish docs"
ALLOW_PUBLISH_TO_LAUNCHER:
value: "true"
description: "Set to true to publish to the launcher"
RUN_EXTENSION_BENCHMARKS:
value: "false"
description: "Set to true to run benchmarks for kit extensions."
OMNI_CI_ENABLE_CXX_COVERAGE:
value: "false"
description: "Set to true to enable the optional C++ code coverage jobs."
# ==============================================================================================================
# Find examples below to extend or modify jobs
#
# Gitlab documentation states that the include files are:
# - Merged with those in the .gitlab-ci.yml file.
# - Always evaluated first and then merged with the content of the .gitlab-ci.yml file, regardless of the position of the include keyword.
# ==============================================================================================================
# How to extend the pipeline (add new jobs)
# uncomment the following job for an example, the 'check' stage will have a new job called 'check-example'
# check-example:
# stage: check
# extends:
# - .omni_nvks_runner
# script:
# - echo "new job check-example"
# ==============================================================================================================
# How to modify an existing job
#
# Read about the merge rules:
# https://docs.gitlab.com/ee/ci/yaml/includes.html#merge-method-for-include
#
# uncomment the following to add a new file in the artifacts path
# .build-artifacts:
# artifacts:
# paths:
# - _build/packages/
# - _build/**/*.log
# - _repo/repo.log
# - new_file.txt
#
# uncomment the following to change the timeout of all build jobs
# .build-common:
# timeout: 30 minutes
#
# uncomment the following to run a script before windows tests
# test-windows-x86_64:
# before_script:
# - echo "running a custom script before windows tests"
# ==============================================================================================================
# Common
#
# Ensure the main and release branches are NOT interruptible. A release engineer may bump USD Composer on the main branch,
# and then another release engineer bump USD Explorer on the main branch, too. The former pipeline should not be canceled.
# The scheduled and tag pipelines are not used yet, but they should be not interruptible, either.
.common-rules:
rules:
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
interruptible: false
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_REF_PROTECTED == "true" ||
$CI_COMMIT_BRANCH =~ /^release\/.*/)
interruptible: false
- if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "parent_pipeline"
- if: $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule" && $ALLOW_SCHEDULE_PIPELINE == "true"
interruptible: false
- if: $CI_COMMIT_TAG && $ALLOW_TAG_PIPELINE == "true"
interruptible: false
# ==============================================================================================================
# Build, test, and publish each app in an isolated pipeline
#
.build_apps:
extends:
- ".build-common"
- ".osec:vault:v3:prod_token_job"
- ".common-rules"
artifacts:
when: always
expire_in: 2 weeks
paths:
- _build/**/*.gcno
- _build/**/*.log
- _build/packages/
- _repo/repo.log
- _repo/repolog*.txt
# Keep the version lock of apps and the generated extensions, we'll need it in the job check-app-version-locks
- source/apps/
- source/extensions/
parallel:
matrix:
- EXT:
- isaacsim.asset.importer.urdf
build-windows-x86_64:
extends:
- ".runner-build-windows-x86_64"
- ".build_apps"
build-linux-x86_64:
extends:
- ".runner-build-linux-x86_64"
- ".build_apps"
# ==============================================================================================================
# Test apps: isolate the test for each app.
# # Disable the included jobs.
# test-windows-x86_64:
# rules:
# - when: never
# test-linux-x86_64:
# rules:
# - when: never
# # Create new ones for each app
# # The difference among these jobs is needs
# .test-windows-app:
# needs:
# extends:
# - ".test-common-windows-x86_64"
# - ".common-rules"
# script:
# - ./repo.bat ci test
# .test-linux-app:
# needs:
# extends:
# - ".test-common-linux-x86_64"
# - ".common-rules"
# script:
# - ./repo.sh ci test
# ==============================================================================================================
# Publish to launchers
#
# Rules:
# * The version file of the app must be changed.
# * Automatically run the job when it's the default branch (main); otherwise, run the job manually.
# Replace this by three new jobs publish-to-launcer-X below.
publish-to-launcher:
rules:
- when: never
# ==============================================================================================================
# Publish extensions to the internal registry
#
# All template extensions are packaged into the fat packages, so there's no need to publish them into any registry.
# The only exception is the special extension omni.all.template.extensions.kit.
# publish-extensions:
# rules:
# - when: never
publish-extensions:
script:
- ./repo.sh build --fetch-only -rd
- ./repo.sh publish_exts -a --from-package -c release
- ./repo.sh publish_exts -a --from-package -c debug
# Generate and publish omni.etm.list.kit_app_template from templates/omni.all.template.extensions.kit so that ETM can
# use it as the test list.
# It's safe to always run the job. The operation will be skipped if the target version of the extension already exists.
publish-etm-list:
extends:
- ".deploy-common"
- ".runner-utility-linux-x86_64"
# Set needs as null so that it'll be run after the test stage.
# You can set it as [] to test it immediately for development.
needs: null
script:
- ./repo.sh ci publish_etm_list
rules:
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
changes:
- templates/omni.all.template.extensions.kit
- if: $CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_REF_PROTECTED == "true" ||
$CI_COMMIT_BRANCH =~ /^release\/.*/)
changes:
- templates/omni.all.template.extensions.kit
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- templates/omni.all.template.extensions.kit
when: manual
# Required to not block the pipeline: https://docs.gitlab.com/ee/ci/jobs/job_control.html#types-of-manual-jobs
allow_failure: true
interruptible: false
# ==============================================================================================================
# Disable unused jobs
#
# Disable it because it doesn't work.
# Instead manually update kit sdk version and the version lock `templates/omni.all.template.extensions.kit`.
release-new-version:
rules:
- when: never
# ==============================================================================================================
# overrides for compliance/osec job
osec:sonarqube:
variables:
SONAR_SOURCES: "source"
SONAR_CFAMILY_COMPILE_COMMANDS: "_build/linux-x86_64/release/compile_commands.json"
LINBUILD_EMBEDDED: "1"
before_script:
- set -eu && ./repo.sh build --generate --config release