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

Use CI matrix from shared-workflows #22

Merged
merged 16 commits into from
May 8, 2024
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ jobs:
run-checks:
uses: ./.github/workflows/checks-and-builds.yaml
with:
build_type: branch
publish: true
secrets: inherit
66 changes: 34 additions & 32 deletions .github/workflows/checks-and-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: checks
on:
workflow_call:
inputs:
publish:
required: false
build_type:
type: string
default: "false"
publish:
type: boolean

jobs:
check-style:
Expand All @@ -20,34 +20,36 @@ jobs:
fetch-depth: 0
- name: Check style
run: "./ci/check_style.sh"
conda-build:
build-conda:
needs: check-style
runs-on: ubuntu-latest
container:
image: rapidsai/ci-conda:cuda12.2.2-ubuntu22.04-py3.9
env:
PUBLISH: "${{ inputs.publish }}"
steps:
- uses: actions/checkout@v4
- name: Set Proper Conda Upload Token
run: |
RAPIDS_CONDA_TOKEN=${{ secrets.CONDA_RAPIDSAI_NIGHTLY_TOKEN }}
if rapids-is-release-build; then
RAPIDS_CONDA_TOKEN=${{ secrets.CONDA_RAPIDSAI_TOKEN }}
fi
echo "RAPIDS_CONDA_TOKEN=${RAPIDS_CONDA_TOKEN}" >> "${GITHUB_ENV}"
- name: Python build
run: "./ci/build_python.sh ${PUBLISH}"
wheel-build:
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type }}
script: "ci/build_python.sh"
# Select only the build with the minimum Python version and the maximum CUDA version
matrix_filter: '[map(select(.ARCH == "amd64")) | min_by((.PY_VER | split(".") | map(tonumber)), (.CUDA_VER | split(".") | map(-tonumber)))]'
build-wheel:
needs: check-style
runs-on: ubuntu-latest
container:
image: rapidsai/ci-wheel:cuda12.2.2-ubuntu20.04-py3.9
env:
PUBLISH: "${{ inputs.publish }}"
RAPIDS_CONDA_TOKEN: ${{ secrets.CONDA_RAPIDSAI_WHEELS_NIGHTLY_TOKEN }}
steps:
- name: checkout code repo
uses: actions/checkout@v4
- name: Build and repair the wheel
run: "./ci/build_wheel.sh ${PUBLISH}"
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type }}
script: "ci/build_wheel.sh"
# Select only the build with the minimum Python version and the maximum CUDA version
matrix_filter: '[map(select(.ARCH == "amd64")) | min_by((.PY_VER | split(".") | map(tonumber)), (.CUDA_VER | split(".") | map(-tonumber)))]'
publish-wheels:
needs:
- build-wheel
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type }}
package-name: rapids-build-backend
if: ${{ inputs.publish }}
publish-conda:
needs:
- build-conda
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type }}
if: ${{ inputs.publish }}
1 change: 1 addition & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ jobs:
run-checks:
uses: ./.github/workflows/checks-and-builds.yaml
with:
build_type: pull-request
publish: false
secrets: inherit
10 changes: 2 additions & 8 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@

set -euo pipefail

UPLOAD_PACKAGES="${1:-false}"
rapids-conda-retry mambabuild conda/recipes/rapids-build-backend

PKG_DIR="${PWD}/conda_package"
rapids-conda-retry mambabuild --output-folder "${PKG_DIR}" conda/recipes/rapids-build-backend

if [ "$UPLOAD_PACKAGES" = "true" ]; then
# TODO: Figure out the best way to get CONDA_PKG_FILE
rapids-retry anaconda -t "${RAPIDS_CONDA_TOKEN}" upload --label main --skip-existing --no-progress "${PKG_DIR}/noarch/"*.tar.bz2
fi
rapids-upload-conda-to-s3 python
6 changes: 1 addition & 5 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@

set -euo pipefail

UPLOAD_PACKAGES="${1:-false}"

python -m pip wheel . -w dist -vv --no-deps --disable-pip-version-check

# Run tests
WHL_FILE=$(ls dist/*.whl)
python -m pip install "${WHL_FILE}[test]"
python -m pytest -v tests/

if [ "$UPLOAD_PACKAGES" = "true" ]; then
anaconda -t "${RAPIDS_CONDA_TOKEN}" upload --skip-existing --no-progress ${WHL_FILE}
fi
rapids-upload-wheels-to-s3 dist
Loading