Skip to content

Commit

Permalink
[Serve] Documentation and typing fixes for `serve.run(..., route_pref…
Browse files Browse the repository at this point in the history
…ix=False)` (#44911)

In #44809 I thought that route_prefix didn't support being set to None to disable HTTP ingress because the type was str, and the docs didn't mention that this was supported (except indirectly in other places which I didn't know about until searching for them as part of this PR). It turns out this feature is already well-supported throughout the controller and proxy, it just wasn't fully documented in the public API, so this PR fixes that.

---------

Signed-off-by: Josh Karpel <[email protected]>
Co-authored-by: Edward Oakes <[email protected]>
  • Loading branch information
JoshKarpel and edoakes authored Apr 23, 2024
1 parent a76e649 commit e3a8614
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/ray/serve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def run(
target: Application,
blocking: bool = False,
name: str = SERVE_DEFAULT_APP_NAME,
route_prefix: str = DEFAULT.VALUE,
route_prefix: Optional[str] = DEFAULT.VALUE,
logging_config: Optional[Union[Dict, LoggingConfig]] = None,
) -> DeploymentHandle:
"""Run an application and return a handle to its ingress deployment.
Expand All @@ -565,9 +565,10 @@ def run(
will loop and log status until Ctrl-C'd.
name: Application name. If not provided, this will be the only
application running on the cluster (it will delete all others).
route_prefix: Route prefix for HTTP requests. If not provided, it will use
route_prefix of the ingress deployment. If specified neither as an argument
nor in the ingress deployment, the route prefix will default to '/'.
route_prefix: Route prefix for HTTP requests. Defaults to '/'.
If `None` is passed, the application will not be exposed over HTTP
(this may be useful if you only want the application to be exposed via
gRPC or a `DeploymentHandle`).
logging_config: Application logging config. If provided, the config will
be applied to all deployments which doesn't have logging config.
Expand Down

0 comments on commit e3a8614

Please sign in to comment.