Skip to content

Commit 6a83341

Browse files
Copilotleofang
andauthored
CI: Fix pathfinder CI infrastructure and remove redundant component testing (NVIDIA#904)
* Initial plan * Update test workflows to fetch cuda-pathfinder from main branch Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Consolidate GitHub CLI installation steps as requested in PR review Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Remove pathfinder test steps from test workflows Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> * Remove cuda.core test steps from both test workflows Co-authored-by: leofang <5534781+leofang@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: leofang <5534781+leofang@users.noreply.github.com>
1 parent 62f73aa commit 6a83341

2 files changed

Lines changed: 50 additions & 116 deletions

File tree

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

Lines changed: 30 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,35 @@ jobs:
149149
SHA: ${{ github.sha }}
150150
run: ./ci/tools/env-vars test
151151

152-
- name: Download cuda-pathfinder build artifacts
153-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
154-
with:
155-
name: cuda-pathfinder-wheel
156-
path: ./cuda_pathfinder
152+
- name: Install GitHub CLI
153+
# gh is needed for artifact fetching in subsequent steps
154+
run: |
155+
# See https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt.
156+
mkdir -p -m 755 /etc/apt/keyrings \
157+
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
158+
&& cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
159+
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
160+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
161+
&& apt update \
162+
&& apt install gh -y
163+
164+
- name: Download cuda-pathfinder build artifacts from main branch
165+
env:
166+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167+
run: |
168+
MAIN_BRANCH="main"
169+
PATHFINDER_BASENAME="cuda-pathfinder-wheel"
170+
LATEST_MAIN_RUN_ID=$(gh run list -b ${MAIN_BRANCH} -L 1 -w "CI" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
171+
if [[ "$LATEST_MAIN_RUN_ID" == "" ]]; then
172+
echo "LATEST_MAIN_RUN_ID not found!"
173+
exit 1
174+
fi
175+
176+
gh run download $LATEST_MAIN_RUN_ID -p ${PATHFINDER_BASENAME} -R NVIDIA/cuda-python
177+
ls -al $PATHFINDER_BASENAME
178+
mkdir -p ./cuda_pathfinder
179+
mv $PATHFINDER_BASENAME/*.whl ./cuda_pathfinder/
180+
rmdir $PATHFINDER_BASENAME
157181
158182
- name: Download cuda-python build artifacts
159183
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}}
@@ -174,16 +198,6 @@ jobs:
174198
env:
175199
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176200
run: |
177-
# See https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt.
178-
# gh is needed for artifact fetching.
179-
mkdir -p -m 755 /etc/apt/keyrings \
180-
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
181-
&& cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
182-
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
183-
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
184-
&& apt update \
185-
&& apt install gh -y
186-
187201
OLD_BRANCH=$(cat .github/BACKPORT_BRANCH)
188202
OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
189203
LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "build-and-test.yml" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
@@ -226,29 +240,7 @@ jobs:
226240
pwd
227241
ls -lahR $CUDA_BINDINGS_CYTHON_TESTS_DIR
228242
229-
- name: Download cuda.core build artifacts
230-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
231-
with:
232-
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
233-
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
234-
235-
- name: Display structure of downloaded cuda.core build artifacts
236-
run: |
237-
pwd
238-
ls -lahR $CUDA_CORE_ARTIFACTS_DIR
239-
240-
- name: Download cuda.core Cython tests
241-
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
242-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
243-
with:
244-
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests
245-
path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}
246243
247-
- name: Display structure of downloaded cuda.core Cython tests
248-
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
249-
run: |
250-
pwd
251-
ls -lahR $CUDA_CORE_CYTHON_TESTS_DIR
252244
253245
- name: Set up Python ${{ matrix.PY_VER }}
254246
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
@@ -278,23 +270,14 @@ jobs:
278270
- name: Set up compute-sanitizer
279271
run: setup-sanitizer
280272

281-
- name: Run cuda.pathfinder tests with see_what_works
282-
env:
283-
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works
284-
run: run-tests pathfinder
285-
286273
- name: Run cuda.bindings tests
287274
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
288275
env:
289276
CUDA_VER: ${{ matrix.CUDA_VER }}
290277
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
291278
run: run-tests bindings
292279

293-
- name: Run cuda.core tests
294-
env:
295-
CUDA_VER: ${{ matrix.CUDA_VER }}
296-
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
297-
run: run-tests core
280+
298281

299282
- name: Ensure cuda-python installable
300283
run: |
@@ -303,17 +286,3 @@ jobs:
303286
else
304287
pip install $(ls cuda_python*.whl)[all]
305288
fi
306-
307-
- name: Install cuda.pathfinder nvidia_wheels_cu12
308-
if: startsWith(matrix.CUDA_VER, '12.')
309-
run: |
310-
pushd cuda_pathfinder
311-
pip install -v .[nvidia_wheels_cu12]
312-
pip freeze
313-
popd
314-
315-
- name: Run cuda.pathfinder tests with all_must_work
316-
if: startsWith(matrix.CUDA_VER, '12.')
317-
env:
318-
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work
319-
run: run-tests pathfinder

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

Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,6 @@ jobs:
117117
shell: bash --noprofile --norc -xeuo pipefail {0}
118118
run: ./ci/tools/env-vars test
119119

120-
- name: Download cuda-pathfinder build artifacts
121-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
122-
with:
123-
name: cuda-pathfinder-wheel
124-
path: ./cuda_pathfinder
125-
126120
- name: Download cuda-python build artifacts
127121
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}}
128122
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
@@ -152,6 +146,25 @@ jobs:
152146
}
153147
gh --version
154148
149+
- name: Download cuda-pathfinder build artifacts from main branch
150+
env:
151+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152+
run: |
153+
$MAIN_BRANCH = "main"
154+
$PATHFINDER_BASENAME = "cuda-pathfinder-wheel"
155+
$runData = gh run list -b $MAIN_BRANCH -L 1 -w "CI" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json
156+
if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) {
157+
Write-Host "LATEST_MAIN_RUN_ID not found!"
158+
exit 1
159+
}
160+
$LATEST_MAIN_RUN_ID = $runData[0].databaseId
161+
162+
gh run download $LATEST_MAIN_RUN_ID -p $PATHFINDER_BASENAME -R NVIDIA/cuda-python
163+
Get-ChildItem -Path $PATHFINDER_BASENAME
164+
New-Item -Path "./cuda_pathfinder" -ItemType Directory -Force
165+
Move-Item -Path "$PATHFINDER_BASENAME/*.whl" -Destination "./cuda_pathfinder/"
166+
Remove-Item -Path $PATHFINDER_BASENAME -Force
167+
155168
- name: Install zstd
156169
# the GPU runner image does not have zstd pre-installed... and it's needed by actions/cache
157170
if: ${{ matrix.LOCAL_CTK == '1' }}
@@ -215,29 +228,7 @@ jobs:
215228
Get-Location
216229
Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_CYTHON_TESTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName
217230
218-
- name: Download cuda.core build artifacts
219-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
220-
with:
221-
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}
222-
path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}
223-
224-
- name: Display structure of downloaded cuda.core build artifacts
225-
run: |
226-
Get-Location
227-
Get-ChildItem -Recurse -Force $env:CUDA_CORE_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName
228-
229-
- name: Download cuda.core Cython tests
230-
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
231-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
232-
with:
233-
name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests
234-
path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}
235231
236-
- name: Display structure of downloaded cuda.core Cython tests
237-
if: ${{ env.SKIP_CYTHON_TEST == '0' }}
238-
run: |
239-
Get-Location
240-
Get-ChildItem -Recurse -Force $env:CUDA_CORE_CYTHON_TESTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName
241232
242233
- name: Set up Python ${{ matrix.PY_VER }}
243234
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
@@ -252,12 +243,6 @@ jobs:
252243
host-platform: ${{ inputs.host-platform }}
253244
cuda-version: ${{ matrix.CUDA_VER }}
254245

255-
- name: Run cuda.pathfinder tests with see_what_works
256-
env:
257-
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works
258-
shell: bash --noprofile --norc -xeuo pipefail {0}
259-
run: run-tests pathfinder
260-
261246
- name: Run cuda.bindings tests
262247
if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }}
263248
env:
@@ -266,12 +251,7 @@ jobs:
266251
shell: bash --noprofile --norc -xeuo pipefail {0}
267252
run: run-tests bindings
268253

269-
- name: Run cuda.core tests
270-
env:
271-
CUDA_VER: ${{ matrix.CUDA_VER }}
272-
LOCAL_CTK: ${{ matrix.LOCAL_CTK }}
273-
shell: bash --noprofile --norc -xeuo pipefail {0}
274-
run: run-tests core
254+
275255

276256
- name: Ensure cuda-python installable
277257
run: |
@@ -281,18 +261,3 @@ jobs:
281261
pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]"
282262
}
283263
284-
- name: Install cuda.pathfinder nvidia_wheels_cu12
285-
if: startsWith(matrix.CUDA_VER, '12.')
286-
shell: bash --noprofile --norc -xeuo pipefail {0}
287-
run: |
288-
pushd cuda_pathfinder
289-
pip install -v .[nvidia_wheels_cu12]
290-
pip freeze
291-
popd
292-
293-
- name: Run cuda.pathfinder tests with all_must_work
294-
if: startsWith(matrix.CUDA_VER, '12.')
295-
env:
296-
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work
297-
shell: bash --noprofile --norc -xeuo pipefail {0}
298-
run: run-tests pathfinder

0 commit comments

Comments
 (0)