Skip to content

Removed deprecated DeploymentMode#63510

Open
johntaylor-cell wants to merge 1 commit into
ray-project:masterfrom
johntaylor-cell:RemoveDeploymentMode
Open

Removed deprecated DeploymentMode#63510
johntaylor-cell wants to merge 1 commit into
ray-project:masterfrom
johntaylor-cell:RemoveDeploymentMode

Conversation

@johntaylor-cell
Copy link
Copy Markdown

Removed the deprecated DeploymentMode enum from the Ray tree at ~/ray and migrated Serve to ProxyLocation throughout.

Core changes (python/ray/serve/config.py)

  • Deleted the DeploymentMode class and its _to_deployment_mode / _from_deployment_mode helpers on ProxyLocation.
  • Added ProxyLocation._normalize() to accept ProxyLocation values and legacy "NoServer" strings (mapped to Disabled).
  • Changed HTTPOptions.location from DeploymentMode to ProxyLocation (default HeadOnly; host=None / location=NoneDisabled).

Internal call sites

  • _private/proxy_state.py, _private/controller.py, _private/config.py — use ProxyLocation directly.
  • scripts.py — deprecated --http-location still accepts NoServer/HeadOnly/EveryNode but normalizes via _normalize; serve run passes proxy_location.value directly.
  • dashboard/modules/serve/serve_head.py — same.
  • _private/api.py — docstring updated.

Tests & release

  • Updated test_config.py, test_proxy_state.py, test_standalone.py, and release/serve_tests/workloads/serve_test_cluster_utils.py.
  • Replaced conversion tests with test_proxy_location_normalize.

Backward compatibility

Legacy "NoServer" in HTTPOptions.location or --http-location is still accepted and normalized to ProxyLocation.Disabled.

Azure autoscaler DeploymentMode (unrelated Azure SDK enum) was left unchanged.

@johntaylor-cell johntaylor-cell requested a review from a team as a code owner May 19, 2026 16:43
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the deprecated DeploymentMode enum and replaces its usage with ProxyLocation throughout the Ray Serve codebase, including internal logic, docstrings, and tests. Key changes include the addition of a normalization method in ProxyLocation to handle legacy 'NoServer' values and the update of HTTPOptions to use the new enum. Feedback suggests updating the CLI's deprecated --http-location flag to include 'Disabled' in its choices for better consistency with the new naming convention.

Comment thread python/ray/serve/scripts.py
@click.option(
"--http-location",
default=DeploymentMode.HeadOnly,
default="HeadOnly",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
default="HeadOnly",
default=ProxyLocation.HeadOnly,

Comment thread python/ray/serve/scripts.py
Comment on lines 766 to +773
- location: [DEPRECATED: use `proxy_location` field instead] The deployment
location of HTTP servers:

- "HeadOnly": start one HTTP server on the head node. Serve
assumes the head node is the node you executed serve.start
on. This is the default.
- "EveryNode": start one HTTP server per node.
- "NoServer": disable HTTP server.
- "Disabled" (or legacy "NoServer"): disable HTTP server.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i guess this is the next one we should drop.

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.

2 participants