-
Notifications
You must be signed in to change notification settings - Fork 589
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
[API server] better error message on API version mismatch #4881
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Aylei <[email protected]>
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 fixing this @aylei!
sky/server/common.py
Outdated
# Raised when the server version is not a numeric. A safe | ||
# assumption is that our client is older since we never used | ||
# a non-numeric API version before. | ||
server_is_older = False |
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.
Also we should probably print a warning in debug here that this is not expected, instead of silently assuming the server is newer :)
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.
Good idea!
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.
The comment is refined and a debug log is added.
Co-authored-by: Romil Bhardwaj <[email protected]>
Signed-off-by: Aylei <[email protected]>
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 @aylei! A quick comment for the hinting we shown
f'{colorama.Fore.YELLOW}SkyPilot API server is too old: ' | ||
f'v{{server_version}} (client version is v{{client_version}}). ' | ||
'Please restart the SkyPilot API server with: ' | ||
'sky api stop; sky api start' | ||
f'v{{server_version}} (client version is v{{client_version}}). {{hint}}' |
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.
Although we allow vague versions with the internal version, we should not emphasize the internal version number here. We can make it easier for people to take actions, i.e. showing the version/commit of the SkyPilot package they should upgrade to. For example, we should check the server commit/version:
- if the server version is something like 1.0.0.dev202xxxx, we should ask user to upgrade their local SkyPilot to
skypilot-nightly==202xxx
- if the server version is something like
0.x.x
, we should ask user to upgrade local SkyPilot toskypilot==0.x.x
- if the server version is something like
1.0.0.dev0
and the commit to beabcde
, we should asks the user to upgrade local version to a specific commitpip install git+https://github.com...@abcde
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.
Great idea! Then I think despite which one is older, we should always hint the user to upgrade/downgrade the client to the server version when there is a version mismatch, since the user may not have control over the server deployment. Wdyt?
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.
That sounds good to me!
In the server being older case, we can add another sentence, like "contact your admin to upgrade the API server or downgrade your local SkyPilot ... "
Co-authored-by: Zhanghao Wu <[email protected]>
close #4878
Tested locally by modifying the version constant:
Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh