-
Notifications
You must be signed in to change notification settings - Fork 640
[Serve] Add endpoint caching for status --endpoint
#5052
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
base: master
Are you sure you want to change the base?
Conversation
…ck to sky serve controller, add more comments
@cblmemo just wondering if you had the opportunity to take a look? |
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 adding this @kyuds ! This is exciting. Left some discussions.
Also, can we include some benchmark on the performance of before & after of this PR?
Ran benchmarks @cblmemo
|
Fixes #2915
This is a caching feature to cache the output for
sky serve status --endpoint
. Whensky serve up
is invoked orsky serve status
is invoked, then the returned serve endpoint will be cached to the db tableendpoint_cache
under~/.sky/serve/service.db
.This endpoint is cached on two conditions:
sky serve up
.sky serve status
IFF theServiceStatus
enum isReady
.This endpoint is removed from the cache on two conditions:
ServiceStatus
ofsky serve status
is notReady
.sky serve down
is invoked.Also there is a new flag called
--force-refresh
that only takes into effect when--endpoint
is also used, which effectively is used to bypass the cache and query the serve controller.One thing I wanted to point out though is I had to make a helper function called_make_dummy
in line 649 ofserve/server/core.py
, which creates dummy data to simulate the return schema of a status request. Without this the code seems to go into an infinitely spinning loop. I couldn't easily find where the schema is enforced, and wasn't sure whether it is appropriate at all to remove the schema enforcement anyways. If the dummy data present in_make_dummy
doesn't seem right, I will be more than happy to modify it!<_make_dummy
function in question>** fixed. please see resolved comment
Tested (run the relevant ones):
bash format.sh
/smoke-test
(CI) orpytest tests/test_smoke.py
(local)/smoke-test -k test_name
(CI) orpytest tests/test_smoke.py::test_name
(local)/quicktest-core
(CI) orpytest tests/smoke_tests/test_backward_compat.py
(local)