Skip to content

[serve] Expose replica versions and applied config id in the details API - #67458

Merged
akyang-anyscale merged 6 commits into
ray-project:masterfrom
qishengxhe:qisheng/serve-rollout-version-details
Oct 30, 2026
Merged

akyang-anyscale merged 6 commits into
ray-project:masterfrom
qishengxhe:qisheng/serve-rollout-version-details

Conversation

@qishengxhe

@qishengxhe qishengxhe commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Problem. The Serve controller knows which version each replica runs and which version a deployment is converging to, but the REST details API does not expose either. External controllers that drive in-place updates can only watch deployment status, and that status flips to UPSCALING/DOWNSCALING with trigger AUTOSCALING as soon as the autoscaler acts mid-rollout, hiding an unfinished rolling update behind an application that reports RUNNING.

Solution. Expose what the controller already tracks: an optional version per replica and target_version per deployment, so a caller can tell a finished rollout from autoscaling churn. An optional config_id on ServeDeploySchema is stored with the config checkpoint and reported back as applied_config_id, so callers can attribute what they read to the config they submitted. All fields are optional; older checkpoints, older clients and configs without an id behave as before. No Serve decision path changes.

Testing

  • Unit: tests/unit/test_deployment_state.py, test_schema.py, test_controller.py (539 passed). New tests cover replica versions through a rolling update under autoscaling, a mid-reconfigure replica, a controller restart mid-rollout with a recovering replica, legacy four-field checkpoints, and the config id echo.
  • Integration: test_deploy_app_2.py::test_instance_details_echo_config_id_and_versions: the echo and replica versions survive a controller restart and clear for a config without an id.
  • End to end: an image built from this branch on top of anyscale/ray:nightly-py312 ran the Anyscale in-place-update suite on a premerge environment; the details API reported target_version, replica version and the echoed config id, and the control plane used them to hold an update open under continuous autoscaling.

Related issue number

N/A

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

…lied config id

A rolling update is complete once every live replica runs the deployment's
target version, which the controller already tracks per replica. Expose that
through the details API so callers can tell a finished rollout from
autoscaling churn: the deployment status alone flips to UPSCALING/AUTOSCALING
mid-rollout. An optional ServeDeploySchema.config_id is persisted with the
config checkpoint and reported back as applied_config_id.

Signed-off-by: qishengxhe <[email protected]>
…egacy checkpoints

A replica's reported version is the one being applied while UPDATING and the
deployment's target while RECOVERING, so a version match alone does not mean
the replica is current. Say so in the API descriptions, cover the mixed
recovery state in a unit test, and test reading checkpoints written before
config_id existed and clearing the echo for a config without one.

Signed-off-by: qishengxhe <[email protected]>
@qishengxhe
qishengxhe force-pushed the qisheng/serve-rollout-version-details branch from c7ed8df to 3b8cdde Compare October 27, 2026 02:14
@qishengxhe qishengxhe changed the title [serve] Report replica and target versions in the details API and echo an applied config id [serve] Expose replica versions and applied config id in the details API Oct 27, 2026
@qishengxhe qishengxhe added go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue labels Oct 27, 2026
A replica-count change keeps the version and the replicas; user_config
reconfigures the same replicas under a new version; actor options and an
application runtime_env change restart replicas under a new version.

Signed-off-by: qishengxhe <[email protected]>
@qishengxhe
qishengxhe marked this pull request as ready for review October 27, 2026 02:53
@qishengxhe
qishengxhe requested a review from a team as a code owner October 27, 2026 02:53
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@akyang-anyscale akyang-anyscale 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.

can we add an integration test that

  1. records target_version and the replica process IDs before killing the controller
  2. after the restart, wait until every replica is RUNNING, then assert that both are unchanged.

@qishengxhe

Copy link
Copy Markdown
Contributor Author

can we add an integration test that

  1. records target_version and the replica process IDs before killing the controller
  2. after the restart, wait until every replica is RUNNING, then assert that both are unchanged.

good idea, updated the test case to cover these

@akyang-anyscale
akyang-anyscale merged commit 1629bfb into ray-project:master Oct 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants