[serve] Avoid deleting dynamically-deployed apps when applying config via REST API#44476
[serve] Avoid deleting dynamically-deployed apps when applying config via REST API#44476edoakes merged 7 commits intoray-project:masterfrom
Conversation
|
cc @JoshKarpel |
zcin
left a comment
There was a problem hiding this comment.
Overall looks great! One question: what happens if the user tries to imperatively deploy an app that was previously deployed declaratively, or vice versa? Do we allow this switching, or will we error out and force the user to delete the former before switching to the latter? (and for what we decide to be expected behavior, can we add a test?)
| def check_application_running( | ||
| name: str, route_prefix: str, *, msg: str = "wonderful world" | ||
| ): | ||
| status = serve.status().applications[name] | ||
| assert status.status == "RUNNING" | ||
| assert requests.post(f"http://localhost:8000{route_prefix}/").text == msg | ||
| return True |
There was a problem hiding this comment.
If this is generalizable, maybe this can be added to test_utils?
There was a problem hiding this comment.
yeah let me see if it makes sense
|
@shrekris-anyscale @zcin I've added tests for the edge cases you pointed out. It's one long mega-test at the moment, probably going to split it out because it's quite confusing this way. But the behavior is that the latest operation for a given app name is how it is treated. |
| self._deployment_state_manager, | ||
| endpoint_state=self._endpoint_state, | ||
| save_checkpoint_func=self._save_checkpoint_func, | ||
| ) |
There was a problem hiding this comment.
Not sure if this makes sense/would be helpful, but maybe we can add a log statement for when an app switches from imperative to declarative or vice versa when redeployed?
|
Thanks @edoakes , this is awesome! Does this automatically expose the information in the Serve REST API for consumption (in KubeRay) or does that need a follow-up PR? |
It doesn't, for now I went with the most minimal solution that doesn't add any public API fields because I wanted to get it out for the next branch cut (today). Do we need it in Kuberay for a specific purpose btw? What will we do with the information? |
This was for the second part of the issue
from my original post in #44226 . The first part of that is implicitly handled by this PR because KubeRay uses the declarative REST API, but for the second part KubeRay would need the additional metadata when it hits the dashboard API to get Serve application statuses. |
## Why are these changes needed? This change exposes the new Serve app submission API type tracking introduced in #44476 in the dashboard API. My intent is to eventually introduce an *option* in KubeRay to *only* care about the status of `DECLARATIVE` Serve apps, so that it doesn't care about "dynamically deployed" `IMPERATIVE` apps. Per request, I've indicated that this is a developer API in the field docstring. ## Related issue number Follow-up for #44226 (comment) --------- Signed-off-by: Josh Karpel <josh.karpel@gmail.com>
…project#45522) ## Why are these changes needed? This change exposes the new Serve app submission API type tracking introduced in ray-project#44476 in the dashboard API. My intent is to eventually introduce an *option* in KubeRay to *only* care about the status of `DECLARATIVE` Serve apps, so that it doesn't care about "dynamically deployed" `IMPERATIVE` apps. Per request, I've indicated that this is a developer API in the field docstring. ## Related issue number Follow-up for ray-project#44226 (comment) --------- Signed-off-by: Josh Karpel <josh.karpel@gmail.com>
Why are these changes needed?
See #44226 for more details, but TL;DR:
serve.runAPI. In this case, we should not delete the dynamically-created apps.APITypeand only deleting apps that were applied via the declarative API. There is no public API change. In the future we may want to consider exposing this metadata so external systems like Kuberay can treat the types of apps differently (e.g., for determining high-level status).Related issue number
Closes #44226
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.