-
Notifications
You must be signed in to change notification settings - Fork 208
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
Port to rattler-build #1796
base: branch-25.04
Are you sure you want to change the base?
Port to rattler-build #1796
Conversation
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
9a224dd
to
c79968f
Compare
conda/recipes/librmm/meta.yaml
Outdated
{% if cuda_major != "11" %} | ||
- cuda-cudart-dev | ||
{% endif %} | ||
- {{ "cuda-cudart-dev" if cuda_major == "12" else "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.
conda-recipe-manager
doesn't like !=
as a comparison operator
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.
Maybe we could do not
and ==
s?
- {{ "cuda-cudart-dev" if cuda_major == "12" else "cuda-version" }} | |
- {{ "cudatoolkit" if not (cuda_major == "12") else "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.
Yep, that works!
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.
We want to write this in a way that only mentions CUDA 11, so that the condition can be trivially deleted when adding future major version support.
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.
Yeah that was the idea. I just goofed on the syntax. Took another go below
conda/recipes/librmm/recipe.yaml
Outdated
version: ${{ env.get("RAPIDS_PACKAGE_VERSION") }} | ||
cuda_version: ${{ (env.get('RAPIDS_CUDA_VERSION') | split('.'))[:2] | join(".") }} | ||
cuda_major: ${{ (env.get('RAPIDS_CUDA_VERSION') | split('.'))[0] }} | ||
date_string: ${{ env.get("RAPIDS_DATE_STRING") }} |
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 grabbed these from rapidsai/cugraph#4551 as currently conda-recipe-manager
doesn't have support for handling converting from the extended jinja2 syntax to the subset that rattler supports
Co-authored-by: jakirkham <[email protected]>
Co-authored-by: jakirkham <[email protected]>
5af3309
to
be8c03f
Compare
well, if we remove still missing all the
|
OK interesting that certainly implicates clobbering to some degree.
Maybe worth double-checking if there are any nvtx-related files in the build environment coming from other packages. Just to rule out clobbering as a possible root cause. |
It does seem to respect the CBC selectors: with
with
|
Ok, so I'm not sure what's up with my LOCAL build environment, but I just pulled down the latest I'll investigate whether my changes are even required for the |
Ok, so the changes removing the nvtx stuff seems to be a me problem, but it's working fine in CI |
conda/recipes/librmm/recipe.yaml
Outdated
- "test -d \"${PREFIX}/include/rmm\"" | ||
about: | ||
homepage: ${{ load_from_file("python/librmm/pyproject.toml").project.urls.Homepage }} | ||
license: ${{ load_from_file("python/librmm/pyproject.toml").project.license.text | replace(" ", "-") }} |
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.
We should probably change python/librmm/pyproject.toml
to use Apache-2.0
as an SPDX identifier. https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
Like this:
- license = { text = "Apache 2.0" }
+ license = "Apache-2.0"
@vyasr Do you know why we chose to write it this way in #1529?
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.
We should probably fix this across the board -- I would suggest raising this with ops (in case they know of restrictions that I do not know). If ops is supportive, let's open a build-planning issue and audit this for all repos. Non-OSS repos may need a different solution, but Apache/BSD-3 repos should be fixable.
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.
Then this will look like:
license: ${{ load_from_file("python/librmm/pyproject.toml").project.license.text | replace(" ", "-") }} | |
license: ${{ load_from_file("python/librmm/pyproject.toml").project.license }} |
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.
IIRC the current choices were made in order to guarantee compatibility with wheeltamer. @raydouglass may remember the exact list of "allowed" licenses. Given that we no longer run wheeltamer before releases that is a moot point, but I don't know if there are any subsequent scans that we have reinstated where this could still be a problem.
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.
Good -- that's exactly what I wondered. If we can adopt a normal SPDX license identifier in our pyproject.toml
files, we absolutely should. I am okay with that being a follow-up to this PR, though.
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.
Yes, previously we used Apache 2.0
to comply with wheeltamer. Wheeltamer does now supports the correct SPDX Apache-2.0
, so would be good to switch to the SPDX identifier across RAPIDS.
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 sweet then we can go ahead and synchronize the values in conda and pip so that we don't need any modification from one to the other.
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.
Following up: I opened rapidsai/build-planning#152 to propose switching to SPDX license expressions (like license = "Apache-2.0"
) but they're not supported by setuptools yet.
To simplify things, we should update our pyproject.toml
files to license = { text = "Apache-2.0" }
as we roll out rattler-build. @jakirkham proposed that here: rapidsai/build-planning#152 (comment)
We should avoid using replace(" ", "-")
in the new recipes, just fix the source when needed.
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.
Pushed up a commit adding the -
in the pyproject.toml
files and removing the replace
- python: | ||
imports: | ||
- rmm | ||
pip_check: false |
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 for the details @vyasr. Let's copy-paste this into a build-planning issue or something that we can use to plan future work. I think we do have worthwhile action items here -- passing pip check
would be a very nice-to-have validation of our packaging.
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.
Approving with a minor fix and one question about making all env
vars required.
Follow-up work:
- SPDX licenses in
pyproject.toml
files - Enabling
pip check
ci/build_cpp.sh
Outdated
-c rapidsai \ | ||
-c rapidsai-nightly \ |
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 wonder if we actually need both of these channels or if we should tighten things up using rapids-is-release-build
to select one or the other.
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.
Agreed. We could probably use logic similar to https://github.com/rapidsai/gha-tools/blob/main/tools/rapids-configure-conda-channels to define an environment variable with channels in https://github.com/rapidsai/gha-tools/blob/main/tools/rapids-configure-rattler.
tl;dr We need to avoid using rapidsai-nightly
or dask/label/dev
when rapids-is-release-build
returns true.
- if: cuda_major == "11" | ||
then: cuda-cudart-dev | ||
about: | ||
homepage: ${{ load_from_file("python/librmm/pyproject.toml").project.urls.Homepage }} |
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.
Can we load_from_file
once into something in the context and then access that data? I don't know if rattler is smart enough to cache the file on its own.
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.
Doesn't seem to work. In all of their documentation examples they repeatedly call load_from_file
on the same file
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.
Weird. I opened prefix-dev/rattler-build#1423. This seems like a bug in the Jinja parsing.
@jakirkham @vyasr anything else you'd like to see here? |
conda/recipes/rmm/recipe.yaml
Outdated
about: | ||
homepage: ${{ load_from_file("python/rmm/pyproject.toml").project.urls.Homepage }} | ||
license: ${{ load_from_file("python/rmm/pyproject.toml").project.license.text | replace(" ", "-") }} | ||
summary: ${{ load_from_file("python/rmm/pyproject.toml").project.description }} |
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.
Is it possible to assign ${{ load_from_file("python/rmm/pyproject.toml").project }}
to a global variable and extract each value from 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.
about: | |
homepage: ${{ load_from_file("python/rmm/pyproject.toml").project.urls.Homepage }} | |
license: ${{ load_from_file("python/rmm/pyproject.toml").project.license.text | replace(" ", "-") }} | |
summary: ${{ load_from_file("python/rmm/pyproject.toml").project.description }} | |
about: | |
homepage: ${{ project.urls.Homepage }} | |
license: ${{ project.license.text }} | |
summary: ${{ project.description }} |
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.
Not currently, no. prefix-dev/rattler-build#1423
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.
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 Gil! 🙏
Am wondering if we can simplify the templating with a context
variable
cuda_major: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }} | ||
date_string: ${{ env.get("RAPIDS_DATE_STRING") }} | ||
py_version: ${{ env.get("RAPIDS_PY_VERSION") }} | ||
head_rev: ${{ git.head_rev(".")[:8] }} |
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.
Maybe something like this?
head_rev: ${{ git.head_rev(".")[:8] }} | |
head_rev: ${{ git.head_rev(".")[:8] }} | |
project: ${{ load_from_file("python/rmm/pyproject.toml").project }} |
conda/recipes/rmm/recipe.yaml
Outdated
about: | ||
homepage: ${{ load_from_file("python/rmm/pyproject.toml").project.urls.Homepage }} | ||
license: ${{ load_from_file("python/rmm/pyproject.toml").project.license.text | replace(" ", "-") }} | ||
summary: ${{ load_from_file("python/rmm/pyproject.toml").project.description }} |
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.
about: | |
homepage: ${{ load_from_file("python/rmm/pyproject.toml").project.urls.Homepage }} | |
license: ${{ load_from_file("python/rmm/pyproject.toml").project.license.text | replace(" ", "-") }} | |
summary: ${{ load_from_file("python/rmm/pyproject.toml").project.description }} | |
about: | |
homepage: ${{ project.urls.Homepage }} | |
license: ${{ project.license.text }} | |
summary: ${{ project.description }} |
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.
One last small set of questions, then this LGTM!
if rapids-is-release-build; then | ||
RAPIDS_CHANNEL=rapidsai | ||
else | ||
RAPIDS_CHANNEL=rapidsai-nightly | ||
fi |
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.
Very minor nit: I foresee this propagating everywhere. Should we turn this into a GHA tool? We could even make it return an array of usable channels so that we also have a centralized place for removing the nvidia channel once we no longer need 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.
Yeah, we should. I'll get that set up
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.
PR up in rapidsai/gha-tools#143
# remove build_cache directory | ||
rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache | ||
|
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.
FYI I opened prefix-dev/rattler-build#1424
version: ${{ version }} | ||
build: | ||
string: cuda${{ cuda_major }}_${{ date_string }}_${{ head_rev }} | ||
script: install_librmm.sh |
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.
A final thought, should we just inline these scripts? They're pretty much all one-liners. I find that the current split makes most recipes harder to parse, not easier. Curious what other reviewers think, but I consider inlining <3 scripts preferable to having a separate file.
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 that's a good idea and would remove one more layer of indirection
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 consider inlining <3 scripts preferable
I ❤️ inline scripts too.
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.
This may be different for cudf or other repos — some of the scripts are multiple lines or have a TON of flags.
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'd say we inline where it's a simple one-liner and if it's more complicated than that (or has a bunch of flags) we stick with the standalone install script.
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 consider inlining <3 scripts preferable
I ❤️ inline scripts too.
Whoops lol I hope at least one of you guessed that I meant "<3 line scripts" 😂
Yeah I'm fine doing this on a case-by-case basis based on the rough 3-line heuristic.
Summary:
recipe.yaml
build
environment compiles things, the individual outputs callcmake --install
git
functions for grabbing the short-SHA (https://rattler.build/latest/experimental_features/#git-functions)load_from_file
to pull in metadata from the correspondingpyproject.toml
(https://rattler.build/latest/experimental_features/#load_from_filefile_path)build_*.sh
--no-build-id
to allowsccache
to look in a predictable place, see: https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-buildrapids-is-release-build
, we include eitherrapidsai
(release) orrapidsai-nightly
(non-release) in the channel listingbuild_cache
directory after building so it doesn't get packaged up with the other artifacts and uploaded to S3xref: rapidsai/build-planning#47