diff --git a/sky/cli.py b/sky/cli.py index ce3ad16ecb9..462e8a5b9de 100644 --- a/sky/cli.py +++ b/sky/cli.py @@ -3560,6 +3560,15 @@ def jobs(): default=False, required=False, help='Skip confirmation prompt.') +# TODO(cooperc): remove this flag once --fast can robustly detect cluster +# yaml config changes +@click.option('--fast', + default=False, + is_flag=True, + help='[Experimental] Launch the job faster by skipping ' + 'controller initialization steps. If you update SkyPilot or ' + 'your local cloud credentials, they will not be reflected until ' + 'you run `sky jobs launch` at least once without this flag.') @timeline.event @usage_lib.entrypoint def jobs_launch( @@ -3586,6 +3595,7 @@ def jobs_launch( detach_run: bool, retry_until_up: bool, yes: bool, + fast: bool, ): """Launch a managed job from a YAML or a command. @@ -3669,7 +3679,8 @@ def jobs_launch( managed_jobs.launch(dag, name, detach_run=detach_run, - retry_until_up=retry_until_up) + retry_until_up=retry_until_up, + fast=fast) @jobs.command('queue', cls=_DocumentedCodeCommand) diff --git a/sky/jobs/core.py b/sky/jobs/core.py index 6c1ac42d192..5668e19332a 100644 --- a/sky/jobs/core.py +++ b/sky/jobs/core.py @@ -36,6 +36,7 @@ def launch( stream_logs: bool = True, detach_run: bool = False, retry_until_up: bool = False, + fast: bool = False, ) -> None: # NOTE(dev): Keep the docstring consistent between the Python API and CLI. """Launch a managed job. @@ -47,6 +48,9 @@ def launch( managed job. name: Name of the managed job. detach_run: Whether to detach the run. + fast: Whether to use sky.launch(fast=True) for the jobs controller. If + True, the SkyPilot wheel and the cloud credentials may not be updated + on the jobs controller. Raises: ValueError: cluster does not exist. Or, the entrypoint is not a valid @@ -138,6 +142,7 @@ def launch( idle_minutes_to_autostop=skylet_constants. CONTROLLER_IDLE_MINUTES_TO_AUTOSTOP, retry_until_up=True, + fast=fast, _disable_controller_check=True)