skypilot-nightly 1.0.0.dev20250603__py3-none-any.whl → 1.0.0.dev20250605__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.
Files changed (142) hide show
  1. sky/__init__.py +3 -3
  2. sky/adaptors/kubernetes.py +8 -0
  3. sky/admin_policy.py +5 -0
  4. sky/backends/backend_utils.py +1 -0
  5. sky/backends/cloud_vm_ray_backend.py +8 -4
  6. sky/{clouds/service_catalog → catalog}/__init__.py +6 -17
  7. sky/{clouds/service_catalog → catalog}/aws_catalog.py +3 -3
  8. sky/{clouds/service_catalog → catalog}/azure_catalog.py +2 -2
  9. sky/{clouds/service_catalog → catalog}/common.py +2 -2
  10. sky/{clouds/service_catalog → catalog}/cudo_catalog.py +1 -1
  11. sky/{clouds/service_catalog → catalog}/data_fetchers/analyze.py +1 -1
  12. sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_aws.py +1 -1
  13. sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_vsphere.py +1 -1
  14. sky/{clouds/service_catalog → catalog}/do_catalog.py +1 -1
  15. sky/{clouds/service_catalog → catalog}/fluidstack_catalog.py +1 -1
  16. sky/{clouds/service_catalog → catalog}/gcp_catalog.py +2 -2
  17. sky/{clouds/service_catalog → catalog}/ibm_catalog.py +1 -1
  18. sky/{clouds/service_catalog → catalog}/kubernetes_catalog.py +2 -2
  19. sky/{clouds/service_catalog → catalog}/lambda_catalog.py +1 -1
  20. sky/{clouds/service_catalog → catalog}/nebius_catalog.py +1 -1
  21. sky/{clouds/service_catalog → catalog}/oci_catalog.py +1 -1
  22. sky/{clouds/service_catalog → catalog}/paperspace_catalog.py +1 -1
  23. sky/{clouds/service_catalog → catalog}/runpod_catalog.py +1 -1
  24. sky/{clouds/service_catalog → catalog}/scp_catalog.py +1 -1
  25. sky/{clouds/service_catalog → catalog}/ssh_catalog.py +3 -3
  26. sky/{clouds/service_catalog → catalog}/vast_catalog.py +1 -1
  27. sky/{clouds/service_catalog → catalog}/vsphere_catalog.py +1 -1
  28. sky/cli.py +16 -13
  29. sky/client/cli.py +16 -13
  30. sky/client/sdk.py +30 -12
  31. sky/clouds/aws.py +41 -40
  32. sky/clouds/azure.py +31 -34
  33. sky/clouds/cloud.py +8 -8
  34. sky/clouds/cudo.py +26 -26
  35. sky/clouds/do.py +24 -24
  36. sky/clouds/fluidstack.py +27 -29
  37. sky/clouds/gcp.py +42 -42
  38. sky/clouds/ibm.py +26 -26
  39. sky/clouds/kubernetes.py +24 -12
  40. sky/clouds/lambda_cloud.py +28 -30
  41. sky/clouds/nebius.py +26 -28
  42. sky/clouds/oci.py +32 -32
  43. sky/clouds/paperspace.py +24 -26
  44. sky/clouds/runpod.py +26 -28
  45. sky/clouds/scp.py +37 -36
  46. sky/clouds/utils/gcp_utils.py +3 -2
  47. sky/clouds/vast.py +27 -27
  48. sky/clouds/vsphere.py +12 -15
  49. sky/core.py +2 -2
  50. sky/dashboard/out/404.html +1 -1
  51. sky/dashboard/out/_next/static/chunks/614-635a84e87800f99e.js +66 -0
  52. sky/dashboard/out/_next/static/chunks/{856-f1b1f7f47edde2e8.js → 856-3a32da4b84176f6d.js} +1 -1
  53. sky/dashboard/out/_next/static/chunks/937.3759f538f11a0953.js +1 -0
  54. sky/dashboard/out/_next/static/chunks/pages/config-1a1eeb949dab8897.js +6 -0
  55. sky/dashboard/out/_next/static/chunks/pages/users-262aab38b9baaf3a.js +16 -0
  56. sky/dashboard/out/_next/static/chunks/pages/workspaces-384ea5fa0cea8f28.js +1 -0
  57. sky/dashboard/out/_next/static/chunks/{webpack-f27c9a32aa3d9c6d.js → webpack-65d465f948974c0d.js} +1 -1
  58. sky/dashboard/out/_next/static/css/667d941a2888ce6e.css +3 -0
  59. sky/dashboard/out/_next/static/qjhIe-yC6nHcLKBqpzO1M/_buildManifest.js +1 -0
  60. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  61. sky/dashboard/out/clusters/[cluster].html +1 -1
  62. sky/dashboard/out/clusters.html +1 -1
  63. sky/dashboard/out/config.html +1 -1
  64. sky/dashboard/out/index.html +1 -1
  65. sky/dashboard/out/infra/[context].html +1 -1
  66. sky/dashboard/out/infra.html +1 -1
  67. sky/dashboard/out/jobs/[job].html +1 -1
  68. sky/dashboard/out/jobs.html +1 -1
  69. sky/dashboard/out/users.html +1 -1
  70. sky/dashboard/out/workspace/new.html +1 -1
  71. sky/dashboard/out/workspaces/[name].html +1 -1
  72. sky/dashboard/out/workspaces.html +1 -1
  73. sky/data/storage_utils.py +5 -2
  74. sky/execution.py +44 -46
  75. sky/global_user_state.py +119 -86
  76. sky/jobs/client/sdk.py +4 -1
  77. sky/jobs/server/core.py +6 -2
  78. sky/models.py +1 -0
  79. sky/optimizer.py +1 -1
  80. sky/provision/cudo/cudo_machine_type.py +1 -1
  81. sky/provision/kubernetes/utils.py +35 -22
  82. sky/provision/vast/utils.py +1 -1
  83. sky/provision/vsphere/common/vim_utils.py +1 -2
  84. sky/provision/vsphere/instance.py +1 -1
  85. sky/provision/vsphere/vsphere_utils.py +7 -11
  86. sky/resources.py +24 -3
  87. sky/serve/server/core.py +1 -1
  88. sky/server/constants.py +3 -1
  89. sky/server/requests/executor.py +4 -1
  90. sky/server/requests/payloads.py +25 -0
  91. sky/server/requests/serializers/decoders.py +1 -1
  92. sky/server/server.py +33 -12
  93. sky/server/stream_utils.py +2 -38
  94. sky/setup_files/MANIFEST.in +1 -0
  95. sky/setup_files/dependencies.py +2 -0
  96. sky/skylet/constants.py +10 -4
  97. sky/skypilot_config.py +92 -39
  98. sky/templates/websocket_proxy.py +11 -1
  99. sky/usage/usage_lib.py +4 -3
  100. sky/users/__init__.py +0 -0
  101. sky/users/model.conf +15 -0
  102. sky/users/permission.py +178 -0
  103. sky/users/rbac.py +86 -0
  104. sky/users/server.py +66 -0
  105. sky/utils/accelerator_registry.py +3 -3
  106. sky/utils/kubernetes/deploy_remote_cluster.py +2 -1
  107. sky/utils/schemas.py +20 -10
  108. sky/workspaces/core.py +2 -2
  109. {skypilot_nightly-1.0.0.dev20250603.dist-info → skypilot_nightly-1.0.0.dev20250605.dist-info}/METADATA +3 -1
  110. {skypilot_nightly-1.0.0.dev20250603.dist-info → skypilot_nightly-1.0.0.dev20250605.dist-info}/RECORD +134 -130
  111. sky/clouds/service_catalog/constants.py +0 -8
  112. sky/dashboard/out/_next/static/chunks/614-3d29f98e0634b179.js +0 -66
  113. sky/dashboard/out/_next/static/chunks/937.f97f83652028e944.js +0 -1
  114. sky/dashboard/out/_next/static/chunks/pages/config-35383adcb0edb5e2.js +0 -6
  115. sky/dashboard/out/_next/static/chunks/pages/users-07b523ccb19317ad.js +0 -6
  116. sky/dashboard/out/_next/static/chunks/pages/workspaces-f54921ec9eb20965.js +0 -1
  117. sky/dashboard/out/_next/static/css/63d3995d8b528eb1.css +0 -3
  118. sky/dashboard/out/_next/static/zTAFq_Iv6_yxQj3fXvJWR/_buildManifest.js +0 -1
  119. /sky/{clouds/service_catalog → catalog}/config.py +0 -0
  120. /sky/{clouds/service_catalog → catalog}/data_fetchers/__init__.py +0 -0
  121. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_azure.py +0 -0
  122. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_cudo.py +0 -0
  123. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_fluidstack.py +0 -0
  124. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_gcp.py +0 -0
  125. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_ibm.py +0 -0
  126. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_lambda_cloud.py +0 -0
  127. /sky/{clouds/service_catalog → catalog}/data_fetchers/fetch_vast.py +0 -0
  128. /sky/dashboard/out/_next/static/chunks/{121-8f55ee3fa6301784.js → 121-865d2bf8a3b84c6a.js} +0 -0
  129. /sky/dashboard/out/_next/static/chunks/{236-fef38aa6e5639300.js → 236-4c0dc6f63ccc6319.js} +0 -0
  130. /sky/dashboard/out/_next/static/chunks/{37-947904ccc5687bac.js → 37-beedd583fea84cc8.js} +0 -0
  131. /sky/dashboard/out/_next/static/chunks/{682-2be9b0f169727f2f.js → 682-6647f0417d5662f0.js} +0 -0
  132. /sky/dashboard/out/_next/static/chunks/{843-a097338acb89b7d7.js → 843-c296541442d4af88.js} +0 -0
  133. /sky/dashboard/out/_next/static/chunks/{969-d7b6fb7f602bfcb3.js → 969-c7abda31c10440ac.js} +0 -0
  134. /sky/dashboard/out/_next/static/chunks/pages/{_app-67925f5e6382e22f.js → _app-cb81dc4d27f4d009.js} +0 -0
  135. /sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/{[job]-158b70da336d8607.js → [job]-65d04d5d77cbb6b6.js} +0 -0
  136. /sky/dashboard/out/_next/static/chunks/pages/clusters/{[cluster]-62c9982dc3675725.js → [cluster]-beabbcd7606c1a23.js} +0 -0
  137. /sky/dashboard/out/_next/static/chunks/pages/jobs/{[job]-a62a3c65dc9bc57c.js → [job]-86c47edc500f15f9.js} +0 -0
  138. /sky/dashboard/out/_next/static/{zTAFq_Iv6_yxQj3fXvJWR → qjhIe-yC6nHcLKBqpzO1M}/_ssgManifest.js +0 -0
  139. {skypilot_nightly-1.0.0.dev20250603.dist-info → skypilot_nightly-1.0.0.dev20250605.dist-info}/WHEEL +0 -0
  140. {skypilot_nightly-1.0.0.dev20250603.dist-info → skypilot_nightly-1.0.0.dev20250605.dist-info}/entry_points.txt +0 -0
  141. {skypilot_nightly-1.0.0.dev20250603.dist-info → skypilot_nightly-1.0.0.dev20250605.dist-info}/licenses/LICENSE +0 -0
  142. {skypilot_nightly-1.0.0.dev20250603.dist-info → skypilot_nightly-1.0.0.dev20250605.dist-info}/top_level.txt +0 -0
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 = 'c571c1f931047cf26b3522d34b0fe1cc06749f3b'
8
+ _SKYPILOT_COMMIT_SHA = '5042bb8db4809907ebb3271f1abdb96ab3ffffb1'
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.dev20250603'
38
+ __version__ = '1.0.0.dev20250605'
39
39
  __root_dir__ = os.path.dirname(os.path.abspath(__file__))
40
40
 
41
41
 
@@ -86,6 +86,7 @@ from sky import clouds
86
86
  from sky.admin_policy import AdminPolicy
87
87
  from sky.admin_policy import MutatedUserRequest
88
88
  from sky.admin_policy import UserRequest
89
+ from sky.catalog import list_accelerators
89
90
  from sky.client.sdk import api_cancel
90
91
  from sky.client.sdk import api_info
91
92
  from sky.client.sdk import api_server_logs
@@ -110,7 +111,6 @@ from sky.client.sdk import storage_delete
110
111
  from sky.client.sdk import storage_ls
111
112
  from sky.client.sdk import stream_and_get
112
113
  from sky.client.sdk import tail_logs
113
- from sky.clouds.service_catalog import list_accelerators
114
114
  from sky.dag import Dag
115
115
  from sky.data import Storage
116
116
  from sky.data import StorageMode
@@ -1,6 +1,7 @@
1
1
  """Kubernetes adaptors"""
2
2
  import logging
3
3
  import os
4
+ import platform
4
5
  from typing import Any, Callable, Optional, Set
5
6
 
6
7
  from sky import sky_logging
@@ -19,6 +20,13 @@ urllib3 = common.LazyImport('urllib3',
19
20
  # Timeout to use for API calls
20
21
  API_TIMEOUT = 5
21
22
 
23
+ # Check if KUBECONFIG is set, and use it if it is.
24
+ DEFAULT_KUBECONFIG_PATH = '~/.kube/config'
25
+ # From kubernetes package, keep a copy here to avoid actually importing
26
+ # kubernetes package when parsing the KUBECONFIG env var to do credential
27
+ # file mounts.
28
+ ENV_KUBECONFIG_PATH_SEPARATOR = ';' if platform.system() == 'Windows' else ':'
29
+
22
30
  DEFAULT_IN_CLUSTER_REGION = 'in-cluster'
23
31
  # The name for the environment variable that stores the in-cluster context name
24
32
  # for Kubernetes clusters. This is used to associate a name with the current
sky/admin_policy.py CHANGED
@@ -21,6 +21,11 @@ class RequestOptions:
21
21
  dryrun: Is the request a dryrun?
22
22
  """
23
23
  cluster_name: Optional[str]
24
+ # Keep these two fields for backward compatibility. The values are copied
25
+ # from task.resources.autostop_config, so that legacy admin policy plugins
26
+ # can still read the correct autostop config from request options before
27
+ # we drop the compatibility.
28
+ # TODO(aylei): remove these fields after 0.12.0
24
29
  idle_minutes_to_autostop: Optional[int]
25
30
  down: bool
26
31
  dryrun: bool
@@ -2836,6 +2836,7 @@ def get_task_resources_str(task: 'task_lib.Task',
2836
2836
  if is_managed_job:
2837
2837
  if task.best_resources.use_spot:
2838
2838
  spot_str = '[Spot]'
2839
+ assert task.best_resources.cpus is not None
2839
2840
  task_cpu_demand = task.best_resources.cpus
2840
2841
  if accelerator_dict is None:
2841
2842
  resources_str = f'CPU:{task_cpu_demand}'
@@ -24,6 +24,7 @@ import filelock
24
24
 
25
25
  import sky
26
26
  from sky import backends
27
+ from sky import catalog
27
28
  from sky import check as sky_check
28
29
  from sky import cloud_stores
29
30
  from sky import clouds
@@ -39,7 +40,6 @@ from sky import task as task_lib
39
40
  from sky.backends import backend_utils
40
41
  from sky.backends import wheel_utils
41
42
  from sky.clouds import cloud as sky_cloud
42
- from sky.clouds import service_catalog
43
43
  from sky.clouds.utils import gcp_utils
44
44
  from sky.data import data_utils
45
45
  from sky.data import storage as storage_lib
@@ -699,6 +699,10 @@ class RayCodeGen:
699
699
  # 139 is the return code of SIGSEGV, i.e. Segmentation Fault.
700
700
  if any(r == 139 for r in returncodes):
701
701
  reason = '(likely due to Segmentation Fault)'
702
+ if any(r == 137 for r in returncodes):
703
+ # Find the first non-137 return code
704
+ non_137 = next(r for r in returncodes if r != 137)
705
+ reason = f'(A Worker failed with return code {{non_137}}, SkyPilot cleaned up the processes on other nodes with return code 137)'
702
706
  print('ERROR: {colorama.Fore.RED}Job {self.job_id} failed with '
703
707
  'return code list:{colorama.Style.RESET_ALL}',
704
708
  returncodes,
@@ -803,7 +807,7 @@ class FailoverCloudErrorHandlerV1:
803
807
  # Sometimes, SCPError will list available regions.
804
808
  for e in errors:
805
809
  if e.find('Regions with capacity available:') != -1:
806
- for r in service_catalog.regions('scp'):
810
+ for r in catalog.regions('scp'):
807
811
  if e.find(r.name) == -1:
808
812
  _add_to_blocked_resources(
809
813
  blocked_resources,
@@ -1088,7 +1092,7 @@ class FailoverCloudErrorHandlerV2:
1088
1092
  output = str(error)
1089
1093
  # Sometimes, lambda cloud error will list available regions.
1090
1094
  if output.find('Regions with capacity available:') != -1:
1091
- for r in service_catalog.regions('lambda'):
1095
+ for r in catalog.regions('lambda'):
1092
1096
  if output.find(r.name) == -1:
1093
1097
  _add_to_blocked_resources(
1094
1098
  blocked_resources,
@@ -2696,7 +2700,7 @@ class CloudVmRayBackend(backends.Backend['CloudVmRayResourceHandle']):
2696
2700
  NAME = 'cloudvmray'
2697
2701
 
2698
2702
  # Backward compatibility, with the old name of the handle.
2699
- ResourceHandle = CloudVmRayResourceHandle # pylint: disable=invalid-name
2703
+ ResourceHandle = CloudVmRayResourceHandle # type: ignore
2700
2704
 
2701
2705
  def __init__(self):
2702
2706
  self.run_timestamp = sky_logging.get_run_timestamp()
@@ -4,26 +4,21 @@ import importlib
4
4
  import typing
5
5
  from typing import Dict, List, Optional, Set, Tuple, Union
6
6
 
7
- from sky.clouds.service_catalog.config import fallback_to_default_catalog
8
- from sky.clouds.service_catalog.constants import ALL_CLOUDS
9
- from sky.clouds.service_catalog.constants import CATALOG_DIR
10
- from sky.clouds.service_catalog.constants import CATALOG_SCHEMA_VERSION
11
- from sky.clouds.service_catalog.constants import HOSTED_CATALOG_DIR_URL
12
- from sky.clouds.service_catalog.constants import (
13
- HOSTED_CATALOG_DIR_URL_S3_MIRROR)
7
+ from sky.catalog.config import fallback_to_default_catalog
8
+ from sky.skylet import constants
14
9
  from sky.utils import resources_utils
15
10
  from sky.utils import subprocess_utils
16
11
 
17
12
  if typing.TYPE_CHECKING:
13
+ from sky.catalog import common
18
14
  from sky.clouds import cloud
19
- from sky.clouds.service_catalog import common
20
15
 
21
16
  CloudFilter = Optional[Union[List[str], str]]
22
17
 
23
18
 
24
19
  def _map_clouds_catalog(clouds: CloudFilter, method_name: str, *args, **kwargs):
25
20
  if clouds is None:
26
- clouds = list(ALL_CLOUDS)
21
+ clouds = list(constants.ALL_CLOUDS)
27
22
 
28
23
  # TODO(hemil): Remove this once the common service catalog
29
24
  # functions are refactored from clouds/kubernetes.py to
@@ -37,10 +32,10 @@ def _map_clouds_catalog(clouds: CloudFilter, method_name: str, *args, **kwargs):
37
32
  def _execute_catalog_method(cloud: str):
38
33
  try:
39
34
  cloud_module = importlib.import_module(
40
- f'sky.clouds.service_catalog.{cloud.lower()}_catalog')
35
+ f'sky.catalog.{cloud.lower()}_catalog')
41
36
  except ModuleNotFoundError:
42
37
  raise ValueError(
43
- 'Cannot find module "sky.clouds.service_catalog'
38
+ 'Cannot find module "sky.catalog'
44
39
  f'.{cloud}_catalog" for cloud "{cloud}".') from None
45
40
  try:
46
41
  method = getattr(cloud_module, method_name)
@@ -382,10 +377,4 @@ __all__ = [
382
377
  'is_image_tag_valid',
383
378
  # Configuration
384
379
  'fallback_to_default_catalog',
385
- # Constants
386
- 'ALL_CLOUDS',
387
- 'HOSTED_CATALOG_DIR_URL',
388
- 'HOSTED_CATALOG_DIR_URL_S3_MIRROR',
389
- 'CATALOG_SCHEMA_VERSION',
390
- 'CATALOG_DIR',
391
380
  ]
@@ -13,10 +13,10 @@ from typing import Dict, List, Optional, Tuple, Union
13
13
  from sky import exceptions
14
14
  from sky import sky_logging
15
15
  from sky.adaptors import common as adaptors_common
16
+ from sky.catalog import common
17
+ from sky.catalog import config
18
+ from sky.catalog.data_fetchers import fetch_aws
16
19
  from sky.clouds import aws
17
- from sky.clouds.service_catalog import common
18
- from sky.clouds.service_catalog import config
19
- from sky.clouds.service_catalog.data_fetchers import fetch_aws
20
20
  from sky.utils import common_utils
21
21
  from sky.utils import resources_utils
22
22
  from sky.utils import rich_utils
@@ -8,8 +8,8 @@ from typing import Dict, List, Optional, Tuple, Union
8
8
 
9
9
  from sky import clouds as cloud_lib
10
10
  from sky import sky_logging
11
+ from sky.catalog import common
11
12
  from sky.clouds import Azure
12
- from sky.clouds.service_catalog import common
13
13
  from sky.utils import resources_utils
14
14
  from sky.utils import ux_utils
15
15
 
@@ -17,7 +17,7 @@ logger = sky_logging.init_logger(__name__)
17
17
 
18
18
  # This list should match the list of regions in
19
19
  # skypilot image generation Packer script's replication_regions
20
- # sky/clouds/service_catalog/images/skypilot-azure-cpu-ubuntu.pkr.hcl
20
+ # sky/clouds/catalog/images/skypilot-azure-cpu-ubuntu.pkr.hcl
21
21
  COMMUNITY_IMAGE_AVAILABLE_REGIONS = {
22
22
  'centralus',
23
23
  'eastus',
@@ -12,7 +12,7 @@ import filelock
12
12
  from sky import sky_logging
13
13
  from sky.adaptors import common as adaptors_common
14
14
  from sky.clouds import cloud as cloud_lib
15
- from sky.clouds.service_catalog import constants
15
+ from sky.skylet import constants
16
16
  from sky.utils import common_utils
17
17
  from sky.utils import registry
18
18
  from sky.utils import rich_utils
@@ -344,7 +344,7 @@ def get_hourly_cost_impl(
344
344
  ) -> float:
345
345
  """Returns the hourly price of a VM instance in the given region and zone.
346
346
 
347
- Refer to get_hourly_cost in service_catalog/__init__.py for the docstring.
347
+ Refer to get_hourly_cost in catalog/__init__.py for the docstring.
348
348
  """
349
349
  df = _get_instance_type(df, instance_type, region, zone)
350
350
  if df.empty:
@@ -3,7 +3,7 @@
3
3
  import typing
4
4
  from typing import Dict, List, Optional, Tuple, Union
5
5
 
6
- from sky.clouds.service_catalog import common
6
+ from sky.catalog import common
7
7
  import sky.provision.cudo.cudo_machine_type as cudo_mt
8
8
  from sky.utils import ux_utils
9
9
 
@@ -3,7 +3,7 @@ import typing
3
3
  from typing import List
4
4
 
5
5
  from sky.adaptors import common as adaptors_common
6
- from sky.clouds.service_catalog import common
6
+ from sky.catalog import common
7
7
 
8
8
  if typing.TYPE_CHECKING:
9
9
  import pandas as pd
@@ -546,7 +546,7 @@ if __name__ == '__main__':
546
546
  print('AWS Service Catalog saved to aws/vms.csv')
547
547
 
548
548
  # Disable refreshing images.csv as we are using skypilot custom AMIs
549
- # See sky/clouds/service_catalog/images/README.md for more details.
549
+ # See sky/clouds/catalog/images/README.md for more details.
550
550
  # image_df = get_all_regions_images_df(user_regions)
551
551
  # _check_regions_integrity(image_df, 'images')
552
552
 
@@ -6,7 +6,7 @@ import typing
6
6
 
7
7
  from sky.adaptors import common as adaptors_common
8
8
  from sky.adaptors import vsphere as vsphere_adaptor
9
- from sky.clouds.service_catalog.common import get_catalog_path
9
+ from sky.catalog.common import get_catalog_path
10
10
  from sky.provision.vsphere.common.cls_api_client import ClsApiClient
11
11
 
12
12
  if typing.TYPE_CHECKING:
@@ -7,7 +7,7 @@ query instance types and pricing information for digital ocean.
7
7
  import typing
8
8
  from typing import Dict, List, Optional, Tuple, Union
9
9
 
10
- from sky.clouds.service_catalog import common
10
+ from sky.catalog import common
11
11
  from sky.utils import ux_utils
12
12
 
13
13
  if typing.TYPE_CHECKING:
@@ -6,7 +6,7 @@ instance types and pricing information for FluidStack.
6
6
  import typing
7
7
  from typing import Dict, List, Optional, Tuple, Union
8
8
 
9
- from sky.clouds.service_catalog import common
9
+ from sky.catalog import common
10
10
  from sky.utils import ux_utils
11
11
 
12
12
  if typing.TYPE_CHECKING:
@@ -9,8 +9,8 @@ from typing import Dict, List, Optional, Tuple
9
9
  from sky import exceptions
10
10
  from sky import sky_logging
11
11
  from sky.adaptors import common as adaptors_common
12
+ from sky.catalog import common
12
13
  from sky.clouds import GCP
13
- from sky.clouds.service_catalog import common
14
14
  from sky.utils import resources_utils
15
15
  from sky.utils import ux_utils
16
16
 
@@ -125,7 +125,7 @@ GCP_ACC_INSTANCE_TYPES = list(_INSTANCE_TYPE_TO_ACC.keys())
125
125
 
126
126
  # Number of CPU cores per GPU based on the AWS setting.
127
127
  # GCP A100 has its own instance type mapping.
128
- # Refer to sky/clouds/service_catalog/gcp_catalog.py
128
+ # Refer to sky/clouds/catalog/gcp_catalog.py
129
129
  _NUM_ACC_TO_NUM_CPU = {
130
130
  # Based on p2 on AWS.
131
131
  'K80': {
@@ -8,8 +8,8 @@ from typing import Dict, List, Optional, Tuple, Union
8
8
 
9
9
  from sky import sky_logging
10
10
  from sky.adaptors import ibm
11
+ from sky.catalog import common
11
12
  from sky.clouds import cloud
12
- from sky.clouds.service_catalog import common
13
13
  from sky.utils import resources_utils
14
14
 
15
15
  logger = sky_logging.init_logger(__name__)
@@ -12,9 +12,9 @@ from sky import clouds as sky_clouds
12
12
  from sky import sky_logging
13
13
  from sky.adaptors import common as adaptors_common
14
14
  from sky.adaptors import kubernetes
15
+ from sky.catalog import CloudFilter
16
+ from sky.catalog import common
15
17
  from sky.clouds import cloud
16
- from sky.clouds.service_catalog import CloudFilter
17
- from sky.clouds.service_catalog import common
18
18
  from sky.provision.kubernetes import utils as kubernetes_utils
19
19
 
20
20
  logger = sky_logging.init_logger(__name__)
@@ -6,7 +6,7 @@ instance types and pricing information for Lambda.
6
6
  import typing
7
7
  from typing import Dict, List, Optional, Tuple, Union
8
8
 
9
- from sky.clouds.service_catalog import common
9
+ from sky.catalog import common
10
10
  from sky.utils import resources_utils
11
11
  from sky.utils import ux_utils
12
12
 
@@ -6,7 +6,7 @@ instance types and pricing information for Nebius.
6
6
  import typing
7
7
  from typing import Dict, List, Optional, Tuple, Union
8
8
 
9
- from sky.clouds.service_catalog import common
9
+ from sky.catalog import common
10
10
  from sky.utils import resources_utils
11
11
  from sky.utils import ux_utils
12
12
 
@@ -17,8 +17,8 @@ import typing
17
17
  from typing import Dict, List, Optional, Tuple, Union
18
18
 
19
19
  from sky.adaptors import oci as oci_adaptor
20
+ from sky.catalog import common
20
21
  from sky.clouds import OCI
21
- from sky.clouds.service_catalog import common
22
22
  from sky.clouds.utils import oci_utils
23
23
  from sky.utils import resources_utils
24
24
 
@@ -7,7 +7,7 @@ query instance types and pricing information for Paperspace.
7
7
  import typing
8
8
  from typing import Dict, List, Optional, Tuple, Union
9
9
 
10
- from sky.clouds.service_catalog import common
10
+ from sky.catalog import common
11
11
  from sky.utils import ux_utils
12
12
 
13
13
  if typing.TYPE_CHECKING:
@@ -7,7 +7,7 @@ query instance types and pricing information for RunPod.
7
7
  import typing
8
8
  from typing import Dict, List, Optional, Tuple, Union
9
9
 
10
- from sky.clouds.service_catalog import common
10
+ from sky.catalog import common
11
11
 
12
12
  if typing.TYPE_CHECKING:
13
13
  from sky.clouds import cloud
@@ -7,7 +7,7 @@ instance types and pricing information for SCP.
7
7
  import typing
8
8
  from typing import Dict, List, Optional, Tuple, Union
9
9
 
10
- from sky.clouds.service_catalog import common
10
+ from sky.catalog import common
11
11
  from sky.utils import resources_utils
12
12
  from sky.utils import ux_utils
13
13
 
@@ -7,10 +7,10 @@ import typing
7
7
  from typing import Dict, List, Optional, Tuple
8
8
 
9
9
  from sky import sky_logging
10
+ from sky.catalog import CloudFilter
11
+ from sky.catalog import common
12
+ from sky.catalog import kubernetes_catalog
10
13
  from sky.clouds import ssh
11
- from sky.clouds.service_catalog import CloudFilter
12
- from sky.clouds.service_catalog import common
13
- from sky.clouds.service_catalog import kubernetes_catalog
14
14
 
15
15
  logger = sky_logging.init_logger(__name__)
16
16
 
@@ -7,7 +7,7 @@ query instance types and pricing information for Vast.ai.
7
7
  import typing
8
8
  from typing import Dict, List, Optional, Tuple, Union
9
9
 
10
- from sky.clouds.service_catalog import common
10
+ from sky.catalog import common
11
11
  from sky.utils import ux_utils
12
12
 
13
13
  if typing.TYPE_CHECKING:
@@ -5,7 +5,7 @@ import typing
5
5
  from typing import Dict, List, Optional, Tuple, Union
6
6
 
7
7
  from sky.adaptors import common as adaptors_common
8
- from sky.clouds.service_catalog import common
8
+ from sky.catalog import common
9
9
 
10
10
  if typing.TYPE_CHECKING:
11
11
  import pandas as pd
sky/cli.py CHANGED
@@ -26,6 +26,7 @@ each other.
26
26
  import collections
27
27
  import copy
28
28
  import datetime
29
+ import fnmatch
29
30
  import functools
30
31
  import getpass
31
32
  import os
@@ -49,6 +50,7 @@ import yaml
49
50
 
50
51
  import sky
51
52
  from sky import backends
53
+ from sky import catalog
52
54
  from sky import clouds
53
55
  from sky import exceptions
54
56
  from sky import global_user_state
@@ -61,7 +63,6 @@ from sky.adaptors import common as adaptors_common
61
63
  from sky.benchmark import benchmark_state
62
64
  from sky.benchmark import benchmark_utils
63
65
  from sky.client import sdk
64
- from sky.clouds import service_catalog
65
66
  from sky.data import storage_utils
66
67
  from sky.provision.kubernetes import constants as kubernetes_constants
67
68
  from sky.provision.kubernetes import utils as kubernetes_utils
@@ -208,14 +209,14 @@ def _get_cluster_records_and_set_ssh_config(
208
209
  return cluster_records
209
210
 
210
211
 
211
- def _get_glob_storages(storages: List[str]) -> List[str]:
212
- """Returns a list of storages that match the glob pattern."""
212
+ def _get_glob_matches(candidate_names: List[str],
213
+ glob_patterns: List[str]) -> List[str]:
214
+ """Returns a list of names that match the glob pattern."""
213
215
  glob_storages = []
214
- for storage_object in storages:
215
- # TODO(zhwu): client side should not rely on global_user_state.
216
- glob_storage = global_user_state.get_glob_storage_name(storage_object)
216
+ for glob_pattern in glob_patterns:
217
+ glob_storage = fnmatch.filter(candidate_names, glob_pattern)
217
218
  if not glob_storage:
218
- click.echo(f'Storage {storage_object} not found.')
219
+ click.echo(f'Storage {glob_pattern} not found.')
219
220
  glob_storages.extend(glob_storage)
220
221
  return list(set(glob_storages))
221
222
 
@@ -3455,7 +3456,7 @@ def check(infra_list: Tuple[str],
3455
3456
  default=False,
3456
3457
  help='Show pricing and instance details for a specified accelerator across '
3457
3458
  'all regions and clouds.')
3458
- @service_catalog.fallback_to_default_catalog
3459
+ @catalog.fallback_to_default_catalog
3459
3460
  @usage_lib.entrypoint
3460
3461
  def show_gpus(
3461
3462
  accelerator_str: Optional[str],
@@ -3835,7 +3836,7 @@ def show_gpus(
3835
3836
  clouds_to_list: Union[Optional[str], List[str]] = cloud_name
3836
3837
  if cloud_name is None:
3837
3838
  clouds_to_list = [
3838
- c for c in service_catalog.ALL_CLOUDS
3839
+ c for c in constants.ALL_CLOUDS
3839
3840
  if c != 'kubernetes' and c != 'ssh'
3840
3841
  ]
3841
3842
 
@@ -3881,13 +3882,13 @@ def show_gpus(
3881
3882
  f'Cloud GPUs{colorama.Style.RESET_ALL}\n')
3882
3883
 
3883
3884
  # "Common" GPUs
3884
- for gpu in service_catalog.get_common_gpus():
3885
+ for gpu in catalog.get_common_gpus():
3885
3886
  if gpu in result:
3886
3887
  gpu_table.add_row([gpu, _list_to_str(result.pop(gpu))])
3887
3888
  yield from gpu_table.get_string()
3888
3889
 
3889
3890
  # Google TPUs
3890
- for tpu in service_catalog.get_tpus():
3891
+ for tpu in catalog.get_tpus():
3891
3892
  if tpu in result:
3892
3893
  tpu_table.add_row([tpu, _list_to_str(result.pop(tpu))])
3893
3894
  if tpu_table.get_string():
@@ -3958,7 +3959,7 @@ def show_gpus(
3958
3959
  all_regions=all_regions))
3959
3960
  # Import here to save module load speed.
3960
3961
  # pylint: disable=import-outside-toplevel,line-too-long
3961
- from sky.clouds.service_catalog import common as catalog_common
3962
+ from sky.catalog import common as catalog_common
3962
3963
 
3963
3964
  # For each gpu name (count not included):
3964
3965
  # - Group by cloud
@@ -4134,7 +4135,9 @@ def storage_delete(names: List[str], all: bool, yes: bool, async_call: bool): #
4134
4135
  return
4135
4136
  names = [storage['name'] for storage in storages]
4136
4137
  else:
4137
- names = _get_glob_storages(names)
4138
+ storages = sdk.get(sdk.storage_ls())
4139
+ existing_storage_names = [storage['name'] for storage in storages]
4140
+ names = _get_glob_matches(existing_storage_names, names)
4138
4141
  if names:
4139
4142
  if not yes:
4140
4143
  storage_names = ', '.join(names)
sky/client/cli.py CHANGED
@@ -26,6 +26,7 @@ each other.
26
26
  import collections
27
27
  import copy
28
28
  import datetime
29
+ import fnmatch
29
30
  import functools
30
31
  import getpass
31
32
  import os
@@ -49,6 +50,7 @@ import yaml
49
50
 
50
51
  import sky
51
52
  from sky import backends
53
+ from sky import catalog
52
54
  from sky import clouds
53
55
  from sky import exceptions
54
56
  from sky import global_user_state
@@ -61,7 +63,6 @@ from sky.adaptors import common as adaptors_common
61
63
  from sky.benchmark import benchmark_state
62
64
  from sky.benchmark import benchmark_utils
63
65
  from sky.client import sdk
64
- from sky.clouds import service_catalog
65
66
  from sky.data import storage_utils
66
67
  from sky.provision.kubernetes import constants as kubernetes_constants
67
68
  from sky.provision.kubernetes import utils as kubernetes_utils
@@ -208,14 +209,14 @@ def _get_cluster_records_and_set_ssh_config(
208
209
  return cluster_records
209
210
 
210
211
 
211
- def _get_glob_storages(storages: List[str]) -> List[str]:
212
- """Returns a list of storages that match the glob pattern."""
212
+ def _get_glob_matches(candidate_names: List[str],
213
+ glob_patterns: List[str]) -> List[str]:
214
+ """Returns a list of names that match the glob pattern."""
213
215
  glob_storages = []
214
- for storage_object in storages:
215
- # TODO(zhwu): client side should not rely on global_user_state.
216
- glob_storage = global_user_state.get_glob_storage_name(storage_object)
216
+ for glob_pattern in glob_patterns:
217
+ glob_storage = fnmatch.filter(candidate_names, glob_pattern)
217
218
  if not glob_storage:
218
- click.echo(f'Storage {storage_object} not found.')
219
+ click.echo(f'Storage {glob_pattern} not found.')
219
220
  glob_storages.extend(glob_storage)
220
221
  return list(set(glob_storages))
221
222
 
@@ -3455,7 +3456,7 @@ def check(infra_list: Tuple[str],
3455
3456
  default=False,
3456
3457
  help='Show pricing and instance details for a specified accelerator across '
3457
3458
  'all regions and clouds.')
3458
- @service_catalog.fallback_to_default_catalog
3459
+ @catalog.fallback_to_default_catalog
3459
3460
  @usage_lib.entrypoint
3460
3461
  def show_gpus(
3461
3462
  accelerator_str: Optional[str],
@@ -3835,7 +3836,7 @@ def show_gpus(
3835
3836
  clouds_to_list: Union[Optional[str], List[str]] = cloud_name
3836
3837
  if cloud_name is None:
3837
3838
  clouds_to_list = [
3838
- c for c in service_catalog.ALL_CLOUDS
3839
+ c for c in constants.ALL_CLOUDS
3839
3840
  if c != 'kubernetes' and c != 'ssh'
3840
3841
  ]
3841
3842
 
@@ -3881,13 +3882,13 @@ def show_gpus(
3881
3882
  f'Cloud GPUs{colorama.Style.RESET_ALL}\n')
3882
3883
 
3883
3884
  # "Common" GPUs
3884
- for gpu in service_catalog.get_common_gpus():
3885
+ for gpu in catalog.get_common_gpus():
3885
3886
  if gpu in result:
3886
3887
  gpu_table.add_row([gpu, _list_to_str(result.pop(gpu))])
3887
3888
  yield from gpu_table.get_string()
3888
3889
 
3889
3890
  # Google TPUs
3890
- for tpu in service_catalog.get_tpus():
3891
+ for tpu in catalog.get_tpus():
3891
3892
  if tpu in result:
3892
3893
  tpu_table.add_row([tpu, _list_to_str(result.pop(tpu))])
3893
3894
  if tpu_table.get_string():
@@ -3958,7 +3959,7 @@ def show_gpus(
3958
3959
  all_regions=all_regions))
3959
3960
  # Import here to save module load speed.
3960
3961
  # pylint: disable=import-outside-toplevel,line-too-long
3961
- from sky.clouds.service_catalog import common as catalog_common
3962
+ from sky.catalog import common as catalog_common
3962
3963
 
3963
3964
  # For each gpu name (count not included):
3964
3965
  # - Group by cloud
@@ -4134,7 +4135,9 @@ def storage_delete(names: List[str], all: bool, yes: bool, async_call: bool): #
4134
4135
  return
4135
4136
  names = [storage['name'] for storage in storages]
4136
4137
  else:
4137
- names = _get_glob_storages(names)
4138
+ storages = sdk.get(sdk.storage_ls())
4139
+ existing_storage_names = [storage['name'] for storage in storages]
4140
+ names = _get_glob_matches(existing_storage_names, names)
4138
4141
  if names:
4139
4142
  if not yes:
4140
4143
  storage_names = ', '.join(names)