Skip to content

Commit 99ff204

Browse files
rparolincpcloud
authored andcommitted
Merge branch 'main' into rparolin/tma_feature
2 parents eef1c7a + 1c28f35 commit 99ff204

114 files changed

Lines changed: 12710 additions & 5776 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/RELEASE-core.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -123,41 +123,21 @@ Pushing the tag triggers a CI run automatically. Monitor it in the
123123

124124
## Upload wheels to PyPI
125125

126-
This is a two-stage process: first publish to TestPyPI, verify, then
127-
publish to PyPI.
128-
129-
### Stage 1: TestPyPI
126+
This is a single `CI: Release` workflow run with two sequential stages:
127+
publish to TestPyPI, then publish the same wheel set to PyPI.
130128

131129
1. Go to **Actions > CI: Release** and run the workflow with:
132130
- **Component**: `cuda-core`
133131
- **The release git tag**: `cuda-core-v0.6.0`
134-
- **The GHA run ID that generated validated artifacts**: This is the
135-
run ID of the successful tag-triggered CI run from the previous step.
136-
You can find it in the URL when viewing the run in the Actions tab
137-
(e.g. `https://github.com/NVIDIA/cuda-python/actions/runs/123456789`
138-
— the run ID is `123456789`).
139-
- **build-ctk-ver**: the `cuda.build.version` from
140-
[`ci/versions.yml`](../ci/versions.yml) (e.g. `13.1.1`)
141-
- **Which wheel index to publish to**: `testpypi`
142-
143-
2. Wait for the workflow to complete.
144-
145-
3. Verify the TestPyPI upload by installing and running tests from a
146-
checked-out copy of the repository:
147-
148-
```bash
149-
pip install -i https://test.pypi.org/simple/ \
150-
--extra-index-url https://pypi.org/simple/ \
151-
cuda-core==0.6.0
152-
cd cuda_core/tests && pytest
153-
```
154132

155-
### Stage 2: PyPI
133+
The workflow automatically looks up the successful tag-triggered CI run
134+
for the selected release tag.
156135

157-
Once TestPyPI verification passes, rerun the same workflow with:
158-
- **Which wheel index to publish to**: `pypi`
136+
2. Wait for the workflow to complete. It will:
137+
- publish the selected wheels to TestPyPI
138+
- publish the same wheel set to PyPI
159139

160-
After completion, verify:
140+
3. After completion, verify the final PyPI upload:
161141

162142
```bash
163143
pip install cuda-core==0.6.0

.github/copy-pr-bot.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/
66

77
enabled: true
8-
# always require manual CI triggering, ignoring signed commits
8+
# auto-sync ready PRs so CI starts immediately; keep draft PRs manual
99
auto_sync_draft: false
10-
auto_sync_ready: false
10+
auto_sync_ready: true

.github/workflows/build-docs.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ name: "CI: Build and update docs"
77
on:
88
workflow_call:
99
inputs:
10-
build-ctk-ver:
11-
type: string
12-
required: true
1310
component:
1411
description: "Component(s) to build docs for"
1512
required: false
@@ -47,18 +44,21 @@ jobs:
4744
run:
4845
shell: bash -el {0}
4946
steps:
50-
- name: validate build-ctk
51-
run: |
52-
if [ ! "${{ inputs.build-ctk-ver }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]; then
53-
echo "error: `build-ctk-ver` ${{ inputs.build-ctk-ver }} version does not match MAJOR.MINOR.MICRO" >&2
54-
exit 1
55-
fi
5647
- name: Checkout ${{ github.event.repository.name }}
5748
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5849
with:
5950
fetch-depth: 0
6051
ref: ${{ inputs.git-tag }}
6152

53+
- name: Read build CTK version
54+
run: |
55+
BUILD_CTK_VER=$(yq '.cuda.build.version' ci/versions.yml)
56+
if [[ ! "${BUILD_CTK_VER}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
57+
echo "error: derived CTK build version ${BUILD_CTK_VER} does not match MAJOR.MINOR.MICRO" >&2
58+
exit 1
59+
fi
60+
echo "BUILD_CTK_VER=${BUILD_CTK_VER}" >> "$GITHUB_ENV"
61+
6262
# TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache
6363

6464
- name: Set up miniforge
@@ -82,7 +82,7 @@ jobs:
8282
uses: ./.github/actions/fetch_ctk
8383
with:
8484
host-platform: linux-64
85-
cuda-version: ${{ inputs.build-ctk-ver }}
85+
cuda-version: ${{ env.BUILD_CTK_VER }}
8686

8787
- name: Set environment variables
8888
run: |
@@ -103,7 +103,7 @@ jobs:
103103
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
104104
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
105105
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
106-
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build-ctk-ver }}-linux-64"
106+
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${BUILD_CTK_VER}-linux-64"
107107
echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
108108
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
109109
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ jobs:
220220
secrets: inherit
221221
uses: ./.github/workflows/build-docs.yml
222222
with:
223-
build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }}
224223
is-release: ${{ github.ref_type == 'tag' }}
225224

226225
checks:

.github/workflows/coverage.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,27 @@ on:
1111

1212
env:
1313
PY_VER: "3.14"
14-
CUDA_VER: "13.1.0"
1514
LOCAL_CTK: "1"
1615
GPU: "a100"
1716
DRIVER: "latest"
1817

1918
jobs:
19+
coverage-vars:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
CUDA_VER: ${{ steps.get-vars.outputs.cuda_ver }}
23+
steps:
24+
- name: Checkout ${{ github.event.repository.name }}
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
- name: Get CUDA version
27+
id: get-vars
28+
run: |
29+
cuda_ver=$(yq '.cuda.build.version' ci/versions.yml)
30+
echo "cuda_ver=$cuda_ver" >> $GITHUB_OUTPUT
31+
2032
coverage-linux:
2133
name: Coverage (Linux)
34+
needs: [coverage-vars]
2235
runs-on: "linux-amd64-gpu-a100-latest-1"
2336
permissions:
2437
id-token: write
@@ -29,6 +42,7 @@ jobs:
2942
env:
3043
HOST_PLATFORM: "linux-64"
3144
ARCH: "x86_64"
45+
CUDA_VER: ${{ needs.coverage-vars.outputs.CUDA_VER }}
3246
# Our self-hosted runners require a container
3347
# TODO: use a different (nvidia?) container
3448
container:
@@ -164,6 +178,7 @@ jobs:
164178
# Build Windows wheels on GitHub-hosted runner (has VS, no GPU)
165179
build-wheel-windows:
166180
name: Build Wheels (Windows)
181+
needs: [coverage-vars]
167182
runs-on: windows-2022
168183
permissions:
169184
contents: read
@@ -173,6 +188,7 @@ jobs:
173188
env:
174189
HOST_PLATFORM: "win-64"
175190
CUDA_PYTHON_COVERAGE: "1"
191+
CUDA_VER: ${{ needs.coverage-vars.outputs.CUDA_VER }}
176192
steps:
177193
- name: Checkout ${{ github.event.repository.name }}
178194
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -231,7 +247,7 @@ jobs:
231247
# Run coverage tests on self-hosted GPU runner (no VS needed, installs pre-built wheels)
232248
coverage-windows:
233249
name: Coverage (Windows)
234-
needs: [build-wheel-windows]
250+
needs: [coverage-vars, build-wheel-windows]
235251
runs-on: "windows-amd64-gpu-a100-latest-1"
236252
permissions:
237253
id-token: write
@@ -240,6 +256,7 @@ jobs:
240256
HOST_PLATFORM: "win-64"
241257
ARCH: "amd64"
242258
CUDA_PYTHON_COVERAGE: "1"
259+
CUDA_VER: ${{ needs.coverage-vars.outputs.CUDA_VER }}
243260
defaults:
244261
run:
245262
shell: bash --noprofile --norc -xeuo pipefail {0}

.github/workflows/release-cuda-pathfinder.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
tag: ${{ steps.vars.outputs.tag }}
4141
version: ${{ steps.vars.outputs.version }}
4242
run-id: ${{ steps.detect-run.outputs.run-id }}
43-
ctk-ver: ${{ steps.ctk.outputs.ctk-ver }}
4443
steps:
4544
- name: Verify running on default branch
4645
run: |
@@ -77,12 +76,6 @@ jobs:
7776
exit 1
7877
fi
7978
80-
- name: Read CTK build version
81-
id: ctk
82-
run: |
83-
ctk_ver=$(yq '.cuda.build.version' ci/versions.yml)
84-
echo "ctk-ver=${ctk_ver}" >> "$GITHUB_OUTPUT"
85-
8679
- name: Detect CI run ID
8780
id: detect-run
8881
env:
@@ -146,7 +139,6 @@ jobs:
146139
secrets: inherit
147140
uses: ./.github/workflows/build-docs.yml
148141
with:
149-
build-ctk-ver: ${{ needs.prepare.outputs.ctk-ver }}
150142
component: cuda-pathfinder
151143
git-tag: ${{ needs.prepare.outputs.tag }}
152144
run-id: ${{ needs.prepare.outputs.run-id }}

.github/workflows/release.yml

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
name: "CI: Release"
66

7-
# Manually-triggered release workflow. Creates a release draft if one doesn't exist for the given tag, or uses existing draft.
7+
# Manually-triggered release workflow. Creates a release draft if one doesn't exist
8+
# for the given tag, or uses an existing draft, then publishes the selected wheels
9+
# to TestPyPI followed by PyPI.
810

911
on:
1012
workflow_dispatch:
@@ -28,16 +30,6 @@ on:
2830
required: false
2931
type: string
3032
default: ""
31-
build-ctk-ver:
32-
type: string
33-
required: true
34-
wheel-dst:
35-
description: "Which wheel index to publish to?"
36-
required: true
37-
type: choice
38-
options:
39-
- testpypi
40-
- pypi
4133

4234
defaults:
4335
run:
@@ -60,15 +52,10 @@ jobs:
6052
env:
6153
GH_TOKEN: ${{ github.token }}
6254
run: |
63-
if [[ -n "${{ inputs.run-id }}" ]]; then
64-
echo "Using provided run ID: ${{ inputs.run-id }}"
65-
echo "run-id=${{ inputs.run-id }}" >> $GITHUB_OUTPUT
66-
else
67-
echo "Auto-detecting successful tag-triggered run ID for tag: ${{ inputs.git-tag }}"
68-
RUN_ID=$(./ci/tools/lookup-run-id "${{ inputs.git-tag }}" "${{ github.repository }}")
69-
echo "Auto-detected run ID: $RUN_ID"
70-
echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT
71-
fi
55+
echo "Auto-detecting successful tag-triggered run ID for tag: ${{ inputs.git-tag }}"
56+
RUN_ID=$(./ci/tools/lookup-run-id "${{ inputs.git-tag }}" "${{ github.repository }}")
57+
echo "Auto-detected run ID: $RUN_ID"
58+
echo "run-id=$RUN_ID" >> "$GITHUB_OUTPUT"
7259
7360
check-tag:
7461
runs-on: ubuntu-latest
@@ -82,17 +69,11 @@ jobs:
8269
env:
8370
GH_TOKEN: ${{ github.token }}
8471
run: |
85-
tags=
86-
for i in $(gh release list -R ${{ github.repository }} --json tagName --jq '.[]| .tagName'); do
87-
tags+=( $i )
88-
done
89-
is_draft=
90-
for i in $(gh release list -R ${{ github.repository }} --json isDraft --jq '.[]| .isDraft'); do
91-
is_draft+=( $i )
92-
done
72+
mapfile -t tags < <(gh release list -R "${{ github.repository }}" --json tagName --jq '.[] | .tagName')
73+
mapfile -t is_draft < <(gh release list -R "${{ github.repository }}" --json isDraft --jq '.[] | .isDraft')
9374
9475
found=0
95-
for idx in ${!tags[@]}; do
76+
for idx in "${!tags[@]}"; do
9677
if [[ "${tags[$idx]}" == "${{ inputs.git-tag }}" ]]; then
9778
echo "found existing release for ${{ inputs.git-tag }}"
9879
found=1
@@ -122,7 +103,6 @@ jobs:
122103
secrets: inherit
123104
uses: ./.github/workflows/build-docs.yml
124105
with:
125-
build-ctk-ver: ${{ inputs.build-ctk-ver }}
126106
component: ${{ inputs.component }}
127107
git-tag: ${{ inputs.git-tag }}
128108
run-id: ${{ needs.determine-run-id.outputs.run-id }}
@@ -143,16 +123,16 @@ jobs:
143123
run-id: ${{ needs.determine-run-id.outputs.run-id }}
144124
component: ${{ inputs.component }}
145125

146-
publish-wheels:
147-
name: Publish wheels
126+
publish-testpypi:
127+
name: Publish wheels to TestPyPI
148128
runs-on: ubuntu-latest
149129
needs:
150130
- check-tag
151131
- determine-run-id
152132
- doc
153133
environment:
154-
name: ${{ inputs.wheel-dst }}
155-
url: https://${{ (inputs.wheel-dst == 'testpypi' && 'test.') || '' }}pypi.org/p/${{ inputs.component }}/
134+
name: testpypi
135+
url: https://test.pypi.org/${{ inputs.component != 'all' && format('p/{0}/', inputs.component) || '' }}
156136
permissions:
157137
id-token: write
158138
steps:
@@ -169,14 +149,37 @@ jobs:
169149
run: |
170150
./ci/tools/validate-release-wheels "${{ inputs.git-tag }}" "${{ inputs.component }}" "dist"
171151
172-
- name: Publish package distributions to PyPI
173-
if: ${{ inputs.wheel-dst == 'pypi' }}
174-
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
175-
176152
- name: Publish package distributions to TestPyPI
177-
if: ${{ inputs.wheel-dst == 'testpypi' }}
178153
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
179154
with:
180155
repository-url: https://test.pypi.org/legacy/
181156

157+
publish-pypi:
158+
name: Publish wheels to PyPI
159+
runs-on: ubuntu-latest
160+
needs:
161+
- determine-run-id
162+
- publish-testpypi
163+
environment:
164+
name: pypi
165+
url: https://pypi.org/${{ inputs.component != 'all' && format('p/{0}/', inputs.component) || '' }}
166+
permissions:
167+
id-token: write
168+
steps:
169+
- name: Checkout Source
170+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
171+
172+
- name: Download component wheels
173+
env:
174+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
run: |
176+
./ci/tools/download-wheels "${{ needs.determine-run-id.outputs.run-id }}" "${{ inputs.component }}" "${{ github.repository }}" "dist"
177+
178+
- name: Validate wheel versions for release tag
179+
run: |
180+
./ci/tools/validate-release-wheels "${{ inputs.git-tag }}" "${{ inputs.component }}" "dist"
181+
182+
- name: Publish package distributions to PyPI
183+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
184+
182185
# TODO: add another job to make the release leave the draft state?

.pre-commit-config.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
language: python
3131
additional_dependencies:
3232
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl
33-
exclude: '(.*pixi\.lock)|(\.git_archival\.txt)'
33+
exclude: '(.*pixi\.lock)|(\.git_archival\.txt)|(.*\.patch$)'
3434
args: ["--fix"]
3535

3636
- id: no-markdown-in-docs-source
@@ -59,7 +59,13 @@ repos:
5959
exclude: &gen_exclude '^(?:cuda_python/README\.md|cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?)$'
6060
- id: mixed-line-ending
6161
- id: trailing-whitespace
62-
exclude: *gen_exclude
62+
exclude: |
63+
(?x)^(?:
64+
cuda_python/README\.md|
65+
cuda_bindings/cuda/bindings/.*\.in?|
66+
cuda_bindings/docs/source/module/.*\.rst?|
67+
.*\.patch$
68+
)$
6369
6470
# Checking for common mistakes
6571
- repo: https://github.com/pre-commit/pygrep-hooks

0 commit comments

Comments
 (0)