-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move wheel testing logic to downstream repos (#116)
This PR is the testing companion to #97. It also introduces a standardized publish workflow that may be reused between pure and manylinux builds (see #89). --------- Co-authored-by: Lawrence Mitchell <[email protected]> Co-authored-by: AJ Schmidt <[email protected]> Co-authored-by: Rick Ratzel <[email protected]>
- Loading branch information
1 parent
49b261b
commit 8fc876d
Showing
3 changed files
with
219 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Publish RAPIDS wheels | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
# repo and branch | ||
repo: | ||
type: string | ||
branch: | ||
type: string | ||
date: | ||
type: string | ||
sha: | ||
type: string | ||
build_type: | ||
required: true | ||
type: string | ||
|
||
# general settings | ||
package-name: | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
actions: read | ||
checks: none | ||
contents: read | ||
deployments: none | ||
discussions: none | ||
id-token: write | ||
issues: none | ||
packages: read | ||
pages: none | ||
pull-requests: read | ||
repository-projects: none | ||
security-events: none | ||
statuses: none | ||
|
||
jobs: | ||
wheel-publish: | ||
name: wheels publish | ||
runs-on: ubuntu-latest | ||
container: | ||
# ctk version of the container is irrelevant in the publish step | ||
# it's simply a launcher for twine | ||
image: "rapidsai/ci-wheel:cuda12.0.1-centos7-py3.10" | ||
env: | ||
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} | ||
TWINE_USERNAME: cibuildwheel | ||
TWINE_PASSWORD: ${{ secrets.RAPIDSAI_PYPI_CI_PASSWORD }} | ||
TWINE_REPOSITORY_URL: "https://pypi.k8s.rapids.ai/simple/" | ||
steps: | ||
- uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ vars.AWS_ROLE_ARN }} | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-duration-seconds: 43200 # 12h | ||
- name: checkout code repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ inputs.repo }} | ||
ref: ${{ inputs.sha }} | ||
fetch-depth: 0 # unshallow fetch for setuptools-scm | ||
persist-credentials: false | ||
|
||
- name: Standardize repository information | ||
uses: rapidsai/shared-action-workflows/[email protected] | ||
with: | ||
repo: ${{ inputs.repo }} | ||
branch: ${{ inputs.branch }} | ||
date: ${{ inputs.date }} | ||
sha: ${{ inputs.sha }} | ||
|
||
- name: Download wheels from downloads.rapids.ai and publish to internal PyPI | ||
run: rapids-twine "${{ inputs.package-name }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
name: Test RAPIDS wheels | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
# repo and branch | ||
repo: | ||
type: string | ||
branch: | ||
type: string | ||
date: | ||
type: string | ||
sha: | ||
type: string | ||
build_type: | ||
required: true | ||
type: string | ||
script: | ||
type: string | ||
default: "ci/test_wheel.sh" | ||
|
||
# general settings | ||
matrix_filter: | ||
type: string | ||
default: "." | ||
|
||
# test settings | ||
test-docker-options: | ||
required: false | ||
type: string | ||
default: '-e _NOOP' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
permissions: | ||
actions: read | ||
checks: none | ||
contents: read | ||
deployments: none | ||
discussions: none | ||
id-token: write | ||
issues: none | ||
packages: read | ||
pages: none | ||
pull-requests: read | ||
repository-projects: none | ||
security-events: none | ||
statuses: none | ||
|
||
jobs: | ||
compute-matrix: | ||
runs-on: ubuntu-latest | ||
env: | ||
BUILD_TYPE: ${{ inputs.build_type }} | ||
outputs: | ||
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} | ||
steps: | ||
- name: Validate test type | ||
run: | | ||
if [[ "$BUILD_TYPE" != "pull-request" ]] && [[ "$BUILD_TYPE" != "nightly" ]]; then | ||
echo "Invalid build type! Must be 'nightly' or 'pull-request'." | ||
exit 1 | ||
fi | ||
- name: Compute test matrix | ||
id: compute-matrix | ||
run: | | ||
set -eo pipefail | ||
export MATRICES=" | ||
pull-request: | ||
- { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' } | ||
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' } | ||
- { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } | ||
nightly: | ||
- { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' } | ||
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' } | ||
- { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } | ||
- { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } | ||
- { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' } | ||
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' } | ||
- { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } | ||
- { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } | ||
" | ||
TEST_MATRIX=$(yq -n 'env(MATRICES) | .[strenv(BUILD_TYPE)]') | ||
export TEST_MATRIX | ||
echo "MATRIX=$( | ||
yq -n -o json 'env(TEST_MATRIX)' | \ | ||
jq -c '${{ inputs.matrix_filter }} | {include: .}' \ | ||
)" | tee --append "${GITHUB_OUTPUT}" | ||
test: | ||
name: ${{ matrix.CUDA_VER }}, ${{ matrix.PY_VER }}, ${{ matrix.ARCH }}, ${{ matrix.LINUX_VER }}, ${{ matrix.gpu }} | ||
needs: compute-matrix | ||
env: | ||
RAPIDS_ARTIFACTS_DIR: ${{ github.workspace }}/artifacts | ||
strategy: | ||
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }} | ||
runs-on: "linux-${{ matrix.ARCH }}-gpu-${{ matrix.gpu }}-${{ matrix.driver }}-1" | ||
container: | ||
image: "rapidsai/citestwheel:cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}" | ||
options: ${{ inputs.test-docker-options }} | ||
env: | ||
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} # GPU jobs must set this container env variable | ||
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} | ||
steps: | ||
- uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
role-to-assume: ${{ vars.AWS_ROLE_ARN }} | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-duration-seconds: 43200 # 12h | ||
- name: Run nvidia-smi to make sure GPU is working | ||
run: nvidia-smi | ||
|
||
- name: Install private index credentials in cibuildwheel container | ||
run: printf 'machine pypi.k8s.rapids.ai\n\tlogin cibuildwheel\n\tpassword ${{ secrets.RAPIDSAI_PYPI_CI_PASSWORD }}\n' > ~/.netrc | ||
|
||
- name: checkout code repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ inputs.repo }} | ||
ref: ${{ inputs.sha }} | ||
fetch-depth: 0 # unshallow fetch for setuptools-scm | ||
persist-credentials: false | ||
|
||
- name: Standardize repository information | ||
uses: rapidsai/shared-action-workflows/[email protected] | ||
with: | ||
repo: ${{ inputs.repo }} | ||
branch: ${{ inputs.branch }} | ||
date: ${{ inputs.date }} | ||
sha: ${{ inputs.sha }} | ||
|
||
- name: Run tests | ||
run: ${{ inputs.script }} | ||
|
||
- name: Upload additional artifacts | ||
if: "!cancelled()" | ||
run: rapids-upload-artifacts-dir cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)_py${RAPIDS_PY_VERSION//.} |