Skip to content
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

[Core] Fail with non-zero exit code when using unsupported features #4515

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2579,6 +2579,7 @@ def start(
except (exceptions.NotSupportedError,
exceptions.ClusterOwnerIdentityMismatchError) as e:
click.echo(str(e))
sys.exit(1)
else:
click.secho(f'Cluster {name} started.', fg='green')

Expand Down Expand Up @@ -2918,6 +2919,7 @@ def _down_or_stop(name: str):
except (exceptions.NotSupportedError,
exceptions.ClusterNotUpError) as e:
message = str(e)
sys.exit(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want a failure for a single cluster to abort the termination for the other clusters. Since we are running the terminations in parallel, how about we gather all the failures and show them in a table at the end and return non-zero for any failure happens during the termination at the end?

else: # no exception raised
success_progress = True
message = (f'{colorama.Fore.GREEN}{operation} '
Expand Down Expand Up @@ -2948,6 +2950,7 @@ def _down_or_stop(name: str):
except (exceptions.NotSupportedError,
exceptions.ClusterOwnerIdentityMismatchError) as e:
message = str(e)
sys.exit(1)
else: # no exception raised
message = (
f'{colorama.Fore.GREEN}{operation} cluster {name}...done.'
Expand Down
Loading