skypilot-nightly 1.0.0.dev20250720__py3-none-any.whl → 1.0.0.dev20250724__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.

Potentially problematic release.


This version of skypilot-nightly might be problematic. Click here for more details.

Files changed (113) hide show
  1. sky/__init__.py +2 -2
  2. sky/admin_policy.py +11 -4
  3. sky/backends/backend_utils.py +27 -11
  4. sky/backends/cloud_vm_ray_backend.py +22 -27
  5. sky/client/cli/command.py +44 -28
  6. sky/client/sdk.py +52 -7
  7. sky/client/sdk.pyi +296 -0
  8. sky/clouds/nebius.py +2 -5
  9. sky/clouds/utils/oci_utils.py +16 -40
  10. sky/clouds/vast.py +2 -1
  11. sky/dashboard/out/404.html +1 -1
  12. sky/dashboard/out/_next/static/BURfWrKsQk9psMPv0OXrh/_buildManifest.js +1 -0
  13. sky/dashboard/out/_next/static/chunks/{1141-d8c6404a7c6fffe6.js → 1141-e49a159c30a6c4a7.js} +1 -1
  14. sky/dashboard/out/_next/static/chunks/1559-18717d96ef2fcbe9.js +30 -0
  15. sky/dashboard/out/_next/static/chunks/{1871-a821dcaaae2a3823.js → 1871-ea0e7283886407ca.js} +2 -2
  16. sky/dashboard/out/_next/static/chunks/2003.b82e6db40ec4c463.js +1 -0
  17. sky/dashboard/out/_next/static/chunks/2350.23778a2b19aabd33.js +1 -0
  18. sky/dashboard/out/_next/static/chunks/2369.2d6e4757f8dfc2b7.js +15 -0
  19. sky/dashboard/out/_next/static/chunks/{2641.5233e938f14e31a7.js → 2641.74c19c4d45a2c034.js} +1 -1
  20. sky/dashboard/out/_next/static/chunks/3785.59705416215ff08b.js +1 -0
  21. sky/dashboard/out/_next/static/chunks/4869.da729a7db3a31f43.js +16 -0
  22. sky/dashboard/out/_next/static/chunks/4937.d75809403fc264ac.js +15 -0
  23. sky/dashboard/out/_next/static/chunks/6135-2abbd0352f8ee061.js +1 -0
  24. sky/dashboard/out/_next/static/chunks/691.488b4aef97c28727.js +55 -0
  25. sky/dashboard/out/_next/static/chunks/6990-f64e03df359e04f7.js +1 -0
  26. sky/dashboard/out/_next/static/chunks/7411-2cc31dc0fdf2a9ad.js +41 -0
  27. sky/dashboard/out/_next/static/chunks/9025.4a9099bdf3ed4875.js +6 -0
  28. sky/dashboard/out/_next/static/chunks/{938-63fc419cb82ad9b3.js → 938-7ee806653aef0609.js} +1 -1
  29. sky/dashboard/out/_next/static/chunks/9847.387abf8a14d722db.js +30 -0
  30. sky/dashboard/out/_next/static/chunks/{9984.2b5e3fa69171bff9.js → 9984.0460de9d3adf5582.js} +1 -1
  31. sky/dashboard/out/_next/static/chunks/pages/_app-da491665d4289aae.js +34 -0
  32. sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/{[job]-fa406155b4223d0d.js → [job]-2186770cc2de1623.js} +2 -2
  33. sky/dashboard/out/_next/static/chunks/pages/clusters/{[cluster]-0c37ee1ac5f3474d.js → [cluster]-95afb019ab85801c.js} +1 -1
  34. sky/dashboard/out/_next/static/chunks/pages/clusters-3d4be4961e1c94eb.js +1 -0
  35. sky/dashboard/out/_next/static/chunks/pages/index-89e7daf7b7df02e0.js +1 -0
  36. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-a90b4fe4616dc501.js +1 -0
  37. sky/dashboard/out/_next/static/chunks/pages/infra-0d3d1f890c5d188a.js +1 -0
  38. sky/dashboard/out/_next/static/chunks/pages/jobs/{[job]-c5b357bfd9502fbe.js → [job]-dc0299ffefebcdbe.js} +2 -2
  39. sky/dashboard/out/_next/static/chunks/pages/jobs-49f790d12a85027c.js +1 -0
  40. sky/dashboard/out/_next/static/chunks/pages/{users-19e98664bdd61643.js → users-6790fcefd5487b13.js} +1 -1
  41. sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-6bcd4b20914d76c9.js +1 -0
  42. sky/dashboard/out/_next/static/chunks/pages/workspaces-5f7fe4b7d55b8612.js +1 -0
  43. sky/dashboard/out/_next/static/chunks/webpack-b6447da22305b14a.js +1 -0
  44. sky/dashboard/out/_next/static/css/b3227360726f12eb.css +3 -0
  45. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  46. sky/dashboard/out/clusters/[cluster].html +1 -1
  47. sky/dashboard/out/clusters.html +1 -1
  48. sky/dashboard/out/config.html +1 -1
  49. sky/dashboard/out/index.html +1 -1
  50. sky/dashboard/out/infra/[context].html +1 -1
  51. sky/dashboard/out/infra.html +1 -1
  52. sky/dashboard/out/jobs/[job].html +1 -1
  53. sky/dashboard/out/jobs.html +1 -1
  54. sky/dashboard/out/users.html +1 -1
  55. sky/dashboard/out/volumes.html +1 -1
  56. sky/dashboard/out/workspace/new.html +1 -1
  57. sky/dashboard/out/workspaces/[name].html +1 -1
  58. sky/dashboard/out/workspaces.html +1 -1
  59. sky/data/mounting_utils.py +93 -32
  60. sky/exceptions.py +8 -0
  61. sky/global_user_state.py +2 -3
  62. sky/jobs/state.py +2 -2
  63. sky/logs/__init__.py +4 -0
  64. sky/logs/agent.py +14 -0
  65. sky/logs/aws.py +276 -0
  66. sky/provision/nebius/utils.py +3 -6
  67. sky/server/common.py +9 -4
  68. sky/server/requests/payloads.py +20 -4
  69. sky/server/rest.py +6 -0
  70. sky/server/server.py +2 -1
  71. sky/setup_files/MANIFEST.in +1 -1
  72. sky/setup_files/alembic.ini +0 -4
  73. sky/skylet/constants.py +4 -0
  74. sky/skypilot_config.py +5 -31
  75. sky/utils/common_utils.py +8 -3
  76. sky/utils/config_utils.py +17 -0
  77. sky/utils/db/migration_utils.py +44 -4
  78. sky/utils/locks.py +319 -0
  79. sky/utils/rich_utils.py +2 -3
  80. sky/utils/schemas.py +92 -56
  81. sky/utils/timeline.py +41 -0
  82. {skypilot_nightly-1.0.0.dev20250720.dist-info → skypilot_nightly-1.0.0.dev20250724.dist-info}/METADATA +1 -1
  83. {skypilot_nightly-1.0.0.dev20250720.dist-info → skypilot_nightly-1.0.0.dev20250724.dist-info}/RECORD +88 -86
  84. sky/dashboard/out/_next/static/chunks/1746.27d40aedc22bd2d6.js +0 -60
  85. sky/dashboard/out/_next/static/chunks/2544.27f70672535675ed.js +0 -1
  86. sky/dashboard/out/_next/static/chunks/2875.c24c6d57dc82e436.js +0 -25
  87. sky/dashboard/out/_next/static/chunks/3785.95b94f18aaec7233.js +0 -1
  88. sky/dashboard/out/_next/static/chunks/3947-b059261d6fa88a1f.js +0 -35
  89. sky/dashboard/out/_next/static/chunks/430.ed51037d1a4a438b.js +0 -1
  90. sky/dashboard/out/_next/static/chunks/4869.c7c055a5c2814f33.js +0 -16
  91. sky/dashboard/out/_next/static/chunks/5491.918ffed0ba7a5294.js +0 -20
  92. sky/dashboard/out/_next/static/chunks/6990-dcb411b566e64cde.js +0 -1
  93. sky/dashboard/out/_next/static/chunks/804-9f5e98ce84d46bdd.js +0 -21
  94. sky/dashboard/out/_next/static/chunks/9025.133e9ba5c780afeb.js +0 -6
  95. sky/dashboard/out/_next/static/chunks/9470-8178183f3bae198f.js +0 -1
  96. sky/dashboard/out/_next/static/chunks/9847.46e613d000c55859.js +0 -30
  97. sky/dashboard/out/_next/static/chunks/pages/_app-507712f30cd3cec3.js +0 -20
  98. sky/dashboard/out/_next/static/chunks/pages/clusters-102d169e87913ba1.js +0 -1
  99. sky/dashboard/out/_next/static/chunks/pages/index-927ddeebe57a8ac3.js +0 -1
  100. sky/dashboard/out/_next/static/chunks/pages/infra/[context]-8b0809f59034d509.js +0 -1
  101. sky/dashboard/out/_next/static/chunks/pages/infra-ae9d2f705ce582c9.js +0 -1
  102. sky/dashboard/out/_next/static/chunks/pages/jobs-5bbdc71878f0a068.js +0 -1
  103. sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-7c0187f43757a548.js +0 -1
  104. sky/dashboard/out/_next/static/chunks/pages/workspaces-a1e43d9ef51a9cea.js +0 -1
  105. sky/dashboard/out/_next/static/chunks/webpack-26cdc782eed15a7d.js +0 -1
  106. sky/dashboard/out/_next/static/css/5122cb0a08486fd3.css +0 -3
  107. sky/dashboard/out/_next/static/pTQKG61ng32Zc7gsAROFJ/_buildManifest.js +0 -1
  108. sky/schemas/db/skypilot_config/001_initial_schema.py +0 -30
  109. /sky/dashboard/out/_next/static/{pTQKG61ng32Zc7gsAROFJ → BURfWrKsQk9psMPv0OXrh}/_ssgManifest.js +0 -0
  110. {skypilot_nightly-1.0.0.dev20250720.dist-info → skypilot_nightly-1.0.0.dev20250724.dist-info}/WHEEL +0 -0
  111. {skypilot_nightly-1.0.0.dev20250720.dist-info → skypilot_nightly-1.0.0.dev20250724.dist-info}/entry_points.txt +0 -0
  112. {skypilot_nightly-1.0.0.dev20250720.dist-info → skypilot_nightly-1.0.0.dev20250724.dist-info}/licenses/LICENSE +0 -0
  113. {skypilot_nightly-1.0.0.dev20250720.dist-info → skypilot_nightly-1.0.0.dev20250724.dist-info}/top_level.txt +0 -0
sky/client/sdk.pyi ADDED
@@ -0,0 +1,296 @@
1
+ """Stub for sky.client.sdk, generated by stubgen."""
2
+ import io
3
+ from typing import Any, Dict, List, Optional, Tuple, Union
4
+
5
+ from _typeshed import Incomplete
6
+ import requests
7
+
8
+ import sky
9
+ from sky import admin_policy as admin_policy
10
+ from sky import backends as backends
11
+ from sky import exceptions as exceptions
12
+ from sky import sky_logging as sky_logging
13
+ from sky import skypilot_config as skypilot_config
14
+ from sky.server import common as server_common
15
+ from sky.server import rest as rest
16
+ from sky.server.requests import payloads as payloads
17
+ from sky.skylet import constants as constants
18
+ from sky.usage import usage_lib as usage_lib
19
+ from sky.utils import admin_policy_utils as admin_policy_utils
20
+ from sky.utils import annotations as annotations
21
+ from sky.utils import cluster_utils as cluster_utils
22
+ from sky.utils import common as common
23
+ from sky.utils import common_utils as common_utils
24
+ from sky.utils import dag_utils as dag_utils
25
+ from sky.utils import env_options as env_options
26
+ from sky.utils import infra_utils as infra_utils
27
+ from sky.utils import rich_utils as rich_utils
28
+ from sky.utils import status_lib as status_lib
29
+ from sky.utils import subprocess_utils as subprocess_utils
30
+ from sky.utils import ux_utils as ux_utils
31
+ from sky.utils.kubernetes import ssh_utils as ssh_utils
32
+
33
+ logger: Incomplete
34
+
35
+
36
+ def reload_config() -> None:
37
+ ...
38
+
39
+
40
+ def stream_response(request_id: Optional[str],
41
+ response: requests.Response,
42
+ output_stream: Optional['io.TextIOBase'] = ...,
43
+ resumable: bool = ...) -> Any:
44
+ ...
45
+
46
+
47
+ def check(infra_list: Optional[Tuple[str, ...]],
48
+ verbose: bool,
49
+ workspace: Optional[str] = ...) -> server_common.RequestId:
50
+ ...
51
+
52
+
53
+ def enabled_clouds(workspace: Optional[str] = ...,
54
+ expand: bool = ...) -> server_common.RequestId:
55
+ ...
56
+
57
+
58
+ def list_accelerators(gpus_only: bool = ...,
59
+ name_filter: Optional[str] = ...,
60
+ region_filter: Optional[str] = ...,
61
+ quantity_filter: Optional[int] = ...,
62
+ clouds: Optional[Union[List[str], str]] = ...,
63
+ all_regions: bool = ...,
64
+ require_price: bool = ...,
65
+ case_sensitive: bool = ...) -> server_common.RequestId:
66
+ ...
67
+
68
+
69
+ def list_accelerator_counts(
70
+ gpus_only: bool = ...,
71
+ name_filter: Optional[str] = ...,
72
+ region_filter: Optional[str] = ...,
73
+ quantity_filter: Optional[int] = ...,
74
+ clouds: Optional[Union[List[str],
75
+ str]] = ...) -> server_common.RequestId:
76
+ ...
77
+
78
+
79
+ def optimize(
80
+ dag: sky.Dag,
81
+ minimize: common.OptimizeTarget = ...,
82
+ admin_policy_request_options: Optional[admin_policy.RequestOptions] = ...
83
+ ) -> server_common.RequestId:
84
+ ...
85
+
86
+
87
+ def workspaces() -> server_common.RequestId:
88
+ ...
89
+
90
+
91
+ def validate(
92
+ dag: sky.Dag,
93
+ workdir_only: bool = ...,
94
+ admin_policy_request_options: Optional[admin_policy.RequestOptions] = ...
95
+ ) -> None:
96
+ ...
97
+
98
+
99
+ def dashboard(starting_page: Optional[str] = ...) -> None:
100
+ ...
101
+
102
+
103
+ def launch(task: Union['sky.Task', 'sky.Dag'],
104
+ cluster_name: Optional[str] = ...,
105
+ retry_until_up: bool = ...,
106
+ idle_minutes_to_autostop: Optional[int] = ...,
107
+ dryrun: bool = ...,
108
+ down: bool = ...,
109
+ backend: Optional['backends.Backend'] = ...,
110
+ optimize_target: common.OptimizeTarget = ...,
111
+ no_setup: bool = ...,
112
+ clone_disk_from: Optional[str] = ...,
113
+ fast: bool = ...,
114
+ _need_confirmation: bool = ...,
115
+ _is_launched_by_jobs_controller: bool = ...,
116
+ _is_launched_by_sky_serve_controller: bool = ...,
117
+ _disable_controller_check: bool = ...) -> server_common.RequestId:
118
+ ...
119
+
120
+
121
+ def exec(
122
+ task: Union['sky.Task', 'sky.Dag'],
123
+ cluster_name: Optional[str] = ...,
124
+ dryrun: bool = ...,
125
+ down: bool = ...,
126
+ backend: Optional['backends.Backend'] = ...) -> server_common.RequestId:
127
+ ...
128
+
129
+
130
+ def tail_logs(cluster_name: str,
131
+ job_id: Optional[int],
132
+ follow: bool,
133
+ tail: int = ...,
134
+ output_stream: Optional['io.TextIOBase'] = ...) -> int:
135
+ ...
136
+
137
+
138
+ def download_logs(cluster_name: str,
139
+ job_ids: Optional[List[str]]) -> Dict[str, str]:
140
+ ...
141
+
142
+
143
+ def start(cluster_name: str,
144
+ idle_minutes_to_autostop: Optional[int] = ...,
145
+ retry_until_up: bool = ...,
146
+ down: bool = ...,
147
+ force: bool = ...) -> server_common.RequestId:
148
+ ...
149
+
150
+
151
+ def down(cluster_name: str, purge: bool = ...) -> server_common.RequestId:
152
+ ...
153
+
154
+
155
+ def stop(cluster_name: str, purge: bool = ...) -> server_common.RequestId:
156
+ ...
157
+
158
+
159
+ def autostop(cluster_name: str,
160
+ idle_minutes: int,
161
+ down: bool = ...) -> server_common.RequestId:
162
+ ...
163
+
164
+
165
+ def queue(cluster_name: str,
166
+ skip_finished: bool = ...,
167
+ all_users: bool = ...) -> server_common.RequestId:
168
+ ...
169
+
170
+
171
+ def job_status(cluster_name: str,
172
+ job_ids: Optional[List[int]] = ...) -> server_common.RequestId:
173
+ ...
174
+
175
+
176
+ def cancel(
177
+ cluster_name: str,
178
+ all: bool = ...,
179
+ all_users: bool = ...,
180
+ job_ids: Optional[List[int]] = ...,
181
+ _try_cancel_if_cluster_is_init: bool = ...) -> server_common.RequestId:
182
+ ...
183
+
184
+
185
+ def status(cluster_names: Optional[List[str]] = ...,
186
+ refresh: common.StatusRefreshMode = ...,
187
+ all_users: bool = ...) -> server_common.RequestId:
188
+ ...
189
+
190
+
191
+ def endpoints(cluster: str,
192
+ port: Optional[Union[int, str]] = ...) -> server_common.RequestId:
193
+ ...
194
+
195
+
196
+ def cost_report(days: Optional[int] = ...) -> server_common.RequestId:
197
+ ...
198
+
199
+
200
+ def storage_ls() -> server_common.RequestId:
201
+ ...
202
+
203
+
204
+ def storage_delete(name: str) -> server_common.RequestId:
205
+ ...
206
+
207
+
208
+ def local_up(gpus: bool,
209
+ ips: Optional[List[str]],
210
+ ssh_user: Optional[str],
211
+ ssh_key: Optional[str],
212
+ cleanup: bool,
213
+ context_name: Optional[str] = ...,
214
+ password: Optional[str] = ...) -> server_common.RequestId:
215
+ ...
216
+
217
+
218
+ def local_down() -> server_common.RequestId:
219
+ ...
220
+
221
+
222
+ def ssh_up(infra: Optional[str] = ...,
223
+ file: Optional[str] = ...) -> server_common.RequestId:
224
+ ...
225
+
226
+
227
+ def ssh_down(infra: Optional[str] = ...) -> server_common.RequestId:
228
+ ...
229
+
230
+
231
+ def realtime_kubernetes_gpu_availability(
232
+ context: Optional[str] = ...,
233
+ name_filter: Optional[str] = ...,
234
+ quantity_filter: Optional[int] = ...,
235
+ is_ssh: Optional[bool] = ...) -> server_common.RequestId:
236
+ ...
237
+
238
+
239
+ def kubernetes_node_info(
240
+ context: Optional[str] = ...) -> server_common.RequestId:
241
+ ...
242
+
243
+
244
+ def status_kubernetes() -> server_common.RequestId:
245
+ ...
246
+
247
+
248
+ def get(request_id: str) -> Any:
249
+ ...
250
+
251
+
252
+ def stream_and_get(request_id: Optional[str] = ...,
253
+ log_path: Optional[str] = ...,
254
+ tail: Optional[int] = ...,
255
+ follow: bool = ...,
256
+ output_stream: Optional['io.TextIOBase'] = ...) -> Any:
257
+ ...
258
+
259
+
260
+ def api_cancel(request_ids: Optional[Union[str, List[str]]] = ...,
261
+ all_users: bool = ...,
262
+ silent: bool = ...) -> server_common.RequestId:
263
+ ...
264
+
265
+
266
+ def api_status(request_ids: Optional[List[str]] = ...,
267
+ all_status: bool = ...) -> List[payloads.RequestPayload]:
268
+ ...
269
+
270
+
271
+ def api_info() -> Dict[str, Any]:
272
+ ...
273
+
274
+
275
+ def api_start(*,
276
+ deploy: bool = ...,
277
+ host: str = ...,
278
+ foreground: bool = ...,
279
+ metrics: bool = ...,
280
+ metrics_port: Optional[int] = ...,
281
+ enable_basic_auth: bool = ...) -> None:
282
+ ...
283
+
284
+
285
+ def api_stop() -> None:
286
+ ...
287
+
288
+
289
+ def api_server_logs(follow: bool = ..., tail: Optional[int] = ...) -> None:
290
+ ...
291
+
292
+
293
+ def api_login(endpoint: Optional[str] = ...,
294
+ relogin: bool = ...,
295
+ service_account_token: Optional[str] = ...) -> None:
296
+ ...
sky/clouds/nebius.py CHANGED
@@ -234,11 +234,8 @@ class Nebius(clouds.Cloud):
234
234
 
235
235
  config_fs = skypilot_config.get_effective_region_config(
236
236
  cloud='nebius',
237
- region=None,
238
- keys=(
239
- region.name,
240
- 'filesystems',
241
- ),
237
+ region=region.name,
238
+ keys=('filesystems',),
242
239
  default_value=[])
243
240
  resources_vars_fs = []
244
241
  for i, fs in enumerate(config_fs):
@@ -107,19 +107,13 @@ class OCIConfig:
107
107
  # Allow task(cluster)-specific compartment/VCN parameters.
108
108
  default_compartment_ocid = skypilot_config.get_effective_region_config(
109
109
  cloud='oci',
110
- region=None,
111
- keys=(
112
- 'default',
113
- 'compartment_ocid',
114
- ),
110
+ region='default',
111
+ keys=('compartment_ocid',),
115
112
  default_value=None)
116
113
  compartment = skypilot_config.get_effective_region_config(
117
114
  cloud='oci',
118
- region=None,
119
- keys=(
120
- region,
121
- 'compartment_ocid',
122
- ),
115
+ region=region,
116
+ keys=('compartment_ocid',),
123
117
  default_value=default_compartment_ocid)
124
118
  return compartment
125
119
 
@@ -127,11 +121,8 @@ class OCIConfig:
127
121
  def get_vcn_ocid(cls, region):
128
122
  # Will reuse the regional VCN if specified.
129
123
  vcn = skypilot_config.get_effective_region_config(cloud='oci',
130
- region=None,
131
- keys=(
132
- region,
133
- 'vcn_ocid',
134
- ),
124
+ region=region,
125
+ keys=('vcn_ocid',),
135
126
  default_value=None)
136
127
  return vcn
137
128
 
@@ -139,11 +130,8 @@ class OCIConfig:
139
130
  def get_vcn_subnet(cls, region):
140
131
  # Will reuse the subnet if specified.
141
132
  vcn = skypilot_config.get_effective_region_config(cloud='oci',
142
- region=None,
143
- keys=(
144
- region,
145
- 'vcn_subnet',
146
- ),
133
+ region=region,
134
+ keys=('vcn_subnet',),
147
135
  default_value=None)
148
136
  return vcn
149
137
 
@@ -155,11 +143,8 @@ class OCIConfig:
155
143
  # last)
156
144
  return skypilot_config.get_effective_region_config(
157
145
  cloud='oci',
158
- region=None,
159
- keys=(
160
- 'default',
161
- 'image_tag_gpu',
162
- ),
146
+ region='default',
147
+ keys=('image_tag_gpu',),
163
148
  default_value='skypilot:gpu-ubuntu-2204')
164
149
 
165
150
  @classmethod
@@ -169,11 +154,8 @@ class OCIConfig:
169
154
  # specified, use the hardcode one at last)
170
155
  return skypilot_config.get_effective_region_config(
171
156
  cloud='oci',
172
- region=None,
173
- keys=(
174
- 'default',
175
- 'image_tag_general',
176
- ),
157
+ region='default',
158
+ keys=('image_tag_general',),
177
159
  default_value='skypilot:cpu-ubuntu-2204')
178
160
 
179
161
  @classmethod
@@ -190,11 +172,8 @@ class OCIConfig:
190
172
  def get_profile(cls) -> str:
191
173
  return skypilot_config.get_effective_region_config(
192
174
  cloud='oci',
193
- region=None,
194
- keys=(
195
- 'default',
196
- 'oci_config_profile',
197
- ),
175
+ region='default',
176
+ keys=('oci_config_profile',),
198
177
  default_value='DEFAULT')
199
178
 
200
179
  @classmethod
@@ -204,11 +183,8 @@ class OCIConfig:
204
183
  # specified, use the hardcode one at last)
205
184
  return skypilot_config.get_effective_region_config(
206
185
  cloud='oci',
207
- region=None,
208
- keys=(
209
- 'default',
210
- 'image_os_type',
211
- ),
186
+ region='default',
187
+ keys=('image_os_type',),
212
188
  default_value='ubuntu')
213
189
 
214
190
 
sky/clouds/vast.py CHANGED
@@ -265,7 +265,8 @@ class Vast(clouds.Cloud):
265
265
  'error \n' # First line is indented by 4 spaces
266
266
  ' Credentials can be set up by running: \n'
267
267
  ' $ pip install vastai\n'
268
- ' $ echo [key] > ~/.vast_api_key\n'
268
+ ' $ mkdir -p ~/.config/vastai\n'
269
+ ' $ echo [key] > ~/.config/vastai/vast_api_key\n'
269
270
  ' For more information, see https://skypilot.readthedocs.io/en/latest/getting-started/installation.html#vast' # pylint: disable=line-too-long
270
271
  )
271
272
 
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/5122cb0a08486fd3.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/5122cb0a08486fd3.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/dashboard/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/dashboard/_next/static/chunks/webpack-26cdc782eed15a7d.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-efc06c2733009cd3.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-c0a4f1ea606d48d2.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-507712f30cd3cec3.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-c72a1f77a3c0be1b.js" defer=""></script><script src="/dashboard/_next/static/pTQKG61ng32Zc7gsAROFJ/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/pTQKG61ng32Zc7gsAROFJ/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"pTQKG61ng32Zc7gsAROFJ","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/b3227360726f12eb.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/b3227360726f12eb.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/dashboard/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/dashboard/_next/static/chunks/webpack-b6447da22305b14a.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-efc06c2733009cd3.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-c0a4f1ea606d48d2.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-da491665d4289aae.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-c72a1f77a3c0be1b.js" defer=""></script><script src="/dashboard/_next/static/BURfWrKsQk9psMPv0OXrh/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/BURfWrKsQk9psMPv0OXrh/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"BURfWrKsQk9psMPv0OXrh","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1 @@
1
+ self.__BUILD_MANIFEST=function(s,c,e,a,t,f,u,n,r,b,i,d,j,k,o){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-89e7daf7b7df02e0.js"],"/_error":["static/chunks/pages/_error-c72a1f77a3c0be1b.js"],"/clusters":["static/chunks/pages/clusters-3d4be4961e1c94eb.js"],"/clusters/[cluster]":[s,c,e,a,t,r,i,f,u,n,d,b,j,k,o,"static/chunks/1871-ea0e7283886407ca.js","static/chunks/pages/clusters/[cluster]-95afb019ab85801c.js"],"/clusters/[cluster]/[job]":[s,c,e,a,t,f,u,n,"static/chunks/pages/clusters/[cluster]/[job]-2186770cc2de1623.js"],"/config":["static/chunks/pages/config-a2673b256b6d416f.js"],"/infra":["static/chunks/pages/infra-0d3d1f890c5d188a.js"],"/infra/[context]":["static/chunks/pages/infra/[context]-a90b4fe4616dc501.js"],"/jobs":["static/chunks/pages/jobs-49f790d12a85027c.js"],"/jobs/[job]":[s,c,e,a,t,r,f,u,n,b,"static/chunks/pages/jobs/[job]-dc0299ffefebcdbe.js"],"/users":["static/chunks/pages/users-6790fcefd5487b13.js"],"/volumes":["static/chunks/pages/volumes-61ea7ba7e56f8d06.js"],"/workspace/new":["static/chunks/pages/workspace/new-5629d4e551dba1ee.js"],"/workspaces":["static/chunks/pages/workspaces-5f7fe4b7d55b8612.js"],"/workspaces/[name]":[s,c,e,a,t,r,i,f,u,n,d,b,j,k,o,"static/chunks/1141-e49a159c30a6c4a7.js","static/chunks/pages/workspaces/[name]-6bcd4b20914d76c9.js"],sortedPages:["/","/_app","/_error","/clusters","/clusters/[cluster]","/clusters/[cluster]/[job]","/config","/infra","/infra/[context]","/jobs","/jobs/[job]","/users","/volumes","/workspace/new","/workspaces","/workspaces/[name]"]}}("static/chunks/616-162f3033ffcd3d31.js","static/chunks/5230-df791914b54d91d9.js","static/chunks/5739-5ea3ffa10fc884f2.js","static/chunks/1664-d65361e92b85e786.js","static/chunks/7411-2cc31dc0fdf2a9ad.js","static/chunks/6989-eab0e9c16b64fd9f.js","static/chunks/3698-9fa11dafb5cad4a6.js","static/chunks/6135-2abbd0352f8ee061.js","static/chunks/1272-1ef0bf0237faccdb.js","static/chunks/8969-8e0b2055bf5dd499.js","static/chunks/1559-18717d96ef2fcbe9.js","static/chunks/6990-f64e03df359e04f7.js","static/chunks/1043-869d9c78bf5dd3df.js","static/chunks/6601-d4a381403a8bae91.js","static/chunks/938-7ee806653aef0609.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -8,4 +8,4 @@
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */let a=(0,r(998).Z)("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]])},1812:function(e,s,r){r.d(s,{X:function(){return n}});var a=r(5893),l=r(7294);let t=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let s=e.message;return s.includes("failed:")&&(s=s.split("failed:")[1].trim()),s},n=e=>{let{error:s,title:r="Error",onDismiss:n}=e,[c,i]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{s&&i(!1)},[s]),!s||c)return null;let o="string"==typeof s?s:t(s);return(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,a.jsx)("div",{className:"ml-3",children:(0,a.jsxs)("div",{className:"text-sm text-red-800",children:[(0,a.jsxs)("strong",{children:[r,":"]})," ",o]})})]}),(0,a.jsx)("button",{onClick:()=>{i(!0),n&&n()},className:"flex-shrink-0 ml-4 text-red-400 hover:text-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 focus:ring-offset-red-50 rounded","aria-label":"Dismiss error",children:(0,a.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})})}},9123:function(e,s,r){r.d(s,{g:function(){return n}});var a=r(5893),l=r(7294),t=r(2350);let n=l.forwardRef((e,s)=>{let{className:r,...l}=e;return(0,a.jsx)("textarea",{className:(0,t.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:s,...l})});n.displayName="Textarea"},1141:function(e,s,r){r.r(s),r.d(s,{WorkspaceEditor:function(){return R}});var a=r(5893),l=r(7294),t=r(1163),n=r(7324),c=r(3266),i=r(8969);r(9470);var o=r(1664),d=r.n(o),u=r(9008),x=r.n(u),m=r(7673),h=r(803),f=r(9123),g=r(5739),p=r(282),b=r(6021),j=r(3626),y=r(8418),N=r(9333),v=r(326);let w=e=>{let{className:s="",variant:r="default",children:l,...t}=e;return(0,a.jsx)("div",{role:"alert",className:"".concat("relative w-full rounded-lg border p-4 flex items-start space-x-2"," ").concat({default:"bg-blue-50 border-blue-200 text-blue-800",destructive:"bg-red-50 border-red-200 text-red-800"}[r]," ").concat(s),...t,children:l})},k=e=>{let{className:s="",children:r,...l}=e;return(0,a.jsx)("div",{className:"text-sm leading-relaxed ".concat(s),...l,children:r})};var C=r(3850),L=r(1812),S=r(938),E=r(1272),Z=r(3225),D=r(3081);let M=e=>{let{message:s}=e;return s?(0,a.jsxs)(w,{className:"border-green-200 bg-green-50",children:[(0,a.jsx)(p.Z,{className:"h-4 w-4 text-green-600"}),(0,a.jsx)(k,{className:"text-green-800",children:s})]}):null},A=e=>{let{workspaceName:s,config:r,enabledClouds:l=[]}=e;if(!r)return null;let t="default"===s,n=0===Object.keys(r).length;if(t&&n)return(0,a.jsx)("div",{className:"text-sm text-gray-500 mb-3 italic p-3 bg-sky-50 rounded border border-sky-200",children:"Workspace 'default' can use all accessible infrastructure."});let c=[],i=[],o=[],d=new Set(l.map(e=>e.toLowerCase()));Object.entries(r).forEach(e=>{let[s,r]=e;if("private"===s||"allowed_users"===s)return;let l=Z.Z2[s.toLowerCase()]||s.toUpperCase(),t=d.has(null==l?void 0:l.toLowerCase());if((null==r?void 0:r.disabled)===!0)i.push(l);else if(r&&Object.keys(r).length>0){let e="";"gcp"===s.toLowerCase()&&r.project_id?e=" (Project ID: ".concat(r.project_id,")"):"aws"===s.toLowerCase()&&r.region&&(e=" (Region: ".concat(r.region,")")),t?c.push((0,a.jsxs)("span",{className:"block",children:[l,e," is enabled."]},"".concat(s,"-enabled"))):o.push((0,a.jsxs)("span",{className:"block text-amber-700",children:[l,e," is configured but not currently available."]},"".concat(s,"-configured-not-enabled")))}else t?c.push((0,a.jsxs)("span",{className:"block",children:[l," is enabled (using default settings)."]},"".concat(s,"-default-enabled"))):o.push((0,a.jsxs)("span",{className:"block text-amber-700",children:[l," is configured but not currently available."]},"".concat(s,"-default-not-enabled")))});let u=[];if(i.length>0){let e=i.join(" and ");u.push((0,a.jsxs)("span",{className:"block",children:[e," ",1===i.length?"is":"are"," explicitly disabled."]},"disabled-clouds"))}return(u.push(...c),u.push(...o),u.length>0)?(0,a.jsx)("div",{className:"text-sm text-gray-700 mb-3 p-3 bg-sky-50 rounded border border-sky-200",children:u}):!t&&n?(0,a.jsx)("div",{className:"text-sm text-gray-500 mb-3 italic p-3 bg-sky-50 rounded border border-sky-200",children:"This workspace has no specific cloud resource configurations and can use all accessible infrastructure."}):null},W=e=>{let{isPrivate:s}=e;return s?(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-700 border border-gray-300",children:"Private"}):(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-300",children:"Public"})},P=e=>{let{workspaceConfig:s,allUsers:r}=e;if(!s.private)return null;let l=s.allowed_users||[],t=(r||[]).filter(e=>"admin"===e.role).map(e=>e.username),n=[...new Set([...l,...t])];return 0===n.length?(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:"Allowed Users (0)"}),(0,a.jsx)("div",{className:"text-amber-600 text-xs italic p-2 bg-amber-50 rounded border border-amber-200",children:"No users configured (workspace may be inaccessible)"})]}):(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:["Allowed Users (",n.length,")"]}),(0,a.jsx)("div",{className:"space-y-1 max-h-48 overflow-y-auto border border-gray-200 rounded",children:n.map(e=>{let s=t.includes(e);return(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs p-2 bg-gray-50 hover:bg-gray-100 border-b border-gray-100 last:border-b-0",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:e}),s?(0,a.jsxs)("span",{className:"inline-flex items-center text-blue-600",children:[(0,a.jsx)(C.r7,{className:"w-3 h-3 mr-1"}),"Admin"]}):(0,a.jsxs)("span",{className:"inline-flex items-center text-gray-600",children:[(0,a.jsx)(b.Z,{className:"w-3 h-3 mr-1"}),"User"]})]},e)})})]})};function R(e){let{workspaceName:s,isNewWorkspace:r=!1}=e,o=(0,t.useRouter)(),[u,p]=(0,l.useState)({}),[b,w]=(0,l.useState)({}),[k,Z]=(0,l.useState)(""),[R,_]=(0,l.useState)(!0),[z,O]=(0,l.useState)(!1),[T,U]=(0,l.useState)(!1),[Y,J]=(0,l.useState)(null),[I,V]=(0,l.useState)(null),[F,H]=(0,l.useState)(null),[X,B]=(0,l.useState)([]),[G,q]=(0,l.useState)({showDialog:!1,deleting:!1,error:null}),[K,Q]=(0,l.useState)({totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:[]}),[$,ee]=(0,l.useState)(!1),es=(0,l.useCallback)(async()=>{_(!0),J(null);try{let e;let[r,a]=await Promise.all([(0,n.fX)(),(0,D.R)()]),l=r[s]||{};p(l),w(l),B(a||[]),e=0===Object.keys(l).length?"".concat(s,":\n # Empty workspace configuration - uses all accessible infrastructure\n"):E.ZP.dump({[s]:l},{indent:2,lineWidth:-1,noRefs:!0,skipInvalid:!0,flowLevel:-1}),Z(e)}catch(e){console.error("Error fetching workspace config:",e),J(e)}finally{_(!1)}},[s]),er=(0,l.useCallback)(async()=>{if(!r){ee(!0);try{let[e,r,a]=await Promise.all([(0,c.getClusters)(),(0,i.getManagedJobs)(),(0,n.yz)(s,!0)]),l=e.filter(e=>(e.workspace||"default")===s),t=l.filter(e=>"RUNNING"===e.status||"LAUNCHING"===e.status),o={};e.forEach(e=>{o[e.cluster]=e.workspace||"default"});let d=r.jobs||[],u=new Set(S.statusGroups.active),x=0;d.forEach(e=>{let r=e.cluster_name||e.resources&&e.resources.cluster_name;r&&o[r]===s&&u.has(e.status)&&x++}),Q({totalClusterCount:l.length,runningClusterCount:t.length,managedJobsCount:x,clouds:Array.isArray(a)?a:[]})}catch(e){console.error("Failed to fetch workspace stats:",e)}finally{ee(!1)}}},[s,r]);(0,l.useEffect)(()=>{r?(_(!1),Z("".concat(s,":\n # New workspace configuration\n # Leave empty to use all accessible infrastructure\n"))):(es(),er())},[s,r,es,er]),(0,l.useEffect)(()=>{U(JSON.stringify(u)!==JSON.stringify(b))},[u,b]);let ea=e=>{Z(e),H(null);try{let r=E.ZP.load(e)||{},a=Object.keys(r);if(0===a.length)p({});else if(1===a.length){let e=a[0];if(e!==s){H('Workspace name cannot be changed. Expected "'.concat(s,'" but found "').concat(e,'".'));return}let l=r[s]||{};p(l)}else H("Configuration must contain only one workspace. Found: ".concat(a.join(", ")))}catch(e){H("Invalid YAML: ".concat(e.message))}},el=async()=>{O(!0),J(null),V(null);try{if(F)throw Error("Please fix YAML errors before saving");let e=E.ZP.load(k)||{},a=Object.keys(e);if(a.length>0&&a[0]!==s)throw Error('Workspace name cannot be changed. Expected "'.concat(s,'".'));r?(await (0,n.MB)(s,u),V("Workspace created successfully!"),setTimeout(()=>{o.push("/workspaces/".concat(s))},1500)):(await (0,n.eA)(s,u),V("Workspace updated successfully!"),w(u),er())}catch(e){console.error("Error saving workspace:",e),J(e)}finally{O(!1)}},et=async()=>{q(e=>({...e,deleting:!0,error:null}));try{await (0,n.zl)(s),V("Workspace deleted successfully!"),setTimeout(()=>{o.push("/workspaces")},1500)}catch(e){console.error("Error deleting workspace:",e),q(s=>({...s,deleting:!1,error:e}))}},en=()=>{q({showDialog:!1,deleting:!1,error:null})},ec=async()=>{await Promise.all([es(),er()])};if(!o.isReady)return(0,a.jsx)("div",{children:"Loading..."});let ei=r?"Create New Workspace | SkyPilot Dashboard":"Workspace: ".concat(s," | SkyPilot Dashboard");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x(),{children:(0,a.jsx)("title",{children:ei})}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(d(),{href:"/workspaces",className:"text-sky-blue hover:underline",children:"Workspaces"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)(d(),{href:r?"/workspace/new":"/workspaces/".concat(s),className:"text-sky-blue hover:underline",children:r?"New Workspace":s}),T&&(0,a.jsx)("span",{className:"ml-3 px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded",children:"Unsaved changes"})]}),(0,a.jsxs)("div",{className:"text-sm flex items-center",children:[(R||z||$)&&(0,a.jsxs)("div",{className:"flex items-center mr-4",children:[(0,a.jsx)(g.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500",children:z?"Saving...":"Loading..."})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[!r&&(0,a.jsxs)("button",{onClick:ec,disabled:R||z||$,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[(0,a.jsx)(j.Z,{className:"w-4 h-4 mr-1.5"}),"Refresh"]}),!r&&"default"!==s&&(0,a.jsxs)("button",{onClick:()=>q({...G,showDialog:!0}),disabled:G.deleting||z,className:"text-red-600 hover:text-red-700 font-medium inline-flex items-center",children:[(0,a.jsx)(y.Z,{className:"w-4 h-4 mr-1.5"}),"Delete"]})]})]})]}),R?(0,a.jsxs)("div",{className:"flex justify-center items-center py-12",children:[(0,a.jsx)(g.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading workspace configuration..."})]}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(L.X,{error:Y,title:"Error",onDismiss:()=>J(null)}),(0,a.jsx)(M,{message:I}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[!r&&(0,a.jsx)("div",{className:"lg:col-span-1",children:(0,a.jsxs)(m.Zb,{className:"h-full",children:[(0,a.jsx)(m.Ol,{children:(0,a.jsx)(m.ll,{className:"text-base font-normal",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Workspace:"})," ",s]}),(0,a.jsx)(W,{isPrivate:!0===b.private})]})})}),(0,a.jsxs)(m.aY,{className:"text-sm pb-2 flex-1",children:[(0,a.jsxs)("div",{className:"py-2 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,a.jsx)(C.QT,{className:"w-4 h-4 mr-2 text-gray-500"}),(0,a.jsx)("span",{children:"Clusters (Running / Total)"})]}),(0,a.jsx)("span",{className:"font-normal text-gray-800",children:$?"...":"".concat(K.runningClusterCount," / ").concat(K.totalClusterCount)})]}),(0,a.jsxs)("div",{className:"py-2 flex items-center justify-between border-t border-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,a.jsx)(C.Vp,{className:"w-4 h-4 mr-2 text-gray-500"}),(0,a.jsx)("span",{children:"Managed Jobs"})]}),(0,a.jsx)("span",{className:"font-normal text-gray-800",children:$?"...":K.managedJobsCount})]})]}),(0,a.jsxs)("div",{className:"px-6 pb-6 text-sm pt-3",children:[(0,a.jsx)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:"Enabled Infra"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:$?(0,a.jsx)("span",{className:"text-gray-500",children:"Loading..."}):K.clouds.length>0?K.clouds.map(e=>(0,a.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,a.jsx)(C.Ye,{className:"w-3.5 h-3.5 mr-1.5 text-green-500"}),(0,a.jsx)("span",{children:e})]},e)):(0,a.jsx)("span",{className:"text-gray-500 italic",children:"No enabled infrastructure"})}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(A,{workspaceName:s,config:b,enabledClouds:K.clouds})}),(0,a.jsx)(P,{workspaceConfig:b,allUsers:X})]})]})}),(0,a.jsx)("div",{className:r?"lg:col-span-3":"lg:col-span-2",children:(0,a.jsxs)(m.Zb,{className:"h-full flex flex-col",children:[(0,a.jsx)(m.Ol,{children:(0,a.jsx)(m.ll,{className:"text-base font-normal",children:r?"New Workspace YAML":"Edit Workspace YAML"})}),(0,a.jsx)(m.aY,{className:"flex-1 flex flex-col",children:(0,a.jsxs)("div",{className:"space-y-4 flex-1 flex flex-col",children:[F&&(0,a.jsx)(L.X,{error:F,onDismiss:()=>H(null)}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-600 mb-3",children:["Configure infra-specific settings for this workspace. Leave empty to use all accessible infrastructure. Refer to"," ",(0,a.jsx)("a",{href:"https://docs.skypilot.co/en/latest/admin/workspaces.html#configuration",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600",children:"SkyPilot Docs"})," ","for more details."]}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Example configuration:"}),(0,a.jsx)("div",{className:"p-3 bg-gray-50 border rounded-lg",children:(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-600 whitespace-pre-wrap",children:"".concat(s||"my-workspace",":\n private: true\n allowed_users:\n - user1@mydomain.com\n - user2@mydomain.com\n gcp:\n project_id: xxx\n disabled: false\n kubernetes:\n allowed_contexts:\n - context-1")})})]}),(0,a.jsx)(f.g,{value:k,onChange:e=>ea(e.target.value),className:"font-mono text-sm flex-1 resize-none",style:{minHeight:"350px"},spellCheck:!1,placeholder:"# Enter workspace configuration in YAML format"}),(0,a.jsx)("div",{className:"flex justify-end space-x-3 pt-3 border-gray-200",children:(0,a.jsxs)(h.z,{onClick:el,disabled:z||F||R,className:"inline-flex items-center bg-sky-600 hover:bg-sky-700 text-white",children:[(0,a.jsx)(N.Z,{className:"w-4 h-4 mr-1.5"}),z?"Applying...":"Apply"]})})]})]})})]})})]})]}),(0,a.jsx)(v.Vq,{open:G.showDialog,onOpenChange:en,children:(0,a.jsxs)(v.cZ,{className:"sm:max-w-md",children:[(0,a.jsxs)(v.fK,{className:"",children:[(0,a.jsx)(v.$N,{children:"Delete Workspace"}),(0,a.jsxs)(v.Be,{children:['Are you sure you want to delete workspace "',s,'"? This action cannot be undone.']})]}),G.error&&(0,a.jsx)(L.X,{error:G.error,title:"Deletion Failed",onDismiss:()=>q(e=>({...e,error:null}))}),(0,a.jsxs)(v.cN,{className:"",children:[(0,a.jsx)(h.z,{variant:"outline",onClick:en,disabled:G.deleting,children:"Cancel"}),(0,a.jsx)(h.z,{variant:"destructive",onClick:et,disabled:G.deleting,children:G.deleting?"Deleting...":"Delete"})]})]})})]})]})}}}]);
11
+ */let a=(0,r(998).Z)("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]])},1812:function(e,s,r){r.d(s,{X:function(){return n}});var a=r(5893),l=r(7294);let t=e=>{if(!(null==e?void 0:e.message))return"An unexpected error occurred.";let s=e.message;return s.includes("failed:")&&(s=s.split("failed:")[1].trim()),s},n=e=>{let{error:s,title:r="Error",onDismiss:n}=e,[c,i]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{s&&i(!1)},[s]),!s||c)return null;let o="string"==typeof s?s:t(s);return(0,a.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-md p-3 mb-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,a.jsx)("div",{className:"ml-3",children:(0,a.jsxs)("div",{className:"text-sm text-red-800",children:[(0,a.jsxs)("strong",{children:[r,":"]})," ",o]})})]}),(0,a.jsx)("button",{onClick:()=>{i(!0),n&&n()},className:"flex-shrink-0 ml-4 text-red-400 hover:text-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 focus:ring-offset-red-50 rounded","aria-label":"Dismiss error",children:(0,a.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]})})}},9123:function(e,s,r){r.d(s,{g:function(){return n}});var a=r(5893),l=r(7294),t=r(2350);let n=l.forwardRef((e,s)=>{let{className:r,...l}=e;return(0,a.jsx)("textarea",{className:(0,t.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:s,...l})});n.displayName="Textarea"},1141:function(e,s,r){r.r(s),r.d(s,{WorkspaceEditor:function(){return R}});var a=r(5893),l=r(7294),t=r(1163),n=r(7324),c=r(3266),i=r(8969);r(6135);var o=r(1664),d=r.n(o),u=r(9008),x=r.n(u),m=r(7673),h=r(803),f=r(9123),g=r(5739),p=r(282),b=r(6021),j=r(3626),y=r(8418),N=r(9333),v=r(326);let w=e=>{let{className:s="",variant:r="default",children:l,...t}=e;return(0,a.jsx)("div",{role:"alert",className:"".concat("relative w-full rounded-lg border p-4 flex items-start space-x-2"," ").concat({default:"bg-blue-50 border-blue-200 text-blue-800",destructive:"bg-red-50 border-red-200 text-red-800"}[r]," ").concat(s),...t,children:l})},k=e=>{let{className:s="",children:r,...l}=e;return(0,a.jsx)("div",{className:"text-sm leading-relaxed ".concat(s),...l,children:r})};var C=r(3850),L=r(1812),S=r(938),E=r(1272),Z=r(3225),D=r(3081);let M=e=>{let{message:s}=e;return s?(0,a.jsxs)(w,{className:"border-green-200 bg-green-50",children:[(0,a.jsx)(p.Z,{className:"h-4 w-4 text-green-600"}),(0,a.jsx)(k,{className:"text-green-800",children:s})]}):null},A=e=>{let{workspaceName:s,config:r,enabledClouds:l=[]}=e;if(!r)return null;let t="default"===s,n=0===Object.keys(r).length;if(t&&n)return(0,a.jsx)("div",{className:"text-sm text-gray-500 mb-3 italic p-3 bg-sky-50 rounded border border-sky-200",children:"Workspace 'default' can use all accessible infrastructure."});let c=[],i=[],o=[],d=new Set(l.map(e=>e.toLowerCase()));Object.entries(r).forEach(e=>{let[s,r]=e;if("private"===s||"allowed_users"===s)return;let l=Z.Z2[s.toLowerCase()]||s.toUpperCase(),t=d.has(null==l?void 0:l.toLowerCase());if((null==r?void 0:r.disabled)===!0)i.push(l);else if(r&&Object.keys(r).length>0){let e="";"gcp"===s.toLowerCase()&&r.project_id?e=" (Project ID: ".concat(r.project_id,")"):"aws"===s.toLowerCase()&&r.region&&(e=" (Region: ".concat(r.region,")")),t?c.push((0,a.jsxs)("span",{className:"block",children:[l,e," is enabled."]},"".concat(s,"-enabled"))):o.push((0,a.jsxs)("span",{className:"block text-amber-700",children:[l,e," is configured but not currently available."]},"".concat(s,"-configured-not-enabled")))}else t?c.push((0,a.jsxs)("span",{className:"block",children:[l," is enabled (using default settings)."]},"".concat(s,"-default-enabled"))):o.push((0,a.jsxs)("span",{className:"block text-amber-700",children:[l," is configured but not currently available."]},"".concat(s,"-default-not-enabled")))});let u=[];if(i.length>0){let e=i.join(" and ");u.push((0,a.jsxs)("span",{className:"block",children:[e," ",1===i.length?"is":"are"," explicitly disabled."]},"disabled-clouds"))}return(u.push(...c),u.push(...o),u.length>0)?(0,a.jsx)("div",{className:"text-sm text-gray-700 mb-3 p-3 bg-sky-50 rounded border border-sky-200",children:u}):!t&&n?(0,a.jsx)("div",{className:"text-sm text-gray-500 mb-3 italic p-3 bg-sky-50 rounded border border-sky-200",children:"This workspace has no specific cloud resource configurations and can use all accessible infrastructure."}):null},W=e=>{let{isPrivate:s}=e;return s?(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-700 border border-gray-300",children:"Private"}):(0,a.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700 border border-green-300",children:"Public"})},P=e=>{let{workspaceConfig:s,allUsers:r}=e;if(!s.private)return null;let l=s.allowed_users||[],t=(r||[]).filter(e=>"admin"===e.role).map(e=>e.username),n=[...new Set([...l,...t])];return 0===n.length?(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:"Allowed Users (0)"}),(0,a.jsx)("div",{className:"text-amber-600 text-xs italic p-2 bg-amber-50 rounded border border-amber-200",children:"No users configured (workspace may be inaccessible)"})]}):(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsxs)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:["Allowed Users (",n.length,")"]}),(0,a.jsx)("div",{className:"space-y-1 max-h-48 overflow-y-auto border border-gray-200 rounded",children:n.map(e=>{let s=t.includes(e);return(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs p-2 bg-gray-50 hover:bg-gray-100 border-b border-gray-100 last:border-b-0",children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:e}),s?(0,a.jsxs)("span",{className:"inline-flex items-center text-blue-600",children:[(0,a.jsx)(C.r7,{className:"w-3 h-3 mr-1"}),"Admin"]}):(0,a.jsxs)("span",{className:"inline-flex items-center text-gray-600",children:[(0,a.jsx)(b.Z,{className:"w-3 h-3 mr-1"}),"User"]})]},e)})})]})};function R(e){let{workspaceName:s,isNewWorkspace:r=!1}=e,o=(0,t.useRouter)(),[u,p]=(0,l.useState)({}),[b,w]=(0,l.useState)({}),[k,Z]=(0,l.useState)(""),[R,_]=(0,l.useState)(!0),[z,O]=(0,l.useState)(!1),[T,U]=(0,l.useState)(!1),[Y,J]=(0,l.useState)(null),[I,V]=(0,l.useState)(null),[F,H]=(0,l.useState)(null),[X,B]=(0,l.useState)([]),[G,q]=(0,l.useState)({showDialog:!1,deleting:!1,error:null}),[K,Q]=(0,l.useState)({totalClusterCount:0,runningClusterCount:0,managedJobsCount:0,clouds:[]}),[$,ee]=(0,l.useState)(!1),es=(0,l.useCallback)(async()=>{_(!0),J(null);try{let e;let[r,a]=await Promise.all([(0,n.fX)(),(0,D.R)()]),l=r[s]||{};p(l),w(l),B(a||[]),e=0===Object.keys(l).length?"".concat(s,":\n # Empty workspace configuration - uses all accessible infrastructure\n"):E.ZP.dump({[s]:l},{indent:2,lineWidth:-1,noRefs:!0,skipInvalid:!0,flowLevel:-1}),Z(e)}catch(e){console.error("Error fetching workspace config:",e),J(e)}finally{_(!1)}},[s]),er=(0,l.useCallback)(async()=>{if(!r){ee(!0);try{let[e,r,a]=await Promise.all([(0,c.getClusters)(),(0,i.getManagedJobs)(),(0,n.yz)(s,!0)]),l=e.filter(e=>(e.workspace||"default")===s),t=l.filter(e=>"RUNNING"===e.status||"LAUNCHING"===e.status),o={};e.forEach(e=>{o[e.cluster]=e.workspace||"default"});let d=r.jobs||[],u=new Set(S.statusGroups.active),x=0;d.forEach(e=>{let r=e.cluster_name||e.resources&&e.resources.cluster_name;r&&o[r]===s&&u.has(e.status)&&x++}),Q({totalClusterCount:l.length,runningClusterCount:t.length,managedJobsCount:x,clouds:Array.isArray(a)?a:[]})}catch(e){console.error("Failed to fetch workspace stats:",e)}finally{ee(!1)}}},[s,r]);(0,l.useEffect)(()=>{r?(_(!1),Z("".concat(s,":\n # New workspace configuration\n # Leave empty to use all accessible infrastructure\n"))):(es(),er())},[s,r,es,er]),(0,l.useEffect)(()=>{U(JSON.stringify(u)!==JSON.stringify(b))},[u,b]);let ea=e=>{Z(e),H(null);try{let r=E.ZP.load(e)||{},a=Object.keys(r);if(0===a.length)p({});else if(1===a.length){let e=a[0];if(e!==s){H('Workspace name cannot be changed. Expected "'.concat(s,'" but found "').concat(e,'".'));return}let l=r[s]||{};p(l)}else H("Configuration must contain only one workspace. Found: ".concat(a.join(", ")))}catch(e){H("Invalid YAML: ".concat(e.message))}},el=async()=>{O(!0),J(null),V(null);try{if(F)throw Error("Please fix YAML errors before saving");let e=E.ZP.load(k)||{},a=Object.keys(e);if(a.length>0&&a[0]!==s)throw Error('Workspace name cannot be changed. Expected "'.concat(s,'".'));r?(await (0,n.MB)(s,u),V("Workspace created successfully!"),setTimeout(()=>{o.push("/workspaces/".concat(s))},1500)):(await (0,n.eA)(s,u),V("Workspace updated successfully!"),w(u),er())}catch(e){console.error("Error saving workspace:",e),J(e)}finally{O(!1)}},et=async()=>{q(e=>({...e,deleting:!0,error:null}));try{await (0,n.zl)(s),V("Workspace deleted successfully!"),setTimeout(()=>{o.push("/workspaces")},1500)}catch(e){console.error("Error deleting workspace:",e),q(s=>({...s,deleting:!1,error:e}))}},en=()=>{q({showDialog:!1,deleting:!1,error:null})},ec=async()=>{await Promise.all([es(),er()])};if(!o.isReady)return(0,a.jsx)("div",{children:"Loading..."});let ei=r?"Create New Workspace | SkyPilot Dashboard":"Workspace: ".concat(s," | SkyPilot Dashboard");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x(),{children:(0,a.jsx)("title",{children:ei})}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,a.jsxs)("div",{className:"text-base flex items-center",children:[(0,a.jsx)(d(),{href:"/workspaces",className:"text-sky-blue hover:underline",children:"Workspaces"}),(0,a.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,a.jsx)(d(),{href:r?"/workspace/new":"/workspaces/".concat(s),className:"text-sky-blue hover:underline",children:r?"New Workspace":s}),T&&(0,a.jsx)("span",{className:"ml-3 px-2 py-1 bg-yellow-100 text-yellow-800 text-xs rounded",children:"Unsaved changes"})]}),(0,a.jsxs)("div",{className:"text-sm flex items-center",children:[(R||z||$)&&(0,a.jsxs)("div",{className:"flex items-center mr-4",children:[(0,a.jsx)(g.Z,{size:15,className:"mt-0"}),(0,a.jsx)("span",{className:"ml-2 text-gray-500",children:z?"Saving...":"Loading..."})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[!r&&(0,a.jsxs)("button",{onClick:ec,disabled:R||z||$,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[(0,a.jsx)(j.Z,{className:"w-4 h-4 mr-1.5"}),"Refresh"]}),!r&&"default"!==s&&(0,a.jsxs)("button",{onClick:()=>q({...G,showDialog:!0}),disabled:G.deleting||z,className:"text-red-600 hover:text-red-700 font-medium inline-flex items-center",children:[(0,a.jsx)(y.Z,{className:"w-4 h-4 mr-1.5"}),"Delete"]})]})]})]}),R?(0,a.jsxs)("div",{className:"flex justify-center items-center py-12",children:[(0,a.jsx)(g.Z,{size:24,className:"mr-2"}),(0,a.jsx)("span",{className:"text-gray-500",children:"Loading workspace configuration..."})]}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(L.X,{error:Y,title:"Error",onDismiss:()=>J(null)}),(0,a.jsx)(M,{message:I}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[!r&&(0,a.jsx)("div",{className:"lg:col-span-1",children:(0,a.jsxs)(m.Zb,{className:"h-full",children:[(0,a.jsx)(m.Ol,{children:(0,a.jsx)(m.ll,{className:"text-base font-normal",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Workspace:"})," ",s]}),(0,a.jsx)(W,{isPrivate:!0===b.private})]})})}),(0,a.jsxs)(m.aY,{className:"text-sm pb-2 flex-1",children:[(0,a.jsxs)("div",{className:"py-2 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,a.jsx)(C.QT,{className:"w-4 h-4 mr-2 text-gray-500"}),(0,a.jsx)("span",{children:"Clusters (Running / Total)"})]}),(0,a.jsx)("span",{className:"font-normal text-gray-800",children:$?"...":"".concat(K.runningClusterCount," / ").concat(K.totalClusterCount)})]}),(0,a.jsxs)("div",{className:"py-2 flex items-center justify-between border-t border-gray-100",children:[(0,a.jsxs)("div",{className:"flex items-center text-gray-600",children:[(0,a.jsx)(C.Vp,{className:"w-4 h-4 mr-2 text-gray-500"}),(0,a.jsx)("span",{children:"Managed Jobs"})]}),(0,a.jsx)("span",{className:"font-normal text-gray-800",children:$?"...":K.managedJobsCount})]})]}),(0,a.jsxs)("div",{className:"px-6 pb-6 text-sm pt-3",children:[(0,a.jsx)("h4",{className:"mb-2 text-xs text-gray-500 tracking-wider",children:"Enabled Infra"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1",children:$?(0,a.jsx)("span",{className:"text-gray-500",children:"Loading..."}):K.clouds.length>0?K.clouds.map(e=>(0,a.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,a.jsx)(C.Ye,{className:"w-3.5 h-3.5 mr-1.5 text-green-500"}),(0,a.jsx)("span",{children:e})]},e)):(0,a.jsx)("span",{className:"text-gray-500 italic",children:"No enabled infrastructure"})}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(A,{workspaceName:s,config:b,enabledClouds:K.clouds})}),(0,a.jsx)(P,{workspaceConfig:b,allUsers:X})]})]})}),(0,a.jsx)("div",{className:r?"lg:col-span-3":"lg:col-span-2",children:(0,a.jsxs)(m.Zb,{className:"h-full flex flex-col",children:[(0,a.jsx)(m.Ol,{children:(0,a.jsx)(m.ll,{className:"text-base font-normal",children:r?"New Workspace YAML":"Edit Workspace YAML"})}),(0,a.jsx)(m.aY,{className:"flex-1 flex flex-col",children:(0,a.jsxs)("div",{className:"space-y-4 flex-1 flex flex-col",children:[F&&(0,a.jsx)(L.X,{error:F,onDismiss:()=>H(null)}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,a.jsxs)("p",{className:"text-sm text-gray-600 mb-3",children:["Configure infra-specific settings for this workspace. Leave empty to use all accessible infrastructure. Refer to"," ",(0,a.jsx)("a",{href:"https://docs.skypilot.co/en/latest/admin/workspaces.html#configuration",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600",children:"SkyPilot Docs"})," ","for more details."]}),(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Example configuration:"}),(0,a.jsx)("div",{className:"p-3 bg-gray-50 border rounded-lg",children:(0,a.jsx)("pre",{className:"text-xs font-mono text-gray-600 whitespace-pre-wrap",children:"".concat(s||"my-workspace",":\n private: true\n allowed_users:\n - user1@mydomain.com\n - user2@mydomain.com\n gcp:\n project_id: xxx\n disabled: false\n kubernetes:\n allowed_contexts:\n - context-1")})})]}),(0,a.jsx)(f.g,{value:k,onChange:e=>ea(e.target.value),className:"font-mono text-sm flex-1 resize-none",style:{minHeight:"350px"},spellCheck:!1,placeholder:"# Enter workspace configuration in YAML format"}),(0,a.jsx)("div",{className:"flex justify-end space-x-3 pt-3 border-gray-200",children:(0,a.jsxs)(h.z,{onClick:el,disabled:z||F||R,className:"inline-flex items-center bg-sky-600 hover:bg-sky-700 text-white",children:[(0,a.jsx)(N.Z,{className:"w-4 h-4 mr-1.5"}),z?"Applying...":"Apply"]})})]})]})})]})})]})]}),(0,a.jsx)(v.Vq,{open:G.showDialog,onOpenChange:en,children:(0,a.jsxs)(v.cZ,{className:"sm:max-w-md",children:[(0,a.jsxs)(v.fK,{className:"",children:[(0,a.jsx)(v.$N,{children:"Delete Workspace"}),(0,a.jsxs)(v.Be,{children:['Are you sure you want to delete workspace "',s,'"? This action cannot be undone.']})]}),G.error&&(0,a.jsx)(L.X,{error:G.error,title:"Deletion Failed",onDismiss:()=>q(e=>({...e,error:null}))}),(0,a.jsxs)(v.cN,{className:"",children:[(0,a.jsx)(h.z,{variant:"outline",onClick:en,disabled:G.deleting,children:"Cancel"}),(0,a.jsx)(h.z,{variant:"destructive",onClick:et,disabled:G.deleting,children:G.deleting?"Deleting...":"Delete"})]})]})})]})]})}}}]);
@@ -0,0 +1,30 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1559,2369],{8671:function(e,t,n){n.d(t,{Z:function(){return r}});/**
2
+ * @license lucide-react v0.407.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */let r=(0,n(998).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},6521:function(e,t,n){n.d(t,{Z:function(){return r}});/**
7
+ * @license lucide-react v0.407.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */let r=(0,n(998).Z)("FileSearch",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4.268 21a2 2 0 0 0 1.727 1H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"ms7g94"}],["path",{d:"m9 18-1.5-1.5",key:"1j6qii"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]])},3610:function(e,t,n){n.d(t,{Z:function(){return r}});/**
12
+ * @license lucide-react v0.407.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */let r=(0,n(998).Z)("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]])},3293:function(e,t,n){n.d(t,{Z:function(){return r}});/**
17
+ * @license lucide-react v0.407.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */let r=(0,n(998).Z)("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]])},3626:function(e,t,n){n.d(t,{Z:function(){return r}});/**
22
+ * @license lucide-react v0.407.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */let r=(0,n(998).Z)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},6327:function(e,t,n){n.d(t,{x8:function(){return eu},VY:function(){return eo},dk:function(){return ea},aV:function(){return er},h_:function(){return en},fC:function(){return ee},Dx:function(){return ei},xz:function(){return et}});var r=n(7294),o=n(6206),i=n(8771),a=n(5360),u=n(1276),l=n(7342),s=n(6063),c=n(5420),d=n(2651),f=n(9981),p=e=>{let t,n;let{present:o,children:a}=e,u=function(e){var t,n;let[o,i]=r.useState(),a=r.useRef(null),u=r.useRef(e),l=r.useRef("none"),[s,c]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>n[e][t]??e,t));return r.useEffect(()=>{let e=m(a.current);l.current="mounted"===s?e:"none"},[s]),(0,f.b)(()=>{let t=a.current,n=u.current;if(n!==e){let r=l.current,o=m(t);e?c("MOUNT"):"none"===o||t?.display==="none"?c("UNMOUNT"):n&&r!==o?c("ANIMATION_OUT"):c("UNMOUNT"),u.current=e}},[e,c]),(0,f.b)(()=>{if(o){let e;let t=o.ownerDocument.defaultView??window,n=n=>{let r=m(a.current).includes(n.animationName);if(n.target===o&&r&&(c("ANIMATION_END"),!u.current)){let n=o.style.animationFillMode;o.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=n)})}},r=e=>{e.target===o&&(l.current=m(a.current))};return o.addEventListener("animationstart",r),o.addEventListener("animationcancel",n),o.addEventListener("animationend",n),()=>{t.clearTimeout(e),o.removeEventListener("animationstart",r),o.removeEventListener("animationcancel",n),o.removeEventListener("animationend",n)}}c("ANIMATION_END")},[o,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:r.useCallback(e=>{a.current=e?getComputedStyle(e):null,i(e)},[])}}(o),l="function"==typeof a?a({present:u.isPresent}):r.Children.only(a),s=(0,i.e)(u.ref,(t=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning?l.ref:(t=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning?l.props.ref:l.props.ref||l.ref);return"function"==typeof a||u.isPresent?r.cloneElement(l,{ref:s}):null};function m(e){return e?.animationName||"none"}p.displayName="Presence";var g=n(5320),h=n(7552),y=n(6223),v=n(3541),M=n(8426),N=n(5893),x="Dialog",[D,w]=(0,a.b)(x),[R,O]=D(x),b=e=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=r.useRef(null),d=r.useRef(null),[f,p]=(0,l.T)({prop:o,defaultProp:i??!1,onChange:a,caller:x});return(0,N.jsx)(R,{scope:t,triggerRef:c,contentRef:d,contentId:(0,u.M)(),titleId:(0,u.M)(),descriptionId:(0,u.M)(),open:f,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),modal:s,children:n})};b.displayName=x;var k="DialogTrigger",I=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=O(k,n),u=(0,i.e)(t,a.triggerRef);return(0,N.jsx)(g.WV.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":K(a.open),...r,ref:u,onClick:(0,o.M)(e.onClick,a.onOpenToggle)})});I.displayName=k;var j="DialogPortal",[C,E]=D(j,{forceMount:void 0}),_=e=>{let{__scopeDialog:t,forceMount:n,children:o,container:i}=e,a=O(j,t);return(0,N.jsx)(C,{scope:t,forceMount:n,children:r.Children.map(o,e=>(0,N.jsx)(p,{present:n||a.open,children:(0,N.jsx)(d.h,{asChild:!0,container:i,children:e})}))})};_.displayName=j;var T="DialogOverlay",F=r.forwardRef((e,t)=>{let n=E(T,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=O(T,e.__scopeDialog);return i.modal?(0,N.jsx)(p,{present:r||i.open,children:(0,N.jsx)(P,{...o,ref:t})}):null});F.displayName=T;var A=(0,M.Z8)("DialogOverlay.RemoveScroll"),P=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=O(T,n);return(0,N.jsx)(y.Z,{as:A,allowPinchZoom:!0,shards:[o.contentRef],children:(0,N.jsx)(g.WV.div,{"data-state":K(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),W="DialogContent",Z=r.forwardRef((e,t)=>{let n=E(W,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=O(W,e.__scopeDialog);return(0,N.jsx)(p,{present:r||i.open,children:i.modal?(0,N.jsx)(U,{...o,ref:t}):(0,N.jsx)(V,{...o,ref:t})})});Z.displayName=W;var U=r.forwardRef((e,t)=>{let n=O(W,e.__scopeDialog),a=r.useRef(null),u=(0,i.e)(t,n.contentRef,a);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.Ry)(e)},[]),(0,N.jsx)(L,{...e,ref:u,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.M)(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:(0,o.M)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,o.M)(e.onFocusOutside,e=>e.preventDefault())})}),V=r.forwardRef((e,t)=>{let n=O(W,e.__scopeDialog),o=r.useRef(!1),i=r.useRef(!1);return(0,N.jsx)(L,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||n.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"!==t.detail.originalEvent.type||(i.current=!0));let r=t.target;n.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),L=r.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:u,...l}=e,d=O(W,n),f=r.useRef(null),p=(0,i.e)(t,f);return(0,h.EW)(),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(c.M,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:u,children:(0,N.jsx)(s.XB,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":K(d.open),...l,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(J,{titleId:d.titleId}),(0,N.jsx)(Q,{contentRef:f,descriptionId:d.descriptionId})]})]})}),S="DialogTitle",q=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=O(S,n);return(0,N.jsx)(g.WV.h2,{id:o.titleId,...r,ref:t})});q.displayName=S;var $="DialogDescription",z=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=O($,n);return(0,N.jsx)(g.WV.p,{id:o.descriptionId,...r,ref:t})});z.displayName=$;var B="DialogClose",H=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=O(B,n);return(0,N.jsx)(g.WV.button,{type:"button",...r,ref:t,onClick:(0,o.M)(e.onClick,()=>i.onOpenChange(!1))})});function K(e){return e?"open":"closed"}H.displayName=B;var X="DialogTitleWarning",[Y,G]=(0,a.k)(X,{contentName:W,titleName:S,docsSlug:"dialog"}),J=({titleId:e})=>{let t=G(X),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
27
+
28
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
29
+
30
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return r.useEffect(()=>{e&&!document.getElementById(e)&&console.error(n)},[n,e]),null},Q=({contentRef:e,descriptionId:t})=>{let n=G("DialogDescriptionWarning"),o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`;return r.useEffect(()=>{let n=e.current?.getAttribute("aria-describedby");t&&n&&!document.getElementById(t)&&console.warn(o)},[o,e,t]),null},ee=b,et=I,en=_,er=F,eo=Z,ei=q,ea=z,eu=H}}]);