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

introduce rapids-generate-pip-constraints #114

Merged
merged 4 commits into from
Oct 31, 2024

Conversation

jameslamb
Copy link
Member

@jameslamb jameslamb commented Sep 5, 2024

Contributes to rapidsai/build-planning#81

rapidsai/shared-workflows#228 introduced a new environment variable for wheel-testing CI jobs, RAPIDS_DEPENDENCIES, which takes the following values:

  • oldest = pin to oldest-supported versions
  • latest = do not constraint versions

To take advantage of that in CI, PRs like rapidsai/cudf#16570 have been rolling out. They're all taking a similar approach, copying around the same snippet of code that generates a pip constraints.txt file using rapids-dependency-file-generator.

Based on the suggestion from rapidsai/cudf#16570 (comment), this proposes wrapping that behavior in a tool.

Notes for Reviewers

Benefits of this change

Simplifies and standardizes CI scripts.

Reduces the effort to roll out other types of testing with alternative dependency sets in the future.

How I tested this

With latest cudf (including the changes from rapidsai/cudf#16570) checked out, ran the following from the root of that repo:

PATH="${HOME}/repos/gha-tools/tools:${PATH}" \
RAPIDS_CUDA_VERSION="12.5.1" \
RAPIDS_DEPENDENCIES=latest \
RAPIDS_PY_VERSION="3.11" \
  ${GHA_TOOLS}/rapids-generate-pip-constraints \
      test_python \
      ./beep-boop.txt
      
cat ./beep-boop.txt
# (empty)

PATH="${HOME}/repos/gha-tools/tools:${PATH}" \
RAPIDS_CUDA_VERSION="12.5.1" \
RAPIDS_DEPENDENCIES=oldest \
RAPIDS_PY_VERSION="3.11" \
  ${GHA_TOOLS}/rapids-generate-pip-constraints \
      test_python \
      ./beep-boop.txt

# # This file is generated by `rapids-dependency-file-generator`.
# # To make changes, edit ../dependencies.yaml and run `rapids-dependency-file-generator`.
# cramjam
# cupy-cuda11x==12.0.0
# cupy-cuda12x==12.0.0
# cupy==12.0.0
# dask-cuda==24.10.*,>=0.0.0a0
# ...

PATH="${HOME}/repos/gha-tools/tools:${PATH}" \
RAPIDS_CUDA_VERSION="12.5.1" \
RAPIDS_DEPENDENCIES=oldset \
RAPIDS_PY_VERSION="3.11" \
  ${GHA_TOOLS}/rapids-generate-pip-constraints \
      test_python \
      ./beep-boop.txt
# [rapids-generate-pip-constraints] Got unrecognized value for RAPIDS_DEPENDENCIES: 'oldset'. Expected one of ('latest', 'oldest').

echo $?
# 1

@jameslamb jameslamb added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Sep 5, 2024
Copy link

@seberg seberg left a comment

Choose a reason for hiding this comment

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

LGTM, nice. Also nice touch to add an error to the if!

@vyasr
Copy link
Contributor

vyasr commented Sep 20, 2024

@jameslamb could you put up a PR updating some repo (e.g. cudf) to use this tool? Cloning this branch in the CI of that repo and updating PATH should allow you to test the new tool.

@jameslamb
Copy link
Member Author

@jameslamb could you put up a PR updating some repo (e.g. cudf) to use this tool? Cloning this branch in the CI of that repo and updating PATH should allow you to test the new tool.

I put up rapidsai/cudf#17131 doing that. It looks like it's doing what we want.

wheel-tests-cudf (..., oldest-deps)

# This file is generated by `rapids-dependency-file-generator`.
# To make changes, edit ../dependencies.yaml and run `rapids-dependency-file-generator`.
...
cupy-cuda11x==12.0.0
cupy-cuda12x==12.0.0
...
numpy==1.23.*
pandas==2.0.*
pyarrow==14.0.0
...
Successfully installed ... cupy-cuda12x-12.0.0 ... numpy-1.23.5 ... pandas-2.0.3 ... pyarrow-14.0.0 ...

(build link)

wheel-tests-cudf (..., latest-deps)

...
Successfully installed ... cupy-cuda11x-13.3.0 ... numpy-2.0.2 ... pandas-2.2.3 ... pyarrow-16.1.0 ...

(build link)

@vyasr @seberg is that convincing? Want to merge this and then use it for the rest of rapidsai/build-planning#81?

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

Yup this LGTM!

@jameslamb
Copy link
Member Author

🎉 alright great, thanks everyone! I'll merge this and go apply it to rmm and cudf (the only two repos that have this testing yet, I think, based on my read of rapidsai/build-planning#81).

@jameslamb jameslamb merged commit 2cdbae8 into rapidsai:main Oct 31, 2024
1 check passed
@jameslamb jameslamb deleted the rapids-constraints branch October 31, 2024 14:55
rapids-bot bot pushed a commit to rapidsai/cudf that referenced this pull request Oct 31, 2024
…CI (#17131)

Follow-up to #16570 (comment)

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

rapidsai/gha-tools#114 (comment)

You can also see one the most recent `wheel-tests-cudf` builds here:

* oldest-deps: numpy 1.x ([build link](https://github.com/rapidsai/cudf/actions/runs/11615430314/job/32347576688?pr=17131)) 
* latest-deps: numpy 2.x ([build link](https://github.com/rapidsai/cudf/actions/runs/11615430314/job/32347577095?pr=17131))

#

Authors:
  - James Lamb (https://github.com/jameslamb)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #17131
rapids-bot bot pushed a commit to rapidsai/rmm that referenced this pull request Nov 7, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants