Skip to content

Commit 8113d02

Browse files
committed
Revert "fix(ci): harden backport run lookup for artifact downloads"
This reverts commit fd31eb2.
1 parent fd31eb2 commit 8113d02

4 files changed

Lines changed: 41 additions & 99 deletions

File tree

.github/workflows/build-wheel.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,14 +401,18 @@ jobs:
401401
402402
OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml)
403403
OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
404-
LATEST_PRIOR_RUN_ID=$(bash ./ci/tools/lookup-run-id-by-branch "${OLD_BRANCH}" "${{ github.repository }}")
404+
LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "ci.yml" -s success -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
405+
if [[ "$LATEST_PRIOR_RUN_ID" == "" ]]; then
406+
echo "LATEST_PRIOR_RUN_ID not found!"
407+
exit 1
408+
fi
405409
406-
gh run download "${LATEST_PRIOR_RUN_ID}" -p "${OLD_BASENAME}" -R "${{ github.repository }}"
407-
rm -rf "${OLD_BASENAME}-tests" # exclude cython test artifacts
408-
ls -al "${OLD_BASENAME}"
410+
gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python
411+
rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts
412+
ls -al $OLD_BASENAME
409413
mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
410-
mv "${OLD_BASENAME}"/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
411-
rmdir "${OLD_BASENAME}"
414+
mv $OLD_BASENAME/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
415+
rmdir $OLD_BASENAME
412416
413417
- name: Build cuda.core wheel
414418
uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,20 @@ jobs:
160160
161161
OLD_BRANCH=${{ needs.compute-matrix.outputs.OLD_BRANCH }}
162162
OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
163-
LATEST_PRIOR_RUN_ID=$(bash ./ci/tools/lookup-run-id-by-branch "${OLD_BRANCH}" "${{ github.repository }}")
163+
LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "ci.yml" -s success -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
164+
if [[ "$LATEST_PRIOR_RUN_ID" == "" ]]; then
165+
echo "LATEST_PRIOR_RUN_ID not found!"
166+
exit 1
167+
fi
164168
165-
gh run download "${LATEST_PRIOR_RUN_ID}" -p "${OLD_BASENAME}" -R "${{ github.repository }}"
166-
rm -rf "${OLD_BASENAME}-tests" # exclude cython test artifacts
167-
ls -al "${OLD_BASENAME}"
169+
gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python
170+
rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts
171+
ls -al $OLD_BASENAME
168172
mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
169-
mv "${OLD_BASENAME}"/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/
170-
rmdir "${OLD_BASENAME}"
173+
mv $OLD_BASENAME/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/
174+
rmdir $OLD_BASENAME
171175
172-
gh run download "${LATEST_PRIOR_RUN_ID}" -p cuda-python-wheel -R "${{ github.repository }}"
176+
gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python
173177
ls -al cuda-python-wheel
174178
mv cuda-python-wheel/*.whl .
175179
rmdir cuda-python-wheel

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

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -142,23 +142,27 @@ jobs:
142142
if: ${{ env.USE_BACKPORT_BINDINGS == '1' }}
143143
env:
144144
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145-
shell: bash --noprofile --norc -xeuo pipefail {0}
146145
run: |
147-
OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml)
148-
OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
149-
LATEST_PRIOR_RUN_ID=$(bash ./ci/tools/lookup-run-id-by-branch "${OLD_BRANCH}" "${{ github.repository }}")
150-
151-
gh run download "${LATEST_PRIOR_RUN_ID}" -p "${OLD_BASENAME}" -R "${{ github.repository }}"
152-
rm -rf "${OLD_BASENAME}-tests" # exclude cython test artifacts
153-
ls -al "${OLD_BASENAME}"
154-
mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
155-
mv "${OLD_BASENAME}"/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
156-
rmdir "${OLD_BASENAME}"
157-
158-
gh run download "${LATEST_PRIOR_RUN_ID}" -p cuda-python-wheel -R "${{ github.repository }}"
159-
ls -al cuda-python-wheel
160-
mv cuda-python-wheel/*.whl .
161-
rmdir cuda-python-wheel
146+
$OLD_BRANCH = yq '.backport_branch' ci/versions.yml
147+
$OLD_BASENAME = "cuda-bindings-python${env:PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
148+
$runData = gh run list -b $OLD_BRANCH -L 1 -w "ci.yml" -s success -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json
149+
if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) {
150+
Write-Host "LATEST_PRIOR_RUN_ID not found!"
151+
exit 1
152+
}
153+
$LATEST_PRIOR_RUN_ID = $runData[0].databaseId
154+
155+
gh run download $LATEST_PRIOR_RUN_ID -p $OLD_BASENAME -R NVIDIA/cuda-python
156+
Remove-Item -Recurse -Force "${OLD_BASENAME}-tests" # exclude cython test artifacts
157+
Get-ChildItem -Path $OLD_BASENAME
158+
New-Item -Path "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" -ItemType Directory -Force
159+
Move-Item -Path "$OLD_BASENAME/*.whl" -Destination "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"
160+
Remove-Item -Path $OLD_BASENAME -Force
161+
162+
gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python
163+
Get-ChildItem -Path cuda-python-wheel
164+
Move-Item -Path "cuda-python-wheel/*.whl" -Destination .
165+
Remove-Item -Path cuda-python-wheel -Force
162166
163167
- name: Display structure of downloaded cuda-python artifacts
164168
run: |

ci/tools/lookup-run-id-by-branch

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)