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

ray-packages v2.9.1 #139

Merged
merged 8 commits into from
Jan 24, 2024
Merged

Conversation

regro-cf-autotick-bot
Copy link
Contributor

It is very likely that the current package version for this feedstock is out of date.

Checklist before merging this PR:

  • Dependencies have been updated if changed: see upstream
  • Tests have passed
  • Updated license if changed and license_file is packaged

Information about this PR:

  1. Feel free to push to the bot's branch to update this PR if needed.
  2. The bot will almost always only open one PR per version.
  3. The bot will stop issuing PRs if more than 3 version bump PRs generated by the bot are open. If you don't want to package a particular version please close the PR.
  4. If you want these PRs to be merged automatically, make an issue with @conda-forge-admin,please add bot automerge in the title and merge the resulting PR. This command will add our bot automerge feature to your feedstock.
  5. If this PR was opened in error or needs to be updated please add the bot-rerun label to this PR. The bot will close this PR and schedule another one. If you do not have permissions to add this label, you can use the phrase @conda-forge-admin, please rerun bot in a PR comment to have the conda-forge-admin add it for you.

Pending Dependency Version Updates

Here is a list of all the pending dependency version updates for this repo. Please double check all dependencies before merging.

Name Upstream Version Current Version
bazel 7.0.1 Anaconda-Server Badge
opencensus 0.11.4-1.1.13 Anaconda-Server Badge
protobuf 25.2 Anaconda-Server Badge
ray-packages 2.9.1 Anaconda-Server Badge

Dependency Analysis

We couldn't run dependency analysis due to an internal error in the bot, depfinder, or grayskull. :/ Help is very welcome!

This PR was created by the regro-cf-autotick-bot. The regro-cf-autotick-bot is a service to automatically track the dependency graph, migrate packages, and propose package version updates for conda-forge. Feel free to drop us a line if there are any issues! This PR was generated by https://github.com/regro/cf-scripts/actions/runs/7579198654, please use this URL for debugging.

@conda-forge-webservices
Copy link
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

recipe/meta.yaml Outdated Show resolved Hide resolved
@mattip
Copy link
Contributor

mattip commented Jan 19, 2024

setup.py changed from 2.9.0 which requires updating the patch

$ git diff -r ray-2.9.0 python/setup.py
diff --git a/python/setup.py b/python/setup.py
index 6c35efcaf6..a34a39cb50 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -254,7 +254,7 @@ if setup_spec.type == SetupType.RAY:
             "pydantic!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,<3",
             "prometheus_client >= 0.7.1",
             "smart_open",
-            "virtualenv >=20.0.24, < 20.21.1",  # For pip runtime env.
+            "virtualenv >=20.0.24, !=20.21.1",  # For pip runtime env.
         ],
         "client": [
             # The Ray client needs a specific range of gRPC to work:

@mattip
Copy link
Contributor

mattip commented Jan 19, 2024

The new pinning means this should be merged only after conda-forge/conda-forge-repodata-patches-feedstock#638 is merged

@timkpaine
Copy link
Member

timkpaine commented Jan 19, 2024

The new pinning means this should be merged only after conda-forge/conda-forge-repodata-patches-feedstock#638 is merged

Doesn't have to really, they're independent of one another

@hmaarrfk
Copy link
Contributor

does ray link to the grpcio library at compilation time?

@mattip
Copy link
Contributor

mattip commented Jan 19, 2024

Yes. ray uses bazel to build everything from source including grpcio

@hmaarrfk
Copy link
Contributor

uses bazel to build everything from source including grpcio

if this is the case, then it should be linking statically to grpcio to avoid abi clashes like the one you are seeing.

Ideally you could reconfigure bazel to use the grpcio from conda-forge. <-- preferred.

If you use the grpcio from conda-forge you should include it in your host dependencies (which it doesn't seem like it is), and in that case, it would be pinned at runtime for the valid parameters.

https://github.com/conda-forge/tensorflow-feedstock/blob/main/recipe/meta.yaml#L207

See tensorflow which uses libgrpc which will then export the right pinnings.

https://github.com/conda-forge/grpc-cpp-feedstock/blob/main/recipe/meta.yaml#L45

Given that libgrpcio uses x.x pinnings, it seems scary to see two different versions of it in the log, but i didn't speed too much time investigating beyond this.

@timkpaine
Copy link
Member

timkpaine commented Jan 19, 2024

Ideally you could reconfigure bazel to use the grpcio from conda-forge. <-- preferred.

agreed, this is the best approach. unfortunately there's also some discussion on the long term future of grpc in ray, and this feedstock is not maintained by anyscale folks, so there's not a lot of appetite to make more changes (we already deal with some large patches)

@mattip
Copy link
Contributor

mattip commented Jan 19, 2024

We discussed using external libraries in the bazel build elsewhere. It is complicated to do in bazel version5 which ray upstream is still using. The tensorflow build has an elegant work-around that would be hard for ray to adopt. Perhaps once ray moves to bazel6 it would be easier.

@hmaarrfk
Copy link
Contributor

if you don't use the conda-forge libgrpc these issues will keep poping up.

The folks at the libgrpc feedstock do not consider it to be abi stable beyond patch version changes.

Therefore your dependency should be one of 1.56 1.57 1.58, 1.59 or 1.60 while you make sure it matches the built in one.

@timkpaine
Copy link
Member

can't really hard pin grpc runtime as it cripples ray's compatibility with the ecosystem (this is why ive been harping on getting stuff done on the upstream repo)

@apmorton
Copy link
Contributor

can't really hard pin grpc runtime as it cripples ray's compatibility with the ecosystem

This is effectively what unvendoring would do - the feedstock would use whatever the current global grpc pin is, and would need to be rebuilt whenever that changed.

In the meantime, we could possibly emulate the correct behavior without unvendoring by:

  • patching the grpc dependency in ray to be the current prevailing pin in conda-forge (1.59 in this case)
  • carrying grpcio as a host dependency in ray-core so the correct runtime pin gets applied

Thoughts?

@hmaarrfk
Copy link
Contributor

This is effectively what unvendoring would do - the feedstock would use whatever the current global grpc pin is, and would need to be rebuilt whenever that changed.

correct.

Reminder, rebuilding is automatically prompted by a bot.

@timkpaine
Copy link
Member

timkpaine commented Jan 19, 2024

It's 1.58 which is a problem. Without updating bazel, I would expect it to just ignore whatever is on the host during build time anyway. It's best to have buy-in from anyscale as anything done here is a workaround for upstream (which should ideally allow for use of dependencies from outside bazel, discussed in #90).

@apmorton
Copy link
Contributor

apmorton commented Jan 19, 2024

As far as I have been able to tell, there is nothing wrong with grpcio 1.58.x packages themselves.

The issue is that grpc is not ABI stable, ray's native components are being built with 1.57.1, and then the python components, through grpcio, load libgrpc $cond_forge_version. The fact that ANY version of grpc other than 1.57.x works with these ray packages is luck.

  • Unvendoring grpc is the correct solution, but that is non-trivial.
  • Pinning grpcio 1.57.x in ray-core is the correct workaround without changing anything upstream, but that negatively impacts compatibility with the rest of the conda-forge ecosystem.
  • Getting upstream to change to 1.59.x and pinning in ray-core would kick the can down the road.
  • Maintaining a patch to https://github.com/ray-project/ray/blob/master/bazel/ray_deps_setup.bzl#L234-L242 to track the conda-forge global grpc pin in this feedstock and pinning in ray-core is probably the most reliable path forward other than unvendoring grpc.

@timkpaine
Copy link
Member

Yep that list sounds correct, my preference continues to be upstream over anything we do here, otherwise it will just be more things breaking periodically over time

@apmorton
Copy link
Contributor

Yep that list sounds correct, my preference continues to be upstream over anything we do here, otherwise it will just be more things breaking periodically over time

This is package already breaks over time because of this issue, and I don't think waiting for a resolution upstream is in the best interest of the conda-forge ecosystem when we all now clearly understand the problem and have a viable workaround.

Having said that, I defer to @conda-forge/core on the correct course of action for this feedstock.

@timkpaine
Copy link
Member

sure, but its also cheap and easy to do (e.g. just repodata patch for known bad versions). Unless there's a volunteer to implement and maintain bazel patching in this repo in perpetuity...

@apmorton
Copy link
Contributor

sure, but its also cheap and easy to do (e.g. just repodata patch for known bad versions). Unless there's a volunteer to implement and maintain bazel patching in this repo in perpetuity...

I disagree. I filed #136 a week ago (after working on this on and off internally for several days) and we're still discussing the correct course of action. This is not cheap and easy.

I will take a stab at the grpc revendoring patch today and am happy to help maintain this going forward until grpcio can be unvendored upstream.

@timkpaine
Copy link
Member

timkpaine commented Jan 19, 2024

the solution for #136 is cheap and easy in conda-forge/conda-forge-repodata-patches-feedstock#638

we're still discussing the correct course of action

its basically all said in #90 (and for the other thread, using repodata-patches), just took a little time to re-litigate 😉

@timkpaine
Copy link
Member

#145 then #140 then this PR

@timkpaine
Copy link
Member

@mattip could you have one last look when you get a chance

recipe/meta.yaml Outdated Show resolved Hide resolved
@mattip
Copy link
Contributor

mattip commented Jan 23, 2024

LGTM. Anyone want to take a look?

@hmaarrfk
Copy link
Contributor

presently, this would allow grpcio 1.60 to be installed with the ray package when other packages have completed their migration.

I suggest a patch:

diff --git a/recipe/meta.yaml b/recipe/meta.yaml
index 2bf83b0..1fd4452 100644
--- a/recipe/meta.yaml
+++ b/recipe/meta.yaml
@@ -12,6 +12,9 @@ source:
     - patches/0002-Disable-making-entry-scripts.patch
     - patches/0003-Ignore-warnings-in-event.cc-and-logging.cc.patch
     - patches/0004-Remove-all-dependencies-from-setup.py.patch
+    # See https://github.com/conda-forge/ray-packages-feedstock/issues/136
+    # Keep in sync with current or active migration of libgrpc to avoid
+    {% set grpcio_version = "1.59" %}
     - patches/0006-Vendor-grpc-1.59.3.patch
     # This patch applies grpc tag v1.59.3 changes from
     # https://github.com/grpc/grpc/blob/35df344f5e17a9cb290ebf0f5b0f03ddb1ff0a97/bazel/grpc_deps.bzl#L243
@@ -161,7 +164,7 @@ outputs:
         - async-timeout
         - colorful
         - gpustat >=1.0.0
-        - grpcio
+        - grpcio {{ grpcio_version }}
         - opencensus
         - prometheus_client >=0.7.1
         - py-spy >=0.2.0
@@ -185,7 +188,7 @@ outputs:
       run:
         - python
         - {{ pin_subpackage('ray-core', exact=True) }}
-        - grpcio
+        - grpcio {{ grpcio_version }}
     test:
       imports:
         - ray

@mattip
Copy link
Contributor

mattip commented Jan 23, 2024

Can the {set...} line be in the middle of the patches section like that?

@h-vetinari
Copy link
Member

Can the {set...} line be in the middle of the patches section like that?

You can consider {% ... %} like a C-ish preprocessor for yaml. Completely separate phase, does dumb string operations (and some very limited variable gymnastics), and all of it is gone once the yaml file is handed to the actual build phase.

recipe/meta.yaml Show resolved Hide resolved
recipe/meta.yaml Outdated
@@ -162,7 +164,7 @@ outputs:
- async-timeout
- colorful
- gpustat >=1.0.0
- grpcio
- grpcio {{ grpcio_version }}
Copy link
Contributor

Choose a reason for hiding this comment

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

@hmaarrfk what is the point of these pins? All outputs depend on the identical version of ray-core, which now exports a runtime dependency on a compatible libgrpc. I don't think this extra grpcio_version thing is required.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah i see you are right. indeed these pins are not necessary. sorry for the noise.

Copy link
Member

Choose a reason for hiding this comment

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

Please revert

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

@mattip mattip merged commit 33169db into conda-forge:main Jan 24, 2024
14 checks passed
@mattip
Copy link
Contributor

mattip commented Jan 24, 2024

Thanks all for the constructive resolution of the grcpio versioning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants