skypilot-nightly 1.0.0.dev20241122__py3-none-any.whl → 1.0.0.dev20241124__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 = '204d979fedece9b7b789dcd2610d1ebdbc8d1fc5'
8
+ _SKYPILOT_COMMIT_SHA = '44625e0e62b70e052072851129507a06ff60636d'
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.dev20241122'
38
+ __version__ = '1.0.0.dev20241124'
39
39
  __root_dir__ = os.path.dirname(os.path.abspath(__file__))
40
40
 
41
41
 
@@ -65,9 +65,14 @@ def list_accelerators(
65
65
  # TODO(romilb): We should consider putting a lru_cache() with TTL to
66
66
  # avoid multiple calls to kubernetes API in a short period of time (e.g.,
67
67
  # from the optimizer).
68
- return list_accelerators_realtime(gpus_only, name_filter, region_filter,
69
- quantity_filter, case_sensitive,
70
- all_regions, require_price)[0]
68
+ return _list_accelerators(gpus_only,
69
+ name_filter,
70
+ region_filter,
71
+ quantity_filter,
72
+ case_sensitive,
73
+ all_regions,
74
+ require_price,
75
+ realtime=False)[0]
71
76
 
72
77
 
73
78
  def list_accelerators_realtime(
@@ -78,10 +83,36 @@ def list_accelerators_realtime(
78
83
  case_sensitive: bool = True,
79
84
  all_regions: bool = False,
80
85
  require_price: bool = True
86
+ ) -> Tuple[Dict[str, List[common.InstanceTypeInfo]], Dict[str, int], Dict[str,
87
+ int]]:
88
+ return _list_accelerators(gpus_only,
89
+ name_filter,
90
+ region_filter,
91
+ quantity_filter,
92
+ case_sensitive,
93
+ all_regions,
94
+ require_price,
95
+ realtime=True)
96
+
97
+
98
+ def _list_accelerators(
99
+ gpus_only: bool,
100
+ name_filter: Optional[str],
101
+ region_filter: Optional[str],
102
+ quantity_filter: Optional[int],
103
+ case_sensitive: bool = True,
104
+ all_regions: bool = False,
105
+ require_price: bool = True,
106
+ realtime: bool = False
81
107
  ) -> Tuple[Dict[str, List[common.InstanceTypeInfo]], Dict[str, int], Dict[str,
82
108
  int]]:
83
109
  """List accelerators in the Kubernetes cluster.
84
110
 
111
+ If realtime is True, the function will query the cluster to fetch real-time
112
+ GPU usage, which is returned in total_accelerators_available. Note that
113
+ this may require an expensive list_pod_for_all_namespaces call, which
114
+ requires cluster-wide pod read permissions.
115
+
85
116
  If the user does not have sufficient permissions to list pods in all
86
117
  namespaces, the function will return free GPUs as -1.
87
118
  """
@@ -115,18 +146,20 @@ def list_accelerators_realtime(
115
146
  accelerators_qtys: Set[Tuple[str, int]] = set()
116
147
  keys = lf.get_label_keys()
117
148
  nodes = kubernetes_utils.get_kubernetes_nodes(context)
118
- # Get the pods to get the real-time GPU usage
119
- try:
120
- pods = kubernetes_utils.get_all_pods_in_kubernetes_cluster(context)
121
- except kubernetes.api_exception() as e:
122
- if e.status == 403:
123
- logger.warning('Failed to get pods in the Kubernetes cluster '
124
- '(forbidden). Please check if your account has '
125
- 'necessary permissions to list pods. Realtime GPU '
126
- 'availability information may be incorrect.')
127
- pods = None
128
- else:
129
- raise
149
+ pods = None
150
+ if realtime:
151
+ # Get the pods to get the real-time GPU usage
152
+ try:
153
+ pods = kubernetes_utils.get_all_pods_in_kubernetes_cluster(context)
154
+ except kubernetes.api_exception() as e:
155
+ if e.status == 403:
156
+ logger.warning(
157
+ 'Failed to get pods in the Kubernetes cluster '
158
+ '(forbidden). Please check if your account has '
159
+ 'necessary permissions to list pods. Realtime GPU '
160
+ 'availability information may be incorrect.')
161
+ else:
162
+ raise
130
163
  # Total number of GPUs in the cluster
131
164
  total_accelerators_capacity: Dict[str, int] = {}
132
165
  # Total number of GPUs currently available in the cluster
sky/skylet/constants.py CHANGED
@@ -39,7 +39,6 @@ SKY_GET_PYTHON_PATH_CMD = (f'[ -s {SKY_PYTHON_PATH_FILE} ] && '
39
39
  'which python3')
40
40
  # Python executable, e.g., /opt/conda/bin/python3
41
41
  SKY_PYTHON_CMD = f'$({SKY_GET_PYTHON_PATH_CMD})'
42
- # Prefer SKY_UV_PIP_CMD, which is faster. TODO(cooper): remove all usages.
43
42
  SKY_PIP_CMD = f'{SKY_PYTHON_CMD} -m pip'
44
43
  # Ray executable, e.g., /opt/conda/bin/ray
45
44
  # We need to add SKY_PYTHON_CMD before ray executable because:
@@ -51,10 +50,6 @@ SKY_RAY_CMD = (f'{SKY_PYTHON_CMD} $([ -s {SKY_RAY_PATH_FILE} ] && '
51
50
  SKY_REMOTE_PYTHON_ENV_NAME = 'skypilot-runtime'
52
51
  SKY_REMOTE_PYTHON_ENV = f'~/{SKY_REMOTE_PYTHON_ENV_NAME}'
53
52
  ACTIVATE_SKY_REMOTE_PYTHON_ENV = f'source {SKY_REMOTE_PYTHON_ENV}/bin/activate'
54
- # uv is used for venv and pip, much faster than python implementations.
55
- SKY_UV_INSTALL_DIR = '"$HOME/.local/bin"'
56
- SKY_UV_CMD = f'{SKY_UV_INSTALL_DIR}/uv'
57
- SKY_UV_PIP_CMD = f'VIRTUAL_ENV={SKY_REMOTE_PYTHON_ENV} {SKY_UV_CMD} pip'
58
53
  # Deleting the SKY_REMOTE_PYTHON_ENV_NAME from the PATH to deactivate the
59
54
  # environment. `deactivate` command does not work when conda is used.
60
55
  DEACTIVATE_SKY_REMOTE_PYTHON_ENV = (
@@ -153,16 +148,12 @@ CONDA_INSTALLATION_COMMANDS = (
153
148
  'echo "Creating conda env with Python 3.10" && '
154
149
  f'conda create -y -n {SKY_REMOTE_PYTHON_ENV_NAME} python=3.10 && '
155
150
  f'conda activate {SKY_REMOTE_PYTHON_ENV_NAME};'
156
- # Install uv for venv management and pip installation.
157
- 'which uv >/dev/null 2>&1 || '
158
- 'curl -LsSf https://astral.sh/uv/install.sh '
159
- f'| UV_INSTALL_DIR={SKY_UV_INSTALL_DIR} sh;'
160
151
  # Create a separate conda environment for SkyPilot dependencies.
161
152
  f'[ -d {SKY_REMOTE_PYTHON_ENV} ] || '
162
153
  # Do NOT use --system-site-packages here, because if users upgrade any
163
154
  # packages in the base env, they interfere with skypilot dependencies.
164
155
  # Reference: https://github.com/skypilot-org/skypilot/issues/4097
165
- f'{SKY_UV_CMD} venv {SKY_REMOTE_PYTHON_ENV};'
156
+ f'{SKY_PYTHON_CMD} -m venv {SKY_REMOTE_PYTHON_ENV};'
166
157
  f'echo "$(echo {SKY_REMOTE_PYTHON_ENV})/bin/python" > {SKY_PYTHON_PATH_FILE};'
167
158
  )
168
159
 
@@ -170,12 +161,15 @@ _sky_version = str(version.parse(sky.__version__))
170
161
  RAY_STATUS = f'RAY_ADDRESS=127.0.0.1:{SKY_REMOTE_RAY_PORT} {SKY_RAY_CMD} status'
171
162
  RAY_INSTALLATION_COMMANDS = (
172
163
  'mkdir -p ~/sky_workdir && mkdir -p ~/.sky/sky_app;'
164
+ # Disable the pip version check to avoid the warning message, which makes
165
+ # the output hard to read.
166
+ 'export PIP_DISABLE_PIP_VERSION_CHECK=1;'
173
167
  # Print the PATH in provision.log to help debug PATH issues.
174
168
  'echo PATH=$PATH; '
175
169
  # Install setuptools<=69.5.1 to avoid the issue with the latest setuptools
176
170
  # causing the error:
177
171
  # ImportError: cannot import name 'packaging' from 'pkg_resources'"
178
- f'{SKY_UV_PIP_CMD} install "setuptools<70"; '
172
+ f'{SKY_PIP_CMD} install "setuptools<70"; '
179
173
  # Backward compatibility for ray upgrade (#3248): do not upgrade ray if the
180
174
  # ray cluster is already running, to avoid the ray cluster being restarted.
181
175
  #
@@ -189,10 +183,10 @@ RAY_INSTALLATION_COMMANDS = (
189
183
  # latest ray port 6380, but those existing cluster launched before #1790
190
184
  # that has ray cluster on the default port 6379 will be upgraded and
191
185
  # restarted.
192
- f'{SKY_UV_PIP_CMD} list | grep "ray " | '
186
+ f'{SKY_PIP_CMD} list | grep "ray " | '
193
187
  f'grep {SKY_REMOTE_RAY_VERSION} 2>&1 > /dev/null '
194
188
  f'|| {RAY_STATUS} || '
195
- f'{SKY_UV_PIP_CMD} install -U ray[default]=={SKY_REMOTE_RAY_VERSION}; ' # pylint: disable=line-too-long
189
+ f'{SKY_PIP_CMD} install --exists-action w -U ray[default]=={SKY_REMOTE_RAY_VERSION}; ' # pylint: disable=line-too-long
196
190
  # In some envs, e.g. pip does not have permission to write under /opt/conda
197
191
  # ray package will be installed under ~/.local/bin. If the user's PATH does
198
192
  # not include ~/.local/bin (the pip install will have the output: `WARNING:
@@ -208,10 +202,10 @@ RAY_INSTALLATION_COMMANDS = (
208
202
  f'which ray > {SKY_RAY_PATH_FILE} || exit 1; }}; ')
209
203
 
210
204
  SKYPILOT_WHEEL_INSTALLATION_COMMANDS = (
211
- f'{{ {SKY_UV_PIP_CMD} list | grep "skypilot " && '
205
+ f'{{ {SKY_PIP_CMD} list | grep "skypilot " && '
212
206
  '[ "$(cat ~/.sky/wheels/current_sky_wheel_hash)" == "{sky_wheel_hash}" ]; } || ' # pylint: disable=line-too-long
213
- f'{{ {SKY_UV_PIP_CMD} uninstall skypilot; '
214
- f'{SKY_UV_PIP_CMD} install "$(echo ~/.sky/wheels/{{sky_wheel_hash}}/'
207
+ f'{{ {SKY_PIP_CMD} uninstall skypilot -y; '
208
+ f'{SKY_PIP_CMD} install "$(echo ~/.sky/wheels/{{sky_wheel_hash}}/'
215
209
  f'skypilot-{_sky_version}*.whl)[{{cloud}}, remote]" && '
216
210
  'echo "{sky_wheel_hash}" > ~/.sky/wheels/current_sky_wheel_hash || '
217
211
  'exit 1; }; ')
@@ -226,7 +220,7 @@ RAY_SKYPILOT_INSTALLATION_COMMANDS = (
226
220
  # The ray installation above can be skipped due to the existing ray cluster
227
221
  # for backward compatibility. In this case, we should not patch the ray
228
222
  # files.
229
- f'{SKY_UV_PIP_CMD} list | grep "ray " | '
223
+ f'{SKY_PIP_CMD} list | grep "ray " | '
230
224
  f'grep {SKY_REMOTE_RAY_VERSION} 2>&1 > /dev/null && '
231
225
  f'{{ {SKY_PYTHON_CMD} -c '
232
226
  '"from sky.skylet.ray_patches import patch; patch()" || exit 1; }; ')
@@ -327,6 +327,13 @@ available_node_types:
327
327
  command: ["/bin/bash", "-c", "--"]
328
328
  args:
329
329
  - |
330
+ # For backwards compatibility, we put a marker file in the pod
331
+ # to indicate that the pod is running with the changes introduced
332
+ # in project nimbus: https://github.com/skypilot-org/skypilot/pull/4393
333
+ # TODO: Remove this marker file and it's usage in setup_commands
334
+ # after v0.10.0 release.
335
+ touch /tmp/skypilot_is_nimbus
336
+
330
337
  # Helper function to conditionally use sudo
331
338
  # TODO(zhwu): consolidate the two prefix_cmd and sudo replacements
332
339
  prefix_cmd() { if [ $(id -u) -ne 0 ]; then echo "sudo"; else echo ""; fi; }
@@ -403,7 +410,7 @@ available_node_types:
403
410
  done
404
411
  {{ conda_installation_commands }}
405
412
  {{ ray_installation_commands }}
406
- VIRTUAL_ENV=~/skypilot-runtime ~/.local/bin/uv pip install skypilot[kubernetes,remote]
413
+ ~/skypilot-runtime/bin/python -m pip install skypilot[kubernetes,remote]
407
414
  touch /tmp/ray_skypilot_installation_complete
408
415
  echo "=== Ray and skypilot installation completed ==="
409
416
 
@@ -575,9 +582,12 @@ setup_commands:
575
582
  STEPS=("apt-ssh-setup" "runtime-setup" "env-setup")
576
583
  start_epoch=$(date +%s);
577
584
  echo "=== Logs for asynchronous ray and skypilot installation ===";
578
- [ -f /tmp/ray_skypilot_installation_complete ] && cat /tmp/${STEPS[1]}.log ||
579
- { tail -f -n +1 /tmp/${STEPS[1]}.log & TAIL_PID=$!; echo "Tail PID: $TAIL_PID"; until [ -f /tmp/ray_skypilot_installation_complete ]; do sleep 0.5; done; kill $TAIL_PID || true; };
580
- [ -f /tmp/${STEPS[1]}.failed ] && { echo "Error: ${STEPS[1]} failed. Exiting."; exit 1; } || true;
585
+ if [ -f /tmp/skypilot_is_nimbus ]; then
586
+ echo "=== Logs for asynchronous ray and skypilot installation ===";
587
+ [ -f /tmp/ray_skypilot_installation_complete ] && cat /tmp/${STEPS[1]}.log ||
588
+ { tail -f -n +1 /tmp/${STEPS[1]}.log & TAIL_PID=$!; echo "Tail PID: $TAIL_PID"; until [ -f /tmp/ray_skypilot_installation_complete ]; do sleep 0.5; done; kill $TAIL_PID || true; };
589
+ [ -f /tmp/${STEPS[1]}.failed ] && { echo "Error: ${STEPS[1]} failed. Exiting."; exit 1; } || true;
590
+ fi
581
591
  end_epoch=$(date +%s);
582
592
  echo "=== Ray and skypilot dependencies installation completed in $(($end_epoch - $start_epoch)) secs ===";
583
593
  start_epoch=$(date +%s);
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: skypilot-nightly
3
- Version: 1.0.0.dev20241122
3
+ Version: 1.0.0.dev20241124
4
4
  Summary: SkyPilot: An intercloud broker for the clouds
5
5
  Author: SkyPilot Team
6
6
  License: Apache 2.0
@@ -1,4 +1,4 @@
1
- sky/__init__.py,sha256=9rkn0Uy1cjIXtImEc_jmOOF1EEB5YgeBWSYeUlDzDmQ,5882
1
+ sky/__init__.py,sha256=gSpB4bqIgwDeXSZzO0gyRjKn3ALUrIUX0wpZ0-dmVU8,5882
2
2
  sky/admin_policy.py,sha256=hPo02f_A32gCqhUueF0QYy1fMSSKqRwYEg_9FxScN_s,3248
3
3
  sky/authentication.py,sha256=pAdCT60OxxiXI9KXDyP2lQ9u9vMc6aMtq5Xi2h_hbdw,20984
4
4
  sky/check.py,sha256=D3Y3saIFAYVvPxuBHnVgJEO0fUVDxgjwuMBaO-D778k,9472
@@ -65,7 +65,7 @@ sky/clouds/service_catalog/cudo_catalog.py,sha256=V_takvL6dWTGQaTLCEvjKIotCDPnMu
65
65
  sky/clouds/service_catalog/fluidstack_catalog.py,sha256=21-cvrYEYTIi7n3ZNF2e7_0QX-PF4BkhlVJUWQOvKrY,5059
66
66
  sky/clouds/service_catalog/gcp_catalog.py,sha256=v_5fsB3dB9oD8U7lBKnCe5ii6AUWEOiQjNarMnU_qLA,24379
67
67
  sky/clouds/service_catalog/ibm_catalog.py,sha256=1iK0KvbI82U7sySb7chr-qm_16x3tTnZ6nIo7o76ouc,4493
68
- sky/clouds/service_catalog/kubernetes_catalog.py,sha256=2M4GyNi2XJq7LOgyr7Da1ncEoMRkezEzHJx4e9veKo0,11086
68
+ sky/clouds/service_catalog/kubernetes_catalog.py,sha256=4MsPXyzpwncwiBmndnbYAMpf2yAP2xINeurM6AaVV2k,12335
69
69
  sky/clouds/service_catalog/lambda_catalog.py,sha256=2R-ccu63BbdvO6X80MtxiniA-jLewXb6I0Ye1rYD9fY,5302
70
70
  sky/clouds/service_catalog/oci_catalog.py,sha256=cyA6ZqwHGOKuPxUl_dKmFGdeWdQGMrvl_-o2MtyF998,8580
71
71
  sky/clouds/service_catalog/paperspace_catalog.py,sha256=MOlfoGRChjEwMzu4nRAho8DrIwwUJ3QlRzrMA1RLqvE,3789
@@ -194,7 +194,7 @@ sky/skylet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
194
194
  sky/skylet/attempt_skylet.py,sha256=GZ6ITjjA0m-da3IxXXfoHR6n4pjp3X3TOXUqVvSrV0k,2136
195
195
  sky/skylet/autostop_lib.py,sha256=JPDHmByuhoNYXSUHl-OnyeJUkOFWn7gDM1FrS7Kr3E8,4478
196
196
  sky/skylet/configs.py,sha256=UtnpmEL0F9hH6PSjhsps7xgjGZ6qzPOfW1p2yj9tSng,1887
197
- sky/skylet/constants.py,sha256=MtE7Tj3m2Fn_IMxifyxOxIT3KTM6tanszqNnU_tlop8,14872
197
+ sky/skylet/constants.py,sha256=2zCJpJAZMsqBUMeNtarJYe5768hiAC4EXJti0ENt24A,14539
198
198
  sky/skylet/events.py,sha256=A09E7LmmwzcGrSG0n8K7d3EZ1ZJr1mmmzoGyhnArYJA,12303
199
199
  sky/skylet/job_lib.py,sha256=Lfk3h-NLoi9mLo5-BPur43fUHVKMpa2hR5wEOCZGsB4,43846
200
200
  sky/skylet/log_lib.py,sha256=tFJXRb-DClFhUh6wQ45cSBNtBkdOZCGlVfwDnqKFRgE,20394
@@ -228,7 +228,7 @@ sky/templates/jobs-controller.yaml.j2,sha256=Gu3ogFxFYr09VEXP-6zEbrCUOFo1aYxWEjA
228
228
  sky/templates/kubernetes-ingress.yml.j2,sha256=73iDklVDWBMbItg0IexCa6_ClXPJOxw7PWz3leku4nE,1340
229
229
  sky/templates/kubernetes-loadbalancer.yml.j2,sha256=IxrNYM366N01bbkJEbZ_UPYxUP8wyVEbRNFHRsBuLsw,626
230
230
  sky/templates/kubernetes-port-forward-proxy-command.sh,sha256=HlG7CPBBedCVBlL9qv0erW_eKm6Irj0LFyaAWuJW_lc,3148
231
- sky/templates/kubernetes-ray.yml.j2,sha256=uymIxWyu7yHOL_G2XJZp0EiqHYtgbIJe4fZPXU6F1gc,28017
231
+ sky/templates/kubernetes-ray.yml.j2,sha256=dQrNwyOAm46To7GA4s8oHftBnWIOOeRJXTHfhG7lgHo,28555
232
232
  sky/templates/kubernetes-ssh-jump.yml.j2,sha256=k5W5sOIMppU7dDkJMwPlqsUcb92y7L5_TVG3hkgMy8M,2747
233
233
  sky/templates/lambda-ray.yml.j2,sha256=HyvO_tX2vxwSsc4IFVSqGuIbjLMk0bevP9bcxb8ZQII,4498
234
234
  sky/templates/local-ray.yml.j2,sha256=FNHeyHF6nW9nU9QLIZceUWfvrFTTcO51KqhTnYCEFaA,1185
@@ -275,9 +275,9 @@ sky/utils/kubernetes/k8s_gpu_labeler_job.yaml,sha256=k0TBoQ4zgf79-sVkixKSGYFHQ7Z
275
275
  sky/utils/kubernetes/k8s_gpu_labeler_setup.yaml,sha256=VLKT2KKimZu1GDg_4AIlIt488oMQvhRZWwsj9vBbPUg,3812
276
276
  sky/utils/kubernetes/rsync_helper.sh,sha256=hyYDaYSNxYaNvzUQBzC8AidB7nDeojizjkzc_CTxycY,1077
277
277
  sky/utils/kubernetes/ssh_jump_lifecycle_manager.py,sha256=RFLJ3k7MR5UN4SKHykQ0lV9SgXumoULpKYIAt1vh-HU,6560
278
- skypilot_nightly-1.0.0.dev20241122.dist-info/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
279
- skypilot_nightly-1.0.0.dev20241122.dist-info/METADATA,sha256=zxomzD3shH_UFn3jG4yVym0RY1iIAqt0-9CYfrJauhU,20222
280
- skypilot_nightly-1.0.0.dev20241122.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
281
- skypilot_nightly-1.0.0.dev20241122.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
282
- skypilot_nightly-1.0.0.dev20241122.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
283
- skypilot_nightly-1.0.0.dev20241122.dist-info/RECORD,,
278
+ skypilot_nightly-1.0.0.dev20241124.dist-info/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
279
+ skypilot_nightly-1.0.0.dev20241124.dist-info/METADATA,sha256=tozaR63Pdm3PXACP_UuuNZKxZXFfxVq0T9eR1-G1YZI,20222
280
+ skypilot_nightly-1.0.0.dev20241124.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
281
+ skypilot_nightly-1.0.0.dev20241124.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
282
+ skypilot_nightly-1.0.0.dev20241124.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
283
+ skypilot_nightly-1.0.0.dev20241124.dist-info/RECORD,,