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

Pin wheel dependencies to same RAPIDS release #1200

Merged
merged 10 commits into from
Jan 31, 2023
4 changes: 2 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
build_type: pull-request
package-name: raft_dask
package-dir: python/raft-dask
before-wheel: "RAPIDS_PY_WHEEL_NAME=pylibraft_cu11 rapids-download-wheels-from-s3 ./local-pylibraft-dep"
cibw-before-build: "pip install --no-deps ./local-pylibraft-dep/pylibraft*.whl"
before-wheel: "RAPIDS_PY_WHEEL_NAME=pylibraft_cu11 rapids-download-wheels-from-s3 ./local-wheelhouse"
#cibw-before-build: "pip install --no-deps ./local-pylibraft-dep/pylibraft*.whl"
skbuild-configure-options: "-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"
wheel-tests-raft-dask:
needs: wheel-build-raft-dask
Expand Down
13 changes: 13 additions & 0 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CURRENT_MAJOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[1]}')
CURRENT_MINOR=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[2]}')
CURRENT_PATCH=$(echo $CURRENT_TAG | awk '{split($0, a, "."); print a[3]}')
CURRENT_SHORT_TAG=${CURRENT_MAJOR}.${CURRENT_MINOR}
CURRENT_UCX_PY_VERSION="$(curl -sL https://version.gpuci.io/rapids/${CURRENT_SHORT_TAG}).*"

#Get <major>.<minor> for next version
NEXT_MAJOR=$(echo $NEXT_FULL_TAG | awk '{split($0, a, "."); print a[1]}')
Expand Down Expand Up @@ -56,3 +57,15 @@ sed_runner "/^ucx_py_version:$/ {n;s/.*/ - \"${NEXT_UCX_PY_VERSION}\"/}" conda/

# Wheel builds install dask-cuda from source, update its branch
sed_runner "s/dask-cuda.git@branch-[^\"\s]\+/dask-cuda.git@branch-${NEXT_SHORT_TAG}/g" .github/workflows/*.yaml

# Need to distutils-normalize the original version
CURRENT_SHORT_TAG_PEP440=$(python -c "from setuptools.extern import packaging; print(packaging.version.Version('${CURRENT_SHORT_TAG}')")
NEXT_SHORT_TAG_PEP440=$(python -c "from setuptools.extern import packaging; print(packaging.version.Version('${NEXT_SHORT_TAG}')")
CURRENT_UCX_PY_VERSION_PEP440=$(python -c "from setuptools.extern import packaging; print(packaging.version.Version('${CURRENT_UCX_PY_VERSION}')")
NEXT_UCX_PY_VERSION_PEP440=$(python -c "from setuptools.extern import packaging; print(packaging.version.Version('${NEXT_UCX_PY_VERSION}')")

# Wheel builds install intra-RAPIDS dependencies from same release
sed_runner "s/${CURRENT_SHORT_TAG_PEP440}/${NEXT_SHORT_TAG_PEP440}/g" python/pylibraft/setup.py
sed_runner "s/${CURRENT_SHORT_TAG_PEP440}/${NEXT_SHORT_TAG_PEP440}/g" python/pylibraft/_custom_build/backend.py
sed_runner "s/${CURRENT_SHORT_TAG_PEP440}/${NEXT_SHORT_TAG_PEP440}/g" python/raft-dask/setup.py
sed_runner "s/${CURRENT_UCX_PY_VERSION_PEP440}/${NEXT_UCX_PY_VERSION_PEP440}/g" python/raft-dask/setup.py
Copy link
Member

Choose a reason for hiding this comment

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

I think it's best to avoid using any kind of CURRENT_SHORT_TAG reference in the search term for these lines because if the source files become out of sync (which happens occasionally) then these sed commands will fail.

I would recommend making the search terms more specific.

Copy link
Member

Choose a reason for hiding this comment

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

BTW, you can test these lines with commands like: bash ci/release/update-version.sh 23.04.00.

I usually try to run a sequence of commands like this to ensure that everything works as expected:

bash ci/release/update-version.sh 23.06.00
bash ci/release/update-version.sh 22.06.00
bash ci/release/update-version.sh 23.02.00

7 changes: 3 additions & 4 deletions python/pylibraft/_custom_build/backend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.

"""Custom build backend for pylibraft to get versioned requirements.

Expand All @@ -18,9 +18,8 @@ def replace_requirements(func):
@wraps(func)
def wrapper(config_settings=None):
orig_list = getattr(_orig, func.__name__)(config_settings)
append_list = [
f"rmm{os.getenv('RAPIDS_PY_WHEEL_CUDA_SUFFIX', default='')}"
]
cuda_suffix = os.getenv("RAPIDS_PY_WHEEL_CUDA_SUFFIX", default="")
append_list = [f"rmm{cuda_suffix}==23.2.*"]
return orig_list + append_list

return wrapper
Expand Down
4 changes: 2 additions & 2 deletions python/pylibraft/setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, NVIDIA CORPORATION.
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
install_requires = [
"numpy",
"cuda-python>=11.7.1,<12.0",
f"rmm{cuda_suffix}",
f"rmm{cuda_suffix}==23.2.*",
]

extras_require = {
Expand Down
4 changes: 2 additions & 2 deletions python/raft-dask/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
"joblib>=0.11",
"dask-cuda>=23.2*",
"dask>=2022.12.0",
f"ucx-py{cuda_suffix}",
f"ucx-py{cuda_suffix}==0.30.*",
"distributed>=2022.12.0",
f"pylibraft{cuda_suffix}",
f"pylibraft{cuda_suffix}==23.2.*",
]

extras_require = {
Expand Down