-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Serve] Optimize ServeController.get_app_config()
#45878
[Serve] Optimize ServeController.get_app_config()
#45878
Conversation
Signed-off-by: Josh Karpel <josh.karpel@gmail.com>
Signed-off-by: Josh Karpel <josh.karpel@gmail.com>
@_ensure_connected | ||
def get_app_config(self, name: str = SERVE_DEFAULT_APP_NAME) -> Dict: | ||
"""Returns the most recently requested Serve config.""" | ||
return ray.get(self._controller.get_app_config.remote(name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be unused, so I went ahead and removed it instead of refactoring it. But I'm happy to provide an equivalent method in this PR if desired.
I'm seeing a test failure on ray/dashboard/modules/serve/serve_rest_api_impl.py Lines 122 to 134 in 24aa146
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Josh Karpel <josh.karpel@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! I left a couple comments.
@@ -877,6 +877,8 @@ def get_serve_instance_details(self) -> Dict: | |||
grpc_config = self.get_grpc_config() | |||
applications = {} | |||
|
|||
app_configs = self.get_app_configs() or {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing a test failure on test_get_applications_while_gcs_down
I believe it's because you're trying to access the KV store while the GCS is down. Could you change this to not fetch the app configs when there are no applications?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just pushed this up 🤞🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is passing now! Re-requested your review
Co-authored-by: shrekris-anyscale <92341594+shrekris-anyscale@users.noreply.github.com> Signed-off-by: Josh Karpel <josh.karpel@gmail.com>
Signed-off-by: Josh Karpel <josh.karpel@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Premerge is failing @JoshKarpel. Could you take a look? |
It looks like a backwards compat test in the Ray Jobs API with a (hopefully) unrelated error https://buildkite.com/ray-project/premerge/builds/27215#01904b67-78b6-49f9-b489-0c09dd2a9dd5:
I merged latest master, will see if it still fails on the new CI run 🤞🏻 |
Looks like the failure was ephemeral @shrekris-anyscale 🤞🏻 |
Thanks! |
Why are these changes needed?
Currently,
ServeController.get_app_config()
is called once for each application duringServeController.get_serve_instance_details()
. Each of those calls requires a round-trip to the GCS to get the Serve checkpoint, but the Serve checkpoint has all of the information for all apps already. This PR replacesServeController.get_app_config()
with a new method that I've very cleverly namedServeController.get_app_configs()
, which effectively pre-fetches all the application configs and leaves it up to the caller to decide what to do with them.Before, 1800 apps with 1 deployment each, no
DeploymentHandle
s, with #45872 :After: so little time it doesn't even appear in the flamegraph!
Related issue number
Discovered alongside #45872
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.