-
Notifications
You must be signed in to change notification settings - Fork 209
355 lines (348 loc) · 12.2 KB
/
Copy pathbuild.yaml
File metadata and controls
355 lines (348 loc) · 12.2 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
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
# SPDX-FileCopyrightText: Copyright (c) 2021-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: build
on:
push:
branches:
- "main"
- "release/*"
tags:
- v[0-9][0-9].[0-9][0-9].[0-9][0-9]
workflow_dispatch:
inputs:
branch:
description: |
branch: git branch the workflow run targets.
Required even when 'sha' is provided because it is also used for organizing artifacts.
required: true
type: string
date:
description: "date: Date (YYYY-MM-DD) this run is for. Used to organize artifacts produced by nightly builds"
required: true
type: string
sha:
description: "sha: full git commit SHA to check out"
required: true
type: string
build_type:
description: "build_type: one of [branch, nightly, pull-request]"
type: string
default: nightly
# Triggering 'test.yaml' from inside 'build.yaml' allows the use of the 'needs:' mechanism
# to ensure tests only start runniing once the builds they need are complete.
trigger-tests:
description: |
If 'true', trigger the test workflow after all builds complete.
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.build_type || 'branch' }}
cancel-in-progress: true
permissions: {}
jobs:
cpp-build:
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
script: ci/build_cpp.sh
python-build:
needs: [cpp-build]
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
script: ci/build_python.sh
upload-conda:
needs: [cpp-build, python-build]
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@main
secrets:
CONDA_RAPIDSAI_NIGHTLY_TOKEN: ${{ secrets.CONDA_RAPIDSAI_NIGHTLY_TOKEN }}
CONDA_RAPIDSAI_TOKEN: ${{ secrets.CONDA_RAPIDSAI_TOKEN }}
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
wheel-build-libcuopt:
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel_libcuopt.sh
package-name: libcuopt
package-type: cpp
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
wheel-publish-libcuopt:
needs: wheel-build-libcuopt
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@main
secrets:
CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN: ${{ secrets.CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN }}
RAPIDSAI_PYPI_TOKEN: ${{ secrets.RAPIDSAI_PYPI_TOKEN }}
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: libcuopt
package-type: cpp
publish-wheel-search-key: cuopt_wheel_cpp_libcuopt
wheel-build-cuopt:
needs: [wheel-build-libcuopt]
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel_cuopt.sh
package-name: cuopt
package-type: python
wheel-publish-cuopt:
needs: wheel-build-cuopt
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@main
secrets:
CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN: ${{ secrets.CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN }}
RAPIDSAI_PYPI_TOKEN: ${{ secrets.RAPIDSAI_PYPI_TOKEN }}
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cuopt
package-type: python
publish-wheel-search-key: cuopt_wheel_python_cuopt_
wheel-build-cuopt-server:
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
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: 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))]))
wheel-publish-cuopt-server:
needs: wheel-build-cuopt-server
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@main
secrets:
CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN: ${{ secrets.CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN }}
RAPIDSAI_PYPI_TOKEN: ${{ secrets.RAPIDSAI_PYPI_TOKEN }}
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cuopt_server
package-type: python
publish-wheel-search-key: cuopt_wheel_python_cuopt-server
docs-build:
needs: [python-build]
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
node_type: "gpu-l4-latest-1"
sha: ${{ inputs.sha }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
arch: "amd64"
file_to_upload: "docs/cuopt/build/html/"
artifact-name: "cuopt_docs"
container_image: "rapidsai/ci-conda:26.08-latest"
script: "ci/build_docs.sh"
wheel-build-cuopt-sh-client:
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@main
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
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: '[map(select(.ARCH == "amd64")) | min_by((.PY_VER | split(".") | map(tonumber)), (.CUDA_VER | split(".") | map(-tonumber)))]'
wheel-publish-cuopt-sh-client:
needs: wheel-build-cuopt-sh-client
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@main
secrets:
CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN: ${{ secrets.CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN }}
RAPIDSAI_PYPI_TOKEN: ${{ secrets.RAPIDSAI_PYPI_TOKEN }}
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cuopt_sh_client
package-type: python
publish-wheel-search-key: cuopt_wheel_python_cuopt-sh-client
tests:
# Docker image build / tests aren't necessary for the 'test.yaml' workflow,
# so 'test.yaml' can be triggered without waiting for those.
needs:
- upload-conda
- wheel-publish-cuopt
- wheel-publish-cuopt-server
- wheel-publish-cuopt-sh-client
- wheel-publish-libcuopt
if: inputs.trigger-tests
permissions:
actions: write
contents: read
runs-on: ubuntu-latest
# ref: https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable
env:
GH_TOKEN: ${{ github.token }}
INPUT_BRANCH: "${{ inputs.branch }}"
INPUT_BUILD_TYPE: "${{ inputs.build_type }}"
INPUT_DATE: "${{ inputs.date }}"
INPUT_SHA: "${{ inputs.sha }}"
steps:
- name: trigger-test-workflow
run: |
# NOTE: '--ref' is the branch to pull the workflow file from, 'branch' input is the branch
# to pull the actual cuOpt source code from
gh workflow run \
--repo NVIDIA/cuopt \
--ref "$GITHUB_REF" \
'test.yaml' \
-f branch="${INPUT_BRANCH}" \
-f build_type="${INPUT_BUILD_TYPE}" \
-f date="${INPUT_DATE}" \
-f sha="${INPUT_SHA}"
build-summary:
if: ${{ always() && (inputs.build_type == 'nightly') }}
needs:
- tests
- build-images
- docs-build
permissions:
contents: read
runs-on: linux-amd64-cpu4
container:
image: python:3.14-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.sha }}
persist-credentials: false
- name: Install dependencies
run: apt-get update && apt-get install -y --no-install-recommends curl
- name: Send build summary
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_TOKEN: ${{ github.token }}
RAPIDS_BRANCH: ${{ inputs.branch }}
SLACK_BOT_TOKEN: ${{ secrets.CUOPT_SLACK_BOT_TOKEN }}
SLACK_CHANNEL_ID: ${{ secrets.CUOPT_SLACK_CHANNEL_ID }}
run: bash ci/build_summary.sh
build-images:
needs:
- wheel-publish-cuopt
- wheel-publish-cuopt-server
- wheel-publish-cuopt-sh-client
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
uses: ./.github/workflows/build_test_publish_images.yaml
secrets: inherit # zizmor: ignore[secrets-inherit]
with:
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
build_type: ${{ inputs.build_type || 'branch' }}