[serve] Expose deployment statuses in REST API#22611
Merged
edoakes merged 53 commits intoray-project:masterfrom Feb 25, 2022
Merged
[serve] Expose deployment statuses in REST API#22611edoakes merged 53 commits intoray-project:masterfrom
edoakes merged 53 commits intoray-project:masterfrom
Conversation
Collaborator
|
@shrekris-anyscale you have merge conflicts from the other PR |
edoakes
requested changes
Feb 24, 2022
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", | ||
| ) |
Collaborator
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
Good call, I updated the API with a separate status endpoint.
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. |
edoakes
approved these changes
Feb 24, 2022
simonsays1980
pushed a commit
to simonsays1980/ray
that referenced
this pull request
Feb 27, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
scripts/format.shto lint the changes in this PR.test_schema.pyandtest_serve_head.py.