-
Notifications
You must be signed in to change notification settings - Fork 143
309 lines (302 loc) · 13.1 KB
/
pr.yaml
File metadata and controls
309 lines (302 loc) · 13.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: pr
on:
push:
branches:
- "pull-request/[0-9]+"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pr-builder:
needs:
- check-lean-ci
- prevent-merge-with-lean-ci
- compute-matrix-filters
- changed-files
- checks
- conda-cpp-build
- conda-cpp-tests
- conda-python-build
- conda-python-tests
- docs-build
- wheel-build-libcuopt
- wheel-build-cuopt
- wheel-tests-cuopt
- wheel-build-cuopt-server
- wheel-tests-cuopt-server
- wheel-build-cuopt-mps-parser
- wheel-build-cuopt-sh-client
- test-self-hosted-server
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@main
check-lean-ci:
runs-on: ubuntu-latest
outputs:
lean_ci_enabled: ${{ steps.check-label.outputs.lean_ci_enabled }}
steps:
- name: Check for lean-ci label
id: check-label
env:
GH_TOKEN: ${{ github.token }}
run: |
# Extract PR number from branch name (pull-request/123 -> 123)
PR_NUMBER=$(echo "${{ github.ref }}" | sed 's|refs/heads/pull-request/||')
echo "Checking PR #$PR_NUMBER for lean-ci label..."
# Check if the PR has the 'lean-ci' label
if gh pr view "$PR_NUMBER" --repo "${{ github.repository }}" --json labels --jq '.labels[].name' | grep -q "^lean-ci$"; then
echo "lean_ci_enabled=true" >> $GITHUB_OUTPUT
echo "⚠️ Lean CI is enabled (lean-ci label found)"
else
echo "lean_ci_enabled=false" >> $GITHUB_OUTPUT
echo "✅ Full CI is enabled"
fi
prevent-merge-with-lean-ci:
runs-on: ubuntu-latest
needs: check-lean-ci
steps:
- name: Check lean-ci status
run: |
if [ "${{ needs.check-lean-ci.outputs.lean_ci_enabled }}" == "true" ]; then
echo "❌ ERROR: This PR has the 'lean-ci' label enabled."
echo "Lean CI is only for testing purposes and should not be merged."
echo "Please remove the 'lean-ci' label and run full CI before merging."
exit 1
else
echo "✅ No lean-ci label found. PR can be merged."
exit 0
fi
compute-matrix-filters:
needs: check-lean-ci
runs-on: ubuntu-latest
outputs:
conda_lean_filter: ${{ steps.set-filters.outputs.conda_lean_filter }}
conda_test_filter: ${{ steps.set-filters.outputs.conda_test_filter }}
wheel_lean_filter: ${{ steps.set-filters.outputs.wheel_lean_filter }}
mps_parser_filter: ${{ steps.set-filters.outputs.mps_parser_filter }}
libcuopt_filter: ${{ steps.set-filters.outputs.libcuopt_filter }}
cuopt_server_filter: ${{ steps.set-filters.outputs.cuopt_server_filter }}
cuopt_sh_client_filter: ${{ steps.set-filters.outputs.cuopt_sh_client_filter }}
steps:
- name: Set matrix filters
id: set-filters
run: |
if [ "${{ needs.check-lean-ci.outputs.lean_ci_enabled }}" == "true" ]; then
echo "conda_lean_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.10\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT
echo "conda_test_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.13\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT
echo "wheel_lean_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT
echo "mps_parser_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT
echo "libcuopt_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT
echo "cuopt_server_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT
echo "cuopt_sh_client_filter=[map(select(.ARCH == \"amd64\" and .PY_VER == \"3.12\")) | max_by(.CUDA_VER | split(\".\") | map(tonumber))]" >> $GITHUB_OUTPUT
else
echo "conda_lean_filter=." >> $GITHUB_OUTPUT
echo "conda_test_filter=." >> $GITHUB_OUTPUT
echo "wheel_lean_filter=." >> $GITHUB_OUTPUT
echo "mps_parser_filter=group_by([.ARCH, (.PY_VER |split(\".\") | map(tonumber))])|map(max_by([(.CUDA_VER|split(\".\")|map(tonumber))]))" >> $GITHUB_OUTPUT
echo "libcuopt_filter=group_by([.ARCH, (.CUDA_VER|split(\".\")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(\".\")|map(tonumber)))" >> $GITHUB_OUTPUT
echo "cuopt_server_filter=map(select(.ARCH == \"amd64\")) | group_by(.CUDA_VER|split(\".\")|map(tonumber)|.[0]) | map(max_by([(.PY_VER|split(\".\")|map(tonumber)), (.CUDA_VER|split(\".\")|map(tonumber))]))" >> $GITHUB_OUTPUT
echo "cuopt_sh_client_filter=[map(select(.ARCH == \"amd64\")) | min_by((.PY_VER | split(\".\") | map(tonumber)), (.CUDA_VER | split(\".\") | map(-tonumber)))]" >> $GITHUB_OUTPUT
fi
changed-files:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@main
with:
files_yaml: |
test_cpp:
- '**'
- '!CONTRIBUTING.md'
- '!README.md'
- '!ci/release/update-version-cuopt.sh'
- '!ci/release/update-version-rapids.sh'
- '!docs/**'
- '!img/**'
- '!notebooks/**'
- '!python/**'
- '!readme_pages/**'
- '!container-builder/**'
- '!helm-chart/**'
- '!ngc/**'
- '!omniverse/**'
- '!regression/**'
- '!resources/**'
- '!ucf/**'
- '!utilities/**'
test_notebooks:
- '**'
- '!CONTRIBUTING.md'
- '!README.md'
- '!ci/release/update-version-cuopt.sh'
- '!ci/release/update-version-rapids.sh'
- '!docs/**'
- '!python/nvcf_client/**'
test_python:
- '**'
- '!CONTRIBUTING.md'
- '!README.md'
- '!ci/release/update-version-cuopt.sh'
- '!ci/release/update-version-rapids.sh'
- '!docs/**'
- '!img/**'
- '!notebooks/**'
- '!python/nvcf_client/**'
test_python_cuopt:
- '**'
- '!CONTRIBUTING.md'
- '!README.md'
- '!ci/release/update-version-cuopt.sh'
- '!ci/release/update-version-rapids.sh'
- '!docs/**'
- '!img/**'
- '!notebooks/**'
- '!python/cuopt_self_hosted/**'
- '!python/cuopt_server/**'
- '!python/nvcf_client/**'
test_python_cuopt_server:
- '**'
- '!CONTRIBUTING.md'
- '!README.md'
- '!ci/release/update-version-cuopt.sh'
- '!ci/release/update-version-rapids.sh'
- '!docs/**'
- '!img/**'
- '!notebooks/**'
- '!python/cuopt_self_hosted/**'
- '!python/nvcf_client/**'
checks:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@main
with:
enable_check_generated_files: false
conda-cpp-build:
needs: [checks, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@main
with:
build_type: pull-request
script: ci/build_cpp.sh
matrix_filter: ${{ needs.compute-matrix-filters.outputs.conda_lean_filter }}
conda-cpp-tests:
needs: [conda-cpp-build, changed-files, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@main
#if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
with:
build_type: pull-request
script: ci/test_cpp.sh
matrix_filter: ${{ needs.compute-matrix-filters.outputs.conda_test_filter }}
conda-python-build:
needs: [conda-cpp-build, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@main
with:
build_type: pull-request
script: ci/build_python.sh
matrix_filter: ${{ needs.compute-matrix-filters.outputs.conda_test_filter }}
conda-python-tests:
needs: [conda-python-build, changed-files, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@main
#if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python
with:
run_codecov: false
build_type: pull-request
script: ci/test_python.sh
matrix_filter: ${{ needs.compute-matrix-filters.outputs.conda_test_filter }}
docs-build:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
with:
build_type: pull-request
node_type: "gpu-l4-latest-1"
arch: "amd64"
file_to_upload: "docs/cuopt/build/html/"
artifact-name: "cuopt_docs"
container_image: "rapidsai/ci-conda:26.02-latest"
script: "ci/build_docs.sh"
wheel-build-cuopt-mps-parser:
needs: compute-matrix-filters
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
build_type: pull-request
script: ci/build_wheel_cuopt_mps_parser.sh
package-name: cuopt_mps_parser
package-type: python
append-cuda-suffix: false
# need 1 build per Python version and arch (but CUDA version doesn't matter so choose the latest)
matrix_filter: ${{ needs.compute-matrix-filters.outputs.mps_parser_filter }}
wheel-build-libcuopt:
needs: [wheel-build-cuopt-mps-parser, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
# build for every combination of arch and CUDA version, but only for the latest Python
matrix_filter: ${{ needs.compute-matrix-filters.outputs.libcuopt_filter }}
package-type: cpp
package-name: libcuopt
build_type: pull-request
script: ci/build_wheel_libcuopt.sh
wheel-build-cuopt:
needs: [wheel-build-cuopt-mps-parser, wheel-build-libcuopt, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
build_type: pull-request
script: ci/build_wheel_cuopt.sh
package-name: cuopt
package-type: python
matrix_filter: ${{ needs.compute-matrix-filters.outputs.wheel_lean_filter }}
wheel-tests-cuopt:
needs: [wheel-build-cuopt, wheel-build-cuopt-mps-parser, wheel-build-cuopt-sh-client, changed-files, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@main
#if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cuopt
with:
build_type: pull-request
script: ci/test_wheel_cuopt.sh
matrix_filter: ${{ needs.compute-matrix-filters.outputs.wheel_lean_filter }}
wheel-build-cuopt-server:
needs: [checks, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
build_type: pull-request
script: ci/build_wheel_cuopt_server.sh
package-name: cuopt_server
package-type: python
pure-wheel: true
# Only need 1 package per CUDA major version. This selects "ARCH=amd64 + the latest supported Python, 1 job per major CUDA version".
matrix_filter: ${{ needs.compute-matrix-filters.outputs.cuopt_server_filter }}
wheel-build-cuopt-sh-client:
needs: compute-matrix-filters
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
build_type: pull-request
script: ci/build_wheel_cuopt_sh_client.sh
package-name: cuopt_sh_client
package-type: python
append-cuda-suffix: false
pure-wheel: true
# only need 1 build (noarch package): this selects amd64, oldest-supported Python, latest-supported CUDA
matrix_filter: ${{ needs.compute-matrix-filters.outputs.cuopt_sh_client_filter }}
wheel-tests-cuopt-server:
needs: [wheel-build-cuopt, wheel-build-cuopt-server, changed-files, compute-matrix-filters]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@main
#if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_cuopt_server
with:
build_type: pull-request
script: ci/test_wheel_cuopt_server.sh
matrix_filter: ${{ needs.compute-matrix-filters.outputs.wheel_lean_filter }}
test-self-hosted-server:
needs: [wheel-build-cuopt, wheel-build-cuopt-server, changed-files]
secrets: inherit
uses: ./.github/workflows/self_hosted_service_test.yaml
#if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python
with:
build_type: pull-request
script: ci/test_self_hosted_service.sh