pass route prefix to replica#53777
Merged
zcin merged 2 commits intoray-project:masterfrom Jun 13, 2025
Merged
Conversation
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for passing a route_prefix parameter through the replica initialization path.
- Adds a
route_prefixargument toReplicaconstructors and stores it. - Propagates
route_prefixfrom deployment state when scheduling replicas. - (Unintentionally) introduces a debug print in the schema module.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/ray/serve/schema.py | Stray debug print added (print("HERE")) |
| python/ray/serve/_private/replica.py | Added route_prefix parameter to constructors and stored on self |
| python/ray/serve/_private/deployment_state.py | Passed deployment_info.route_prefix to replica start call |
Comments suppressed due to low confidence (3)
python/ray/serve/_private/replica.py:339
- Adding
route_prefixas a required positional argument is a breaking change. Consider giving it a default value (e.g.,route_prefix: str = None) or making it keyword-only to preserve backward compatibility.
route_prefix: str,
python/ray/serve/_private/replica.py:346
- The new
route_prefixattribute should be documented in the constructor docstring so its purpose and expected format are clear to maintainers.
self._route_prefix = route_prefix
python/ray/serve/_private/replica.py:339
- [nitpick] There are no existing tests verifying that
route_prefixis correctly propagated; consider adding unit tests for bothReplicaconstructors to ensureself._route_prefixis set and used as expected.
route_prefix: str,
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
abrarsheikh
approved these changes
Jun 13, 2025
elliot-barn
pushed a commit
that referenced
this pull request
Jun 18, 2025
## Why are these changes needed? Pass route_prefix to replica. --------- Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
elliot-barn
pushed a commit
that referenced
this pull request
Jul 2, 2025
## Why are these changes needed? Pass route_prefix to replica. --------- Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Pass route_prefix to replica.