Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[serve] Remove ability to specify route_prefix at deployment level #48223

Merged
merged 37 commits into from
Oct 26, 2024

Conversation

edoakes
Copy link
Contributor

@edoakes edoakes commented Oct 23, 2024

Why are these changes needed?

Removes the ability to specify route_prefix at the deployment level (which has been deprecated for a number of releases).

Also rips out some vestigial code which was unused:

  • Deployment._deploy
  • log_deployment_update_status
  • get_deployment

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Oct 23, 2024
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes marked this pull request as ready for review October 25, 2024 14:02
@edoakes edoakes changed the title [WIP][serve] Remove route_prefix at deployment level [serve] Remove ability to specify route_prefix at deployment level Oct 25, 2024
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes requested review from zcin and GeneDer October 25, 2024 15:49
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Copy link
Contributor

@zcin zcin left a comment

Choose a reason for hiding this comment

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

nice!

@@ -479,7 +419,6 @@ def options(
new_deployment_config,
new_replica_config,
version=version,
Copy link
Contributor

Choose a reason for hiding this comment

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

should we remove version too, or does that require more code changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should, but I'd rather do it in a separate PR at least

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this already got bigger than I wanted 😓

schema = ServeApplicationSchema(
name=name,
route_prefix=ingress.route_prefix,
route_prefix="/",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
route_prefix="/",
route_prefix=f"/{name}",

I think this will need to be a distinct generated route prefix for each application because the pydantic model will fail to parse if every route prefix is "/".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh you're right. don't we default it to /{name} somewhere else already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I changed it to do /{name} if there are multiple apps, else just /

Copy link
Contributor

Choose a reason for hiding this comment

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

nice lgtm

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes self-assigned this Oct 25, 2024
@edoakes edoakes requested a review from zcin October 25, 2024 20:44
Copy link
Contributor

@GeneDer GeneDer left a comment

Choose a reason for hiding this comment

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

LGTM! Kinda feel this is something Alex would have picked up for onboarding XP

python/ray/serve/_private/client.py Show resolved Hide resolved
python/ray/serve/deployment.py Show resolved Hide resolved
python/ray/serve/tests/test_http_routes.py Outdated Show resolved Hide resolved


@PublicAPI(stability="stable")
def run(
target: Application,
blocking: bool = False,
name: str = SERVE_DEFAULT_APP_NAME,
route_prefix: Optional[str] = DEFAULT.VALUE,
route_prefix: Optional[str] = "/",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason why route_prefix had to default to DEFAULT.VALUE instead of "/" before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None means "no route prefix" and previously we wanted to pick up the route_prefix of the ingress deployment if nothing was specified here to override

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes merged commit 90e6e72 into ray-project:master Oct 26, 2024
5 checks passed
can-anyscale added a commit that referenced this pull request Oct 28, 2024
…t level" (#48292)

Reverts #48223

Broke #48289 so revert to
unblock the release.
edoakes added a commit that referenced this pull request Oct 29, 2024
Stacked on: #48223

Reimplements the `.bind()` codepath to avoid using the Ray DAG codepath
which adds a lot of complexity for little benefit.

The DAG traversal code is much simpler, around 100 lines of
self-contained code in `build_app.py`. I've also added unit tests for
it.

There should be no behavior change here.

---------

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Jay-ju pushed a commit to Jay-ju/ray that referenced this pull request Nov 5, 2024
…ay-project#48223)

Removes the ability to specify `route_prefix` at the deployment level
(which has been deprecated for a number of releases).

Also rips out some vestigial code which was unused:

- `Deployment._deploy`
- `log_deployment_update_status`
- `get_deployment`

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Jay-ju pushed a commit to Jay-ju/ray that referenced this pull request Nov 5, 2024
Jay-ju pushed a commit to Jay-ju/ray that referenced this pull request Nov 5, 2024
Stacked on: ray-project#48223

Reimplements the `.bind()` codepath to avoid using the Ray DAG codepath
which adds a lot of complexity for little benefit.

The DAG traversal code is much simpler, around 100 lines of
self-contained code in `build_app.py`. I've also added unit tests for
it.

There should be no behavior change here.

---------

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
JP-sDEV pushed a commit to JP-sDEV/ray that referenced this pull request Nov 14, 2024
…ay-project#48223)

Removes the ability to specify `route_prefix` at the deployment level
(which has been deprecated for a number of releases).

Also rips out some vestigial code which was unused:

- `Deployment._deploy`
- `log_deployment_update_status`
- `get_deployment`

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
JP-sDEV pushed a commit to JP-sDEV/ray that referenced this pull request Nov 14, 2024
…t level" (ray-project#48292)

Reverts ray-project#48223

Broke ray-project#48289 so revert to
unblock the release.
Signed-off-by: JP-sDEV <jon.pablo80@gmail.com>
JP-sDEV pushed a commit to JP-sDEV/ray that referenced this pull request Nov 14, 2024
Stacked on: ray-project#48223

Reimplements the `.bind()` codepath to avoid using the Ray DAG codepath
which adds a lot of complexity for little benefit.

The DAG traversal code is much simpler, around 100 lines of
self-contained code in `build_app.py`. I've also added unit tests for
it.

There should be no behavior change here.

---------

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
mohitjain2504 pushed a commit to mohitjain2504/ray that referenced this pull request Nov 15, 2024
…ay-project#48223)

Removes the ability to specify `route_prefix` at the deployment level
(which has been deprecated for a number of releases).

Also rips out some vestigial code which was unused:

- `Deployment._deploy`
- `log_deployment_update_status`
- `get_deployment`

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
mohitjain2504 pushed a commit to mohitjain2504/ray that referenced this pull request Nov 15, 2024
…t level" (ray-project#48292)

Reverts ray-project#48223

Broke ray-project#48289 so revert to
unblock the release.

Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
mohitjain2504 pushed a commit to mohitjain2504/ray that referenced this pull request Nov 15, 2024
Stacked on: ray-project#48223

Reimplements the `.bind()` codepath to avoid using the Ray DAG codepath
which adds a lot of complexity for little benefit.

The DAG traversal code is much simpler, around 100 lines of
self-contained code in `build_app.py`. I've also added unit tests for
it.

There should be no behavior change here.

---------

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Signed-off-by: mohitjain2504 <mohit.jain@dream11.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