rapids-rattler-channel-string: add support for prepending channels - #176
Merged
Conversation
jameslamb
marked this pull request as ready for review
May 14, 2025 03:04
gforsyth
approved these changes
May 14, 2025
gforsyth
left a comment
Contributor
There was a problem hiding this comment.
One typo, but this looks great, approving so you can merge at your discretion!
Comment on lines
+3
to
+35
| # Populates shell variables expected to be used by build scripts invoking `ratther-build`. | ||
| # | ||
| # This is intended to be `source`'d, not invoked as an executable. | ||
| # | ||
| # Variables: | ||
| # | ||
| # * RATTLER_ARGS = Bash array of arguments to be passed to invocations of `rattler-build build` | ||
| # * RATTLER_CHANNELS = Bash array of conda channels, where each item is prefixed with '--channel '. | ||
| # If variable `RAPIDS_PREPENDED_CONDA_CHANNELS` is defined when this script is invoked, | ||
| # it is expected to hold a bash array with additional conda channels (omitting the '--channel ' prefix). | ||
| # Each of these is PREPENDED to the output in `RATTLER_CHANNELS`. | ||
| # | ||
| # Usage: | ||
| # | ||
| # # standard usage | ||
| # source rapids-rattler-channel-string | ||
| # rattler-build build \ | ||
| # --recipe conda/recipes/librmm \ | ||
| # --output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \ | ||
| # "${RATTLER_CHANNELS[@]}" | ||
| # | ||
| # # prepend custom channels | ||
| # LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1909 cpp) | ||
| # RMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1909 python) | ||
| # RAPIDS_PREPENDED_CONDA_CHANNELS=("${LIBRMM_CHANNEL}" "${RMM_CHANNEL}") | ||
| # | ||
| # source rapids-rattler-channel-string | ||
| # rattler-build build \ | ||
| # --recipe conda/recipes/librmm \ | ||
| # --output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \ | ||
| # "${RATTLER_CHANNELS[@]}" | ||
| # | ||
|
|
Contributor
There was a problem hiding this comment.
Thanks for documenting this!!
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributes to https://github.com/rapidsai/build-infra/issues/237
Contributes to rapidsai/build-planning#14
Splitting this off from #/173
Overview
As of this PR, if a bash array
RAPIDS_PREPENDED_CONDA_CHANNELSis detected wheneverrapids-rattler-channel-stringis sourced, it prepends each element of that array the channel list passed torattler-build(RATTLER_CHANNELS).Notes for Reviewers
Benefits of these changes
Helps with simplifying "use packages from one PR in another PR's CI" (related: rapidsai/docs#601).
With this, you could create a script like
ci/use_conda_packages_from_prs.shandsourceit at the top of everyci/build*.sh, without any other changes toci/build*.shscripts required:More Details
rapids-rattler-channel-string(first added in #143) defines a bash array,RATTLER_CHANNELS, containing a list of conda channels to be used when building the build/host/test environments inrattler-buildbuilds. Like this:(cuml code link)
The ordering in that channel list is important... for any projects using conda "strict" channel priority, those channels are searched in order for packages, and the first package found is used.
When testing something like "use packages from this
cuvsPR in CI on thiscumlPR", it's desirable to download the upstream PR's CI artifacts and tellrattler-buildto use them. One useful mechanism for that is to put the "channels" (local directories) holding those downloaded files into the channel list. It's important that you be able to prepend them, so strict channel priority will result in the locally-downloaded packages being chosen.This change makes that possible for
rattler-buildbuilds (see above and rapidsai/docs#601).How I tested this
Tested this as part of #173, via NVIDIA/cudf#18747
Evidence that it worked: NVIDIA/cudf#18747 (comment)