-
Notifications
You must be signed in to change notification settings - Fork 440
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
Add core programmatic API align with CLI #978
Conversation
Thanks for sharing the draft of the PR for review!
Another way to achieve our goal is to have each functionality implemented in its module instead of So our
wdyt? |
(have not read the PR; just a note) This is timely! @pounde reported that there's no simple API to call for the effects of
|
Good idea! |
Merged the master branch.
For the onprem and benchmark, I have not moved them into the core as they may not be immediately needed yet, and may experience some API change in the short future. We can move them in a future PR. Wdyt @romilbhardwaj @concretevitamin ? Future TODO:
|
This sounds good to me. |
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 is great! We will have a much cleaner python API after this PR. Left some comments
if sync_down: | ||
click.secho('Syncing down logs to local...', fg='yellow') | ||
backend.sync_down_logs(handle, job_id) | ||
core.download_logs(cluster, job_ids) |
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.
comment: It would be nice to have a flag to specify the log download destination. They get put into ~/sky_logs/
, which is okay for now, but something we should keep an eye out for (or mark as a good first issue ;) )
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 is a great point! I just added the option for the core.download_logs
, so that the user can specify the local_dir
. For the CLI, it may be better to keep it simpler without the option?
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, thanks @Michaelvll! Should be good to merge after smoke tests. We should also add examples for the new APIs as a new PR
Thank you for the review @romilbhardwaj! Just passed the smoke tests. Merging. |
Closes #871 and #980. Also, makes #972 easier.
Our current implementation has many functionalities in the
cli.py
, which makes python API users have to use subprocess to do the cluster, jobs, and storage management, and cannot handle easily handle the return values (needs to be done with string process).This PR currently just has the skeleton of SDK and APIs. The implementation will be filled later. Please take a look at the API hierarchy and let me know if you find it not appropriate. : )
I am not sure whether thestop
,start
,down
,autostop
should be placed undersky
orsky.sdk
. If placed undersky.sdk
, it is a bit weird to only havelaunch
andexec
undersky
.I updated the hierarchy of the APIs based on the suggestion of @romilbhardwaj.
Other changes
sky logs
.Hierarchy of the APIs:
sky
TODOs
Tested:
CLIs
sky launch -c min ./example/minimal.yaml
sky stop min
sky start min
sky autostop min
sky autostop --cancel min
sky queue
sky spot launch -n test-queue 'sleep 10000; echo hi'
sky spot status
sky spot cancel -n test-queue
sky logs test-multi-echo-zhwu-164b 1 2 3 4 -s
sky logs test-multi-echo-zhwu-164b 3 -s
sky logs test-multi-echo-zhwu-164b 3
sky logs test-multi-echo-zhwu-164b 1 2 3 4
failstests/run_smoke_test.sh
(Failed TPU VM as TPU VM: guard against spurious and transient failures #962)