Allow testing of earliest/latest dependencies#1613
Allow testing of earliest/latest dependencies#1613rapids-bot[bot] merged 5 commits intorapidsai:branch-24.10from
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.
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.
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.
| 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? |
jameslamb
left a comment
There was a problem hiding this comment.
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.
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
| - cuda-nvcc | ||
| - matrix: | ||
| packages: | ||
| specific: |
There was a problem hiding this comment.
| 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-generatoris 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.
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.
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.) |
jameslamb
left a comment
There was a problem hiding this comment.
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 🤩
jakirkham
left a comment
There was a problem hiding this comment.
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.yamlfile 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.)