Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move wheel testing logic to downstream repos #116

Merged
merged 13 commits into from
Jul 21, 2023
147 changes: 147 additions & 0 deletions .github/workflows/wheels-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
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
test_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
env:
SMOKE_TEST_CMD: ${{ inputs.test-smoketest }}
UNIT_TEST_CMD: ${{ inputs.test-unittest }}
vyasr marked this conversation as resolved.
Show resolved Hide resolved
run: |
set -eo pipefail

export MATRICES="
pull-request:
- { arch: 'amd64', python: '3.9', ctk: '11.8.0', image: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { arch: 'amd64', python: '3.10', ctk: '12.0.1', image: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { arch: 'arm64', python: '3.9', ctk: '12.0.1', image: 'ubuntu20.04', gpu: 'a100', driver: 'latest' }
nightly:
- { arch: 'amd64', python: '3.9', ctk: '11.8.0', image: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { arch: 'amd64', python: '3.10', ctk: '11.8.0', image: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { arch: 'arm64', python: '3.9', ctk: '11.8.0', image: 'ubuntu20.04', gpu: 'a100', driver: 'latest' }
- { arch: 'arm64', python: '3.10', ctk: '11.8.0', image: 'ubuntu20.04', gpu: 'a100', driver: 'latest' }
- { arch: 'amd64', python: '3.9', ctk: '12.0.1', image: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { arch: 'amd64', python: '3.10', ctk: '12.0.1', image: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { arch: 'arm64', python: '3.9', ctk: '12.0.1', image: 'ubuntu20.04', gpu: 'a100', driver: 'latest' }
- { arch: 'arm64', python: '3.10', ctk: '12.0.1', image: 'ubuntu20.04', gpu: 'a100', driver: 'latest' }
vyasr marked this conversation as resolved.
Show resolved Hide resolved
"

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}"

wheel-test:
vyasr marked this conversation as resolved.
Show resolved Hide resolved
name: wheel test ${{ matrix.arch }} ${{ matrix.python }} ${{ matrix.ctk }}
vyasr marked this conversation as resolved.
Show resolved Hide resolved
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.ctk }}-${{ matrix.image }}-py${{ matrix.python }}"
options: ${{ inputs.test-docker-options }}
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} # GPU jobs must set this container env variable
RAPIDS_PY_VERSION: ${{ matrix.python }}
RAPIDS_CUDA_VERSION: ${{ matrix.ctk }}
vyasr marked this conversation as resolved.
Show resolved Hide resolved
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.test_script }}

- name: Upload additional artifacts
if: "!cancelled()"
run: rapids-upload-artifacts-dir cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)_py${RAPIDS_PY_VERSION//.}