Description
Most RAPIDS projects have separate build jobs (which produce artifacts like wheels and conda packages) and test jobs (which install those artifacts and then run tests using the installed versions).
Some of those test jobs for wheels do something like this (pseudocode) to install those build-job artifacts:
download-from-s3 project.whl > ./dist/
pip install "project" --find-links ./dist
As we discovered in NVIDIA/raft#2348, that use of --find-links can result in some types of failures being missed in CI.
For example, if that wheel in ./dist has impossible-to-resolve dependencies, pip install will happily disregard it and backtrack to older wheels on https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/.
From "Finding Packages' in the pip docs (link)
pip looks for packages in a number of places: on PyPI ..., in the local filesystem, and in any additional repositories specified via --find-links or --index-url. There is no ordering in the locations that are searched. ...they are all checked, and the “best” match for the requirements ... is selected.
Wherever possible, use of --find-links should be avoided across RAPIDS CI jobs, in favor of asking pip to directly install the just-downloaded wheel(s) like this:
Benefits of this work
- improves the chance of catching issues like "this wheel has unsatisfiable requirements" in CI, near the change that leads to that issue
- improves release confidence and velocity in changes to how wheels are built
Acceptance Criteria
- across RAPIDS projects' CI , there are as few
--find-links or PIP_FIND_LINKS pointing at a local directory as possible
Approach
Use GitHub search to look for uses of the following across RAPIDS:
pip install --find-links
PIP_FIND_LINKS variable
Whenever possible, replace those by pointing pip install directly at the files to consider, e.g. like this:
# globbing is enough if not using [extras]
pip install ./dist/*
# echo the full name for use with [extras]
pip install "$(echo ./dist/*.whl)[test]"
Build jobs might require a different approach from test jobs
You'll find some uses like this one in rmm, where a wheel of some dependency is downloaded and then needed at build time.
CPP_WHEELHOUSE=$(
RAPIDS_PY_WHEEL_NAME="rmm_${RAPIDS_PY_CUDA_SUFFIX}" \
rapids-download-wheels-from-s3 cpp /tmp/librmm_dist
)
pip wheel \
-w dist \
--no-deps \
--find-links "${CPP_WHEELHOUSE}" \
.
(rmm - ci/build_wheel.sh)
That use of --find-links is there because RAPIDS CI build jobs tend to use build isolation. Test out whether it's possible to additionally pass specific wheel files to pip wheel --constraint to force pip wheel to use them.
python -m pip wheel \
-w dist \
-vvv \
--no-deps \
--disable-pip-version-check \
--find-links "${CPP_WHEELHOUSE}" \
--constraint "${CPP_WHEELHOUSE}/*.whl" \
.
Something like that might work to force pip to use that file, even in the isolated build environment.
But if not, it's fine to leave the build jobs alone, in exchange for the benefits we get from using build isolation.
Notes
Relevant discussions:
### Tasks
- [x] cugraph (https://github.com/rapidsai/cugraph/pull/4509)
- [x] cugraph-gnn (https://github.com/rapidsai/cugraph-gnn/pull/7)
- [x] cugraph-pg (https://github.com/rapidsai/cugraph-pg/pull/22)
- [x] kvikio (https://github.com/rapidsai/kvikio/pull/397)
- [x] raft (https://github.com/rapidsai/raft/pull/2349)
- [x] rmm (builds: https://github.com/rapidsai/rmm/pull/1586 | tests: https://github.com/rapidsai/rmm/pull/1583)
- [x] ucxx (https://github.com/rapidsai/ucxx/pull/234)
- [x] ucx-wheels (https://github.com/rapidsai/ucx-wheels/pull/9)
Description
Most RAPIDS projects have separate build jobs (which produce artifacts like wheels and conda packages) and test jobs (which install those artifacts and then run tests using the installed versions).
Some of those test jobs for wheels do something like this (pseudocode) to install those build-job artifacts:
As we discovered in NVIDIA/raft#2348, that use of
--find-linkscan result in some types of failures being missed in CI.For example, if that wheel in
./disthas impossible-to-resolve dependencies,pip installwill happily disregard it and backtrack to older wheels on https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/.From "Finding Packages' in the
pipdocs (link)Wherever possible, use of
--find-linksshould be avoided across RAPIDS CI jobs, in favor of askingpipto directly install the just-downloaded wheel(s) like this:pip install ./dist/*.whlBenefits of this work
rapids-build-backend(Update RAPIDS Python packages to use rapids-build-backend #31)Acceptance Criteria
--find-linksorPIP_FIND_LINKSpointing at a local directory as possibleApproach
Use GitHub search to look for uses of the following across RAPIDS:
pip install --find-linksPIP_FIND_LINKSvariableWhenever possible, replace those by pointing
pip installdirectly at the files to consider, e.g. like this:Build jobs might require a different approach from test jobs
You'll find some uses like this one in
rmm, where a wheel of some dependency is downloaded and then needed at build time.(rmm - ci/build_wheel.sh)
That use of
--find-linksis there because RAPIDS CI build jobs tend to use build isolation. Test out whether it's possible to additionally pass specific wheel files topip wheel --constraintto forcepip wheelto use them.python -m pip wheel \ -w dist \ -vvv \ --no-deps \ --disable-pip-version-check \ --find-links "${CPP_WHEELHOUSE}" \ --constraint "${CPP_WHEELHOUSE}/*.whl" \ .Something like that might work to force
pipto use that file, even in the isolated build environment.But if not, it's fine to leave the build jobs alone, in exchange for the benefits we get from using build isolation.
Notes
Relevant discussions:
raft-daskwheel has unsatisfiable dependency requirements NVIDIA/raft#2348