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

[Serve] Good error message when Serve not installed and ensure Serve installs ray[default] #19570

Merged
merged 3 commits into from
Oct 21, 2021

Conversation

simon-mo
Copy link
Contributor

@simon-mo simon-mo commented Oct 21, 2021

Why are these changes needed?

Related issue number

Closes #19262
Closes #19303

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 :(

@@ -201,6 +201,8 @@
python/ray/tests/test_basic_3
- bazel test --test_output=streamed --config=ci --test_env=RAY_MINIMAL=1 $(./scripts/bazel_export_options)
python/ray/tests/test_runtime_env_ray_minimal
- bazel test --test_output=streamed --config=ci --test_env=RAY_MINIMAL=1 $(./scripts/bazel_export_options)
python/ray/tests/test_serve_ray_minimal
# TODO(archit)
Copy link
Contributor

Choose a reason for hiding this comment

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

My fault, forgot to remove this... I can remove this in my next PR, or feel free to remove it in this PR

from ray.serve.batching import batch
from ray.serve.config import HTTPOptions
except ModuleNotFoundError as e:
e.msg += (". You can run `pip install ray[serve]` to install all Ray Serve"
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
e.msg += (". You can run `pip install ray[serve]` to install all Ray Serve"
e.msg += (". You can run `pip install 'ray[serve]'` to install all Ray Serve"

To make it work with zsh which is the default shell on newer Macs

os.environ.get("RAY_MINIMAL") != "1",
reason="This test is only run in CI with a minimal Ray installation.")
def test_errr_msg():
with pytest.raises(ModuleNotFoundError, match="install ray\[serve\]"):
Copy link
Contributor

@architkulkarni architkulkarni Oct 21, 2021

Choose a reason for hiding this comment

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

Suggested change
with pytest.raises(ModuleNotFoundError, match="install ray\[serve\]"):
with pytest.raises(ModuleNotFoundError, match="install 'ray\[serve\]'"):

python/setup.py Outdated
@@ -211,6 +211,9 @@ def get_packages(self):
],
}

# Ray Serve depends on the Ray dashboard components.
setup_spec.extras["serve"] += setup_spec.extras["default"]
Copy link
Contributor

@architkulkarni architkulkarni Oct 21, 2021

Choose a reason for hiding this comment

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

Nice! I assume nothing bad should happen if the same dependency appears twice in the list? (e.g. if it appears both in the original "serve" list and also in the "default" list)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah there will be problems, fixed it

@pytest.mark.skipif(
os.environ.get("RAY_MINIMAL") != "1",
reason="This test is only run in CI with a minimal Ray installation.")
def test_errr_msg():
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
def test_errr_msg():
def test_error_msg():

@edoakes edoakes added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Oct 21, 2021
@simon-mo simon-mo merged commit 03805d4 into ray-project:master Oct 21, 2021
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
3 participants