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

patch ray-default and ray-client to avoid 2.9.0 + grcpio1.58 #638

Closed
wants to merge 2 commits into from

Conversation

mattip
Copy link

@mattip mattip commented Jan 18, 2024

Checklist

  • Used a static YAML file for the patch if possible (instructions).
  • Only wrote code directly into generate_patch_json.py if absolutely necessary.
  • Ran pre-commit run -a and ensured all files pass the linting checks.
  • Ran python show_diff.py and posted the output as part of the PR.
  • Modifications won't affect packages built in the future.

This is my first PR to this repo. What I want to do is prevent the use of grpcio 1.58 with ray version2.9.0 and greater. Fixes conda-forge/ray-packages-feedstock#136 and conda-forge/grpc-cpp-feedstock#343.

I am not sure why show_diff repeats osx64 twice. Note that ray 2.9.0 is not yet supported on win64, that will be done once I fix conda-forge/ray-packages-feedstock#137.

$ python recipe/show_diff.py --use-cache
================================================================================
================================================================================
linux-armv7l
================================================================================
================================================================================
win-32
================================================================================
================================================================================
osx-arm64
osx-arm64::ray-client-2.9.0-py39hdf13c20_0.conda
osx-arm64::ray-client-2.9.0-py311ha1ab1f8_0.conda
osx-arm64::ray-client-2.9.0-py38h150bfb4_0.conda
osx-arm64::ray-client-2.9.0-py310hb6292c7_0.conda
-    "grpcio !=1.56.0",
+    "grpcio !=1.58,!=1.56.0",
osx-arm64::ray-default-2.9.0-py311hd6b026f_0.conda
osx-arm64::ray-default-2.9.0-py310h28793f1_0.conda
osx-arm64::ray-default-2.9.0-py311hf131290_0.conda
osx-arm64::ray-default-2.9.0-py39hbdb43d7_0.conda
osx-arm64::ray-default-2.9.0-py39h32b681b_0.conda
osx-arm64::ray-default-2.9.0-py310h0ffa552_0.conda
osx-arm64::ray-default-2.9.0-py38h406562f_0.conda
osx-arm64::ray-default-2.9.0-py38h93c57f1_0.conda
-    "grpcio",
+    "grpcio !=1.58",
================================================================================
================================================================================
linux-ppc64le
================================================================================
================================================================================
linux-aarch64
================================================================================
================================================================================
noarch
noarch::aiohttp-jinja2-1.6-pyhd8ed1ab_0.conda
-    "aiohttp >=3.9.0",
+    "aiohttp >=3.6.3",
================================================================================
================================================================================
win-64
================================================================================
================================================================================
osx-64
osx-64::ray-client-2.9.0-py38h50d1736_0.conda
osx-64::ray-client-2.9.0-py310h2ec42d9_0.conda
osx-64::ray-client-2.9.0-py39h6e9494a_0.conda
osx-64::ray-client-2.9.0-py311h6eed73b_0.conda
-    "grpcio !=1.56.0",
+    "grpcio !=1.58,!=1.56.0",
osx-64::ray-default-2.9.0-py310h5e29caf_0.conda
osx-64::ray-default-2.9.0-py310h3d77ae6_0.conda
osx-64::ray-default-2.9.0-py311h9c189b4_0.conda
osx-64::ray-default-2.9.0-py311hf91cc31_0.conda
osx-64::ray-default-2.9.0-py39h98b42ae_0.conda
osx-64::ray-default-2.9.0-py38h6282081_0.conda
osx-64::ray-default-2.9.0-py39h464767f_0.conda
osx-64::ray-default-2.9.0-py38h18fd85d_0.conda
-    "grpcio",
+    "grpcio !=1.58",
================================================================================
================================================================================
linux-64
linux-64::ray-default-2.9.0-py38h53c94ba_0.conda
linux-64::ray-default-2.9.0-py39h7a4ae58_0.conda
linux-64::ray-client-2.9.0-py39hf3d152e_0.conda
linux-64::ray-client-2.9.0-py38h578d9bd_0.conda
linux-64::ray-default-2.9.0-py310ha1e06c9_0.conda
linux-64::ray-default-2.9.0-py311hbd2507d_0.conda
linux-64::ray-default-2.9.0-py39h9a2ef2b_0.conda
linux-64::ray-client-2.9.0-py311h38be061_0.conda
linux-64::ray-default-2.9.0-py311h48098de_0.conda
linux-64::ray-default-2.9.0-py310h8d86c01_0.conda
linux-64::ray-default-2.9.0-py38h73d8af5_0.conda
linux-64::ray-client-2.9.0-py310hff52083_0.conda
-    "grpcio",
+    "grpcio !=1.58",

@mattip mattip requested a review from a team as a code owner January 18, 2024 13:21
@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.

Signed-off-by: mattip <matti.picus@gmail.com>
@timkpaine
Copy link
Member

@mattip in my testing, 1.58 was broken against basically all. So I would do when ray <= 2.9 so folks on all previous versions are guarded

@apmorton
Copy link
Contributor

For the record, as I stated in a comment on the original issue which @timkpaine deleted, there is no point patching this metadata until the ray feedstock itself is updated to prevent solving with grpcio 1.58.

If you do not do this, we will be right back here again in a broken state as soon as the next PR is merged to the ray feedstock.

@timkpaine
Copy link
Member

timkpaine commented Jan 18, 2024

@apmorton that's not true, actually the opposite. Changing it in the feedstock on the existing version does nothing at all as the solver can skip the patched build and choose the unpatched release. So this change has to happen if anything is to be done about existing versions.

@apmorton
Copy link
Contributor

@apmorton that's not true, actually the opposite. Changing it in the feedstock on the existing version does nothing at all as the solver can skip build 1 and choose build 0. So this change has to happen if anything is to be done about existing versions.

I fully understand this - but you cannot patch existing builds and leave the feedstock unchanged.

If you do not apply this grpcio pin in the ray-packages feedstock the next build of ray will incorrectly be able to solve against grpcio 1.58

@timkpaine
Copy link
Member

timkpaine commented Jan 18, 2024

no reason to patch, just wait for the next release. it happens relatively frequently, I expect a 2.9.1 shortly anyway. Certainly no reason to wait for that to do this PR, this PR should be done now to fix the current state.

@apmorton
Copy link
Contributor

And in the next build of the ray feedstock you will pin grpcio to prevent this from being reintroduced? That is certainly not the impression I get based on your replies in the original issue.

@timkpaine
Copy link
Member

@apmorton of course, but there are also some conversations over on the original ray project RE grpc compatibility/performance/long term path, and we should make sure to not just pin this and forget as it will likely crop up again.

@mattip
Copy link
Author

mattip commented Jan 18, 2024

Hmm. I guess I misunderstood how the version_gt works then: I thought it would apply to future versions as well. So could I just remove the version line entirely?

There is this comment in the PR template about future package resolutions:

Modifications won't affect packages built in the future. Make sure to add a condition and record.get("timestamp", 0) < NOW so your changes only affect packages built in the past. Replace NOW with python -c "import time; print(f'{time.time():.0f}000')"

So if I don't add that condition will the patch apply to future packages?

Edit: uncomment the html comment in the quote

@timkpaine
Copy link
Member

timkpaine commented Jan 18, 2024

@mattip future versions can have the pin added (e.g. the next ray release, assuming we're confident this is a one-off grpc problem), but modifying an existing release to have more restrictive pinning and incrementing a build doesn't really do anything. So in this repo, you can override resolution of those past releases to force a new version resolution. Here you'd say "ray less than or equal to 2.9.0, make sure grpc != 1.58" and the solver will respect that as if the pin had been in place in those prior releases.

@apmorton
Copy link
Contributor

You are supposed to check that box to indicate your patch WON'T impact future builds - which is generally accomplished by adding a timestamp_lt with the current unix timestamp.

@mattip
Copy link
Author

mattip commented Jan 18, 2024

OK, I inverted the condition. Now the result of

`$ python ./recipe/show_diff.py
================================================================================
================================================================================
linux-armv7l
================================================================================
================================================================================
win-32
================================================================================
================================================================================
osx-arm64
osx-arm64::ray-client-2.9.0-py310hb6292c7_0.conda
osx-arm64::ray-client-2.9.0-py311ha1ab1f8_0.conda
osx-arm64::ray-client-2.9.0-py39hdf13c20_0.conda
osx-arm64::ray-client-2.9.0-py38h150bfb4_0.conda
-    "grpcio !=1.56.0",
+    "grpcio !=1.58,!=1.56.0",
osx-arm64::ray-default-2.9.0-py39hbdb43d7_0.conda
osx-arm64::ray-default-2.9.0-py310h0ffa552_0.conda
osx-arm64::ray-default-2.9.0-py311hf131290_0.conda
osx-arm64::ray-default-2.9.0-py38h93c57f1_0.conda
osx-arm64::ray-default-2.9.0-py39h32b681b_0.conda
osx-arm64::ray-default-2.9.0-py311hd6b026f_0.conda
osx-arm64::ray-default-2.9.0-py38h406562f_0.conda
osx-arm64::ray-default-2.9.0-py310h28793f1_0.conda
-    "grpcio",
+    "grpcio !=1.58",
================================================================================
================================================================================
linux-ppc64le
================================================================================
================================================================================
linux-aarch64
================================================================================
================================================================================
noarch
noarch::aiohttp-jinja2-1.6-pyhd8ed1ab_0.conda
-    "aiohttp >=3.9.0",
+    "aiohttp >=3.6.3",
================================================================================
================================================================================
win-64
win-64::ray-client-2.8.1-py39hcbf5309_1.conda
win-64::ray-client-2.8.0-py39hcbf5309_0.conda
win-64::ray-client-2.8.1-py310h5588dad_0.conda
win-64::ray-client-2.6.3-py310h5588dad_1.conda
win-64::ray-client-2.8.1-py311h1ea47a8_1.conda
win-64::ray-client-2.7.1-py38haa244fe_1.conda
win-64::ray-client-2.7.0-py39hcbf5309_0.conda
win-64::ray-client-2.8.0-py310h5588dad_2.conda
win-64::ray-client-2.8.1-py310h5588dad_1.conda
win-64::ray-client-2.7.1-py310h5588dad_0.conda
win-64::ray-client-2.8.1-py311h1ea47a8_0.conda
win-64::ray-client-2.6.3-py38haa244fe_1.conda
win-64::ray-client-2.7.1-py38haa244fe_0.conda
win-64::ray-client-2.8.0-py38haa244fe_2.conda
win-64::ray-client-2.7.1-py39hcbf5309_0.conda
win-64::ray-client-2.8.0-py39hcbf5309_1.conda
win-64::ray-client-2.6.1-py38haa244fe_0.conda
win-64::ray-client-2.8.0-py311h1ea47a8_2.conda
win-64::ray-client-2.6.3-py310h5588dad_0.conda
win-64::ray-client-2.7.1-py311h1ea47a8_0.conda
win-64::ray-client-2.8.1-py38haa244fe_1.conda
win-64::ray-client-2.6.1-py310h5588dad_0.conda
win-64::ray-client-2.8.0-py311h1ea47a8_0.conda
win-64::ray-client-2.8.0-py311h1ea47a8_1.conda
win-64::ray-client-2.7.0-py38haa244fe_0.conda
win-64::ray-client-2.6.1-py39hcbf5309_0.conda
win-64::ray-client-2.7.1-py311h1ea47a8_1.conda
win-64::ray-client-2.8.0-py38haa244fe_0.conda
win-64::ray-client-2.6.2-py39hcbf5309_0.conda
win-64::ray-client-2.8.0-py39hcbf5309_2.conda
win-64::ray-client-2.7.1-py39hcbf5309_1.conda
win-64::ray-client-2.6.3-py38haa244fe_0.conda
win-64::ray-client-2.8.0-py310h5588dad_1.conda
win-64::ray-client-2.6.3-py39hcbf5309_0.conda
win-64::ray-client-2.7.0-py310h5588dad_0.conda
win-64::ray-client-2.7.1-py310h5588dad_1.conda
win-64::ray-client-2.6.2-py310h5588dad_0.conda
win-64::ray-client-2.6.3-py39hcbf5309_1.conda
win-64::ray-client-2.8.0-py310h5588dad_0.conda
win-64::ray-client-2.8.0-py38haa244fe_1.conda
win-64::ray-client-2.8.1-py39hcbf5309_0.conda
win-64::ray-client-2.8.1-py38haa244fe_0.conda
win-64::ray-client-2.6.2-py38haa244fe_0.conda
-    "grpcio",
+    "grpcio !=1.58",
================================================================================
================================================================================
osx-64
osx-64::ray-client-2.8.0-py311h6eed73b_0.conda
osx-64::ray-client-2.8.0-py311h6eed73b_2.conda
osx-64::ray-client-2.7.1-py39h6e9494a_1.conda
osx-64::ray-client-2.8.1-py39h6e9494a_0.conda
osx-64::ray-client-2.7.1-py311h6eed73b_1.conda
osx-64::ray-client-2.8.0-py39h6e9494a_0.conda
osx-64::ray-client-2.8.0-py39h6e9494a_1.conda
osx-64::ray-client-2.9.0-py310h2ec42d9_0.conda
osx-64::ray-client-2.8.0-py38h50d1736_0.conda
osx-64::ray-client-2.8.1-py311h6eed73b_1.conda
osx-64::ray-client-2.8.0-py311h6eed73b_1.conda
osx-64::ray-client-2.7.1-py310h2ec42d9_1.conda
osx-64::ray-client-2.8.0-py39h6e9494a_2.conda
osx-64::ray-client-2.8.0-py310h2ec42d9_2.conda
osx-64::ray-client-2.9.0-py39h6e9494a_0.conda
osx-64::ray-client-2.7.1-py38h50d1736_1.conda
osx-64::ray-client-2.8.1-py38h50d1736_0.conda
osx-64::ray-client-2.9.0-py38h50d1736_0.conda
osx-64::ray-client-2.8.0-py310h2ec42d9_0.conda
osx-64::ray-client-2.8.1-py39h6e9494a_1.conda
osx-64::ray-client-2.8.1-py311h6eed73b_0.conda
osx-64::ray-client-2.8.0-py38h50d1736_2.conda
osx-64::ray-client-2.8.1-py310h2ec42d9_0.conda
osx-64::ray-client-2.8.1-py38h50d1736_1.conda
osx-64::ray-client-2.8.0-py38h50d1736_1.conda
osx-64::ray-client-2.8.1-py310h2ec42d9_1.conda
osx-64::ray-client-2.9.0-py311h6eed73b_0.conda
osx-64::ray-client-2.8.0-py310h2ec42d9_1.conda
-    "grpcio !=1.56.0",
+    "grpcio !=1.58,!=1.56.0",
osx-64::ray-default-2.9.0-py38h18fd85d_0.conda
osx-64::ray-default-2.9.0-py310h3d77ae6_0.conda
osx-64::ray-default-2.9.0-py310h5e29caf_0.conda
osx-64::ray-default-2.9.0-py311hf91cc31_0.conda
osx-64::ray-default-2.9.0-py38h6282081_0.conda
osx-64::ray-default-2.9.0-py39h98b42ae_0.conda
osx-64::ray-default-2.9.0-py311h9c189b4_0.conda
osx-64::ray-default-2.9.0-py39h464767f_0.conda
-    "grpcio",
+    "grpcio !=1.58",
================================================================================
================================================================================
linux-64
linux-64::ray-default-2.9.0-py310h8d86c01_0.conda
linux-64::ray-default-2.9.0-py39h9a2ef2b_0.conda
linux-64::ray-default-2.9.0-py311h48098de_0.conda
linux-64::ray-client-2.8.1-py38h578d9bd_1.conda
linux-64::ray-default-2.9.0-py311hbd2507d_0.conda
linux-64::ray-client-2.8.0-py38h578d9bd_0.conda
linux-64::ray-client-2.6.3-py38h578d9bd_1.conda
linux-64::ray-client-2.6.3-py39hf3d152e_1.conda
linux-64::ray-client-2.8.1-py310hff52083_1.conda
linux-64::ray-client-2.8.0-py39hf3d152e_1.conda
linux-64::ray-client-2.6.3-py310hff52083_0.conda
linux-64::ray-client-2.9.0-py310hff52083_0.conda
linux-64::ray-client-2.7.1-py38h578d9bd_0.conda
linux-64::ray-default-2.9.0-py38h53c94ba_0.conda
linux-64::ray-client-2.8.0-py311h38be061_2.conda
linux-64::ray-client-2.7.1-py311h38be061_1.conda
linux-64::ray-client-2.7.1-py311h38be061_0.conda
linux-64::ray-client-2.8.0-py38h578d9bd_2.conda
linux-64::ray-client-2.8.0-py39hf3d152e_0.conda
linux-64::ray-client-2.7.1-py38h578d9bd_1.conda
linux-64::ray-client-2.7.1-py39hf3d152e_0.conda
linux-64::ray-client-2.7.1-py39hf3d152e_1.conda
linux-64::ray-client-2.8.0-py311h38be061_1.conda
linux-64::ray-client-2.8.1-py311h38be061_1.conda
linux-64::ray-client-2.8.1-py39hf3d152e_0.conda
linux-64::ray-client-2.9.0-py39hf3d152e_0.conda
linux-64::ray-client-2.8.0-py310hff52083_1.conda
linux-64::ray-client-2.9.0-py38h578d9bd_0.conda
linux-64::ray-default-2.9.0-py38h73d8af5_0.conda
linux-64::ray-client-2.7.0-py39hf3d152e_0.conda
linux-64::ray-default-2.9.0-py39h7a4ae58_0.conda
linux-64::ray-client-2.6.1-py39hf3d152e_0.conda
linux-64::ray-client-2.6.1-py38h578d9bd_0.conda
linux-64::ray-default-2.9.0-py310ha1e06c9_0.conda
linux-64::ray-client-2.6.2-py39hf3d152e_0.conda
linux-64::ray-client-2.7.1-py310hff52083_1.conda
linux-64::ray-client-2.8.0-py311h38be061_0.conda
linux-64::ray-client-2.7.1-py310hff52083_0.conda
linux-64::ray-client-2.6.2-py38h578d9bd_0.conda
linux-64::ray-client-2.8.1-py38h578d9bd_0.conda
linux-64::ray-client-2.8.1-py39hf3d152e_1.conda
linux-64::ray-client-2.7.0-py310hff52083_0.conda
linux-64::ray-client-2.6.3-py39hf3d152e_0.conda
linux-64::ray-client-2.6.3-py310hff52083_1.conda
linux-64::ray-client-2.6.3-py38h578d9bd_0.conda
linux-64::ray-client-2.8.1-py310hff52083_0.conda
linux-64::ray-client-2.8.1-py311h38be061_0.conda
linux-64::ray-client-2.8.0-py310hff52083_0.conda
linux-64::ray-client-2.8.0-py39hf3d152e_2.conda
linux-64::ray-client-2.6.2-py310hff52083_0.conda
linux-64::ray-client-2.8.0-py310hff52083_2.conda
linux-64::ray-client-2.6.1-py310hff52083_0.conda
linux-64::ray-client-2.9.0-py311h38be061_0.conda
linux-64::ray-client-2.7.0-py38h578d9bd_0.conda
-    "grpcio",
+    "grpcio !=1.58",

</details.

@apmorton
Copy link
Contributor

apmorton commented Jan 19, 2024

I think !=1.58 still allows 1.58.1 and 1.58.2 to be installed because != is an exact match.

I don't know if there is a better way, but !=1.58.1, !=1.58.2 should work (as those are the two 1.58` releases published to conda-forge right now).

EDIT: the better way is grpcio !=1.58.*, as @timkpaine used in conda-forge/ray-packages-feedstock#139

@hmaarrfk
Copy link
Contributor

I would merge a patch that pins exactly to 1.57. But something that allows new versions of grpcio to be installed would cause the problem to reappear in the future.

then:
- replace_depends:
old: grpcio
new: grpcio !=1.58
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
new: grpcio !=1.58
new: grpcio =1.57

Copy link
Contributor

Choose a reason for hiding this comment

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

I’ve seen and participated in the above discussion by asking relevant questions in the feedstock PR.

You asked why this is taking too long to merge in. Making patches that just have to be patched again later is not a sustainable strategy.

I personally don’t have enough knowledge of the details of grpcio to guarantee that 1.57 will work with 1.60 for example. If you want to allow 1.57 and 1.59 I might consider it. But following the grpcio pinnings, it doesn’t seem safe to leave the upper bound of grpcio unbound.

If an other core member agrees with your strategy and disagrees with mine they are entirely free to merge this. I am just applying conda-forge best practices to help review this request and get your package running.

please don’t outright dismiss the real concerns I raised in the feedstock PR.

Copy link
Member

@timkpaine timkpaine Jan 19, 2024

Choose a reason for hiding this comment

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

not "outright dismissing", please review all of the background linked previously for context that you might've missed with a quick screen. Hard pinning to a specific version will immediately break a lot of people who are otherwise fine. And thats certainly not great from a best practices or community standpoint! But feel free to not merge if you're not comfortable with the changes, there are other folks in core.

Copy link
Member

@timkpaine timkpaine Jan 19, 2024

Choose a reason for hiding this comment

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

You asked why this is taking too long to merge in.

I did not, not sure where you got that from...I am a maintainer trying to get the right outcome with the smallest blast radius

get your package running

Not my package of course, I am just a volunteer....

Copy link
Contributor

Choose a reason for hiding this comment

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

I think a pin to both 1.57 and 1.59 might be acceptable. However. I haven’t tested.

Copy link
Member

@timkpaine timkpaine Jan 20, 2024

Choose a reason for hiding this comment

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

@apmorton has already shown 1.56 works as well. so the conservative approach is to disable known non-working versions, which I think is least disruptive. disabling all except for 1 (or 2) known-working version seems to be overly disruptive.

Copy link
Contributor

Choose a reason for hiding this comment

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

so long as some upper bound on the version exists.

@timkpaine
Copy link
Member

timkpaine commented Jan 19, 2024

see other thread, I would not hard pin for now as we want to maintain as broad compatibility as we can, even at the introduction of some flakiness (which may need to be resolved with additional repodata patches when discovered).

@mattip
Copy link
Author

mattip commented Jan 25, 2024

I see three choices:

  • close this PR, anyone using older versions should update to 2.9 with the libgrpc migration pin to 1.59
  • use a repodata patch to pin older versions to use 1.57, even if they were compiled with an earlier version
  • something else.

Personally, closing this PR and not dealing with older versions makes the most sense to me. Thoughts?

@anyscalesam
Copy link

@timkpaine thoughts on @mattip's comment above?

@timkpaine
Copy link
Member

I don't like the idea of leaving older versions broken, but at the same time I don't want to be overly broad in potentially breaking older environments that don't notice a defect. I like @mattip's current changes without the suggested changes (e.g. mark known bad instead of forcing known good).

@isuruf

@apmorton
Copy link
Contributor

I think the most correct thing to do at this point is update all previous versions of ray to add != 1.58.* to whatever the existing pin is for that version - we know 1.58 is broken, but we don't really know what does work for every past version, and actually testing that for all previous releases is incredibly time consuming.

(the current version of this patch won't do anything since it says !=1.58, which does not prevent 1.58.1 or 1.58.2 from being solved)

I will draft a new patch.

@apmorton apmorton mentioned this pull request Jan 29, 2024
5 tasks
@timkpaine
Copy link
Member

this can be closed in favor of #645 (@mattip)

@mattip mattip closed this Jan 30, 2024
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.

Compatibility issues with grpcio on conda-forge
5 participants