Skip to content

Removed deprecated DeploymentMode#63510

Merged
abrarsheikh merged 3 commits into
ray-project:masterfrom
johntaylor-cell:RemoveDeploymentMode
May 19, 2026
Merged

Removed deprecated DeploymentMode#63510
abrarsheikh merged 3 commits into
ray-project:masterfrom
johntaylor-cell:RemoveDeploymentMode

Conversation

@johntaylor-cell

Copy link
Copy Markdown
Contributor

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

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

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.

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 Outdated
Comment thread python/ray/serve/scripts.py Outdated
Comment thread python/ray/serve/scripts.py Outdated
Comment thread python/ray/serve/config.py Outdated
Signed-off-by: john.taylor <john.taylor@anyscale.com>
@abrarsheikh abrarsheikh added the go add ONLY when ready to merge, run all tests label May 19, 2026
Signed-off-by: john.taylor <john.taylor@anyscale.com>
@ray-gardener ray-gardener Bot added serve Ray Serve Related Issue docs An issue or change related to documentation labels May 19, 2026
@abrarsheikh

Copy link
Copy Markdown
Contributor

nice

@abrarsheikh abrarsheikh merged commit cff1f4b into ray-project:master May 19, 2026
6 checks passed
TruongQuangPhat pushed a commit to cyhapun/ray-fix-issue that referenced this pull request May 27, 2026
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=None` →
`Disabled`).

### 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.

---------

Signed-off-by: john.taylor <john.taylor@anyscale.com>
Signed-off-by: phattruong <23120318@student.hcmus.edu.vn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

2 participants