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] Enable serve status when proxies disabled #42286

Merged

Conversation

shrekris-anyscale
Copy link
Contributor

Why are these changes needed?

Serve proxies can be disabled by setting serve.start(..., proxy_location=ProxyLocation.Disabled). However, serve status currently fails when proxies are disabled.

This change fixes the issue and lets serve status succeed even when proxy_location==ProxyLocation.Disabled.

Related issue number

Closes #41723.

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • 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 added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • 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
      • This change adds a unit test to test_config.py.

Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
@shrekris-anyscale shrekris-anyscale requested review from edoakes and a team January 10, 2024 00:35
Comment on lines +153 to +166
def _to_deployment_mode(
cls, proxy_location: Union["ProxyLocation", str]
) -> DeploymentMode:
if isinstance(proxy_location, str):
proxy_location = ProxyLocation(proxy_location)
elif not isinstance(proxy_location, ProxyLocation):
raise TypeError(
f"Must be a `ProxyLocation` or str, got: {type(proxy_location)}."
)

if proxy_location == ProxyLocation.Disabled:
return DeploymentMode.NoServer
elif v == ProxyLocation.HeadOnly:
return DeploymentMode.HeadOnly
elif v == ProxyLocation.EveryNode:
return DeploymentMode.EveryNode
else:
raise ValueError(f"Unrecognized `ProxyLocation`: {v}.")
return DeploymentMode(proxy_location.value)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should not change behavior. I refactored this for simplicity's sake.

Copy link
Contributor

@GeneDer GeneDer left a comment

Choose a reason for hiding this comment

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

Small non-blocking suggestions, but overall LGTM! Thanks for fixing the issue Shreyas!

python/ray/serve/_private/controller.py Outdated Show resolved Hide resolved
python/ray/serve/tests/unit/test_config.py Show resolved Hide resolved
python/ray/serve/_private/controller.py Outdated Show resolved Hide resolved
Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
@edoakes edoakes merged commit 65478d4 into ray-project:master Jan 10, 2024
9 checks passed
vickytsang pushed a commit to ROCm/ray that referenced this pull request Jan 12, 2024
Serve proxies can be disabled by setting serve.start(..., proxy_location=ProxyLocation.Disabled). However, serve status currently fails when proxies are disabled.

This change fixes the issue and lets serve status succeed even when proxy_location==ProxyLocation.Disabled.

---------

Signed-off-by: Shreyas Krishnaswamy <shrekris@anyscale.com>
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.

[Serve] serve status breaks when disabling http proxy
4 participants