Repository navigation
[serve][ci] Upgrade uvicorn and follow ASGI protocol for root_path - #66446
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates several Python dependencies, including upgrading uvicorn to 0.53.0 and watchfiles to 1.3.0, as well as adding lerobot and removing obsolete packages like aim and dm-control. A critical issue was identified where the Python 3.12 lockfiles (ray_test_py312_cpu.lock and ray_test_py312_cu130.lock) incorrectly reference the Python 3.13 compiled requirements constraint file, which could lead to package incompatibility. These lockfiles need to be regenerated using the correct Python 3.12 constraints.
b83361e to
8519b0e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8519b0e. Configure here.
72f2f6b to
f1eb418
Compare
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
f1eb418 to
5182cd4
Compare
|
Notes for reviewers: 5182cd4 is new after Elliot's approval for changes only related to dependencies. This commit adapts Ray Serve's behavior to respect the ASGI protocol. |
uvicorn and watchfiles dependenciesuvicorn and follow ASGI protocol for root_path
uvicorn and follow ASGI protocol for root_pathuvicorn and follow ASGI protocol for root_path
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
|
485a7a7: With |
Why can't ray serve support any
|
|
Premerge https://buildkite.com/ray-project/premerge/builds/73946/canvas passed on an earlier commit: 43867f5. The latest premerge https://buildkite.com/ray-project/premerge/builds/74061/canvas has also mostly passed, except for a couple of LLM GPU tests that already passed on the earlier commit. There are no LLM-related changes since then, so it should be safe to merge rather than wait for those tests to acquire GPU resources and rerun. |
## Description As title. - **Prerequisite**: Depends on #66446. - **DeepGEMM packaging**: The vLLM 0.30.0 wheel now bundles DeepGEMM at `vllm.third_party.deep_gemm`, pinned to vLLM's fork (vllm-project/vllm#56876). This change, however, can't be tested alongside CI because DeepGEMM requires IB setup. CI will [fail](https://buildkite.com/ray-project/premerge/builds/73952/table?jid=01a0daa5-650f-492e-a98e-2cff57c63c4b&tab=output) without [removing DeepGEMM](https://github.com/ray-project/ray/pull/66384/changes#diff-9a06c622586d761628d2e83c393109b8885f94d700a04383a68f3981ac6878f2L107). - **Quantization test changes**: vLLM 0.30.0 dropped support for GPTQ checkpoints with `desc_act=True` (vllm-project/vllm#54809). The old `neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16` checkpoint uses it, so every replica failed at engine config time, and therefore the service never became healthy. `RedHatAI/Qwen3.5-9B-quantized.w4a16` is a similar-size replacement: 4-bit with static activation ordering, and it fits on A10G. PD configs set `VLLM_SSM_CONV_STATE_LAYOUT=DS`, which NIXL requires for hybrid models. ## Related issues > Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234". ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. --------- Signed-off-by: Jeffrey Wang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Resolve deplock conflicts from #66446 (uvicorn 0.53.0 / watchfiles 1.3.0): keep the retired Windows torch27 locks deleted and regenerate all locks with raydepsets. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
ray-project#66446) ## Description Ray images pin `uvicorn` 0.22, which doesn't follow the ASGI spec for `root_path`, so `http_options.root_path` behaves differently depending on the installed uvicorn (ray-project#55776), and it breaks direct ingress and HAProxy. This PR upgrades uvicorn to 0.53 (with a `>=0.26` floor) and makes every ingress mode follow ASGI. Transitively, we also raise `watchfiles` to `>=0.20` as required by newer `uvicorn` installs. ### How each ingress mode handles `root_path` Example: `root_path="/serve"` and `route_prefix="/hello"`. A proxy in front of Serve strips `/serve`, so Serve receives `/hello/items/1`. In every mode, the app should see: ``` path = /serve/hello/items/1 root_path = /serve/hello ``` - **HTTP proxy:** uvicorn adds `/serve` to the path. The proxy matches `/hello` after `root_path`, then sets `root_path=/serve/hello`. This was already correct with uvicorn 0.26+. - **Direct ingress:** the replica's uvicorn adds `/serve`. The replica now matches `/hello` after `root_path` and sets `root_path=/serve/hello`. - **Problem**: Prior to this PR, it matched against the full path, so every request got a 404. - **HAProxy:** forwards `/hello/items/1` unchanged to a replica, which then works like direct ingress. - **Problem**: Prior to this PR, it also stripped `/serve` whenever the path started with it, which removed the prefix a second time. ### `/-/healthz` and `/-/routes` These are Serve's own endpoints, not part of ASGI. - `/-/healthz` reports whether the ingress is ready. KubeRay probes, load balancers and HAProxy's replica checks call it. - `/-/routes` returns the route table, like `{"/hello": "default"}`. Serve must match them **after** removing `root_path`. Direct ingress didn't, so `/-/healthz` returned 404. HAProxy then marked every replica down, and traffic silently fell back to the proxy actor. ## Breaking changes Requests that still include the prefix, like `/serve/hello` or `/serve/-/healthz`, now return 404. Users must strip the prefix at their ingress or unset `root_path`. ### Impact on KubeRay: None kuberay-project/kuberay#4494 happened because Serve only answered health checks at `<root_path>/-/healthz`. That was true on uvicorn 0.22 images, and again after ray-project#57555, which forced the 0.22 behavior onto uvicorn 0.41. KubeRay's worker readiness probe and head-pod check always call `/-/healthz` on port 8000, so the pods never became ready. This PR doesn't cause the same issue. Following ASGI, Serve now expects requests without `root_path`, so `/-/healthz` returns 200 when `root_path` is set, in all three modes. [test_http_root_path](https://github.com/ray-project/ray/pull/66446/changes#diff-2351bd6cf47275a74cc504b065e417ee6c550affc762df3d90e2e7f2ecb277f2R311) checks exactly this. Therefore, KubeRay needs no changes. ## Related issues Closes ray-project#55776. Supersedes ray-project#66443. ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. --------- Signed-off-by: Jeffrey Wang <[email protected]>
## Description As title. - **Prerequisite**: Depends on ray-project#66446. - **DeepGEMM packaging**: The vLLM 0.30.0 wheel now bundles DeepGEMM at `vllm.third_party.deep_gemm`, pinned to vLLM's fork (vllm-project/vllm#56876). This change, however, can't be tested alongside CI because DeepGEMM requires IB setup. CI will [fail](https://buildkite.com/ray-project/premerge/builds/73952/table?jid=01a0daa5-650f-492e-a98e-2cff57c63c4b&tab=output) without [removing DeepGEMM](https://github.com/ray-project/ray/pull/66384/changes#diff-9a06c622586d761628d2e83c393109b8885f94d700a04383a68f3981ac6878f2L107). - **Quantization test changes**: vLLM 0.30.0 dropped support for GPTQ checkpoints with `desc_act=True` (vllm-project/vllm#54809). The old `neuralmagic/Meta-Llama-3.1-8B-Instruct-quantized.w4a16` checkpoint uses it, so every replica failed at engine config time, and therefore the service never became healthy. `RedHatAI/Qwen3.5-9B-quantized.w4a16` is a similar-size replacement: 4-bit with static activation ordering, and it fits on A10G. PD configs set `VLLM_SSM_CONV_STATE_LAYOUT=DS`, which NIXL requires for hybrid models. ## Related issues > Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to ray-project#1234". ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. --------- Signed-off-by: Jeffrey Wang <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>

Description
Ray images pin
uvicorn0.22, which doesn't follow the ASGI spec forroot_path, sohttp_options.root_pathbehaves differently depending on the installed uvicorn (#55776), and it breaks direct ingress and HAProxy. This PR upgrades uvicorn to 0.53 (with a>=0.26floor) and makes every ingress mode follow ASGI. Transitively, we also raisewatchfilesto>=0.20as required by neweruvicorninstalls.How each ingress mode handles
root_pathExample:
root_path="/serve"androute_prefix="/hello". A proxy in front of Serve strips/serve, so Serve receives/hello/items/1. In every mode, the app should see:/serveto the path. The proxy matches/helloafterroot_path, then setsroot_path=/serve/hello. This was already correct with uvicorn 0.26+./serve. The replica now matches/helloafterroot_pathand setsroot_path=/serve/hello./hello/items/1unchanged to a replica, which then works like direct ingress./servewhenever the path started with it, which removed the prefix a second time./-/healthzand/-/routesThese are Serve's own endpoints, not part of ASGI.
/-/healthzreports whether the ingress is ready. KubeRay probes, load balancers and HAProxy's replica checks call it./-/routesreturns the route table, like{"/hello": "default"}.Serve must match them after removing
root_path. Direct ingress didn't, so/-/healthzreturned 404. HAProxy then marked every replica down, and traffic silently fell back to the proxy actor.Breaking changes
Requests that still include the prefix, like
/serve/helloor/serve/-/healthz, now return 404. Users must strip the prefix at their ingress or unsetroot_path.Impact on KubeRay: None
kuberay-project/kuberay#4494 happened because Serve only answered health checks at
<root_path>/-/healthz. That was true on uvicorn 0.22 images, and again after #57555, which forced the 0.22 behavior onto uvicorn 0.41. KubeRay's worker readiness probe and head-pod check always call/-/healthzon port 8000, so the pods never became ready.This PR doesn't cause the same issue. Following ASGI, Serve now expects requests without
root_path, so/-/healthzreturns 200 whenroot_pathis set, in all three modes. test_http_root_path checks exactly this. Therefore, KubeRay needs no changes.Related issues
Closes #55776. Supersedes #66443.
Additional information