Skip to content

[serve] Expose deployment statuses in REST API - #22611

Merged
edoakes merged 53 commits into
ray-project:masterfrom
shrekris-anyscale:rest_status
Feb 25, 2022
Merged

edoakes merged 53 commits into
ray-project:masterfrom
shrekris-anyscale:rest_status

Conversation

@shrekris-anyscale

Copy link
Copy Markdown
Contributor

Why are these changes needed?

This change exposes deployment statuses in Serve's REST API. When the dashboard receives a GET command, it returns both the deployment information and the status information.

Related issue number

This change builds on the REST API from #22578.

Checks

@edoakes

edoakes commented Feb 24, 2022

Copy link
Copy Markdown
Collaborator

@shrekris-anyscale you have merge conflicts from the other PR

Comment on lines +26 to +37
@routes.get("/api/serve/deployments/")
@optional_utils.init_ray_and_catch_exceptions(connect_to_serve=True)
async def get_all_deployments(self, req: Request) -> Response:
deployments = list(serve.list_deployments().values())
statuses = get_deployment_statuses()
serve_instance_schema = serve_instance_to_schema(
deployments=deployments, statuses=statuses
)
return Response(
text=json.dumps(serve_instance_schema.json()),
content_type="application/json",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this came up in design review; let's separate getting the goal state/config of deployments w/ getting the current status (concretely, split this into a GET /api/serve/deployments/status API

this makes it simpler from the caller side: what you PUT for the config is exactly what you GET

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call, I updated the API with a separate status endpoint.

@edoakes

edoakes commented Feb 24, 2022

Copy link
Copy Markdown
Collaborator

@shrekris-anyscale comment about the API, will wait to review the rest until merge conflicts are resolved as it's hard to see the diff from the previous PR.

Comment thread python/ray/serve/common.py Resolved
@edoakes
edoakes merged commit e85540a into ray-project:master Feb 25, 2022
simonsays1980 pushed a commit to simonsays1980/ray that referenced this pull request Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants