skypilot-nightly 1.0.0.dev20240902__py3-none-any.whl → 1.0.0.dev20240903__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sky/__init__.py CHANGED
@@ -5,7 +5,7 @@ from typing import Optional
5
5
  import urllib.request
6
6
 
7
7
  # Replaced with the current commit when building the wheels.
8
- _SKYPILOT_COMMIT_SHA = '2e204d001b037cd4ff84abbaa4f2c81d3442ba22'
8
+ _SKYPILOT_COMMIT_SHA = '0203971a36dbcf0a6d3615e6ed25f3f6d11b53f6'
9
9
 
10
10
 
11
11
  def _get_git_commit():
@@ -35,7 +35,7 @@ def _get_git_commit():
35
35
 
36
36
 
37
37
  __commit__ = _get_git_commit()
38
- __version__ = '1.0.0.dev20240902'
38
+ __version__ = '1.0.0.dev20240903'
39
39
  __root_dir__ = os.path.dirname(os.path.abspath(__file__))
40
40
 
41
41
 
@@ -3112,7 +3112,8 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
3112
3112
  setup_script = log_lib.make_task_bash_script(setup,
3113
3113
  env_vars=setup_envs)
3114
3114
  encoded_script = shlex.quote(setup_script)
3115
- if detach_setup or _is_command_length_over_limit(encoded_script):
3115
+
3116
+ def _dump_setup_script(setup_script: str) -> None:
3116
3117
  with tempfile.NamedTemporaryFile('w', prefix='sky_setup_') as f:
3117
3118
  f.write(setup_script)
3118
3119
  f.flush()
@@ -3121,6 +3122,9 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
3121
3122
  target=remote_setup_file_name,
3122
3123
  up=True,
3123
3124
  stream_logs=False)
3125
+
3126
+ if detach_setup or _is_command_length_over_limit(encoded_script):
3127
+ _dump_setup_script(setup_script)
3124
3128
  create_script_code = 'true'
3125
3129
  else:
3126
3130
  create_script_code = (f'{{ echo {encoded_script} > '
@@ -3128,20 +3132,42 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
3128
3132
 
3129
3133
  if detach_setup:
3130
3134
  return
3135
+
3131
3136
  setup_log_path = os.path.join(self.log_dir,
3132
3137
  f'setup-{runner.node_id}.log')
3133
- returncode = runner.run(
3134
- f'{create_script_code} && {setup_cmd}',
3135
- log_path=setup_log_path,
3136
- process_stream=False,
3137
- # We do not source bashrc for setup, since bashrc is sourced
3138
- # in the script already.
3139
- # Skip an empty line and two lines due to the /bin/bash -i and
3140
- # source ~/.bashrc in the setup_cmd.
3141
- # bash: cannot set terminal process group (7398): Inappropriate ioctl for device # pylint: disable=line-too-long
3142
- # bash: no job control in this shell
3143
- skip_lines=3,
3144
- )
3138
+
3139
+ def _run_setup(setup_cmd: str) -> int:
3140
+ returncode = runner.run(
3141
+ setup_cmd,
3142
+ log_path=setup_log_path,
3143
+ process_stream=False,
3144
+ # We do not source bashrc for setup, since bashrc is sourced
3145
+ # in the script already.
3146
+ # Skip an empty line and two lines due to the /bin/bash -i
3147
+ # and source ~/.bashrc in the setup_cmd.
3148
+ # bash: cannot set terminal process group (7398): Inappropriate ioctl for device # pylint: disable=line-too-long
3149
+ # bash: no job control in this shell
3150
+ skip_lines=3)
3151
+ return returncode
3152
+
3153
+ returncode = _run_setup(f'{create_script_code} && {setup_cmd}',)
3154
+ if returncode == 255:
3155
+ is_message_too_long = False
3156
+ with open(setup_log_path, 'r', encoding='utf-8') as f:
3157
+ if 'too long' in f.read():
3158
+ is_message_too_long = True
3159
+
3160
+ if is_message_too_long:
3161
+ # If the setup script is too long, we retry it with dumping
3162
+ # the script to a file and running it with SSH. We use a
3163
+ # general length limit check before but it could be
3164
+ # inaccurate on some systems.
3165
+ logger.debug(
3166
+ 'Failed to run setup command inline due to '
3167
+ 'command length limit. Dumping setup script to '
3168
+ 'file and running it with SSH.')
3169
+ _dump_setup_script(setup_script)
3170
+ returncode = _run_setup(setup_cmd)
3145
3171
 
3146
3172
  def error_message() -> str:
3147
3173
  # Use the function to avoid tailing the file in success case
@@ -3223,7 +3249,8 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
3223
3249
 
3224
3250
  code = job_lib.JobLibCodeGen.queue_job(job_id, job_submit_cmd)
3225
3251
  job_submit_cmd = ' && '.join([mkdir_code, create_script_code, code])
3226
- if _is_command_length_over_limit(job_submit_cmd):
3252
+
3253
+ def _dump_code_to_file(codegen: str) -> None:
3227
3254
  runners = handle.get_command_runners()
3228
3255
  head_runner = runners[0]
3229
3256
  with tempfile.NamedTemporaryFile('w', prefix='sky_app_') as fp:
@@ -3238,6 +3265,9 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
3238
3265
  target=script_path,
3239
3266
  up=True,
3240
3267
  stream_logs=False)
3268
+
3269
+ if _is_command_length_over_limit(job_submit_cmd):
3270
+ _dump_code_to_file(codegen)
3241
3271
  job_submit_cmd = f'{mkdir_code} && {code}'
3242
3272
 
3243
3273
  if managed_job_dag is not None:
@@ -3263,6 +3293,16 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
3263
3293
  job_submit_cmd,
3264
3294
  stream_logs=False,
3265
3295
  require_outputs=True)
3296
+ if returncode == 255 and 'too long' in stdout + stderr:
3297
+ # If the setup script is too long, we retry it with dumping
3298
+ # the script to a file and running it with SSH. We use a general
3299
+ # length limit check before but it could be inaccurate on some
3300
+ # systems.
3301
+ _dump_code_to_file(codegen)
3302
+ returncode, stdout, stderr = self.run_on_head(handle,
3303
+ job_submit_cmd,
3304
+ stream_logs=False,
3305
+ require_outputs=True)
3266
3306
 
3267
3307
  # Happens when someone calls `sky exec` but remote is outdated
3268
3308
  # necessitating calling `sky launch`.
sky/cli.py CHANGED
@@ -29,6 +29,7 @@ import functools
29
29
  import multiprocessing
30
30
  import os
31
31
  import shlex
32
+ import shutil
32
33
  import signal
33
34
  import subprocess
34
35
  import sys
@@ -368,7 +369,9 @@ def _install_shell_completion(ctx: click.Context, param: click.Parameter,
368
369
  echo "{bashrc_diff}" >> ~/.bashrc'
369
370
 
370
371
  cmd = (f'(grep -q "SkyPilot" ~/.bashrc) || '
371
- f'[[ ${{BASH_VERSINFO[0]}} -ge 4 ]] && ({install_cmd})')
372
+ f'([[ ${{BASH_VERSINFO[0]}} -ge 4 ]] && ({install_cmd}) || '
373
+ f'(echo "Bash must be version 4 or above." && exit 1))')
374
+
372
375
  reload_cmd = _RELOAD_BASH_CMD
373
376
 
374
377
  elif value == 'fish':
@@ -390,7 +393,10 @@ def _install_shell_completion(ctx: click.Context, param: click.Parameter,
390
393
  ctx.exit()
391
394
 
392
395
  try:
393
- subprocess.run(cmd, shell=True, check=True, executable='/bin/bash')
396
+ subprocess.run(cmd,
397
+ shell=True,
398
+ check=True,
399
+ executable=shutil.which('bash'))
394
400
  click.secho(f'Shell completion installed for {value}', fg='green')
395
401
  click.echo(
396
402
  'Completion will take effect once you restart the terminal: ' +
sky/exceptions.py CHANGED
@@ -100,9 +100,13 @@ class CommandError(Exception):
100
100
  self.command = command
101
101
  self.error_msg = error_msg
102
102
  self.detailed_reason = detailed_reason
103
+
103
104
  if not command:
104
105
  message = error_msg
105
106
  else:
107
+ if len(command) > 100:
108
+ # Chunck the command to avoid overflow.
109
+ command = command[:100] + '...'
106
110
  message = (f'Command {command} failed with return code '
107
111
  f'{returncode}.\n{error_msg}')
108
112
  super().__init__(message)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: skypilot-nightly
3
- Version: 1.0.0.dev20240902
3
+ Version: 1.0.0.dev20240903
4
4
  Summary: SkyPilot: An intercloud broker for the clouds
5
5
  Author: SkyPilot Team
6
6
  License: Apache 2.0
@@ -1,11 +1,11 @@
1
- sky/__init__.py,sha256=LE8e--jogGuSSz7iw7FFOF0A5HRGx_Lt2HIXh1yQWFQ,5588
1
+ sky/__init__.py,sha256=nHssscXKP8yTZ6J_-_6KrrK4fNZy9Pe3O-tWwQRvxFQ,5588
2
2
  sky/authentication.py,sha256=PXKsabUKnvhoTNoNwZzo66qjCLAsuc5pQ8esVu0IYh8,20424
3
3
  sky/check.py,sha256=sqUCow5Gqqtp2ouk7tZ3whwDOK23wqyUJvcxMBsich8,9080
4
- sky/cli.py,sha256=XlgRr617B_yE2HV_nW01D_m5nWntW2GstutNrMp86UA,201504
4
+ sky/cli.py,sha256=2cOw3lXzRA-uLlEH-eK7N_1VmUpf1LR4Ztu-ZaKu3Is,201673
5
5
  sky/cloud_stores.py,sha256=RjFgmRhUh1Kk__f6g3KxzLp9s7dA0pFK4W1AukEuUaw,21153
6
6
  sky/core.py,sha256=YF_6kwj8Ja171Oycb8L25SZ7V_ylZYovFS_jpnjwGo0,34408
7
7
  sky/dag.py,sha256=d3gF030wYmit01jxszEygT4EvKJUky3DBlG3PfWPp_w,2529
8
- sky/exceptions.py,sha256=JmIRKAIg8OWqLAevVLn0pFw8xIe17dYMUQYY_pNdMlc,8454
8
+ sky/exceptions.py,sha256=gfrmh8djfZ0oGn1XtYWn8ca7wEyghkbzg4Hkq6tdjj8,8594
9
9
  sky/execution.py,sha256=nyLjzYOY1e-NHJeufrx24Oz2_tyBrKVoAu_tQtrhL0I,25235
10
10
  sky/global_user_state.py,sha256=PywEmUutF97XBgRMClR6IS5_KM8JJC0oA1LsPUZebp0,28681
11
11
  sky/optimizer.py,sha256=YGBhJPlcvylYON7MLrYEMtBOqJLt4LdlguQclVvvl4E,58677
@@ -30,7 +30,7 @@ sky/adaptors/vsphere.py,sha256=zJP9SeObEoLrpgHW2VHvZE48EhgVf8GfAEIwBeaDMfM,2129
30
30
  sky/backends/__init__.py,sha256=UDjwbUgpTRApbPJnNfR786GadUuwgRk3vsWoVu5RB_c,536
31
31
  sky/backends/backend.py,sha256=xtxR6boDv1o-uSCjbJhOMkKMnZvBZh3gExx4khFWPTI,5932
32
32
  sky/backends/backend_utils.py,sha256=8RDFfrr-1xnefnLhRKK2d8xlFBLR43ZjcDShB2K7_m8,126163
33
- sky/backends/cloud_vm_ray_backend.py,sha256=dRUIVroKw5vrOqEheJ1OwVKQiHgG9LfNdE3rmdviIZA,230209
33
+ sky/backends/cloud_vm_ray_backend.py,sha256=b238j7D7n5jg-H5O3kaNKG7heXzHgbhPGFZHVU7vfYo,232141
34
34
  sky/backends/docker_utils.py,sha256=Hyw1YY20EyghhEbYx6O2FIMDcGkNzBzV9TM7LFynei8,8358
35
35
  sky/backends/local_docker_backend.py,sha256=H4GBo0KFUC_EEf-ziv1OUbfAkOI5BrwkYs9fYOxSoNw,16741
36
36
  sky/backends/wheel_utils.py,sha256=3QS4T_Ydvo4DbYhogtyADyNBEf04I6jUCL71M285shQ,7963
@@ -270,9 +270,9 @@ sky/utils/kubernetes/k8s_gpu_labeler_job.yaml,sha256=KPqp23B-zQ2SZK03jdHeF9fLTog
270
270
  sky/utils/kubernetes/k8s_gpu_labeler_setup.yaml,sha256=VLKT2KKimZu1GDg_4AIlIt488oMQvhRZWwsj9vBbPUg,3812
271
271
  sky/utils/kubernetes/rsync_helper.sh,sha256=1ad-m4s8QTPxaBQxNIL8AGDfX4un6T0dxZgk-R7OLyE,154
272
272
  sky/utils/kubernetes/ssh_jump_lifecycle_manager.py,sha256=RFLJ3k7MR5UN4SKHykQ0lV9SgXumoULpKYIAt1vh-HU,6560
273
- skypilot_nightly-1.0.0.dev20240902.dist-info/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
274
- skypilot_nightly-1.0.0.dev20240902.dist-info/METADATA,sha256=GWp2jRkpst2h0ZjBBSD_1fJO1xHeRvghFkDZY8BwwFo,18870
275
- skypilot_nightly-1.0.0.dev20240902.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
276
- skypilot_nightly-1.0.0.dev20240902.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
277
- skypilot_nightly-1.0.0.dev20240902.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
278
- skypilot_nightly-1.0.0.dev20240902.dist-info/RECORD,,
273
+ skypilot_nightly-1.0.0.dev20240903.dist-info/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
274
+ skypilot_nightly-1.0.0.dev20240903.dist-info/METADATA,sha256=V0zqcv3aHLg6NOspSLg4SqJ-sToLhzQ5VWR7R1bWoaE,18870
275
+ skypilot_nightly-1.0.0.dev20240903.dist-info/WHEEL,sha256=ixB2d4u7mugx_bCBycvM9OzZ5yD7NmPXFRtKlORZS2Y,91
276
+ skypilot_nightly-1.0.0.dev20240903.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
277
+ skypilot_nightly-1.0.0.dev20240903.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
278
+ skypilot_nightly-1.0.0.dev20240903.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (74.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5