Skip to content

Commit

Permalink
[Spot] Retry until up for spot (#2004)
Browse files Browse the repository at this point in the history
* Fix retry-until-up for spot launch

* format

* abbr

* Update sky/cli.py

Co-authored-by: Zongheng Yang <[email protected]>

* format

---------

Co-authored-by: Zongheng Yang <[email protected]>
  • Loading branch information
Michaelvll and concretevitamin committed Jun 4, 2023
1 parent 80cf06d commit 9e39de6
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions sky/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3353,9 +3353,9 @@ def spot():
help=('If True, as soon as a job is submitted, return from this call '
'and do not stream execution logs.'))
@click.option(
'--retry-until-up',
'-r',
default=True,
'--retry-until-up/--no-retry-until-up',
'-r/-no-r',
default=None,
is_flag=True,
required=False,
help=('(Default: True; this flag is deprecated and will be removed in a '
Expand Down Expand Up @@ -3429,6 +3429,18 @@ def spot_launch(
disk_tier=disk_tier,
spot_recovery=spot_recovery,
)
# Deprecation.
if retry_until_up is not None:
flag_str = '--retry-until-up'
if not retry_until_up:
flag_str = '--no-retry-until-up'
click.secho(
f'Flag {flag_str} is deprecated and will be removed in a '
'future release (managed spot jobs will always be retried). '
'Please file an issue if this does not work for you.',
fg='yellow')
else:
retry_until_up = True

if not yes:
prompt = f'Launching a new spot task {name!r}. Proceed?'
Expand All @@ -3444,14 +3456,6 @@ def spot_launch(
if resources.cloud is not None else clouds.Cloud)
task_cloud.check_cluster_name_is_valid(name)

# Deprecation.
if not retry_until_up:
click.secho(
'Flag --retry-until-up is deprecated and will be removed in a '
'future release (defaults to True). Please file an issue if this '
'does not work for you.',
fg='yellow')

sky.spot_launch(task,
name,
detach_run=detach_run,
Expand Down

0 comments on commit 9e39de6

Please sign in to comment.