-
Notifications
You must be signed in to change notification settings - Fork 539
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
Implement config validation #2645
Conversation
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 submitting the PR @iojw! The code looks mostly good to me, but there seems to be a circular import, when I tried sky check
with the current PR.
sky/data/storage.py", line 49, in <module>
str(clouds.AWS()),
AttributeError: partially initialized module 'sky.clouds' has no attribute 'AWS' (most likely due to a circular import)
Updated to throw an exception and also to fix the circular import issue mentioned (it's caused by the Strangely, I'm unable to reproduce it locally, so could you help to verify that it is fixed @Michaelvll ? |
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 identifying the issues and fixing them @iojw! It looks mostly good. Left some minor comments. cc'ing @concretevitamin to see if he has some additional test to be run. : )
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 the schema check @iojw! LGTM with an additional comment. Would be nice to do some more manual test to avoid any accident false positive schema alert.
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 @iojw! Left some comments on the k8s config docs, otherwise LGTM!
Thank you @romilbhardwaj for taking a look! I'll merge this in soon if there are no further comments. |
Closes #2474
Implements validation for the
~/.sky/config.yaml
file. If there is an error, an exception is thrown and the user is warned.To avoid circular imports, I had to refactor the code a bit, moving validation code into
common_utils
and moving the imports insky.util.schemas
to within the functions.Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
bash tests/backward_comaptibility_tests.sh