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

Publish nightly wheels to NVIDIA index instead of PyPI #1294

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,23 @@ jobs:
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
wheel-build:
runs-on: ubuntu-latest
container:
image: rapidsai/ci-conda:latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build wheel
run: ci/build_python_pypi.sh
env:
GH_TOKEN: ${{ github.token }}
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.RAPIDSAI_PYPI_TOKEN }}
skip-existing: true
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.02
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel.sh
# Package is pure Python and only ever requires one build.
matrix_filter: map(select(.ARCH == "amd64" and .PY_VER == "3.10" and .CUDA_VER == "12.0.1"))
Comment on lines +69 to +70
Copy link
Member

@ajschmidt8 ajschmidt8 Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pentschev, you can generalize this with the following:

matrix_filter: map(select(.ARCH=="amd64")) | sort_by(.CUDA_VER, (.PY_VER | split(".") | map(tonumber))) | [.[-1]]

That will filter the matrix to only include amd64 machines, sort those machines by CUDA_VER and PY_VER, and then select the last element (which will have the latest CUDA and Python version).

You can optionally take this a step further to switch from a centos7/rockylinux image to an Ubuntu image with this minor amendment:

matrix_filter: map(select(.ARCH=="amd64")) | sort_by(.CUDA_VER, (.PY_VER | split(".") | map(tonumber))) | [.[-1] + {LINUX_VER: "ubuntu22.04"}]

Though this will require the Ubuntu version to be updated periodically as RAPIDS rotates CI image versions.

Copy link
Member

@ajschmidt8 ajschmidt8 Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if you don't care about the CUDA_VER, then this can be simplified to:

matrix_filter: map(select(.ARCH=="amd64")) | sort_by((.PY_VER | split(".") | map(tonumber))) | [.[-1]]

and

matrix_filter: map(select(.ARCH=="amd64")) | sort_by((.PY_VER | split(".") | map(tonumber))) | [.[-1] + {LINUX_VER: "ubuntu22.04"}]

Here's one final variation that can be used too, which sorts the entries by PY_VER, gets the last entry, and then overrides the ARCH and LINUX_VER values:

matrix_filter: sort_by((.PY_VER | split(".") | map(tonumber))) | [.[-1] + {ARCH: "amd64", LINUX_VER: "ubuntu22.04"}]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Dask-CUDA is a pure Python package (agnostic to OS, Python version, CUDA version, etc.), think this is just selecting one build arbitrarily

Is the idea of these suggestions just to avoid hard-coding version information in the selector?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. the hardcoded Python and CUDA versions will eventually be invalid as we update to newer versions. these generalized snippets prevent us from having to upgrade these versions in the future

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wheel-publish:
needs: wheel-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.02
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: dask-cuda
42 changes: 0 additions & 42 deletions ci/build_python_pypi.sh

This file was deleted.

18 changes: 18 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

source rapids-configure-sccache
source rapids-date-string

package_name=dask-cuda
vyasr marked this conversation as resolved.
Show resolved Hide resolved
package_dir="pip/${package_name}"
version=$(rapids-generate-version)

sed -i "s/^version = .*/version = \"${version}\"/g" "${package_dir}/pyproject.toml"

cd "${package_dir}"
python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check

RAPIDS_PY_WHEEL_NAME="${package_name}" rapids-upload-wheels-to-s3 dist
Loading