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 rapids-build-backend #1343

Merged
merged 10 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:
args: ["--module=dask_cuda", "--ignore-missing-imports"]
pass_filenames: false
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.8.0
rev: v1.13.11
hooks:
- id: rapids-dependency-file-generator
args: ["--clean"]
Expand Down
2 changes: 1 addition & 1 deletion ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ rapids-logger "Create test conda environment"

rapids-dependency-file-generator \
--output conda \
--file_key docs \
--file-key docs \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml

rapids-mamba-retry env create --yes -f env.yaml -n docs
Expand Down
10 changes: 2 additions & 8 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

package_name="dask_cuda"

version=$(rapids-generate-version)
commit=$(git rev-parse HEAD)

echo "${version}" | tr -d '"' > VERSION
sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_name}/_version.py"
rapids-generate-version > ./VERSION

rapids-logger "Begin py build"
conda config --set path_conflict prevent

RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \
RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry mambabuild \
conda/recipes/dask-cuda

rapids-upload-conda-to-s3 python
17 changes: 1 addition & 16 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,7 @@ set -euo pipefail
source rapids-configure-sccache
source rapids-date-string

version=$(rapids-generate-version)
commit=$(git rev-parse HEAD)

echo "${version}" | tr -d '"' > VERSION
sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "dask_cuda/_version.py"

# For nightlies we want to ensure that we're pulling in alphas as well. The
# easiest way to do so is to augment the spec with a constraint containing a
# min alpha version that doesn't affect the version bounds but does allow usage
# of alpha versions for that dependency without --pre
alpha_spec=''
if ! rapids-is-release-build; then
alpha_spec=',>=0.0.0a0'
fi

sed -r -i "s/rapids-dask-dependency==(.*)\"/rapids-dask-dependency==\1${alpha_spec}\"/g" pyproject.toml
rapids-generate-version > ./VERSION

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

Expand Down
2 changes: 1 addition & 1 deletion ci/check_style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rapids-logger "Create checks conda environment"

rapids-dependency-file-generator \
--output conda \
--file_key checks \
--file-key checks \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml

rapids-mamba-retry env create --yes -f env.yaml -n checks
Expand Down
6 changes: 3 additions & 3 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function sed_runner() {
echo "${NEXT_FULL_TAG}" | tr -d '"' > VERSION

# Bump testing dependencies
sed_runner "s/ucx-py==.*/ucx-py==${NEXT_UCXPY_VERSION}.*/g" dependencies.yaml
sed_runner "s/ucxx==.*/ucxx==${NEXT_UCXPY_VERSION}.*/g" dependencies.yaml
sed_runner "s/ucx-py==.*/ucx-py==${NEXT_UCXPY_VERSION}.*,>=0.0.0a0/g" dependencies.yaml
sed_runner "s/ucxx==.*/ucxx==${NEXT_UCXPY_VERSION}.*,>=0.0.0a0/g" dependencies.yaml

DEPENDENCIES=(
cudf
Expand All @@ -47,7 +47,7 @@ DEPENDENCIES=(
)
for FILE in dependencies.yaml conda/environments/*.yaml; do
for DEP in "${DEPENDENCIES[@]}"; do
sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*/g" "${FILE}"
sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}"
done
done

Expand Down
2 changes: 1 addition & 1 deletion ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -euo pipefail
rapids-logger "Generate Python testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file_key test_python \
--file-key test_python \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml

rapids-mamba-retry env create --yes -f env.yaml -n test
Expand Down
15 changes: 8 additions & 7 deletions conda/environments/all_cuda-114_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ dependencies:
- click >=8.1
- cuda-version=11.4
- cudatoolkit
- cudf==24.8.*
- dask-cudf==24.8.*
- distributed-ucxx==0.39.*
- kvikio==24.8.*
- cudf==24.8.*,>=0.0.0a0
- dask-cudf==24.8.*,>=0.0.0a0
- distributed-ucxx==0.39.*,>=0.0.0a0
- kvikio==24.8.*,>=0.0.0a0
- numactl-devel-cos7-x86_64
- numba>=0.57
- numpy>=1.23,<2.0a0
Expand All @@ -24,13 +24,14 @@ dependencies:
- pytest
- pytest-cov
- python>=3.9,<3.12
- rapids-dask-dependency==24.8.*
- rapids-build-backend>=0.3.0,<0.4.0dev0
- rapids-dask-dependency==24.8.*,>=0.0.0a0
- setuptools>=64.0.0
- sphinx
- sphinx-click>=2.7.1
- sphinx-rtd-theme>=0.5.1
- ucx-proc=*=gpu
- ucx-py==0.39.*
- ucxx==0.39.*
- ucx-py==0.39.*,>=0.0.0a0
- ucxx==0.39.*,>=0.0.0a0
- zict>=2.0.0
name: all_cuda-114_arch-x86_64
15 changes: 8 additions & 7 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ dependencies:
- click >=8.1
- cuda-version=11.8
- cudatoolkit
- cudf==24.8.*
- dask-cudf==24.8.*
- distributed-ucxx==0.39.*
- kvikio==24.8.*
- cudf==24.8.*,>=0.0.0a0
- dask-cudf==24.8.*,>=0.0.0a0
- distributed-ucxx==0.39.*,>=0.0.0a0
- kvikio==24.8.*,>=0.0.0a0
- numactl-devel-cos7-x86_64
- numba>=0.57
- numpy>=1.23,<2.0a0
Expand All @@ -24,13 +24,14 @@ dependencies:
- pytest
- pytest-cov
- python>=3.9,<3.12
- rapids-dask-dependency==24.8.*
- rapids-build-backend>=0.3.0,<0.4.0dev0
- rapids-dask-dependency==24.8.*,>=0.0.0a0
- setuptools>=64.0.0
- sphinx
- sphinx-click>=2.7.1
- sphinx-rtd-theme>=0.5.1
- ucx-proc=*=gpu
- ucx-py==0.39.*
- ucxx==0.39.*
- ucx-py==0.39.*,>=0.0.0a0
- ucxx==0.39.*,>=0.0.0a0
- zict>=2.0.0
name: all_cuda-118_arch-x86_64
15 changes: 8 additions & 7 deletions conda/environments/all_cuda-122_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ dependencies:
- cuda-nvcc-impl
- cuda-nvrtc
- cuda-version=12.2
- cudf==24.8.*
- dask-cudf==24.8.*
- distributed-ucxx==0.39.*
- kvikio==24.8.*
- cudf==24.8.*,>=0.0.0a0
- dask-cudf==24.8.*,>=0.0.0a0
- distributed-ucxx==0.39.*,>=0.0.0a0
- kvikio==24.8.*,>=0.0.0a0
- numactl-devel-cos7-x86_64
- numba>=0.57
- numpy>=1.23,<2.0a0
Expand All @@ -25,13 +25,14 @@ dependencies:
- pytest
- pytest-cov
- python>=3.9,<3.12
- rapids-dask-dependency==24.8.*
- rapids-build-backend>=0.3.0,<0.4.0dev0
- rapids-dask-dependency==24.8.*,>=0.0.0a0
- setuptools>=64.0.0
- sphinx
- sphinx-click>=2.7.1
- sphinx-rtd-theme>=0.5.1
- ucx-proc=*=gpu
- ucx-py==0.39.*
- ucxx==0.39.*
- ucx-py==0.39.*,>=0.0.0a0
- ucxx==0.39.*,>=0.0.0a0
- zict>=2.0.0
name: all_cuda-122_arch-x86_64
1 change: 1 addition & 0 deletions conda/recipes/dask-cuda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ requirements:
host:
- python
- pip
- rapids-build-backend>=0.3.0,<0.4.0.dev0
run:
- python
{% for r in data.get("project", {}).get("dependencies", []) %}
Expand Down
14 changes: 12 additions & 2 deletions dask_cuda/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
import importlib.resources

__version__ = (
importlib.resources.files("dask_cuda").joinpath("VERSION").read_text().strip()
importlib.resources.files(__package__).joinpath("VERSION").read_text().strip()
)
__git_commit__ = ""
try:
__git_commit__ = (
importlib.resources.files(__package__)
.joinpath("GIT_COMMIT")
.read_text()
.strip()
)
except FileNotFoundError:
__git_commit__ = ""

__all__ = ["__git_commit__", "__version__"]
12 changes: 12 additions & 0 deletions dask_cuda/tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

import dask_cuda


def test_version_constants_are_populated():
# __git_commit__ will only be non-empty in a built distribution
assert isinstance(dask_cuda.__git_commit__, str)

# __version__ should always be non-empty
assert isinstance(dask_cuda.__version__, str)
assert len(dask_cuda.__version__) > 0
35 changes: 28 additions & 7 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ dependencies:
common:
- output_types: [conda, requirements, pyproject]
packages:
- rapids-build-backend>=0.3.0,<0.4.0dev0
- setuptools>=64.0.0
cuda_version:
specific:
Expand Down Expand Up @@ -153,23 +154,23 @@ dependencies:
- numpy>=1.23,<2.0a0
- pandas>=1.3
- pynvml>=11.0.0,<11.5
- rapids-dask-dependency==24.8.*
- rapids-dask-dependency==24.8.*,>=0.0.0a0
- zict>=2.0.0
test_python:
common:
- output_types: [conda, requirements, pyproject]
packages:
- cudf==24.8.*
- dask-cudf==24.8.*
- kvikio==24.8.*
- pytest
- pytest-cov
- ucx-py==0.39.*
- output_types: [conda]
packages:
- distributed-ucxx==0.39.*
- &cudf_conda cudf==24.8.*,>=0.0.0a0
- &dask_cudf_conda dask-cudf==24.8.*,>=0.0.0a0
- distributed-ucxx==0.39.*,>=0.0.0a0
- &kvikio_conda kvikio==24.8.*,>=0.0.0a0
- &ucx_py_conda ucx-py==0.39.*,>=0.0.0a0
- ucx-proc=*=gpu
- ucxx==0.39.*
- ucxx==0.39.*,>=0.0.0a0
specific:
- output_types: conda
matrices:
Expand All @@ -181,3 +182,23 @@ dependencies:
arch: aarch64
packages:
- numactl-devel-cos7-aarch64
- output_types: [requirements, pyproject]
Copy link
Member Author

@jameslamb jameslamb Jun 3, 2024

Choose a reason for hiding this comment

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

dependencies.yaml here is being used to populate a [test] extra in pyproject.toml that is not ever actually used (as far as I can tell).

I've documented the (I think separate) work to set up wheel tests at some point in #1344.

For purposes of this PR, I chose to:

  • break this list down into CUDA-version-specific matrices (so rapids-build-backend will choose the suffixed ones when populating the test extra on the wheels it produces)
  • omit kvikio for the CUDA-version-specific cases for pyproject / requirements, as it doesn't currently have wheels (add wheel output kvikio#369)

Because this is being built with disable-cuda=true, the wheels built by rapids-build-backend will continue to have unsuffixed dependencies and include kvikio.

But at least breaking out the matrices like this means that other uses of rapids-dependency-file-generator to generate CUDA-specific requirements for this repo would get the -cu{major} suffixed versions.

matrices:
# kvikio should be added to the CUDA-version-specific matrices once there are wheels available
# ref: https://github.com/rapidsai/kvikio/pull/369
- matrix: {cuda: "12.*"}
packages:
- cudf-cu12==24.8.*,>=0.0.0a0
- dask-cudf-cu12==24.8.*,>=0.0.0a0
- ucx-py-cu12==0.39.*,>=0.0.0a0
- matrix: {cuda: "11.*"}
packages:
- cudf-cu11==24.8.*,>=0.0.0a0
- dask-cudf-cu11==24.8.*,>=0.0.0a0
- ucx-py-cu11==0.39.*,>=0.0.0a0
- matrix:
packages:
- *cudf_conda
- *dask_cudf_conda
- *kvikio_conda
- *ucx_py_conda
21 changes: 15 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[build-system]
build-backend = "setuptools.build_meta"
build-backend = "rapids_build_backend.build"
requires = [
"rapids-build-backend>=0.3.0,<0.4.0dev0",
"setuptools>=64.0.0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.

Expand All @@ -20,7 +21,7 @@ dependencies = [
"numpy>=1.23,<2.0a0",
"pandas>=1.3",
"pynvml>=11.0.0,<11.5",
"rapids-dask-dependency==24.8.*",
"rapids-dask-dependency==24.8.*,>=0.0.0a0",
"zict>=2.0.0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.
classifiers = [
Expand Down Expand Up @@ -49,12 +50,12 @@ docs = [
"sphinx-rtd-theme>=0.5.1",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.
test = [
"cudf==24.8.*",
"dask-cudf==24.8.*",
"kvikio==24.8.*",
"cudf==24.8.*,>=0.0.0a0",
"dask-cudf==24.8.*,>=0.0.0a0",
"kvikio==24.8.*,>=0.0.0a0",
"pytest",
"pytest-cov",
"ucx-py==0.39.*",
"ucx-py==0.39.*,>=0.0.0a0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.

[project.urls]
Expand Down Expand Up @@ -129,6 +130,14 @@ filterwarnings = [
"ignore:Dask DataFrame implementation is deprecated:DeprecationWarning",
]

[tool.rapids-build-backend]
build-backend = "setuptools.build_meta"
commit-files = [
"dask_cuda/GIT_COMMIT"
]
dependencies-file = "dependencies.yaml"
disable-cuda = true

[tool.setuptools]
license-files = ["LICENSE"]

Expand Down
Loading