Skip to content

Commit

Permalink
Adapt RAPIDS CI workflows for numba-cuda
Browse files Browse the repository at this point in the history
Modifies workflows and build scripts to use artifact storage instead of
AWS S3 for the built packages.
  • Loading branch information
gmarkall committed Jul 26, 2024
1 parent 6c17570 commit 24de68e
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 38 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/conda-python-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ jobs:
env:
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }}
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 43200 # 12h
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
Expand All @@ -114,6 +109,9 @@ jobs:
run: ${{ inputs.script }}
env:
GH_TOKEN: ${{ github.token }}
- name: Upload additional artifacts
- name: Upload conda package
if: "!cancelled()"
run: rapids-upload-artifacts-dir cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)_py${RAPIDS_PY_VERSION//.}
uses: actions/upload-artifact@v4
with:
name: conda-package
path: ${{ env.package_path }}
9 changes: 4 additions & 5 deletions .github/workflows/conda-python-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,15 @@ jobs:
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }}
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 43200 # 12h
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.sha }}
fetch-depth: 0
- uses: actions/download-artifact@v4
name: conda-package
- name: Display structure of downloaded files
run: ls -R
- name: Standardize repository information
run: |
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}"
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/wheels-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
node_type:
required: false
type: string
default: "cpu16"
default: "cpu8"

# general settings
matrix_filter:
Expand Down Expand Up @@ -117,11 +117,6 @@ jobs:
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }}

steps:
- uses: aws-actions/configure-aws-credentials@v4
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@v4
with:
Expand Down Expand Up @@ -162,6 +157,9 @@ jobs:
GH_TOKEN: ${{ github.token }}
# Use a shell that loads the rc file so that we get the compiler settings
shell: bash -leo pipefail {0}
- name: Upload additional artifacts
- name: Upload wheel
if: "!cancelled()"
run: rapids-upload-artifacts-dir cuda${RAPIDS_CUDA_VERSION%%.*}_$(arch)_py${RAPIDS_PY_VERSION//.}
uses: actions/upload-artifact@v4
with:
name: wheel
path: ${{ env.package_path }}
10 changes: 4 additions & 6 deletions .github/workflows/wheels-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ jobs:
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@v4
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

Expand All @@ -139,7 +134,10 @@ jobs:
ref: ${{ inputs.sha }}
fetch-depth: 0 # unshallow fetch for setuptools-scm
persist-credentials: false

- uses: actions/download-artifact@v4
name: wheel
- name: Display structure of downloaded files
run: ls -R
- name: Standardize repository information
uses: rapidsai/shared-actions/rapids-github-info@main
with:
Expand Down
3 changes: 2 additions & 1 deletion ci/build_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ rapids-logger "Begin py build"

rapids-conda-retry mambabuild conda/recipes/numba-cuda

rapids-upload-conda-to-s3 python
package_path=(/tmp/conda-bld-output/noarch/numba-cuda-*.tar.bz2)
echo "package_path=$package_path" >> $GITHUB_ENV
5 changes: 3 additions & 2 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ rapids-logger "Build wheel"
mkdir -p ./dist
python -m pip wheel . --wheel-dir=./dist -vvv --disable-pip-version-check --no-deps

rapids-logger "Upload Wheel"
RAPIDS_PY_WHEEL_NAME="numba_cuda" rapids-upload-wheels-to-s3 ./dist
package_path=$(realpath ./dist/numba_cuda-*.whl)
echo "Package path: $package_path"
echo "package_path=$package_path" >> $GITHUB_ENV
9 changes: 4 additions & 5 deletions ci/test_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ set +u
conda activate test
set -u

PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)
package=$(realpath conda-package/numba-cuda-*.tar.bz2)
echo "Package path: $package"
rapids-mamba-retry install $package

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
pushd "${RAPIDS_TESTS_DIR}"

rapids-print-env

rapids-mamba-retry install \
--channel "${PYTHON_CHANNEL}" \
numba-cuda

rapids-logger "Check GPU usage"
nvidia-smi

Expand Down
7 changes: 3 additions & 4 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ python -m pip install \
cuda-python \
pytest

rapids-logger "Download Wheel"
RAPIDS_PY_WHEEL_NAME="numba_cuda" rapids-download-wheels-from-s3 ./dist/

rapids-logger "Install wheel"
python -m pip install $(echo ./dist/numba_cuda*.whl)
package=$(realpath wheel/numba_cuda*.whl)
echo "Package path: $package"
python -m pip install $package

rapids-logger "Check GPU usage"
nvidia-smi
Expand Down

0 comments on commit 24de68e

Please sign in to comment.