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

Add hiredis dependency on supported platforms #20437

Merged
merged 5 commits into from
Nov 17, 2021

Conversation

wuisawesome
Copy link
Contributor

@wuisawesome wuisawesome commented Nov 16, 2021

Why are these changes needed?

This PR adds the hiredis dependency for non M1 machines.

This removes the redis < 4.0 pin.

Since hiredis doesn't have M1 mac wheels yet, so users there will have extra warning messages in their outputs if they use redis 4.0.

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

python/setup.py Outdated
@@ -267,6 +268,11 @@ def get_packages(self):
"redis >= 3.5.0, < 4.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you need to remove this?

@@ -267,6 +268,11 @@ def get_packages(self):
"redis >= 3.5.0, < 4.0.0",
]

if platform.system() == "Darwin" and platform.machine() == "arm64":
setup_spec.install_requires.append("redis >= 3.5.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Add comment as to why?

Copy link
Contributor

@ericl ericl left a comment

Choose a reason for hiding this comment

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

LGTM, let's wait for tests.

@ericl ericl added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Nov 16, 2021
@pcmoritz
Copy link
Contributor

Windows failure! Can you fix @wuisawesome

+ cd /d/a/ray/ray/python/../python
+ /d/a/ray/ray/python/../ci/keep_alive pip install -v -e .
Obtaining file:///D:/a/ray/ray/python
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: 'c:\hostedtoolcache\windows\python\3.6.8\x64\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'D:\\a\\ray\\ray\\python\\setup.py'"'"'; __file__='"'"'D:\\a\\ray\\ray\\python\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\RUNNER~1\AppData\Local\Temp\pip-pip-egg-info-su7manth'
       cwd: D:\a\ray\ray\python\
  Complete output (1 lines):
  error in ray setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid requirement, parse error at "', redis '"
  ----------------------------------------
WARNING: Discarding file:///D:/a/ray/ray/python. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

@wuisawesome
Copy link
Contributor Author

Tune workflow and dashboard errors all look unrelated. merging.

cc @zhe-thoughts @iycheng we need to cherry-pick this one

@wuisawesome wuisawesome merged commit d1c6249 into ray-project:master Nov 17, 2021
@zhe-thoughts
Copy link
Collaborator

@wuisawesome @ericl @pcmoritz Verifying: this PR fixes #20416, is that right? (It's not linked to the issue)

@wuisawesome
Copy link
Contributor Author

Actually @ericl, Waleed, and I talked an I think we may not want to cherry-pick this one (though we still want it in master).

@pcmoritz
Copy link
Contributor

@wuisawesome and @ericl can you say what the rationale is?

@wuisawesome
Copy link
Contributor Author

The release branch currently has redis < 4.0 on all platforms.

The main drawback is that in the future, if people won't be able to use ray 1.9 with redis 4.0. We’ll probably be able to support it by 1.10 though.

The main drawback of cherry picking this PR is that there's some additional risk in adding a new dependency and major version upgrade this late in the release cycle. Note that this is somewhat mitigated by the fact that we use hiredis as the primary redis client in the ray core already, and redis 3.9 already did feature detection and used hiredis (and chances are you already have hiredis installed and have been using it, even though release testing didn’t).

@pcmoritz
Copy link
Contributor

pcmoritz commented Nov 18, 2021

Thanks for the summary!

I think we should try hard to be as compatible as possible with external packages, it is very reasonable to assume that somebody wants to use their own redis client in a Ray application or mix Ray with other packages that might have their own requirements on the redis client and therefore we should strive to support as many versions for that as possible. Given that we have pretty exhaustive tests for the codepaths involving redis in the CI and the release tests and they are passing with redis-py 4 on most platforms, supporting redis-py 4 on these platforms should be low risk and if that is the case we should support it.

I'd love to hear other opinions on this if somebody disagrees :)

Ideally of course we can also be compatible with redis-py 4 on Windows and M1 Macs, hopefully we can still make that happen together with upstream, but we certainly shouldn't be blocked on it.

@zhe-thoughts
Copy link
Collaborator

And just linking that the redis < 4.0 setting was introduced in #20430

@wuisawesome
Copy link
Contributor Author

Looks like we're pretty close to re-simplifying all these PRs. redis/redis-py#1726 has been approved, so once it makes its way into a pypi release, we can just go back to the redis >= 3.5.0 rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants