Skip to content

pass route prefix to replica#53777

Merged
zcin merged 2 commits intoray-project:masterfrom
zcin:pass-route-prefix
Jun 13, 2025
Merged

pass route prefix to replica#53777
zcin merged 2 commits intoray-project:masterfrom
zcin:pass-route-prefix

Conversation

@zcin
Copy link
Copy Markdown
Contributor

@zcin zcin commented Jun 12, 2025

Why are these changes needed?

Pass route_prefix to replica.

Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Copilot AI review requested due to automatic review settings June 12, 2025 20:43
@zcin zcin requested a review from a team as a code owner June 12, 2025 20:43
@zcin zcin requested a review from abrarsheikh June 12, 2025 20:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for passing a route_prefix parameter through the replica initialization path.

  • Adds a route_prefix argument to Replica constructors and stores it.
  • Propagates route_prefix from 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_prefix as 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_prefix attribute 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_prefix is correctly propagated; consider adding unit tests for both Replica constructors to ensure self._route_prefix is 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 abrarsheikh added the go add ONLY when ready to merge, run all tests label Jun 13, 2025
@zcin zcin merged commit 2123541 into ray-project:master Jun 13, 2025
6 checks passed
@zcin zcin deleted the pass-route-prefix branch June 13, 2025 16:41
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>
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.

3 participants