-
Notifications
You must be signed in to change notification settings - Fork 200
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
Allow testing of earliest/latest dependencies #1613
Conversation
/ok to test |
ddc6263
to
0047966
Compare
ci/test_wheel.sh
Outdated
--output requirements \ | ||
--file-key test_python \ | ||
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES}" \ | ||
| tee oldest-dependencies.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this works now also for the wheel tests. A bit unfortunate that we need the branch and maybe the dependencies.yaml
entries.
On the up-side, it should be impossible to forgot to update the dependency file, as the below install will fail if there is an inconsistency:
EDIT: Sorry, pip doesn't notice it for rmm
since the test requirements don't include numpy
/numba
. Not sure it is vital, but I'll try to see if I can make one of them fail (or the conda one already fails).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be simplified a bit, and that it'd be better to use constraints instead of requirements:
- so we don't end up installing anything unnecessary
- so this test can still catch issues of the form "wheel forgot to include some required dependencies in its metadata
Would you consider something like this instead?
echo "" > ./constraints.txt
if [[ $RAPIDS_DEPENDENCIES == "oldest" ]]; then
rapids-dependency-file-generator \
--output requirements \
--file-key test_python \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES}" \
| tee ./constraints.txt
fi
# echo to expand wildcard before adding '[extra]' requires for pip
python -m pip install \
-v \
--constraint ./constraints.txt \
"$(echo "${WHEELHOUSE}"/rmm_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]"
ci/test_wheel.sh
Outdated
if [[ $RAPIDS_DEPENDENCIES != "oldest" ]]; then | ||
python -m pip install -v "${PIP_PACKAGE}[test]" | ||
else | ||
python -m pip install rapids-dependency-file-generator && pyenv rehash # TODO: include in image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python -m pip install rapids-dependency-file-generator && pyenv rehash # TODO: include in image |
This should be included in the image now (just to note).
Should this be retargeted to 24.10 since we are in code freeze? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'm generally supportive of this pattern. Left some suggestions for your consideration.
ci/test_wheel.sh
Outdated
--output requirements \ | ||
--file-key test_python \ | ||
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES}" \ | ||
| tee oldest-dependencies.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be simplified a bit, and that it'd be better to use constraints instead of requirements:
- so we don't end up installing anything unnecessary
- so this test can still catch issues of the form "wheel forgot to include some required dependencies in its metadata
Would you consider something like this instead?
echo "" > ./constraints.txt
if [[ $RAPIDS_DEPENDENCIES == "oldest" ]]; then
rapids-dependency-file-generator \
--output requirements \
--file-key test_python \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES}" \
| tee ./constraints.txt
fi
# echo to expand wildcard before adding '[extra]' requires for pip
python -m pip install \
-v \
--constraint ./constraints.txt \
"$(echo "${WHEELHOUSE}"/rmm_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]"
dependencies.yaml
Outdated
@@ -312,3 +312,14 @@ dependencies: | |||
- cuda-nvcc | |||
- matrix: | |||
packages: | |||
specific: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specific: |
This second specific:
is going to clobber the first one.
Try this out:
import yaml
import pprint
with open("dependencies.yaml") as f:
parsed = yaml.safe_load(f)
pprint.pprint(parsed["dependencies"]["test_python"])
You'll see that entry with cuda-nvcc
is lost.
import yaml
import pprint
with open("dependencies.yaml") as f:
parsed = yaml.safe_load(f)
pprint.pprint(parsed["dependencies"]["test_python"])
This is because:
rapids-dependency-file-generator
is written in Python- the YAML-loading library it uses represents YAML data as a Python dictionary
rapidsai/dependency-file-generator#104 tracks the (not currently active) work to change that. A YAML linter might also be able to detect and prevent this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks (also for the other tip)! So one of the jobs shouldn't end up with the constraints, will look into it.
(Over at cudf, I had to notice that it becomes even a bit more annoying to add cupy
into the mix, since it requires cupy_cu11
or cupy_cu12
depending on cuda version.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since it requires cupy_cu11 or cupy_cu12 depending on cuda version
For sure. I'm very familiar with the requirements for these dependencies.yaml
files and why the suffixes are split up the way they are (I did rapidsai/cudf#16183 and similar across RAPIDS), so @
me any time and I'm happy to help with a review.
Thanks @jameslamb adopted your suggestions, the constraints file is not just cleaner but also helpful :). (Close/reopen to kick CI to run fully once more.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey great, thanks for considering the suggestions!
This looks great to me... very little new complexity in exchange for a really useful testing improvement. I like it 🤩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sebastian for working on this and James for reviewing! 🙏
/merge |
…CI (#1716) Follow-up to #1613 Similar to rapidsai/cudf#17131 Proposes using the new `rapids-generate-pip-constraints` tool from `gha-tools` to generate a list of pip constraints pinning to the oldest supported verisons of dependencies here. ## Notes for Reviewers ### How I tested this `wheel-tests`: * oldest-deps: numpy 1.x ([build link](https://github.com/rapidsai/rmm/actions/runs/11620907528/job/32364032641?pr=1716#step:8:106)) * latest-deps: numpy 2.x ([build link](https://github.com/rapidsai/rmm/actions/runs/11620907528/job/32364032835?pr=1716#step:8:104)) And the testing of the general approach in rapidsai/gha-tools#114 (comment) Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Bradley Dice (https://github.com/bdice) URL: #1716
Mostly identical to gh-1606, which allows the testing of oldest/latest dependencies. What oldest/latest dependencies means exactly has to be set by each project in their
dependencies.yaml
file for the test env.See rapidsai/shared-workflows#228 for the workflow changes.
This is part of preparing for 2.0 (which should just work, but in the end no need to include it in the same PR).
Modifications from draft PR:
oldest
, as suggested by Matthew.(Draft, since the shared workflow should be pushed in first to revert the branch renaming probably. Need to test that the wheel workflow is correct.)