Skip to content

[serve] add max_replicas_per_node to /api/serve/applications response#63234

Merged
abrarsheikh merged 1 commit into
ray-project:masterfrom
akyang-anyscale:alexyang/schema-max-per-node
May 8, 2026
Merged

[serve] add max_replicas_per_node to /api/serve/applications response#63234
abrarsheikh merged 1 commit into
ray-project:masterfrom
akyang-anyscale:alexyang/schema-max-per-node

Conversation

@akyang-anyscale
Copy link
Copy Markdown
Contributor

@akyang-anyscale akyang-anyscale commented May 8, 2026

when constructing the DeploymentSchema from the DeploymentInfo, we were excluding some fields including max_replicas_per_node which may be helpful for debugging. this PR adds that field in.

@akyang-anyscale akyang-anyscale requested a review from a team as a code owner May 8, 2026 19:54
@akyang-anyscale akyang-anyscale added the go add ONLY when ready to merge, run all tests label May 8, 2026
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 implements the propagation of the max_replicas_per_node field from ReplicaConfig to DeploymentSchema in the _deployment_info_to_schema function, supported by new unit tests. Feedback was provided regarding the handling of None values; the current implementation omits the field when it is None, but if the API needs to explicitly return null to indicate no limit, the type hint should be updated to Optional[int] and the assignment should be made unconditional.

Comment on lines +689 to +690
if info.replica_config.max_replicas_per_node is not None:
schema.max_replicas_per_node = info.replica_config.max_replicas_per_node
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.

medium

The max_replicas_per_node field in DeploymentSchema is defined as an int (line 433), but its description states that None is a valid value for the default (no limit). If info.replica_config.max_replicas_per_node is None, this implementation skips setting the field, leaving it as DEFAULT.VALUE. While this correctly omits the field from the API response when unset, it also means the API can never explicitly return null for this field. If the intention is to allow an explicit null in the response to indicate "no limit", the type hint in DeploymentSchema should be updated to Optional[int] and this assignment should be made unconditional.

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
@akyang-anyscale akyang-anyscale force-pushed the alexyang/schema-max-per-node branch from d0f9f8b to df15b79 Compare May 8, 2026 20:03
@abrarsheikh
Copy link
Copy Markdown
Contributor

please add some description to this PR. What architectural defect resulted in this situation seems a bit odd that the context of /api/serve/applications is driven by ReplicaConfig.

@akyang-anyscale
Copy link
Copy Markdown
Contributor Author

please add some description to this PR. What architectural defect resulted in this situation seems a bit odd that the context of /api/serve/applications is driven by ReplicaConfig.

not sure if it's an architectural defect rather than some fields are just omitted today. ray_actor_options is also derived from ReplicaConfig

@abrarsheikh abrarsheikh merged commit bde05a9 into ray-project:master May 8, 2026
6 checks passed
chillCode404 pushed a commit to chillCode404/ray-contrib that referenced this pull request May 9, 2026
…ray-project#63234)

when constructing the `DeploymentSchema` from the `DeploymentInfo`, we
were excluding some fields including `max_replicas_per_node` which may
be helpful for debugging. this PR adds that field in.

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
dancingactor pushed a commit to dancingactor/ray that referenced this pull request May 13, 2026
…ray-project#63234)

when constructing the `DeploymentSchema` from the `DeploymentInfo`, we
were excluding some fields including `max_replicas_per_node` which may
be helpful for debugging. this PR adds that field in.

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
am-kinetica pushed a commit to kineticadb/ray that referenced this pull request May 14, 2026
…ray-project#63234)

when constructing the `DeploymentSchema` from the `DeploymentInfo`, we
were excluding some fields including `max_replicas_per_node` which may
be helpful for debugging. this PR adds that field in.

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
Signed-off-by: anindyam1969 <amukherjee@kinetica.com>
Lucas61000 pushed a commit to Lucas61000/ray that referenced this pull request May 15, 2026
…ray-project#63234)

when constructing the `DeploymentSchema` from the `DeploymentInfo`, we
were excluding some fields including `max_replicas_per_node` which may
be helpful for debugging. this PR adds that field in.

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants