Skip to content

[Doc] Update Serve replica scheduling docs for label_selector and fal…#60922

Merged
abrarsheikh merged 10 commits intoray-project:masterfrom
ryanaoleary:serve-doc-update-labels
Feb 17, 2026
Merged

[Doc] Update Serve replica scheduling docs for label_selector and fal…#60922
abrarsheikh merged 10 commits intoray-project:masterfrom
ryanaoleary:serve-doc-update-labels

Conversation

@ryanaoleary
Copy link
Copy Markdown
Contributor

Description

This PR adds documentation for the changes added in #57694, specifically the label_selector, fallback_strategy, and placement_group_bundle_label_selector added to the Serve API.

Related issues

#51564

Additional information

…lback_strategy API

Signed-off-by: ryanaoleary <ryanaoleary@google.com>
@ryanaoleary ryanaoleary requested a review from a team as a code owner February 10, 2026 11:14
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 updates the replica scheduling documentation to incorporate new features: label_selector, fallback_strategy, and placement_group_bundle_label_selector. The changes are well-structured and clearly explain the new functionalities with corresponding code examples. I've identified a minor typo and suggested including a missing code example to enhance the documentation's clarity.

ryanaoleary and others added 3 commits February 10, 2026 04:27
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
@ray-gardener ray-gardener bot added the community-contribution Contributed by the community label Feb 10, 2026

# __custom_resources_main_start__
# __label_selector_main_start__
if __name__ == "__main__":
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.

Similarly, let's make other examples runnable at doc test time. That will ensure examples dont drift with changing APIs

Copy link
Copy Markdown
Contributor Author

@ryanaoleary ryanaoleary Feb 13, 2026

Choose a reason for hiding this comment

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

Done in 5942593 and dd88395, I added resources to the RayCluster and similar serve.run calls

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.

wonder what the behavior is with label selector?

Copy link
Copy Markdown
Contributor Author

@ryanaoleary ryanaoleary Feb 13, 2026

Choose a reason for hiding this comment

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

It filters by label selector first and then does the bin-packing, added this description in:
e65d60b

@abrarsheikh abrarsheikh added the serve Ray Serve Related Issue label Feb 12, 2026
Signed-off-by: ryanaoleary <ryanaoleary@google.com>
Signed-off-by: ryanaoleary <ryanaoleary@google.com>
Signed-off-by: ryanaoleary <ryanaoleary@google.com>
@abrarsheikh abrarsheikh added the go add ONLY when ready to merge, run all tests label Feb 13, 2026
@abrarsheikh
Copy link
Copy Markdown
Contributor

@ryanaoleary please fix the doc test


[2026-02-13T18:17:32Z] ==================== Test output for //doc:source/serve/doc_code/replica_scheduling:
--
[2026-02-13T18:17:32Z] Traceback (most recent call last):
[2026-02-13T18:17:32Z]   File "/root/.cache/bazel/_bazel_root/1df605deb6d24fc8068f6e25793ec703/execroot/io_ray/bazel-out/k8-opt/bin/doc/source/serve/doc_code/replica_scheduling.runfiles/io_ray/doc/source/serve/doc_code/replica_scheduling.py", line 40, in <module>
[2026-02-13T18:17:32Z]     def PlacementGroupBundleLabelSelector(request):
[2026-02-13T18:17:32Z]   File "/rayci/python/ray/serve/api.py", line 487, in decorator
[2026-02-13T18:17:32Z]     replica_config = ReplicaConfig.create(
[2026-02-13T18:17:32Z]   File "/rayci/python/ray/serve/_private/config.py", line 630, in create
[2026-02-13T18:17:32Z]     config = cls(
[2026-02-13T18:17:32Z]   File "/rayci/python/ray/serve/_private/config.py", line 518, in __init__
[2026-02-13T18:17:32Z]     self._validate()
[2026-02-13T18:17:32Z]   File "/rayci/python/ray/serve/_private/config.py", line 543, in _validate
[2026-02-13T18:17:32Z]     self._validate_placement_group_options()
[2026-02-13T18:17:32Z]   File "/rayci/python/ray/serve/_private/config.py", line 762, in _validate_placement_group_options
[2026-02-13T18:17:32Z]     raise ValueError(
[2026-02-13T18:17:32Z] ValueError: When using `placement_group_bundles`, the replica actor will be placed in the first bundle, so the resource requirements for the actor must be a subset of the first bundle. `num_cpus` for the actor is 1, but the bundle only has 0 `CPU` specified.
[2026-02-13T18:17:32Z] ================================================================================


Signed-off-by: ryanaoleary <ryanaoleary@google.com>
@ryanaoleary
Copy link
Copy Markdown
Contributor Author

Should be fixed with b7d26b9, ran it successfully with: python doc/source/serve/doc_code/replica_scheduling.py

ryanaoleary and others added 2 commits February 13, 2026 16:33
Signed-off-by: ryanaoleary <ryanaoleary@google.com>
@abrarsheikh abrarsheikh merged commit 10176c4 into ray-project:master Feb 17, 2026
6 checks passed
ans9868 pushed a commit to ans9868/ray that referenced this pull request Feb 18, 2026
ray-project#60922)

## Description
This PR adds documentation for the changes added in
ray-project#57694, specifically the
`label_selector`, `fallback_strategy`, and
`placement_group_bundle_label_selector` added to the Serve API.

## Related issues
ray-project#51564

## Additional information

---------

Signed-off-by: ryanaoleary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Adel Nour <ans9868@nyu.edu>
Aydin-ab pushed a commit to kunling-anyscale/ray that referenced this pull request Feb 20, 2026
ray-project#60922)

## Description
This PR adds documentation for the changes added in
ray-project#57694, specifically the
`label_selector`, `fallback_strategy`, and
`placement_group_bundle_label_selector` added to the Serve API.

## Related issues
ray-project#51564

## Additional information

---------

Signed-off-by: ryanaoleary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
peterxcli pushed a commit to peterxcli/ray that referenced this pull request Feb 25, 2026
ray-project#60922)

## Description
This PR adds documentation for the changes added in
ray-project#57694, specifically the
`label_selector`, `fallback_strategy`, and
`placement_group_bundle_label_selector` added to the Serve API.

## Related issues
ray-project#51564

## Additional information

---------

Signed-off-by: ryanaoleary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
peterxcli pushed a commit to peterxcli/ray that referenced this pull request Feb 25, 2026
ray-project#60922)

## Description
This PR adds documentation for the changes added in
ray-project#57694, specifically the
`label_selector`, `fallback_strategy`, and
`placement_group_bundle_label_selector` added to the Serve API.

## Related issues
ray-project#51564

## Additional information

---------

Signed-off-by: ryanaoleary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
preneond pushed a commit to preneond/ray that referenced this pull request Mar 23, 2026
ray-project#60922)

## Description
This PR adds documentation for the changes added in
ray-project#57694, specifically the
`label_selector`, `fallback_strategy`, and
`placement_group_bundle_label_selector` added to the Serve API.

## Related issues
ray-project#51564

## Additional information

---------

Signed-off-by: ryanaoleary <ryanaoleary@google.com>
Signed-off-by: Ryan O'Leary <113500783+ryanaoleary@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community 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