Skip to content

[serve] Expose deployment statuses in REST API#22611

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

[serve] Expose deployment statuses in REST API#22611
edoakes merged 53 commits intoray-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

  • 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 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
      • This change adds unit tests to test_schema.py and test_serve_head.py.

@edoakes
Copy link
Copy Markdown
Collaborator

edoakes commented Feb 24, 2022

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

@edoakes edoakes added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label 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",
)
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
Copy link
Copy Markdown
Collaborator

edoakes commented Feb 24, 2022

@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.

@shrekris-anyscale shrekris-anyscale removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Feb 24, 2022
@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