-
Notifications
You must be signed in to change notification settings - Fork 633
CLI: make sky down/stop/start
default to a unique cluster if exists.
#2325
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
Conversation
sky down/stop
default to a unique cluster if exists.sky down/stop/start
default to a unique cluster if exists.
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.
@concretevitamin Tried this out and all works well! One unexpected behavior was that sky start
currently doesn't display any outputs when there is 0 cluster in status
while stop
/down
does. Is this intended?
(base) root@e3f961aef279:~# sky status
Clusters
No existing clusters.
Managed spot jobs
No in progress jobs. (See: sky spot -h)
(base) root@e3f961aef279:~# sky start
(base) root@e3f961aef279:~# sky stop
Cluster(s) not found (tip: see `sky status`).
(base) root@e3f961aef279:~# sky down
Cluster(s) not found (tip: see `sky status`).
When there are >1 clusters, it does behave as expeced:
Clusters
NAME LAUNCHED RESOURCES STATUS AUTOSTOP COMMAND
sky-0fb2-root < 1 sec 1x AWS(m6i.2xlarge) UP - sky launch --cloud aws -y
sky-d04e-root 3 mins ago 1x AWS(m6i.2xlarge) UP - sky start
(base) root@e3f961aef279:~# sky stop
Usage: sky stop [OPTIONS] [CLUSTERS]...
Try 'sky stop -h' for help.
Error: `sky stop` requires either a cluster name or glob, or the -a/--all flag.
(base) root@e3f961aef279:~# sky start
Usage: sky start [OPTIONS] [CLUSTERS]...
Try 'sky start -h' for help.
Error: `sky start` requires either a cluster name or glob, or the -a/--all flag.
sky/cli.py
Outdated
clusters = all_cluster_names | ||
else: | ||
raise click.UsageError( | ||
'`sky start` requires either a cluster name or glob, ' |
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.
'`sky start` requires either a cluster name or glob, ' | |
'`sky start` requires either a cluster name (see `sky status`) or glob, ' |
I'm wondering if we should keep the (see 'sky status')
to inform (same for sky stop
/down
)?
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.
Done.
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.
One unexpected behavior was that sky start currently doesn't display any outputs when there is 0 cluster in status while stop/down does. Is this intended?
Great catch, fixed.
sky/cli.py
Outdated
clusters = all_cluster_names | ||
else: | ||
raise click.UsageError( | ||
'`sky start` requires either a cluster name or glob, ' |
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.
Done.
Partially address #1877.
When I have only 1 cluster in
status
:Previously
This PR makes it so that
down/stop
defaults to it:When I have 0 cluster in
status
: this PRSame for
sky start
.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