Skip to content

Commit fc682d9

Browse files
Merge branch 'main' into handle-version-specific-options
2 parents b3e254d + ead87d1 commit fc682d9

Some content is hidden

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

54 files changed

+24800
-6219
lines changed

.github/workflows/build-and-test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- "3.9"
3232
cuda-version:
3333
# Note: this is for build-time only.
34-
- "12.6.2"
34+
- "12.8.0"
3535
name: Build (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }})
3636
if: ${{ github.repository_owner == 'nvidia' }}
3737
permissions:
@@ -220,7 +220,7 @@ jobs:
220220
- "3.9"
221221
cuda-version:
222222
# Note: this is for test-time only.
223-
- "12.6.2"
223+
- "12.8.0"
224224
- "12.0.1"
225225
- "11.8.0"
226226
local-ctk:
@@ -235,7 +235,7 @@ jobs:
235235
include:
236236
- host-platform: linux-64
237237
python-version: "3.12"
238-
cuda-version: "12.6.2"
238+
cuda-version: "12.8.0"
239239
local-ctk: 1
240240
runner: H100
241241
name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }})

.github/workflows/build-docs.yml

Lines changed: 102 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ on:
66
build-ctk-ver:
77
type: string
88
required: true
9+
component:
10+
description: "Component(s) to build docs for"
11+
required: false
12+
default: "all"
13+
type: string
14+
# below are the acceptable options:
15+
# - cuda-core
16+
# - cuda-bindings
17+
# - cuda-python
18+
# - all
19+
git-tag:
20+
description: "Target git tag to build docs for"
21+
required: false
22+
default: ""
23+
type: string
24+
run-id:
25+
description: "The GHA run ID that generated validated artifacts"
26+
required: false
27+
default: ${{ github.run_id }}
28+
type: string
29+
is-release:
30+
description: "Are we building release docs?"
31+
required: false
32+
default: false
33+
type: boolean
934

1035
jobs:
1136
build:
@@ -27,6 +52,7 @@ jobs:
2752
uses: actions/checkout@v4
2853
with:
2954
fetch-depth: 0
55+
ref: ${{ inputs.git-tag }}
3056

3157
# TODO: cache conda env to speed up the workflow once conda-incubator/setup-miniconda#267
3258
# is resolved
@@ -59,44 +85,77 @@ jobs:
5985
PYTHON_VERSION_FORMATTED="312" # see above
6086
REPO_DIR=$(pwd)
6187
88+
if [[ ${{ inputs.is-release }} == "true" ]]; then
89+
FILE_HASH="*"
90+
COMMIT_HASH="${{ inputs.git-tag }}"
91+
else
92+
FILE_HASH="${{ github.sha }}"
93+
COMMIT_HASH="${{ github.sha }}"
94+
fi
95+
6296
# make outputs from the previous job as env vars
6397
CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-linux-64"
98+
echo "COMMIT_HASH=${COMMIT_HASH}" >> $GITHUB_ENV
6499
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
65-
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV
100+
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
66101
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
67102
CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ inputs.build-ctk-ver }}-linux-64"
68103
echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV
69-
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV
104+
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
70105
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
71106
72107
- name: Download cuda-python build artifacts
73108
uses: actions/download-artifact@v4
74109
with:
75110
name: cuda-python-wheel
76111
path: .
112+
run-id: ${{ inputs.run-id }}
113+
github-token: ${{ github.token }}
77114

78115
- name: Display structure of downloaded cuda-python artifacts
79116
run: |
80117
pwd
81118
ls -lahR .
82119
83120
- name: Download cuda.bindings build artifacts
121+
if: ${{ !inputs.is-release }}
84122
uses: actions/download-artifact@v4
85123
with:
86124
name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
87125
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
88126

127+
- name: Download cuda.bindings build artifacts
128+
if: ${{ inputs.is-release }}
129+
uses: actions/download-artifact@v4
130+
with:
131+
pattern: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}
132+
merge-multiple: true
133+
path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
134+
run-id: ${{ inputs.run-id }}
135+
github-token: ${{ github.token }}
136+
89137
- name: Display structure of downloaded cuda.bindings artifacts
90138
run: |
91139
pwd
92140
ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR
93141
94142
- name: Download cuda.core build artifacts
143+
if: ${{ !inputs.is-release }}
95144
uses: actions/download-artifact@v4
96145
with:
97146
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
98147
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
99148

149+
- name: Download cuda.core build artifacts
150+
if: ${{ inputs.is-release }}
151+
uses: actions/download-artifact@v4
152+
with:
153+
pattern: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
154+
merge-multiple: true
155+
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
156+
run-id: ${{ inputs.run-id }}
157+
github-token: ${{ github.token }}
158+
100159
- name: Display structure of downloaded cuda.core build artifacts
101160
run: |
102161
pwd
@@ -114,23 +173,53 @@ jobs:
114173
115174
pip install cuda_python*.whl
116175
117-
# This step sets the PR_NUMBER env var.
176+
# This step sets the PR_NUMBER/BUILD_LATEST/BUILD_PREVIEW env vars.
118177
- name: Get PR number
178+
if: ${{ !inputs.is-release }}
119179
uses: ./.github/actions/get_pr_number
120180

121-
- name: Build all (latest) docs
122-
id: build
181+
- name: Set up artifact directories
182+
run: |
183+
mkdir -p artifacts/docs
184+
# create an empty folder for removal use
185+
mkdir -p artifacts/empty_docs
186+
187+
- name: Build all docs
188+
if: ${{ inputs.component == 'all' }}
123189
run: |
124190
pushd cuda_python/docs/
125-
./build_all_docs.sh latest-only
191+
if [[ "${{ inputs.is-release }}" == "false" ]]; then
192+
./build_all_docs.sh latest-only
193+
else
194+
./build_all_docs.sh
195+
# At release time, we don't want to update the latest docs
196+
rm -rf build/html/latest
197+
fi
126198
ls -l build
127199
popd
128-
129-
mkdir -p artifacts/docs
130200
mv cuda_python/docs/build/html/* artifacts/docs/
131201
132-
# create an empty folder for removal use
133-
mkdir -p artifacts/empty_docs
202+
- name: Build component docs
203+
if: ${{ inputs.component != 'all' }}
204+
run: |
205+
COMPONENT=$(echo "${{ inputs.component }}" | tr '-' '_')
206+
pushd ${COMPONENT}/docs/
207+
if [[ "${{ inputs.is-release }}" == "false" ]]; then
208+
./build_docs.sh latest-only
209+
else
210+
./build_docs.sh
211+
# At release time, we don't want to update the latest docs
212+
rm -rf build/html/latest
213+
fi
214+
ls -l build
215+
popd
216+
if [[ "${{ inputs.component }}" != "cuda-python" ]]; then
217+
TARGET="${{ inputs.component }}"
218+
mkdir -p artifacts/docs/${TARGET}
219+
else
220+
TARGET=""
221+
fi
222+
mv ${COMPONENT}/docs/build/html/* artifacts/docs/${TARGET}
134223
135224
# TODO: Consider removing this step?
136225
- name: Upload doc artifacts
@@ -140,19 +229,20 @@ jobs:
140229
retention-days: 3
141230

142231
- name: Deploy or clean up doc preview
232+
if: ${{ !inputs.is-release }}
143233
uses: ./.github/actions/doc_preview
144234
with:
145235
source-folder: ${{ (github.ref_name != 'main' && 'artifacts/docs') ||
146236
'artifacts/empty_docs' }}
147237
pr-number: ${{ env.PR_NUMBER }}
148238

149239
- name: Deploy doc update
150-
if: ${{ github.ref_name == 'main' }}
240+
if: ${{ github.ref_name == 'main' || inputs.is-release }}
151241
uses: JamesIves/github-pages-deploy-action@v4
152242
with:
153243
git-config-name: cuda-python-bot
154244
git-config-email: cuda-python-bot@users.noreply.github.com
155245
folder: artifacts/docs/
156246
target-folder: docs/
157-
commit-message: "Deploy latest docs: ${{ github.sha }}"
247+
commit-message: "Deploy ${{ (inputs.is-release && 'release') || 'latest' }} docs: ${{ env.COMMIT_HASH }}"
158248
clean: false
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "CI: Upload git archive"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
git-tag:
7+
type: string
8+
required: true
9+
10+
concurrency:
11+
# Concurrency group that uses the workflow name and PR number if available
12+
# or commit SHA as a fallback. If a new build is triggered under that
13+
# concurrency group while a previous build is running it will be canceled.
14+
# Repeated pushes to a PR will cancel all previous builds, while multiple
15+
# merges to main will not cancel.
16+
group: ${{ github.workflow }}-${{ github.ref_name || github.sha }}
17+
cancel-in-progress: true
18+
19+
permissions:
20+
contents: write
21+
22+
jobs:
23+
# create source archive and upload it to the published release
24+
# URL to the archive: https://github.com/NVIDIA/<repo>/releases/download/<tag>/<repo>-<tag>.tar.gz
25+
upload:
26+
if: ${{ !github.event.repository.fork }}
27+
runs-on: ubuntu-latest
28+
env:
29+
ARCHIVE_NAME: ${{ github.event.repository.name }}-${{ inputs.git-tag }}
30+
steps:
31+
- name: Checkout Source
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
ref: ${{ inputs.git-tag }}
36+
37+
- name: Create Release Directory
38+
run: mkdir -p release
39+
40+
- name: Archive Source
41+
run: >
42+
git archive
43+
--format=tar.gz
44+
--prefix="${{ env.ARCHIVE_NAME }}/"
45+
--output="release/${{ env.ARCHIVE_NAME }}.tar.gz"
46+
${{ inputs.git-tag }}
47+
48+
- name: Compute Checksum
49+
run: >
50+
sha256sum "release/${{ env.ARCHIVE_NAME }}.tar.gz"
51+
| awk '{print $1}'
52+
> "release/${{ env.ARCHIVE_NAME }}.tar.gz.sha256sum"
53+
54+
- name: Upload Archive
55+
env:
56+
GH_TOKEN: ${{ github.token }}
57+
run: >
58+
gh release upload
59+
--clobber "${{ inputs.git-tag }}"
60+
--repo "${{ github.repository }}"
61+
release/*

0 commit comments

Comments
 (0)