Skip to content

Commit 2676e38

Browse files
committed
ci: finish planner output and environment simplification
1 parent 29ca7e0 commit 2676e38

12 files changed

Lines changed: 113 additions & 160 deletions

‎.github/workflows/build-wheel.yml‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ on:
1717
required: false
1818
type: boolean
1919
default: false
20-
python-versions:
21-
description: "JSON-encoded array of Python versions to build (e.g. '[\"3.11\",\"3.12\"]'). ci.yml sources this from ci/versions.yml."
22-
required: true
23-
type: string
2420

2521
defaults:
2622
run:
@@ -35,7 +31,7 @@ jobs:
3531
strategy:
3632
fail-fast: false
3733
matrix:
38-
python-version: ${{ fromJSON(inputs.python-versions) }}
34+
python-version: ${{ fromJSON(inputs.workplan).jobs.wheel_python_versions[inputs.host-platform] }}
3935
name: py${{ matrix.python-version }}
4036
runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') ||
4137
(inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
@@ -96,7 +92,7 @@ jobs:
9692
HOST_PLATFORM: ${{ inputs.host-platform }}
9793
PY_VER: ${{ matrix.python-version }}
9894
SHA: ${{ github.sha }}
99-
run: ./ci/tools/env-vars build
95+
run: python ci/tools/ci_env.py build
10096

10197
- name: Install rapidsai/sccache
10298
if: ${{ startsWith(inputs.host-platform, 'linux') && (env.BUILD_BINDINGS == 'true' || env.BUILD_CORE == 'true') }}

‎.github/workflows/ci.yml‎

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,14 @@ jobs:
9090
actions: read
9191
contents: read
9292
outputs:
93-
bindings-config: ${{ steps.registry.outputs.bindings-config }}
94-
python-supported: ${{ steps.registry.outputs.python-supported }}
95-
windows-arm64-supported: ${{ steps.registry.outputs.windows-arm64-supported }}
96-
windows-arm64-python-supported: ${{ steps.registry.outputs.windows-arm64-python-supported }}
97-
windows-arm64-single-cuda-major: ${{ steps.registry.outputs.windows-arm64-single-cuda-major }}
93+
bindings-config: ${{ steps.workplan.outputs.bindings-config }}
9894
workplan: ${{ steps.workplan.outputs.workplan }}
95+
platform-linux: ${{ steps.workplan.outputs.platform-linux }}
96+
platform-windows: ${{ steps.workplan.outputs.platform-windows }}
97+
windows-arm64-build: ${{ steps.workplan.outputs.windows-arm64-build }}
98+
windows-arm64-single-cuda-major: ${{ steps.workplan.outputs.windows-arm64-single-cuda-major }}
99+
sdist-tests: ${{ steps.workplan.outputs.sdist-tests }}
100+
core-api-checks: ${{ steps.workplan.outputs.core-api-checks }}
99101
steps:
100102
- name: Checkout repository
101103
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -112,10 +114,6 @@ jobs:
112114
- name: Install CI tool test dependencies
113115
run: python3 -m pip install -e './ci[test]'
114116

115-
- name: Read bindings configuration and select supported build platforms
116-
id: registry
117-
run: python3 -m ci.tools.bindings_config --github-output "$GITHUB_OUTPUT"
118-
119117
- name: Resolve PR merge base
120118
id: merge-base
121119
if: ${{ startsWith(github.ref_name, 'pull-request/') }}
@@ -211,24 +209,13 @@ jobs:
211209
MERGE_BASE: ${{ steps.merge-base.outputs.sha }}
212210
BASELINE_RUN_ID: ${{ steps.baseline.outputs.run_id }}
213211
RELEASE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
214-
run: |
215-
set -euo pipefail
216-
planner_args=(
217-
--merge-base "$MERGE_BASE"
218-
--baseline-run-id "$BASELINE_RUN_ID"
219-
)
220-
if [[ -n "$RELEASE_TAG" ]]; then
221-
planner_args+=(--release-tag "$RELEASE_TAG")
222-
fi
223-
python3 -m ci.tools.compute_ci_plan "${planner_args[@]}" \
224-
--github-output "$GITHUB_OUTPUT" \
225-
--github-step-summary "$GITHUB_STEP_SUMMARY"
212+
run: python3 -m ci.tools.compute_ci_plan
226213

227214
api-check-core-vs-release:
228215
name: API check (cuda_core vs. latest release)
229216
if: >-
230217
${{ !fromJSON(needs.should-skip.outputs.skip) &&
231-
fromJSON(needs.detect-changes.outputs.workplan).jobs.core_api_checks }}
218+
needs.detect-changes.outputs.core-api-checks == 'true' }}
232219
runs-on: ubuntu-latest
233220
needs:
234221
- should-skip
@@ -279,7 +266,7 @@ jobs:
279266
if: >-
280267
${{ startsWith(github.ref_name, 'pull-request/') &&
281268
!fromJSON(needs.should-skip.outputs.skip) &&
282-
fromJSON(needs.detect-changes.outputs.workplan).jobs.core_api_checks }}
269+
needs.detect-changes.outputs.core-api-checks == 'true' }}
283270
runs-on: ubuntu-latest
284271
needs:
285272
- should-skip
@@ -333,7 +320,6 @@ jobs:
333320
with:
334321
host-platform: ${{ matrix.host-platform }}
335322
workplan: ${{ needs.detect-changes.outputs.workplan }}
336-
python-versions: ${{ needs.detect-changes.outputs.python-supported }}
337323

338324
# See build-linux-64 for why build jobs are split by platform.
339325
build-linux-aarch64:
@@ -349,7 +335,7 @@ jobs:
349335
if: ${{ github.repository_owner == 'nvidia' &&
350336
!fromJSON(needs.should-skip.outputs.skip) &&
351337
!fromJSON(needs.should-skip.outputs.doc-only) &&
352-
fromJSON(needs.detect-changes.outputs.workplan).jobs.platforms.linux }}
338+
needs.detect-changes.outputs.platform-linux == 'true' }}
353339
permissions:
354340
actions: read
355341
contents: read
@@ -358,7 +344,6 @@ jobs:
358344
with:
359345
host-platform: ${{ matrix.host-platform }}
360346
workplan: ${{ needs.detect-changes.outputs.workplan }}
361-
python-versions: ${{ needs.detect-changes.outputs.python-supported }}
362347

363348
# See build-linux-64 for why build jobs are split by platform.
364349
build-windows:
@@ -374,7 +359,7 @@ jobs:
374359
if: ${{ github.repository_owner == 'nvidia' &&
375360
!fromJSON(needs.should-skip.outputs.skip) &&
376361
!fromJSON(needs.should-skip.outputs.doc-only) &&
377-
fromJSON(needs.detect-changes.outputs.workplan).jobs.platforms.windows }}
362+
needs.detect-changes.outputs.platform-windows == 'true' }}
378363
permissions:
379364
actions: read
380365
contents: read
@@ -383,7 +368,6 @@ jobs:
383368
with:
384369
host-platform: ${{ matrix.host-platform }}
385370
workplan: ${{ needs.detect-changes.outputs.workplan }}
386-
python-versions: ${{ needs.detect-changes.outputs.python-supported }}
387371

388372
# Windows ARM64 is available starting with CUDA 13.4. While CUDA 13 is current,
389373
# build only that major; at 13/14, both configured majors have ARM64 toolkits.
@@ -395,9 +379,7 @@ jobs:
395379
if: ${{ github.repository_owner == 'nvidia' &&
396380
!fromJSON(needs.should-skip.outputs.skip) &&
397381
!fromJSON(needs.should-skip.outputs.doc-only) &&
398-
needs.detect-changes.outputs.windows-arm64-supported == 'true' &&
399-
fromJSON(needs.detect-changes.outputs.workplan).jobs.windows_arm64_build &&
400-
fromJSON(needs.detect-changes.outputs.workplan).jobs.platforms.windows }}
382+
needs.detect-changes.outputs.windows-arm64-build == 'true' }}
401383
permissions:
402384
actions: read
403385
contents: read
@@ -407,7 +389,6 @@ jobs:
407389
host-platform: win-arm64
408390
workplan: ${{ needs.detect-changes.outputs.workplan }}
409391
single-cuda-major: ${{ needs.detect-changes.outputs.windows-arm64-single-cuda-major == 'true' }}
410-
python-versions: ${{ needs.detect-changes.outputs.windows-arm64-python-supported }}
411392

412393
woa-main-dispatch:
413394
name: Dispatch WoA integration
@@ -447,7 +428,7 @@ jobs:
447428
if: ${{ github.repository_owner == 'nvidia' &&
448429
!fromJSON(needs.should-skip.outputs.skip) &&
449430
!fromJSON(needs.should-skip.outputs.doc-only) &&
450-
fromJSON(needs.detect-changes.outputs.workplan).jobs.sdist_tests }}
431+
needs.detect-changes.outputs.sdist-tests == 'true' }}
451432
permissions:
452433
actions: read
453434
contents: read
@@ -472,7 +453,7 @@ jobs:
472453
if: ${{ github.repository_owner == 'nvidia' &&
473454
!fromJSON(needs.should-skip.outputs.skip) &&
474455
!fromJSON(needs.should-skip.outputs.doc-only) &&
475-
fromJSON(needs.detect-changes.outputs.workplan).jobs.sdist_tests }}
456+
needs.detect-changes.outputs.sdist-tests == 'true' }}
476457
permissions:
477458
actions: read
478459
contents: read
@@ -496,7 +477,7 @@ jobs:
496477
name: Test ${{ matrix.host-platform }}
497478
if: ${{ github.repository_owner == 'nvidia' &&
498479
!fromJSON(needs.should-skip.outputs.doc-only) &&
499-
fromJSON(needs.detect-changes.outputs.workplan).jobs.platforms.linux }}
480+
needs.detect-changes.outputs.platform-linux == 'true' }}
500481
permissions:
501482
actions: read
502483
contents: read # This is required for actions/checkout
@@ -523,7 +504,7 @@ jobs:
523504
name: Test ${{ matrix.host-platform }}
524505
if: ${{ github.repository_owner == 'nvidia' &&
525506
!fromJSON(needs.should-skip.outputs.doc-only) &&
526-
fromJSON(needs.detect-changes.outputs.workplan).jobs.platforms.linux }}
507+
needs.detect-changes.outputs.platform-linux == 'true' }}
527508
permissions:
528509
actions: read
529510
contents: read # This is required for actions/checkout
@@ -551,7 +532,7 @@ jobs:
551532
name: Test ${{ matrix.host-platform }}
552533
if: ${{ github.repository_owner == 'nvidia' &&
553534
!fromJSON(needs.should-skip.outputs.doc-only) &&
554-
fromJSON(needs.detect-changes.outputs.workplan).jobs.platforms.windows }}
535+
needs.detect-changes.outputs.platform-windows == 'true' }}
555536
permissions:
556537
actions: read
557538
contents: read # This is required for actions/checkout
@@ -630,12 +611,11 @@ jobs:
630611
fi
631612
632613
doc_only="${{ needs.should-skip.outputs.doc-only }}"
633-
linux_selected="${{ needs.detect-changes.outputs.workplan && fromJSON(needs.detect-changes.outputs.workplan).jobs.platforms.linux || false }}"
634-
windows_selected="${{ needs.detect-changes.outputs.workplan && fromJSON(needs.detect-changes.outputs.workplan).jobs.platforms.windows || false }}"
635-
windows_arm64_supported="${{ needs.detect-changes.outputs.windows-arm64-supported }}"
636-
windows_arm64_selected="${{ needs.detect-changes.outputs.workplan && fromJSON(needs.detect-changes.outputs.workplan).jobs.windows_arm64_build || false }}"
637-
build_selected="${{ needs.detect-changes.outputs.workplan && fromJSON(needs.detect-changes.outputs.workplan).jobs.sdist_tests || false }}"
638-
run_core_api_check="${{ needs.detect-changes.outputs.workplan && fromJSON(needs.detect-changes.outputs.workplan).jobs.core_api_checks || false }}"
614+
linux_selected="${{ needs.detect-changes.outputs.platform-linux }}"
615+
windows_selected="${{ needs.detect-changes.outputs.platform-windows }}"
616+
windows_arm64_selected="${{ needs.detect-changes.outputs.windows-arm64-build }}"
617+
build_selected="${{ needs.detect-changes.outputs.sdist-tests }}"
618+
run_core_api_check="${{ needs.detect-changes.outputs.core-api-checks }}"
639619
is_pr="${{ startsWith(github.ref_name, 'pull-request/') }}"
640620
status="success"
641621
check_result() {
@@ -667,7 +647,7 @@ jobs:
667647
check_result "build-windows" "$windows_expected"
668648
669649
windows_arm64_expected="skipped"
670-
if [[ "$windows_arm64_supported" == "true" && "$windows_arm64_selected" == "true" ]]; then
650+
if [[ "$windows_arm64_selected" == "true" ]]; then
671651
windows_arm64_expected="$windows_expected"
672652
fi
673653
check_result "build-windows-arm64" "$windows_arm64_expected"

‎.github/workflows/coverage.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
PY_VER: ${{ env.PY_VER }}
111111
SHA: ${{ github.sha }}
112112
run: |
113-
./ci/tools/env-vars test
113+
python ci/tools/ci_env.py test
114114
echo "CUDA_PYTHON_COVERAGE=1" >> $GITHUB_ENV
115115
116116
- name: Set up mini CTK

‎.github/workflows/test-wheel-linux.yml‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ defaults:
5757

5858
jobs:
5959
compute-matrix:
60-
# Let empty configuration reach validation even when the workplan has no tests.
61-
if: >-
62-
${{ inputs.bindings-config == '' || inputs.bindings-config == 'LEGACY_CONFIG' || inputs.workplan == '' ||
63-
contains(fromJSON(inputs.workplan).jobs.test_cuda_majors.*, true) }}
6460
runs-on: ubuntu-latest
6561
env:
6662
BINDINGS_CONFIG: ${{ inputs.bindings-config }}
@@ -138,8 +134,7 @@ jobs:
138134
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
139135
runs-on: "${{ matrix.FLAVOR || 'linux' }}-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.RUNNER_DRIVER }}-${{ matrix.GPU_COUNT }}"
140136
# The build stage could fail but we want the CI to keep moving.
141-
if: ${{ github.repository_owner == 'nvidia' && !cancelled() &&
142-
(inputs.bindings-config == 'LEGACY_CONFIG' || inputs.workplan == '' || contains(fromJSON(inputs.workplan).jobs.test_cuda_majors.*, true)) }}
137+
if: ${{ github.repository_owner == 'nvidia' && !cancelled() }}
143138
# Our self-hosted runners require a container
144139
# TODO: use a different (nvidia?) container
145140
container:
@@ -178,7 +173,7 @@ jobs:
178173
# for artifact fetching, graphics libs, g++ required for cffi in
179174
# example; util-linux for `nsenter` (custom-DRIVER rows re-exec
180175
# install_gpu_driver.sh onto the host through nsenter)
181-
# yq supports retained legacy-snapshot routing in ci/tools/env-vars
176+
# yq supports retained legacy-snapshot routing in ci/tools/ci_env.py
182177
dependencies: "jq wget libgl1 libegl1 g++ util-linux yq"
183178
dependent_exes: "jq wget yq"
184179

@@ -219,7 +214,7 @@ jobs:
219214
PY_VER: ${{ matrix.PY_VER }}
220215
SHA: ${{ inputs.sha || github.sha }}
221216
SKIP_BINDINGS_TEST_OVERRIDE: ${{ env.TEST_BINDINGS != 'true' && '1' || '0' }}
222-
run: ./.ci-control/ci/tools/env-vars test
217+
run: python .ci-control/ci/tools/ci_env.py test
223218

224219
- name: Apply extra matrix environment variables
225220
if: ${{ matrix.ENV }}

‎.github/workflows/test-wheel-windows.yml‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ on:
5353

5454
jobs:
5555
compute-matrix:
56-
# Let empty configuration reach validation even when the workplan has no tests.
57-
if: >-
58-
${{ inputs.bindings-config == '' || inputs.bindings-config == 'LEGACY_CONFIG' || inputs.workplan == '' ||
59-
contains(fromJSON(inputs.workplan).jobs.test_cuda_majors.*, true) }}
6056
runs-on: ubuntu-latest
6157
defaults:
6258
run:
@@ -134,8 +130,7 @@ jobs:
134130
strategy:
135131
fail-fast: false
136132
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
137-
if: ${{ github.repository_owner == 'nvidia' && !cancelled() &&
138-
(inputs.bindings-config == 'LEGACY_CONFIG' || inputs.workplan == '' || contains(fromJSON(inputs.workplan).jobs.test_cuda_majors.*, true)) }}
133+
if: ${{ github.repository_owner == 'nvidia' && !cancelled() }}
139134
runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.RUNNER_DRIVER }}-${{ matrix.GPU_COUNT }}"
140135
steps:
141136
- name: Enable Git symlinks (Windows, must precede checkout)
@@ -211,7 +206,7 @@ jobs:
211206
SHA: ${{ inputs.sha || github.sha }}
212207
SKIP_BINDINGS_TEST_OVERRIDE: ${{ env.TEST_BINDINGS != 'true' && '1' || '0' }}
213208
shell: bash --noprofile --norc -xeuo pipefail {0}
214-
run: ./.ci-control/ci/tools/env-vars test
209+
run: python .ci-control/ci/tools/ci_env.py test
215210

216211
- name: Apply extra matrix environment variables
217212
if: ${{ matrix.ENV }}

‎ci/tools/bindings_config.py‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -232,40 +232,20 @@ def write_github_env(data: Mapping[str, object], path: Path) -> None:
232232
stream.write(f"RESOLVED_BINDINGS_PACKAGE={json.dumps(data, separators=(',', ':'))}\n")
233233

234234

235-
def write_registry_github_output(config: BindingsConfig, path: Path) -> None:
236-
"""Emit the registry and the scalar outputs needed by the CI caller."""
237-
current = config.package_for_release_status("current")
238-
versions = wheel_python_versions(current.toolkit_version, "win-arm64", config.python_supported)
239-
values = {
240-
"bindings-config": config.to_json(),
241-
"python-supported": json.dumps(config.python_supported),
242-
"windows-arm64-supported": str(bool(versions)).lower(),
243-
"windows-arm64-single-cuda-major": str(config.windows_arm64_single_cuda_major).lower(),
244-
"windows-arm64-python-supported": json.dumps(versions),
245-
}
246-
with path.open("a", encoding="utf-8") as stream:
247-
for name, value in values.items():
248-
stream.write(f"{name}={value}\n")
249-
250-
251235
def main(argv: list[str] | None = None) -> int:
252236
parser = argparse.ArgumentParser(description=__doc__)
253237
parser.add_argument("--config", type=Path, default=DEFAULT_CONFIG)
254238
output = parser.add_mutually_exclusive_group()
255239
output.add_argument("--package-roots", action="store_true")
256240
output.add_argument("--release-status", choices=sorted(RELEASE_STATUSES))
257241
output.add_argument("--release-tag", help="resolve a release tag against its source tree")
258-
output.add_argument("--github-output", type=Path, help="append registry and CI scalar outputs")
259242
parser.add_argument("--release-source-root", type=Path)
260243
commands = parser.add_subparsers(dest="command")
261244
write_env = commands.add_parser("write-github-env", help="append package JSON from stdin to GITHUB_ENV")
262245
write_env.add_argument("github_env", type=Path, metavar="GITHUB_ENV")
263246
args = parser.parse_args(argv)
264247

265248
try:
266-
if args.github_output is not None:
267-
write_registry_github_output(load_config(args.config), args.github_output)
268-
return 0
269249
if args.command == "write-github-env":
270250
if args.package_roots or args.release_status or args.release_tag or args.release_source_root is not None:
271251
parser.error("write-github-env does not accept registry selectors")

0 commit comments

Comments
 (0)