skypilot-nightly 1.0.0.dev20250627__py3-none-any.whl → 1.0.0.dev20250630__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 (173) hide show
  1. sky/__init__.py +2 -2
  2. sky/adaptors/kubernetes.py +14 -0
  3. sky/adaptors/nebius.py +2 -2
  4. sky/authentication.py +12 -5
  5. sky/backends/backend_utils.py +92 -26
  6. sky/check.py +5 -2
  7. sky/client/cli/command.py +39 -8
  8. sky/client/sdk.py +217 -167
  9. sky/client/service_account_auth.py +47 -0
  10. sky/clouds/aws.py +10 -4
  11. sky/clouds/azure.py +5 -2
  12. sky/clouds/cloud.py +5 -2
  13. sky/clouds/gcp.py +31 -18
  14. sky/clouds/kubernetes.py +54 -34
  15. sky/clouds/nebius.py +8 -2
  16. sky/clouds/ssh.py +5 -2
  17. sky/clouds/utils/aws_utils.py +10 -4
  18. sky/clouds/utils/gcp_utils.py +22 -7
  19. sky/clouds/utils/oci_utils.py +62 -14
  20. sky/dashboard/out/404.html +1 -1
  21. sky/dashboard/out/_next/static/NdypbqMxaYucRGfopkKXa/_buildManifest.js +1 -0
  22. sky/dashboard/out/_next/static/chunks/1043-1b39779691bb4030.js +1 -0
  23. sky/dashboard/out/_next/static/chunks/{141-fa5a20cbf401b351.js → 1141-726e5a3f00b67185.js} +2 -2
  24. sky/dashboard/out/_next/static/chunks/1272-1ef0bf0237faccdb.js +1 -0
  25. sky/dashboard/out/_next/static/chunks/1664-d65361e92b85e786.js +1 -0
  26. sky/dashboard/out/_next/static/chunks/1691.44e378727a41f3b5.js +21 -0
  27. sky/dashboard/out/_next/static/chunks/1871-80dea41717729fa5.js +6 -0
  28. sky/dashboard/out/_next/static/chunks/2544.27f70672535675ed.js +1 -0
  29. sky/dashboard/out/_next/static/chunks/{875.52c962183328b3f2.js → 2875.c24c6d57dc82e436.js} +1 -1
  30. sky/dashboard/out/_next/static/chunks/3256.7257acd01b481bed.js +11 -0
  31. sky/dashboard/out/_next/static/chunks/3698-52ad1ca228faa776.js +1 -0
  32. sky/dashboard/out/_next/static/chunks/3785.b3cc2bc1d49d2c3c.js +1 -0
  33. sky/dashboard/out/_next/static/chunks/3937.d7f1c55d1916c7f2.js +1 -0
  34. sky/dashboard/out/_next/static/chunks/{947-6620842ef80ae879.js → 3947-b059261d6fa88a1f.js} +1 -1
  35. sky/dashboard/out/_next/static/chunks/{697.6460bf72e760addd.js → 4697.f5421144224da9fc.js} +1 -1
  36. sky/dashboard/out/_next/static/chunks/4725.4c849b1e05c8e9ad.js +1 -0
  37. sky/dashboard/out/_next/static/chunks/5230-df791914b54d91d9.js +1 -0
  38. sky/dashboard/out/_next/static/chunks/{491.b3d264269613fe09.js → 5491.918ffed0ba7a5294.js} +1 -1
  39. sky/dashboard/out/_next/static/chunks/5739-5ea3ffa10fc884f2.js +8 -0
  40. sky/dashboard/out/_next/static/chunks/616-162f3033ffcd3d31.js +39 -0
  41. sky/dashboard/out/_next/static/chunks/6601-fcfad0ddf92ec7ab.js +1 -0
  42. sky/dashboard/out/_next/static/chunks/6989-6ff4e45dfb49d11d.js +1 -0
  43. sky/dashboard/out/_next/static/chunks/6990-d0dc765474fa0eca.js +1 -0
  44. sky/dashboard/out/_next/static/chunks/8969-909d53833da080cb.js +1 -0
  45. sky/dashboard/out/_next/static/chunks/8982.a2e214068f30a857.js +1 -0
  46. sky/dashboard/out/_next/static/chunks/{25.76c246239df93d50.js → 9025.a7c44babfe56ce09.js} +2 -2
  47. sky/dashboard/out/_next/static/chunks/938-044ad21de8b4626b.js +1 -0
  48. sky/dashboard/out/_next/static/chunks/9470-21d059a1dfa03f61.js +1 -0
  49. sky/dashboard/out/_next/static/chunks/9984.739ae958a066298d.js +1 -0
  50. sky/dashboard/out/_next/static/chunks/fd9d1056-61f2257a9cd8b32b.js +1 -0
  51. sky/dashboard/out/_next/static/chunks/{framework-87d061ee6ed71b28.js → framework-efc06c2733009cd3.js} +1 -1
  52. sky/dashboard/out/_next/static/chunks/main-app-68c028b1bc5e1b72.js +1 -0
  53. sky/dashboard/out/_next/static/chunks/{main-e0e2335212e72357.js → main-c0a4f1ea606d48d2.js} +1 -1
  54. sky/dashboard/out/_next/static/chunks/pages/{_app-9a3ce3170d2edcec.js → _app-a37b06ddb64521fd.js} +2 -2
  55. sky/dashboard/out/_next/static/chunks/pages/_error-c72a1f77a3c0be1b.js +1 -0
  56. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-8135aba0712bda37.js +6 -0
  57. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-b8e1114e6d38218c.js +6 -0
  58. sky/dashboard/out/_next/static/chunks/pages/clusters-9744c271a1642f76.js +1 -0
  59. sky/dashboard/out/_next/static/chunks/pages/config-a2673b256b6d416f.js +1 -0
  60. sky/dashboard/out/_next/static/chunks/pages/index-927ddeebe57a8ac3.js +1 -0
  61. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-8b0809f59034d509.js +1 -0
  62. sky/dashboard/out/_next/static/chunks/pages/infra-ae9d2f705ce582c9.js +1 -0
  63. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-c4d5cfac7fbc0668.js +16 -0
  64. sky/dashboard/out/_next/static/chunks/pages/jobs-5bbdc71878f0a068.js +1 -0
  65. sky/dashboard/out/_next/static/chunks/pages/users-cd43fb3c122eedde.js +1 -0
  66. sky/dashboard/out/_next/static/chunks/pages/volumes-4ebf6484f7216387.js +1 -0
  67. sky/dashboard/out/_next/static/chunks/pages/workspace/new-5629d4e551dba1ee.js +1 -0
  68. sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-7c0187f43757a548.js +1 -0
  69. sky/dashboard/out/_next/static/chunks/pages/workspaces-06bde99155fa6292.js +1 -0
  70. sky/dashboard/out/_next/static/chunks/webpack-d427db53e54de9ce.js +1 -0
  71. sky/dashboard/out/_next/static/css/0da6afe66176678a.css +3 -0
  72. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  73. sky/dashboard/out/clusters/[cluster].html +1 -1
  74. sky/dashboard/out/clusters.html +1 -1
  75. sky/dashboard/out/config.html +1 -1
  76. sky/dashboard/out/index.html +1 -1
  77. sky/dashboard/out/infra/[context].html +1 -1
  78. sky/dashboard/out/infra.html +1 -1
  79. sky/dashboard/out/jobs/[job].html +1 -1
  80. sky/dashboard/out/jobs.html +1 -1
  81. sky/dashboard/out/users.html +1 -1
  82. sky/dashboard/out/volumes.html +1 -1
  83. sky/dashboard/out/workspace/new.html +1 -1
  84. sky/dashboard/out/workspaces/[name].html +1 -1
  85. sky/dashboard/out/workspaces.html +1 -1
  86. sky/data/storage.py +8 -3
  87. sky/global_user_state.py +257 -9
  88. sky/jobs/client/sdk.py +20 -25
  89. sky/models.py +16 -0
  90. sky/optimizer.py +46 -0
  91. sky/provision/__init__.py +14 -6
  92. sky/provision/kubernetes/config.py +1 -1
  93. sky/provision/kubernetes/constants.py +9 -0
  94. sky/provision/kubernetes/instance.py +24 -18
  95. sky/provision/kubernetes/network.py +15 -9
  96. sky/provision/kubernetes/network_utils.py +42 -23
  97. sky/provision/kubernetes/utils.py +73 -35
  98. sky/provision/kubernetes/volume.py +77 -15
  99. sky/provision/nebius/utils.py +10 -4
  100. sky/resources.py +10 -4
  101. sky/serve/client/sdk.py +28 -34
  102. sky/server/common.py +51 -3
  103. sky/server/constants.py +3 -0
  104. sky/server/requests/executor.py +4 -0
  105. sky/server/requests/payloads.py +33 -0
  106. sky/server/requests/requests.py +19 -0
  107. sky/server/rest.py +6 -15
  108. sky/server/server.py +121 -6
  109. sky/skylet/constants.py +7 -0
  110. sky/skypilot_config.py +32 -4
  111. sky/task.py +12 -0
  112. sky/users/permission.py +29 -0
  113. sky/users/server.py +384 -5
  114. sky/users/token_service.py +196 -0
  115. sky/utils/common_utils.py +4 -5
  116. sky/utils/config_utils.py +41 -0
  117. sky/utils/controller_utils.py +5 -1
  118. sky/utils/log_utils.py +68 -0
  119. sky/utils/resource_checker.py +153 -0
  120. sky/utils/resources_utils.py +12 -4
  121. sky/utils/schemas.py +87 -60
  122. sky/utils/subprocess_utils.py +2 -6
  123. sky/volumes/server/core.py +103 -78
  124. sky/volumes/utils.py +22 -5
  125. sky/workspaces/core.py +9 -117
  126. {skypilot_nightly-1.0.0.dev20250627.dist-info → skypilot_nightly-1.0.0.dev20250630.dist-info}/METADATA +1 -1
  127. {skypilot_nightly-1.0.0.dev20250627.dist-info → skypilot_nightly-1.0.0.dev20250630.dist-info}/RECORD +133 -128
  128. sky/dashboard/out/_next/static/HudU4f4Xsy-cP51JvXSZ-/_buildManifest.js +0 -1
  129. sky/dashboard/out/_next/static/chunks/230-d6e363362017ff3a.js +0 -1
  130. sky/dashboard/out/_next/static/chunks/43-36177d00f6956ab2.js +0 -1
  131. sky/dashboard/out/_next/static/chunks/470-92dd1614396389be.js +0 -1
  132. sky/dashboard/out/_next/static/chunks/544.110e53813fb98e2e.js +0 -1
  133. sky/dashboard/out/_next/static/chunks/616-d6128fa9e7cae6e6.js +0 -39
  134. sky/dashboard/out/_next/static/chunks/645.961f08e39b8ce447.js +0 -1
  135. sky/dashboard/out/_next/static/chunks/664-047bc03493fda379.js +0 -1
  136. sky/dashboard/out/_next/static/chunks/690.55f9eed3be903f56.js +0 -16
  137. sky/dashboard/out/_next/static/chunks/785.dc2686c3c1235554.js +0 -1
  138. sky/dashboard/out/_next/static/chunks/798-c0525dc3f21e488d.js +0 -1
  139. sky/dashboard/out/_next/static/chunks/799-3625946b2ec2eb30.js +0 -8
  140. sky/dashboard/out/_next/static/chunks/871-3db673be3ee3750b.js +0 -6
  141. sky/dashboard/out/_next/static/chunks/937.3759f538f11a0953.js +0 -1
  142. sky/dashboard/out/_next/static/chunks/938-068520cc11738deb.js +0 -1
  143. sky/dashboard/out/_next/static/chunks/969-d3a0b53f728d280a.js +0 -1
  144. sky/dashboard/out/_next/static/chunks/973-81b2d057178adb76.js +0 -1
  145. sky/dashboard/out/_next/static/chunks/982.1b61658204416b0f.js +0 -1
  146. sky/dashboard/out/_next/static/chunks/984.e8bac186a24e5178.js +0 -1
  147. sky/dashboard/out/_next/static/chunks/989-db34c16ad7ea6155.js +0 -1
  148. sky/dashboard/out/_next/static/chunks/990-0ad5ea1699e03ee8.js +0 -1
  149. sky/dashboard/out/_next/static/chunks/fd9d1056-2821b0f0cabcd8bd.js +0 -1
  150. sky/dashboard/out/_next/static/chunks/main-app-241eb28595532291.js +0 -1
  151. sky/dashboard/out/_next/static/chunks/pages/_error-1be831200e60c5c0.js +0 -1
  152. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-aff040d7bc5d0086.js +0 -6
  153. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-8040f2483897ed0c.js +0 -6
  154. sky/dashboard/out/_next/static/chunks/pages/clusters-f119a5630a1efd61.js +0 -1
  155. sky/dashboard/out/_next/static/chunks/pages/config-6b255eae088da6a3.js +0 -1
  156. sky/dashboard/out/_next/static/chunks/pages/index-6b0d9e5031b70c58.js +0 -1
  157. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-b302aea4d65766bf.js +0 -1
  158. sky/dashboard/out/_next/static/chunks/pages/infra-ee8cc4d449945d19.js +0 -1
  159. sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-e4b23128db0774cd.js +0 -16
  160. sky/dashboard/out/_next/static/chunks/pages/jobs-0a5695ff3075d94a.js +0 -1
  161. sky/dashboard/out/_next/static/chunks/pages/users-4978cbb093e141e7.js +0 -1
  162. sky/dashboard/out/_next/static/chunks/pages/volumes-476b670ef33d1ecd.js +0 -1
  163. sky/dashboard/out/_next/static/chunks/pages/workspace/new-5b59bce9eb208d84.js +0 -1
  164. sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-cb7e720b739de53a.js +0 -1
  165. sky/dashboard/out/_next/static/chunks/pages/workspaces-50e230828730cfb3.js +0 -1
  166. sky/dashboard/out/_next/static/chunks/webpack-08fdb9e6070127fc.js +0 -1
  167. sky/dashboard/out/_next/static/css/52082cf558ec9705.css +0 -3
  168. /sky/dashboard/out/_next/static/{HudU4f4Xsy-cP51JvXSZ- → NdypbqMxaYucRGfopkKXa}/_ssgManifest.js +0 -0
  169. /sky/dashboard/out/_next/static/chunks/{804-4c9fc53aa74bc191.js → 804-9f5e98ce84d46bdd.js} +0 -0
  170. {skypilot_nightly-1.0.0.dev20250627.dist-info → skypilot_nightly-1.0.0.dev20250630.dist-info}/WHEEL +0 -0
  171. {skypilot_nightly-1.0.0.dev20250627.dist-info → skypilot_nightly-1.0.0.dev20250630.dist-info}/entry_points.txt +0 -0
  172. {skypilot_nightly-1.0.0.dev20250627.dist-info → skypilot_nightly-1.0.0.dev20250630.dist-info}/licenses/LICENSE +0 -0
  173. {skypilot_nightly-1.0.0.dev20250627.dist-info → skypilot_nightly-1.0.0.dev20250630.dist-info}/top_level.txt +0 -0
sky/workspaces/core.py CHANGED
@@ -1,13 +1,11 @@
1
1
  """Workspace management core."""
2
2
 
3
- import concurrent.futures
4
- from typing import Any, Callable, Dict, List
3
+ from typing import Any, Callable, Dict, List, Tuple
5
4
 
6
5
  import filelock
7
6
 
8
7
  from sky import check as sky_check
9
8
  from sky import exceptions
10
- from sky import global_user_state
11
9
  from sky import models
12
10
  from sky import sky_logging
13
11
  from sky import skypilot_config
@@ -17,6 +15,7 @@ from sky.users import permission
17
15
  from sky.utils import annotations
18
16
  from sky.utils import common_utils
19
17
  from sky.utils import config_utils
18
+ from sky.utils import resource_checker
20
19
  from sky.utils import schemas
21
20
  from sky.workspaces import utils as workspaces_utils
22
21
 
@@ -79,116 +78,6 @@ def _update_workspaces_config(
79
78
  f'file if you believe it is stale.') from e
80
79
 
81
80
 
82
- def _check_workspace_has_no_active_resources(workspace_name: str,
83
- operation: str) -> None:
84
- """Check if a workspace has active clusters or managed jobs.
85
-
86
- Args:
87
- workspace_name: The name of the workspace to check.
88
- operation: The operation being performed ('update' or 'delete').
89
-
90
- Raises:
91
- ValueError: If the workspace has active clusters or managed jobs.
92
- """
93
- _check_workspaces_have_no_active_resources([(workspace_name, operation)])
94
-
95
-
96
- def _check_workspaces_have_no_active_resources(
97
- workspace_operations: list) -> None:
98
- """Check if workspaces have active clusters or managed jobs.
99
-
100
- Args:
101
- workspace_operations: List of tuples (workspace_name, operation) where
102
- operation is 'update' or 'delete'.
103
-
104
- Raises:
105
- ValueError: If any workspace has active clusters or managed jobs.
106
- The error message will include all workspaces with issues.
107
- """
108
- if not workspace_operations:
109
- return
110
-
111
- def get_all_clusters():
112
- return global_user_state.get_clusters()
113
-
114
- def get_all_managed_jobs():
115
- # pylint: disable=import-outside-toplevel
116
- from sky.jobs.server import core as managed_jobs_core
117
- try:
118
- return managed_jobs_core.queue(refresh=False,
119
- skip_finished=True,
120
- all_users=True)
121
- except exceptions.ClusterNotUpError:
122
- logger.warning('All jobs should be finished in workspace.')
123
- return []
124
-
125
- # Fetch both clusters and jobs in parallel
126
- with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
127
- clusters_future = executor.submit(get_all_clusters)
128
- jobs_future = executor.submit(get_all_managed_jobs)
129
-
130
- all_clusters = clusters_future.result()
131
- all_managed_jobs = jobs_future.result()
132
-
133
- # Collect all error messages instead of raising immediately
134
- error_messages = []
135
-
136
- # Check each workspace against the fetched data
137
- for workspace_name, operation in workspace_operations:
138
- # Filter clusters for this workspace
139
- workspace_clusters = [
140
- cluster for cluster in all_clusters
141
- if (cluster.get('workspace', constants.SKYPILOT_DEFAULT_WORKSPACE)
142
- == workspace_name)
143
- ]
144
-
145
- # Filter managed jobs for this workspace
146
- workspace_active_jobs = [
147
- job for job in all_managed_jobs
148
- if job.get('workspace', constants.SKYPILOT_DEFAULT_WORKSPACE) ==
149
- workspace_name
150
- ]
151
-
152
- # Collect error messages for this workspace
153
- workspace_errors = []
154
-
155
- if workspace_clusters:
156
- active_cluster_names = [
157
- cluster['name'] for cluster in workspace_clusters
158
- ]
159
- cluster_list = ', '.join(active_cluster_names)
160
- workspace_errors.append(
161
- f'{len(workspace_clusters)} active cluster(s): {cluster_list}')
162
-
163
- if workspace_active_jobs:
164
- job_names = [str(job['job_id']) for job in workspace_active_jobs]
165
- job_list = ', '.join(job_names)
166
- workspace_errors.append(
167
- f'{len(workspace_active_jobs)} active managed job(s): '
168
- f'{job_list}')
169
-
170
- # If this workspace has issues, add to overall error messages
171
- if workspace_errors:
172
- workspace_error_summary = ' and '.join(workspace_errors)
173
- error_messages.append(
174
- f'Cannot {operation} workspace {workspace_name!r} because it '
175
- f'has {workspace_error_summary}.')
176
-
177
- # If we collected any errors, raise them all together
178
- if error_messages:
179
- if len(error_messages) == 1:
180
- # Single workspace error
181
- full_message = error_messages[
182
- 0] + ' Please terminate these resources first.'
183
- else:
184
- # Multiple workspace errors
185
- full_message = (f'Cannot proceed due to active resources in '
186
- f'{len(error_messages)} workspace(s):\n' +
187
- '\n'.join(f'• {msg}' for msg in error_messages) +
188
- '\nPlease terminate these resources first.')
189
- raise ValueError(full_message)
190
-
191
-
192
81
  def _validate_workspace_config(workspace_name: str,
193
82
  workspace_config: Dict[str, Any]) -> None:
194
83
  """Validate the workspace configuration.
@@ -229,7 +118,8 @@ def update_workspace(workspace_name: str, config: Dict[str,
229
118
  # Check for active clusters and managed jobs in the workspace
230
119
  # TODO(zhwu): we should allow the edits that only contain changes to
231
120
  # allowed_users or private.
232
- _check_workspace_has_no_active_resources(workspace_name, 'update')
121
+ resource_checker.check_no_active_resources_for_workspaces([(workspace_name,
122
+ 'update')])
233
123
 
234
124
  def update_workspace_fn(workspaces: Dict[str, Any]) -> None:
235
125
  """Function to update workspace inside the lock."""
@@ -327,7 +217,8 @@ def delete_workspace(workspace_name: str) -> Dict[str, Any]:
327
217
  raise ValueError(f'Workspace {workspace_name!r} does not exist.')
328
218
 
329
219
  # Check for active clusters and managed jobs in the workspace
330
- _check_workspace_has_no_active_resources(workspace_name, 'delete')
220
+ resource_checker.check_no_active_resources_for_workspaces([(workspace_name,
221
+ 'delete')])
331
222
 
332
223
  def delete_workspace_fn(workspaces: Dict[str, Any]) -> None:
333
224
  """Function to delete workspace inside the lock."""
@@ -396,7 +287,7 @@ def update_config(config: Dict[str, Any]) -> Dict[str, Any]:
396
287
  new_workspaces = config.get('workspaces', {})
397
288
 
398
289
  # Collect all workspaces that need to be checked for active resources
399
- workspaces_to_check = []
290
+ workspaces_to_check: List[Tuple[str, str]] = []
400
291
  workspaces_to_check_policy: Dict[str, Dict[str, List[str]]] = {
401
292
  'add': {},
402
293
  'update': {},
@@ -430,7 +321,8 @@ def update_config(config: Dict[str, Any]) -> Dict[str, Any]:
430
321
  workspaces_to_check_policy['delete'][workspace_name] = ['*']
431
322
 
432
323
  # Check all workspaces for active resources in one efficient call
433
- _check_workspaces_have_no_active_resources(workspaces_to_check)
324
+ resource_checker.check_no_active_resources_for_workspaces(
325
+ workspaces_to_check)
434
326
 
435
327
  # Use file locking to prevent race conditions
436
328
  lock_path = skypilot_config.get_skypilot_config_lock_path()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skypilot-nightly
3
- Version: 1.0.0.dev20250627
3
+ Version: 1.0.0.dev20250630
4
4
  Summary: SkyPilot: Run AI on Any Infra — Unified, Faster, Cheaper.
5
5
  Author: SkyPilot Team
6
6
  License: Apache 2.0