-
Notifications
You must be signed in to change notification settings - Fork 4
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
Remove uses of 'pip --find-links' in CI #69
Comments
This is fundamentally the pip analog to #14. I moved us towards As far as build isolation, it's worth noting that we might have to do away with that anyway in light of C++ wheels and the sccache issues that come with using this in ephemeral isolated build environments. |
Thanks for that! I hadn't considered the connection between this idea and #14.
At a minimum, for wheel test jobs I think the But yeah, the case for build jobs (at least as long as we want build isolation) is tough. |
Well like I said we might have to get rid of build isolation so we can figure that part out when we get done with C++ wheels. |
Avoid `pip --find-links` which can fail to install and fall back to older wheels. See rapidsai/build-planning#69 for more information. Authors: - Bradley Dice (https://github.com/bdice) - Peter Andreas Entschev (https://github.com/pentschev) Approvers: - Peter Andreas Entschev (https://github.com/pentschev) - Ray Douglass (https://github.com/raydouglass) URL: #235
Contributes to rapidsai/build-planning#31 Contributes to rapidsai/build-planning#69 Contributes to rapidsai/dependency-file-generator#89 Proposes: * introducing `rapids-build-backend` as this project's build backend, to reduce the complexity of various CI/build scripts * using `pip install ./dist/*.whl` instead of `pip install --find-links ./dist` in CI, to reduce the risk of the types of bugs described in rapidsai/build-planning#69 Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) - Ray Douglass (https://github.com/raydouglass) - Peter Andreas Entschev (https://github.com/pentschev) URL: #234
Avoid `pip --find-links` which can fail to install and fall back to older wheels. See rapidsai/build-planning#69 for more information. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - James Lamb (https://github.com/jameslamb) URL: #1583
Avoid `pip --find-links` which can fail to install and fall back to older wheels. See rapidsai/build-planning#69 for more information. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - James Lamb (https://github.com/jameslamb) URL: #1583
Was experimenting with approaches for this today, and I think I found one that'll give us a strong guarantee of correctness for build dependencies even while using build isolation. It appears that So, given some wheel(s) downloaded like this... RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
CPP_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="rmm_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp /tmp/librmm_dist) ... instead of this (the current pattern used in python -m pip wheel \
--no-deps \
-w dist \
--find-links "${CPP_WHEELHOUSE}" \
. ... I think we could force echo "librmm @ file://$(echo ${CPP_WHEELHOUSE}/librmm_*.whl)" > ./constraints.txt
PIP_CONSTRAINT="${PWD}/constraints.txt" \
python -m pip wheel \
--no-deps \
-w dist \
. That worked for me in some local experiments using simple pure-Python projects. I think I could test it with I'll try that some time soon. |
This worked! Using the See "How I tested this" here: rapidsai/rmm#1586 I've updated the tasklist at the top of this issue with the remaining places across RAPIDS where |
This behavior makes sense. I'm pretty sure you'll observe the same behavior for all of the CLI flags vs environment variables (e.g. Thanks for doing this research! I'm fine moving forward with this approach, although I'll reiterate that it might be a short-lived change if we end up having to remove build isolation anyway when we migrate to C++ wheels. |
Yeah I think you're right. This is the behavior I observed but it wasn't necessarily what I expected. Either way, the environment variable approach seems to work well and I think it'll continue to for as long as we're using build isolation.
Ok thanks! Since it's not too much effort to implement this and since only a few of the projects currently are using |
Contributes to rapidsai/build-planning#69. Proposes a stricter pattern for passing a `librmm` wheel from the `wheel-build-cpp` job that produced it into the `wheel-build-python` job wanting to use it (as a build dependency of `rmm`). This change improves the likelihood that issues with the `librmm` wheels will be caught in CI. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: #1586
For sure, I was surprised when I first found this too. |
Contributes to rapidsai/build-planning#69. Proposes a stricter pattern for passing a `libkvikio` wheel from the `wheel-build-cpp` job that produced it into the `wheel-build-python` job wanting to use it (as a build dependency of `kvikio`). This change improves the likelihood that issues with the `libkivkio` wheels will be caught in CI. ## Notes for Reviewers See rapidsai/rmm#1586 and rapidsai/build-planning#69 (comment) for details on how I tested this approach. I didn't propose this on #369 because I hadn't quite finished testing the approach yet. But I do think we should do this for all of the C++ wheels (rapidsai/build-planning#33). Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Mike Sarahan (https://github.com/msarahan) URL: #397
Contributes to rapidsai/build-planning#69 Contributes to rapidsai/build-planning#33 Proposes a stricter pattern for passing a `pylibcugraph` wheel from the `wheel-build-cpp` job that produced it into the `wheel-build-python` job wanting to use it (as a build dependency of `cugraph`). This change improves the likelihood that issues with the `pylibcugraph` wheels will be caught in CI. ## Notes for Reviewers See rapidsai/rmm#1586 and rapidsai/build-planning#69 (comment) for details on how I tested this approach. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Mike Sarahan (https://github.com/msarahan) URL: #4509
I believe this is complete, and can be closed. I have open PRs up in I've checked the
I've also reviewed the open C++ wheels PRs (#33) and left comments on any that are using |
Thanks James! 🙏 |
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 rapidsai/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)Wherever possible, use of
--find-links
should be avoided across RAPIDS CI jobs, in favor of askingpip
to directly install the just-downloaded wheel(s) like this:pip install ./dist/*.whl
Benefits of this work
rapids-build-backend
(Update RAPIDS Python packages to use rapids-build-backend #31)Acceptance Criteria
--find-links
orPIP_FIND_LINKS
pointing at a local directory as possibleApproach
Use GitHub search to look for uses of the following across RAPIDS:
pip install --find-links
PIP_FIND_LINKS
variableWhenever possible, replace those by pointing
pip install
directly 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-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 topip wheel --constraint
to forcepip wheel
to use them.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:
raft-dask
wheel has unsatisfiable dependency requirements raft#2348Tasks
The text was updated successfully, but these errors were encountered: