[3/n] [Serve] expose deployment topology in serve instance details#58355
[3/n] [Serve] expose deployment topology in serve instance details#58355abrarsheikh merged 15 commits intomasterfrom
Conversation
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
fetch outbound deployments from all replicas at initialization. Next PR -> #58355 --------- Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
There was a problem hiding this comment.
Bug: Ingress Conflict: Silent Overwrite, Lacks Validation.
When multiple deployments have ingress=True, the code silently overwrites self._ingress_deployment_name with each one in iteration order, causing the last deployment to become the ingress. This is non-deterministic and lacks validation, unlike the similar case for multiple route prefixes which raises a RayServeException. The test change on line 230 makes this more likely by marking all deployments with a route_prefix as ingress.
python/ray/serve/_private/application_state.py#L386-L389
ray/python/ray/serve/_private/application_state.py
Lines 386 to 389 in 0e03017
Bug: Missing name corrupts Deployment ID.
The docs_path property creates a DeploymentID with self._ingress_deployment_name as the name without checking if it's None. When no ingress deployment exists, this passes None to DeploymentID(name=None, ...), which violates the type contract since DeploymentID.name expects a str. This will cause errors when trying to look up the deployment or use the ID.
python/ray/serve/_private/application_state.py#L279-L288
ray/python/ray/serve/_private/application_state.py
Lines 279 to 288 in 0e03017
|
@cursoragent its currently implicit in the code that there will always be exactly one ingress. So i odnt think we need special handling for this. |
|
Unable to authenticate your request. Please make sure to connect your GitHub account to Cursor. Go to Cursor |
…oject#58350) fetch outbound deployments from all replicas at initialization. Next PR -> ray-project#58355 --------- Signed-off-by: abrar <abrar@anyscale.com>
Signed-off-by: abrar <abrar@anyscale.com>
…oject#58350) fetch outbound deployments from all replicas at initialization. Next PR -> ray-project#58355 --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: Aydin Abiar <aydin@anyscale.com>
…ay-project#58355) ### Summary This PR exposes deployment topology information in Ray Serve instance details, allowing users to visualize and understand the dependency graph of deployments within their applications. ### What's Changed #### New Data Structures Added two new schema classes to represent deployment topology: - **`DeploymentNode`** - Represents a node in the deployment DAG - **`DeploymentTopology`** - Represents the full dependency graph #### Implementation **Controller Integration** - Updated `ServeController` to include `deployment_topology` in `ApplicationDetails` when serving instance details - Topology is now accessible via the `get_serve_details()` API --- **Example Output:** ```python { "app_name": "my_app", "ingress_deployment": "Ingress", "nodes": { "Ingress": { "name": "Ingress", "is_ingress": True, "outbound_deployments": [ {"name": "ServiceA", "app_name": "my_app"} ] }, "ServiceA": { "name": "ServiceA", "is_ingress": False, "outbound_deployments": [ {"name": "Database", "app_name": "my_app"} ] }, "Database": { "name": "Database", "is_ingress": False, "outbound_deployments": [] } } } ``` --------- Signed-off-by: abrar <abrar@anyscale.com> Co-authored-by: Lonnie Liu <95255098+aslonnie@users.noreply.github.com>
…oject#58350) fetch outbound deployments from all replicas at initialization. Next PR -> ray-project#58355 --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: YK <1811651+ykdojo@users.noreply.github.com>
…ay-project#58355) ### Summary This PR exposes deployment topology information in Ray Serve instance details, allowing users to visualize and understand the dependency graph of deployments within their applications. ### What's Changed #### New Data Structures Added two new schema classes to represent deployment topology: - **`DeploymentNode`** - Represents a node in the deployment DAG - **`DeploymentTopology`** - Represents the full dependency graph #### Implementation **Controller Integration** - Updated `ServeController` to include `deployment_topology` in `ApplicationDetails` when serving instance details - Topology is now accessible via the `get_serve_details()` API --- **Example Output:** ```python { "app_name": "my_app", "ingress_deployment": "Ingress", "nodes": { "Ingress": { "name": "Ingress", "is_ingress": True, "outbound_deployments": [ {"name": "ServiceA", "app_name": "my_app"} ] }, "ServiceA": { "name": "ServiceA", "is_ingress": False, "outbound_deployments": [ {"name": "Database", "app_name": "my_app"} ] }, "Database": { "name": "Database", "is_ingress": False, "outbound_deployments": [] } } } ``` --------- Signed-off-by: abrar <abrar@anyscale.com> Co-authored-by: Lonnie Liu <95255098+aslonnie@users.noreply.github.com> Signed-off-by: YK <1811651+ykdojo@users.noreply.github.com>
…oject#58350) fetch outbound deployments from all replicas at initialization. Next PR -> ray-project#58355 --------- Signed-off-by: abrar <abrar@anyscale.com>
…ay-project#58355) ### Summary This PR exposes deployment topology information in Ray Serve instance details, allowing users to visualize and understand the dependency graph of deployments within their applications. ### What's Changed #### New Data Structures Added two new schema classes to represent deployment topology: - **`DeploymentNode`** - Represents a node in the deployment DAG - **`DeploymentTopology`** - Represents the full dependency graph #### Implementation **Controller Integration** - Updated `ServeController` to include `deployment_topology` in `ApplicationDetails` when serving instance details - Topology is now accessible via the `get_serve_details()` API --- **Example Output:** ```python { "app_name": "my_app", "ingress_deployment": "Ingress", "nodes": { "Ingress": { "name": "Ingress", "is_ingress": True, "outbound_deployments": [ {"name": "ServiceA", "app_name": "my_app"} ] }, "ServiceA": { "name": "ServiceA", "is_ingress": False, "outbound_deployments": [ {"name": "Database", "app_name": "my_app"} ] }, "Database": { "name": "Database", "is_ingress": False, "outbound_deployments": [] } } } ``` --------- Signed-off-by: abrar <abrar@anyscale.com> Co-authored-by: Lonnie Liu <95255098+aslonnie@users.noreply.github.com>
…oject#58350) fetch outbound deployments from all replicas at initialization. Next PR -> ray-project#58355 --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: Future-Outlier <eric901201@gmail.com>
…oject#58350) fetch outbound deployments from all replicas at initialization. Next PR -> ray-project#58355 --------- Signed-off-by: abrar <abrar@anyscale.com> Signed-off-by: peterxcli <peterxcli@gmail.com>
…ay-project#58355) ### Summary This PR exposes deployment topology information in Ray Serve instance details, allowing users to visualize and understand the dependency graph of deployments within their applications. ### What's Changed #### New Data Structures Added two new schema classes to represent deployment topology: - **`DeploymentNode`** - Represents a node in the deployment DAG - **`DeploymentTopology`** - Represents the full dependency graph #### Implementation **Controller Integration** - Updated `ServeController` to include `deployment_topology` in `ApplicationDetails` when serving instance details - Topology is now accessible via the `get_serve_details()` API --- **Example Output:** ```python { "app_name": "my_app", "ingress_deployment": "Ingress", "nodes": { "Ingress": { "name": "Ingress", "is_ingress": True, "outbound_deployments": [ {"name": "ServiceA", "app_name": "my_app"} ] }, "ServiceA": { "name": "ServiceA", "is_ingress": False, "outbound_deployments": [ {"name": "Database", "app_name": "my_app"} ] }, "Database": { "name": "Database", "is_ingress": False, "outbound_deployments": [] } } } ``` --------- Signed-off-by: abrar <abrar@anyscale.com> Co-authored-by: Lonnie Liu <95255098+aslonnie@users.noreply.github.com> Signed-off-by: peterxcli <peterxcli@gmail.com>
Summary
This PR exposes deployment topology information in Ray Serve instance details, allowing users to visualize and understand the dependency graph of deployments within their applications.
What's Changed
New Data Structures
Added two new schema classes to represent deployment topology:
DeploymentNode- Represents a node in the deployment DAGDeploymentTopology- Represents the full dependency graphImplementation
Controller Integration
ServeControllerto includedeployment_topologyinApplicationDetailswhen serving instance detailsget_serve_details()APIExample Output:
{ "app_name": "my_app", "ingress_deployment": "Ingress", "nodes": { "Ingress": { "name": "Ingress", "is_ingress": True, "outbound_deployments": [ {"name": "ServiceA", "app_name": "my_app"} ] }, "ServiceA": { "name": "ServiceA", "is_ingress": False, "outbound_deployments": [ {"name": "Database", "app_name": "my_app"} ] }, "Database": { "name": "Database", "is_ingress": False, "outbound_deployments": [] } } }