skypilot-nightly 1.0.0.dev20250817__py3-none-any.whl → 1.0.0.dev20250819__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 (49) hide show
  1. sky/__init__.py +2 -2
  2. sky/catalog/data_fetchers/fetch_aws.py +2 -0
  3. sky/dashboard/out/404.html +1 -1
  4. sky/dashboard/out/_next/static/chunks/3015-bf218e4973bf5c8f.js +1 -0
  5. sky/dashboard/out/_next/static/chunks/8969-23c8fbdb8b397d59.js +1 -0
  6. sky/dashboard/out/_next/static/chunks/{webpack-b6987eb47888da9c.js → webpack-008593a02784a2df.js} +1 -1
  7. sky/dashboard/out/_next/static/{s93sHgT13r_pnzP1An3gW → tYn7R2be3cQPYJfTxxE09}/_buildManifest.js +1 -1
  8. sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
  9. sky/dashboard/out/clusters/[cluster].html +1 -1
  10. sky/dashboard/out/clusters.html +1 -1
  11. sky/dashboard/out/config.html +1 -1
  12. sky/dashboard/out/index.html +1 -1
  13. sky/dashboard/out/infra/[context].html +1 -1
  14. sky/dashboard/out/infra.html +1 -1
  15. sky/dashboard/out/jobs/[job].html +1 -1
  16. sky/dashboard/out/jobs/pools/[pool].html +1 -1
  17. sky/dashboard/out/jobs.html +1 -1
  18. sky/dashboard/out/users.html +1 -1
  19. sky/dashboard/out/volumes.html +1 -1
  20. sky/dashboard/out/workspace/new.html +1 -1
  21. sky/dashboard/out/workspaces/[name].html +1 -1
  22. sky/dashboard/out/workspaces.html +1 -1
  23. sky/jobs/constants.py +1 -1
  24. sky/jobs/server/core.py +42 -33
  25. sky/jobs/server/utils.py +2 -1
  26. sky/jobs/utils.py +56 -9
  27. sky/provision/provisioner.py +10 -6
  28. sky/server/common.py +2 -4
  29. sky/server/requests/payloads.py +1 -0
  30. sky/server/requests/serializers/encoders.py +15 -3
  31. sky/server/server.py +4 -1
  32. sky/setup_files/MANIFEST.in +1 -0
  33. sky/skylet/ray_patches/__init__.py +17 -3
  34. sky/skylet/ray_patches/autoscaler.py.diff +18 -0
  35. sky/skylet/ray_patches/cli.py.diff +19 -0
  36. sky/skylet/ray_patches/command_runner.py.diff +17 -0
  37. sky/skylet/ray_patches/log_monitor.py.diff +20 -0
  38. sky/skylet/ray_patches/resource_demand_scheduler.py.diff +32 -0
  39. sky/skylet/ray_patches/updater.py.diff +18 -0
  40. sky/skylet/ray_patches/worker.py.diff +41 -0
  41. {skypilot_nightly-1.0.0.dev20250817.dist-info → skypilot_nightly-1.0.0.dev20250819.dist-info}/METADATA +1 -1
  42. {skypilot_nightly-1.0.0.dev20250817.dist-info → skypilot_nightly-1.0.0.dev20250819.dist-info}/RECORD +47 -40
  43. sky/dashboard/out/_next/static/chunks/3015-fd15b3ff228f7738.js +0 -1
  44. sky/dashboard/out/_next/static/chunks/8969-6d493b1e2fa45826.js +0 -1
  45. /sky/dashboard/out/_next/static/{s93sHgT13r_pnzP1An3gW → tYn7R2be3cQPYJfTxxE09}/_ssgManifest.js +0 -0
  46. {skypilot_nightly-1.0.0.dev20250817.dist-info → skypilot_nightly-1.0.0.dev20250819.dist-info}/WHEEL +0 -0
  47. {skypilot_nightly-1.0.0.dev20250817.dist-info → skypilot_nightly-1.0.0.dev20250819.dist-info}/entry_points.txt +0 -0
  48. {skypilot_nightly-1.0.0.dev20250817.dist-info → skypilot_nightly-1.0.0.dev20250819.dist-info}/licenses/LICENSE +0 -0
  49. {skypilot_nightly-1.0.0.dev20250817.dist-info → skypilot_nightly-1.0.0.dev20250819.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
1
- sky/__init__.py,sha256=NzH57a-A1sJaLxvPBqPnETXqy4WTRXECE47OSB6nttk,6589
1
+ sky/__init__.py,sha256=kGLWB-L9YZHphOC6gzXETZp8oNIDguWzCr85ZcucpV0,6589
2
2
  sky/admin_policy.py,sha256=BeSowGnWfDj58ALiNf3cc2N4gMQWzjO6aXnX7vaqYhk,9782
3
3
  sky/authentication.py,sha256=V7zGSV7bqcAKC_EGOOS0KhJ01ZFLnme0WnjLFO7zavs,25603
4
4
  sky/check.py,sha256=Z7D6txaOAEL7fyEQ8q-Zxk1aWaHpEcl412Rj2mThbQ0,31025
@@ -64,7 +64,7 @@ sky/catalog/vast_catalog.py,sha256=IEOg-TFgtmXjpr0agFx9X7He6k5juZWKduVUoXQ2IWM,4
64
64
  sky/catalog/vsphere_catalog.py,sha256=22LzkYdGwDZDCCK2YZXN2d_D-uhQ6aRQBm6vCwTUdBE,4531
65
65
  sky/catalog/data_fetchers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
66
  sky/catalog/data_fetchers/analyze.py,sha256=ftnrOceREmjimFWBLwhtF2aqOnOZNl6TmYxqD6eIhHY,2069
67
- sky/catalog/data_fetchers/fetch_aws.py,sha256=_OD3ePYFRCJsqh-udV0X4I9gSNsw4nfh40BClHl5Rsw,24175
67
+ sky/catalog/data_fetchers/fetch_aws.py,sha256=CYldV0tiWKsAZs_6znIi-jyy9uBA6z9UorQnreZEOKo,24257
68
68
  sky/catalog/data_fetchers/fetch_azure.py,sha256=7YVnoGDGGZI2TK02bj_LOoD4E5J5CFl6eqz2XlR4Vy8,12790
69
69
  sky/catalog/data_fetchers/fetch_cudo.py,sha256=QGzLJkwsVloiOqDqGNg4ZXpU47iJwjtgQ28xZLqpev8,3640
70
70
  sky/catalog/data_fetchers/fetch_fluidstack.py,sha256=hsqpQi_YUI-qil3zLCEGatrR7BkWzywr4otRdHrd-4k,7350
@@ -112,22 +112,22 @@ sky/clouds/utils/azure_utils.py,sha256=NToRBnhEyuUvb-nBnsKTxjhOBRkMcrelL8LK4w6s4
112
112
  sky/clouds/utils/gcp_utils.py,sha256=09MF4Vx0EW7S-GXGpyxpl2aQlHrqeu9ioV0nyionAyk,9890
113
113
  sky/clouds/utils/oci_utils.py,sha256=TFqAqRLggg4Z0bhxrrq8nouSSomZy-ub1frHXEkud2M,7302
114
114
  sky/clouds/utils/scp_utils.py,sha256=VGuccVO5uFGr8-yolWSoYrgr11z6cIeDBGcqkBzAyOs,18409
115
- sky/dashboard/out/404.html,sha256=9qM9sPCcjehv_AA-vqJk3c1eEkWKeWA52k74vcL7Dsg,1423
116
- sky/dashboard/out/clusters.html,sha256=IxJgqGjId9GoJ0D6oVj8nsEn9GVOUAihiwC8HyK9QgE,1418
117
- sky/dashboard/out/config.html,sha256=AD3uPWBtVXg2KIsb5dVIXnThb1JJLDd84htEgsfW3vM,1414
115
+ sky/dashboard/out/404.html,sha256=L4RsqCd1FTUlgzwuP0vHgBu4CUDqwy273Rkq90GmMlc,1423
116
+ sky/dashboard/out/clusters.html,sha256=aU4M9iInqj_EQi1MEbxsneGJzPnDmIoNqs_5imrUMGA,1418
117
+ sky/dashboard/out/config.html,sha256=5LkMcs8yWaZcYF3IzAbgDuqSI9VDoT64VCgYQYiK6QE,1414
118
118
  sky/dashboard/out/favicon.ico,sha256=XilUZZglAl_1zRsg85QsbQgmQAzGPQjcUIJ-A3AzYn8,93590
119
- sky/dashboard/out/index.html,sha256=ysIsFRU96BgD1slvnwBMdEnM_rQXvxSAQUT651BbCtA,1407
120
- sky/dashboard/out/infra.html,sha256=C63GoGSdFMZrcV5GnEDHnseQz9htJsaq_swSEFP8pv0,1412
121
- sky/dashboard/out/jobs.html,sha256=PCLMEBQo8O23WMsXH9wlTUsRVPMPCgKtNsGty46IpHY,1410
119
+ sky/dashboard/out/index.html,sha256=TfVYJ2ki-CwQNfTGSX9f6IhbnSaQmbxekOoBU9I0JUc,1407
120
+ sky/dashboard/out/infra.html,sha256=UG8DrmHmvJ0xZja4dyVCQxi28Qaxr-UuM8DmwMFlzYQ,1412
121
+ sky/dashboard/out/jobs.html,sha256=wU_x3HcolSeCTRO9pmZ96lcX77h7gaYxsUWqRAr9ccw,1410
122
122
  sky/dashboard/out/skypilot.svg,sha256=c0iRtlfLlaUm2p0rG9NFmo5FN0Qhf3pq5Xph-AeMPJw,5064
123
- sky/dashboard/out/users.html,sha256=sO3mUxQFGDKDoMw_Hib8GGvi5Uv24SD6AiM7692adlI,1412
124
- sky/dashboard/out/volumes.html,sha256=XyKPa5jh68Jrbm5Bd_wF6diyz433Fn87gm_rkLTvYdw,1416
125
- sky/dashboard/out/workspaces.html,sha256=-Kem2_dlCrijIrJvzWdyxPT4zK9jQarAQRf-tyUJi18,1422
123
+ sky/dashboard/out/users.html,sha256=4rWGGdDvsAAiEZ5ksU_Cbm3KG0jDy2TB3LSIJHWVdV8,1412
124
+ sky/dashboard/out/volumes.html,sha256=ukl_7yriI8YSokIBwxO2xP2fZqwla_c5kJrwwQQZRK4,1416
125
+ sky/dashboard/out/workspaces.html,sha256=qlnauNqpu4cpIq5ER1IetvGjp3EfDoFAZSy7Vi0yZFM,1422
126
126
  sky/dashboard/out/_next/static/chunks/1121-2edb8ab2ba080a76.js,sha256=fLXxFyYpxIIH-GAL9X9Ew3rc2f6zqOZqg6TjrapDZUM,8554
127
127
  sky/dashboard/out/_next/static/chunks/1141-2f60a90b7d76838e.js,sha256=tUOoU0nIEShZeD5pBiOWrl8-czHc6PpnxxJilnDplHM,17330
128
128
  sky/dashboard/out/_next/static/chunks/1272-1ef0bf0237faccdb.js,sha256=VJ6y-Z6Eg2T93hQIRfWAbjAkQ7nQhglmIaVbEpKSILY,38451
129
129
  sky/dashboard/out/_next/static/chunks/2350.fab69e61bac57b23.js,sha256=TQCHO4AUL9MZo1e_8GOiL8y6vjQpj5tdXZ8oCKwM1LA,271
130
- sky/dashboard/out/_next/static/chunks/3015-fd15b3ff228f7738.js,sha256=SG7jsHcCvFEJtODTvDCuSGmmWASn85tPhEwgmfMerh0,38205
130
+ sky/dashboard/out/_next/static/chunks/3015-bf218e4973bf5c8f.js,sha256=HVUqOiHR_zgRMKopnRkQU6GVt9qskpo1_3FfaZMWPlk,38729
131
131
  sky/dashboard/out/_next/static/chunks/3785.bc5d2853355c9c47.js,sha256=6fVX2IMO1KPvJT8-_6lGk902AiUdi9oOwT-OpX9nHSk,4427
132
132
  sky/dashboard/out/_next/static/chunks/3850-ff4a9a69d978632b.js,sha256=XphBY9psNzmvGD28zgDunQEb-TX0_eOVaElmcuOjD1g,7455
133
133
  sky/dashboard/out/_next/static/chunks/3937.210053269f121201.js,sha256=0tYP8uuog_WLEZmEuej4zenfX0PUa17nR874wSSBgqI,54583
@@ -148,7 +148,7 @@ sky/dashboard/out/_next/static/chunks/7411-b15471acd2cba716.js,sha256=Dnmr9e-yZQ
148
148
  sky/dashboard/out/_next/static/chunks/754-d0da8ab45f9509e9.js,sha256=R6UUmK1P1PfVx9zOU0jlBsVSk5ZchuPwWObAeVkkhU0,785694
149
149
  sky/dashboard/out/_next/static/chunks/7669.1f5d9a402bf5cc42.js,sha256=FbppLXkHKPxzVKrJg15FwCoqLU18yn5jBgYgDkjqDGM,52179
150
150
  sky/dashboard/out/_next/static/chunks/8838.e7953f42af2b0544.js,sha256=2oTAwFktVQkqRa7sAhLAK9bTB5zSKWQdP2v4JrpWxLU,12040
151
- sky/dashboard/out/_next/static/chunks/8969-6d493b1e2fa45826.js,sha256=z-FvBYsEHF1NtKitfIX-MI-_LRDzmqX2RUiYT_WNA_U,11897
151
+ sky/dashboard/out/_next/static/chunks/8969-23c8fbdb8b397d59.js,sha256=BBlqnwaQqoh-myHA6gUr_sPPwP9G2u5gyuSnznd9z9o,12111
152
152
  sky/dashboard/out/_next/static/chunks/9025.a1bef12d672bb66d.js,sha256=Qmu5IJ8QMLwYYKT22vy4Rbzsf5BHzaUhdolaX4dhfQc,10561
153
153
  sky/dashboard/out/_next/static/chunks/9037-89a84fd7fa31362d.js,sha256=2ivIVd6v8xfZg1T4aXFtuZEXDeuejYEKPCQoLMmvbRo,18942
154
154
  sky/dashboard/out/_next/static/chunks/9277.71481d5b2e606e33.js,sha256=4IJ1zGg1_QBEbvrzUu9FZHPVF6j5yFU0IjcuwRy6IC4,20222
@@ -158,7 +158,7 @@ sky/dashboard/out/_next/static/chunks/framework-cf60a09ccd051a10.js,sha256=_Qbam
158
158
  sky/dashboard/out/_next/static/chunks/main-app-587214043926b3cc.js,sha256=t7glRfataAjNw691Wni-ZU4a3BsygRzPKoI8NOm-lsY,116244
159
159
  sky/dashboard/out/_next/static/chunks/main-f15ccb73239a3bf1.js,sha256=jxOPLDVX3rkMc_jvGx2a-N2v6mvfOa8O6V0o-sLT0tI,110208
160
160
  sky/dashboard/out/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js,sha256=6QPOwdWeAVe8x-SsiDrm-Ga6u2DkqgG5SFqglrlyIgA,91381
161
- sky/dashboard/out/_next/static/chunks/webpack-b6987eb47888da9c.js,sha256=KnjqVYZgiIhckGkRs2b38RyjU__hpywCSJsvw7KIpMg,4744
161
+ sky/dashboard/out/_next/static/chunks/webpack-008593a02784a2df.js,sha256=sSw7U2iheTO5IgdsBeV2xE33iBg8lyl-1FDl-aPRKzU,4744
162
162
  sky/dashboard/out/_next/static/chunks/pages/_app-ce361c6959bc2001.js,sha256=mllo4Yasw61zRtEO49uE_MrAutg9josSJShD0DNSjf0,95518
163
163
  sky/dashboard/out/_next/static/chunks/pages/_error-c66a4e8afc46f17b.js,sha256=vjERjtMAbVk-19LyPf1Jc-H6TMcrSznSz6brzNqbqf8,253
164
164
  sky/dashboard/out/_next/static/chunks/pages/clusters-469814d711d63b1b.js,sha256=p8CQtv5n745WbV7QdyCapmglI2s_2UBB-f_KZE4RAZg,879
@@ -177,16 +177,16 @@ sky/dashboard/out/_next/static/chunks/pages/jobs/pools/[pool]-7d4182df6625fe10.j
177
177
  sky/dashboard/out/_next/static/chunks/pages/workspace/new-3f88a1c7e86a3f86.js,sha256=83s5N5CZwIaRcmYMfqn2we60n2VRmgFw6Tbx18b8-e0,762
178
178
  sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-65f72dee417237ef.js,sha256=JLMuvtlbTdAfZZQXphwUWEL4QI8G8ePamwRCq2UgYqc,1495
179
179
  sky/dashboard/out/_next/static/css/4614e06482d7309e.css,sha256=nk6GriyGVd1aGXrLd7BcMibnN4v0z-Q_mXGxrHFWqrE,56126
180
- sky/dashboard/out/_next/static/s93sHgT13r_pnzP1An3gW/_buildManifest.js,sha256=6cVugfJHfVcz4JRjvZ6oKtDNO5eYDiZbp8PwEqYYMQA,2428
181
- sky/dashboard/out/_next/static/s93sHgT13r_pnzP1An3gW/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
182
- sky/dashboard/out/clusters/[cluster].html,sha256=0MLc_rsO8bZP2b3srixo-uVyJnrGgusokKh05aItQTI,2936
183
- sky/dashboard/out/clusters/[cluster]/[job].html,sha256=M30ctwnvy905VSck2UnhssMNW9MGmIt_nWl8eLLj92E,2073
184
- sky/dashboard/out/infra/[context].html,sha256=XbhmD-2AfYIdkBnN_q0I_y-HKq9NL3NEz_2kmKUMrB8,1436
185
- sky/dashboard/out/jobs/[job].html,sha256=fak4p-8eHeox5rHV7FnjgbXF_KJy4KpPoNS05hwvEQk,2304
186
- sky/dashboard/out/jobs/pools/[pool].html,sha256=hzgJyLfIZ6wZdx07WAL8fLs36J96AGgBx6z9DrhXOgs,2142
180
+ sky/dashboard/out/_next/static/tYn7R2be3cQPYJfTxxE09/_buildManifest.js,sha256=LUiI7KnUALcdnX9KDvhKXBuPg2B2A0tLJ5V_XpzRGzU,2428
181
+ sky/dashboard/out/_next/static/tYn7R2be3cQPYJfTxxE09/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
182
+ sky/dashboard/out/clusters/[cluster].html,sha256=GC6zXjKRz6hbBk0-Y3DWgBbEvpcHyuX2O-4s7sT8nTw,2936
183
+ sky/dashboard/out/clusters/[cluster]/[job].html,sha256=nILHPkOtcWMz_OQDXZlkQ6nguIgB84ps_KINs8sVlQc,2073
184
+ sky/dashboard/out/infra/[context].html,sha256=p_coLEP9nfb2q9MY03-7Rt2h47jhIqrlq27Pv3-V_fY,1436
185
+ sky/dashboard/out/jobs/[job].html,sha256=V_96cXyf04JoayPyN0dyNhD7uokqWtidghMjEUWdhww,2304
186
+ sky/dashboard/out/jobs/pools/[pool].html,sha256=MwpJy5lZPEdslW1jw2m6euvEGOTiyB_NGVQ85srX3ew,2142
187
187
  sky/dashboard/out/videos/cursor-small.mp4,sha256=8tRdp1vjawOrXUar1cfjOc-nkaKmcwCPZx_LO0XlCvQ,203285
188
- sky/dashboard/out/workspace/new.html,sha256=8sgyFSp8c5z-VfL9Hl6ZQM-VE_LK0O75ef7DLksbjtA,1428
189
- sky/dashboard/out/workspaces/[name].html,sha256=JrfFGcJ1K10gN-mfp-VqX36zWlx65VQfSgZfp1aJQhY,2759
188
+ sky/dashboard/out/workspace/new.html,sha256=6dUWFXKQm8KMuGDb130XUJaMh9bHFGBH-THFq0GLt34,1428
189
+ sky/dashboard/out/workspaces/[name].html,sha256=s40EyDTdv4jZ4Yk7b1oTV0jL2AHpKLH7-yumw3vAums,2759
190
190
  sky/data/__init__.py,sha256=Nhaf1NURisXpZuwWANa2IuCyppIuc720FRwqSE2oEwY,184
191
191
  sky/data/data_transfer.py,sha256=N8b0CQebDuHieXjvEVwlYmK6DbQxUGG1RQJEyTbh3dU,12040
192
192
  sky/data/data_utils.py,sha256=AjEA_JRjo9NBMlv-Lq5iV4lBED_YZ1VqBR9pG6fGVWE,35179
@@ -194,19 +194,19 @@ sky/data/mounting_utils.py,sha256=OduhvpNQuuqXc3VgDEpwnZI1gY6zDwZlx_sTJfvv5IY,24
194
194
  sky/data/storage.py,sha256=5GShP2kJaPDNldVWQxrRXOqhL74rc40JhkpB_mpytfQ,208682
195
195
  sky/data/storage_utils.py,sha256=YVLrBdZvQr5wvug0TYOpuSuSriySIiqkD-xsdAIB84s,14978
196
196
  sky/jobs/__init__.py,sha256=BiABNdlab7xZDOv4C34kc1XuxG6C_Ip7Q96mT2iCnIg,1686
197
- sky/jobs/constants.py,sha256=Yal-JuXMHyHLj9NxizV0ApgZkq-_3ZfoWq4kPpjrQj8,3305
197
+ sky/jobs/constants.py,sha256=UEjv_adaHB8UDiOPF_cgZauAM5U9vMu2rn6N60f3bhk,3306
198
198
  sky/jobs/controller.py,sha256=e6a5-AnknM3IVslXtKFs70FQwxe5p1WiZm4mOgo7pmY,38671
199
199
  sky/jobs/recovery_strategy.py,sha256=6DcrbFLeNj322WI7-ldBoxiIMTJAHku4uIuzrgf3NhQ,31276
200
200
  sky/jobs/scheduler.py,sha256=iBcMy0SS60QxvwK93HAziFErt66t_66CckFP6i7pJDU,15265
201
201
  sky/jobs/state.py,sha256=eDlI8eB2RGR-B1UDYRfcBsAJOp_K9DZOl91tkUEYcAc,67404
202
- sky/jobs/utils.py,sha256=N2NTlBZoK7Z4MS87IbIbvgx-qAurmDmlNONLzHLsHSo,83256
202
+ sky/jobs/utils.py,sha256=xlq0oftp7ZqSGvijyGOac45B9K6tsZhdlAGwg_lm720,85546
203
203
  sky/jobs/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
204
204
  sky/jobs/client/sdk.py,sha256=MqaI2sotaQQWBFzawB5tnWNX_OcMLiO-Dsi5zcc8IeU,16405
205
205
  sky/jobs/client/sdk_async.py,sha256=qOI5TB5FDdX36R9rZ1lL9ouzQtJ6qnZxuK9uoKF86oU,4791
206
206
  sky/jobs/server/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
207
- sky/jobs/server/core.py,sha256=B9OchYtZm_C-0Ap7S3FcpSsaliFNS2CN833pygajlb8,40475
207
+ sky/jobs/server/core.py,sha256=FbClCppWI5q85rxHtHavE8mo73AGUrk3mHIudjNv0fM,40821
208
208
  sky/jobs/server/server.py,sha256=v91KdT-ntLna46arzIgjckvNqebyREPw8z8U61t79qo,7195
209
- sky/jobs/server/utils.py,sha256=l8vKhRYAti0n2fFJTGFV_KxlHAmGVrPDkM3xbxNQDKo,3502
209
+ sky/jobs/server/utils.py,sha256=7YRZNF8BGTQwWRiY7P40n4hQpCCOkp9gBiapd5rVFaI,3517
210
210
  sky/logs/__init__.py,sha256=zW4gAEvWDz5S53FlLp3krAuKrmTSJ0e3kZDnhxSbW4E,722
211
211
  sky/logs/agent.py,sha256=tv0C40_FauZpvU93Ro_mC23LnaXWhSTjqch1JQMXiqw,2771
212
212
  sky/logs/aws.py,sha256=cbRE3sHGFSZUqGwLQvMzoxu6QFyO5SglMUXLEQNUC1c,9740
@@ -220,7 +220,7 @@ sky/provision/docker_utils.py,sha256=ev_f5ZebMZ4NYe6OxleisBO8EAB6W0FHFJlaqVK3ugE
220
220
  sky/provision/instance_setup.py,sha256=YjANEJoPSamKLav_BjoGiTOkFlGKoR_F1DlGuUFe-U0,26141
221
221
  sky/provision/logging.py,sha256=_sx_TH6nLt0FF3myS5pEZbiMhXyl4s1XwMidu_TTBUw,2091
222
222
  sky/provision/metadata_utils.py,sha256=LrxeV4wD2QPzNdXV_npj8q-pr35FatxBBjF_jSbpOT0,4013
223
- sky/provision/provisioner.py,sha256=j2099M-DwfBQOuQiLoUcuq6m5kBnMYuKEu0GlQltIQE,33090
223
+ sky/provision/provisioner.py,sha256=gH85DqHFAUJU1L95zA1kA6lsYMDzClSfQHe9gWfpBE0,33352
224
224
  sky/provision/aws/__init__.py,sha256=mxq8PeWJqUtalDozTNpbtENErRZ1ktEs8uf2aG9UUgU,731
225
225
  sky/provision/aws/config.py,sha256=Ux9lCz6HWnxARSBdBgA2V401Pamq3E1lr-uzfgG3TOc,28045
226
226
  sky/provision/aws/instance.py,sha256=8mjjZN3dGHddrpMzr0CcwQH-cM8W73YV4G3r1Pma414,43387
@@ -353,13 +353,13 @@ sky/serve/server/core.py,sha256=QEdBUE0clX8ZSQEO_mb5Gt3ykeWBdVzqtmiRcBjH7UY,1032
353
353
  sky/serve/server/impl.py,sha256=Oe-4hSYuNXZ48YOiA9FHyaiwh0rrS02dg7aOWnRsQbQ,42760
354
354
  sky/serve/server/server.py,sha256=A9K37a0nQgZeN3eKWv62Oh2C5TSAReTZ9pHmztqlI-c,4396
355
355
  sky/server/__init__.py,sha256=MPPBqFzXz6Jv5QSk6td_IcvnfXfNErDZVcizu4MLRow,27
356
- sky/server/common.py,sha256=vnuSyJYFT_MFZXXedRYOyOHWPwckeQmGDARsT4APm4Y,39181
356
+ sky/server/common.py,sha256=oSYD2PLnnQL3R5K5kbMaSJH5hUoF9ddU0KZ7vMbkVLk,39141
357
357
  sky/server/config.py,sha256=XWf5Kw4am6vMO5wcyWevbQAFH-dmKb7AMEgDzD083-M,8538
358
358
  sky/server/constants.py,sha256=yjX8t73w6gj3_SDSP4vBFdNdiOqq7dnlXT2pw3yo0jM,2321
359
359
  sky/server/daemons.py,sha256=3cwp-Os2StWLaOF21Sv4jzJ1zkEYpKuiKF5HFkg86WA,8700
360
360
  sky/server/metrics.py,sha256=6H6n6dq_C5HMaU97mJlRUB9bqOEA_k205PO15wE3AWk,3648
361
361
  sky/server/rest.py,sha256=XExs_gWGnHQCgXcxdSW7MRr9iJ66b1WDMpkkYWa_LNc,12684
362
- sky/server/server.py,sha256=iJBCuS6050UFQtoRcsMApADgL-g_FP2UlJQpDVU6JRQ,76806
362
+ sky/server/server.py,sha256=3U57Uryat27LEt8iMlaxK6DRmqWl75nu3TgCM2XOfl4,77015
363
363
  sky/server/state.py,sha256=YbVOMJ1JipQQv17gLIGyiGN7MKfnP83qlUa5MB1z0Yk,747
364
364
  sky/server/stream_utils.py,sha256=RS4RuMxQqTGqp3uxzZVtmFWzos4d49P7hMX_VklzEVU,9189
365
365
  sky/server/uvicorn.py,sha256=7K-_Xge8EDWGqunqzSqPzGVBo5X1F8snKzWmzE2FdrY,9292
@@ -372,7 +372,7 @@ sky/server/html/token_page.html,sha256=eUndS5u1foL9vaWGPRTLMt7lCzD1g0wYJ2v_EeeFz
372
372
  sky/server/requests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
373
373
  sky/server/requests/event_loop.py,sha256=OhpPbuce65bbjpGRlcJa78AVnYSm08SzFKt70ypCUuQ,1211
374
374
  sky/server/requests/executor.py,sha256=1TFMCK2-VyyxhkPitOyUk-3Eutozw_H9ncs-9OBrekc,27168
375
- sky/server/requests/payloads.py,sha256=ZWyFc6zq4mMn6HuypNWhoEJo8Z8AeyM4Fv9rWnj79Ls,26144
375
+ sky/server/requests/payloads.py,sha256=5lyGBtG9rU-TNVjtIBRRtGQAG2AxGlZ4Oax37ncSOw0,26185
376
376
  sky/server/requests/preconditions.py,sha256=uUQjzFFHf7O5-WvBypMzqViGmd1CXksbqrrDPmY_s_Y,7178
377
377
  sky/server/requests/process.py,sha256=UpJp5rZizNMFRCNRtudFSjbcJhFarFbtAGDWI9x_ZyE,13197
378
378
  sky/server/requests/requests.py,sha256=-A399p-xVwGCA63qUvur7gI1qtDJPwo_bRbagjr3L1o,24219
@@ -381,8 +381,8 @@ sky/server/requests/queues/local_queue.py,sha256=X6VkBiUmgd_kfqIK1hCtMWG1b8GiZbY
381
381
  sky/server/requests/queues/mp_queue.py,sha256=jDqP4Jd28U3ibSFyMR1DF9I2OWZrPZqFJrG5S6RFpyw,3403
382
382
  sky/server/requests/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
383
383
  sky/server/requests/serializers/decoders.py,sha256=KSOy147DLT05RBEHpnFyY0Pi3hxMWl_y-dWGfTDCMeU,7175
384
- sky/server/requests/serializers/encoders.py,sha256=8WO-D8C3fPdQj_uJpAnHr87xJcnzGLc7VHZMV_HGb6k,6395
385
- sky/setup_files/MANIFEST.in,sha256=fKWkj_JoaZ1FxrEaoEaD6Oz35LLYcsJYUorTBw01Y3A,738
384
+ sky/server/requests/serializers/encoders.py,sha256=Wc7mZAxRn14IFV-eollqvPROF_L2vamMZ3oE9i9MUz0,6765
385
+ sky/setup_files/MANIFEST.in,sha256=4gbgHHwSdP6BbMJv5XOt-2K6wUVWF_T9CGsdESvh918,776
386
386
  sky/setup_files/alembic.ini,sha256=854_UKvCaFmZ8vI16tSHbGgP9IMFQ42Td6c9Zmn2Oxs,5079
387
387
  sky/setup_files/dependencies.py,sha256=D-y2qkG21XSL7MFceqqogvRc_RrBhgtDG2cI3gJWfTk,7213
388
388
  sky/setup_files/setup.py,sha256=GTXvAi65S4_TSLhQ1GzkmaWf_yzciHiaxMbZumcTtKU,7522
@@ -405,13 +405,20 @@ sky/skylet/providers/ibm/__init__.py,sha256=GXo5F9ztvs0qMDI_G9wM5KvzySfYugslJMHH
405
405
  sky/skylet/providers/ibm/node_provider.py,sha256=PoKp-lyIT2eE6BLqljufhZtGlTrJLe8ebk6mMj2KMdU,38265
406
406
  sky/skylet/providers/ibm/utils.py,sha256=63vhKqLLOhAZdibSp8VWWONeyCER9F6U2VLrSpzlizk,1292
407
407
  sky/skylet/providers/ibm/vpc_provider.py,sha256=GiOGlWYqqeBETfAeKqVj2-9shsMSP7z1WnO8UP5JTNo,34630
408
- sky/skylet/ray_patches/__init__.py,sha256=IoCzj9zFaHW-n__bLD8dgC2pJMTfZRxRpr8rZGvMyrw,2761
408
+ sky/skylet/ray_patches/__init__.py,sha256=hCzUsFJWo8QHGWhwAmn6OtdPv8X7hMrI_0HizslwGxA,3318
409
+ sky/skylet/ray_patches/autoscaler.py.diff,sha256=M19KI9uA5j_K7ZefkVon5olmaIZJO1EU_4hLbzwfeFU,796
409
410
  sky/skylet/ray_patches/autoscaler.py.patch,sha256=cZK15L29aay-qx6JoGVPNsPIo3UiG0bAHh8fqfFd-44,291
411
+ sky/skylet/ray_patches/cli.py.diff,sha256=TxMZ0mlOlzbWCVw6KkoP0P9iO7oL-I_uro-0VeFFQHY,608
410
412
  sky/skylet/ray_patches/cli.py.patch,sha256=ooEAr3OfA6LN7v4iaNltY6w63TaOFssgw9iKWP49iJc,349
413
+ sky/skylet/ray_patches/command_runner.py.diff,sha256=JPAnGYtkaWf6lwWtCKdCPgx7eKjOgnF-VVg8F2yQx0k,534
411
414
  sky/skylet/ray_patches/command_runner.py.patch,sha256=CDW8AdNdaJ0qYUiB7GcwhR-FHw46LgkCQ1eqb__4COA,224
415
+ sky/skylet/ray_patches/log_monitor.py.diff,sha256=nLjG5I3K_dr1kAaYddwneaLT5mfvUZ-Oph5P6g32GSU,923
412
416
  sky/skylet/ray_patches/log_monitor.py.patch,sha256=CPoh3U_ogOHrkMOK7jaIRnwdzxjBTlUgsXoLTF7ZA4A,531
417
+ sky/skylet/ray_patches/resource_demand_scheduler.py.diff,sha256=q5fyJQzeNHUlGLJ_gUCbAS7rFoWurffz4pWnhH8r_j4,1336
413
418
  sky/skylet/ray_patches/resource_demand_scheduler.py.patch,sha256=AVV-Hw-Rxw16aFm4VsyzayX1QOvwmQuM79iVdSjkSl4,658
419
+ sky/skylet/ray_patches/updater.py.diff,sha256=Qo9Utp68IKLJl-rWjFJ5dJqsZexs5NXLye6U4zPYiwQ,539
414
420
  sky/skylet/ray_patches/updater.py.patch,sha256=ZNMGVYICPBB44jLbEx2KvCgIY7BWYdDv3-2b2HJWmAQ,289
421
+ sky/skylet/ray_patches/worker.py.diff,sha256=agiK3C1elsLO8aLcspfUJvtG-88ckLZoDmxqbS2oA0M,1266
415
422
  sky/skylet/ray_patches/worker.py.patch,sha256=_OBhibdr3xOy5Qje6Tt8D1eQVm_msi50TJbCJmOTxVU,565
416
423
  sky/ssh_node_pools/__init__.py,sha256=phpYJAd7I0uO1-O87eb9PbetGbtMiKW5mI-NQCZlXPA,40
417
424
  sky/ssh_node_pools/core.py,sha256=NyT-9W94lnKT_I1mfa068t-pIB7xzZ1WBjKTUdZIDGI,4877
@@ -524,9 +531,9 @@ sky/workspaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
524
531
  sky/workspaces/core.py,sha256=AjwbbRwk0glzCnqICJk4sQzMoUcawixbXoQWKLB3-aQ,25372
525
532
  sky/workspaces/server.py,sha256=Box45DS54xXGHy7I3tGKGy-JP0a8G_z6IhfvGlEXtsA,3439
526
533
  sky/workspaces/utils.py,sha256=IIAiFoS6sdb2t0X5YoX9AietpTanZUQNTK8cePun-sY,2143
527
- skypilot_nightly-1.0.0.dev20250817.dist-info/licenses/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
528
- skypilot_nightly-1.0.0.dev20250817.dist-info/METADATA,sha256=YH9KVtmZaOpsY-sv6jRnXDaKPZ9fRHWF8NjP-i0HAJg,20381
529
- skypilot_nightly-1.0.0.dev20250817.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
530
- skypilot_nightly-1.0.0.dev20250817.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
531
- skypilot_nightly-1.0.0.dev20250817.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
532
- skypilot_nightly-1.0.0.dev20250817.dist-info/RECORD,,
534
+ skypilot_nightly-1.0.0.dev20250819.dist-info/licenses/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
535
+ skypilot_nightly-1.0.0.dev20250819.dist-info/METADATA,sha256=WyRMnhURxpS1vfpmQXMcnA_8zOwZp9gCeA2lEGLxbyU,20381
536
+ skypilot_nightly-1.0.0.dev20250819.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
537
+ skypilot_nightly-1.0.0.dev20250819.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
538
+ skypilot_nightly-1.0.0.dev20250819.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
539
+ skypilot_nightly-1.0.0.dev20250819.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3015],{23015:function(e,s,t){t.r(s),t.d(s,{ClusterJobs:function(){return K},ManagedJobs:function(){return B},ManagedJobsTable:function(){return T},Status2Actions:function(){return q},filterJobsByName:function(){return U},filterJobsByPool:function(){return O},filterJobsByUser:function(){return W},filterJobsByWorkspace:function(){return J},statusGroups:function(){return z}});var r=t(85893),a=t(67294),l=t(11163),n=t(41664),i=t.n(n),c=t(55739),o=t(30803),d=t(37673),h=t(68764),u=t(36989),x=t(51214),m=t(68969),p=t(6378);class j{_generateFilterKey(e){let{allUsers:s=!0,nameMatch:t,userMatch:r,workspaceMatch:a,poolMatch:l}=e;return["allUsers:".concat(s),t?"name:".concat(t):"",r?"user:".concat(r):"",a?"workspace:".concat(a):"",l?"pool:".concat(l):""].filter(Boolean).join("|")||"default"}_getCacheStatus(e){let s=this.fullDataCache.get(e),t=Date.now();if(!s)return{isCached:!1,isFresh:!1,age:0,maxAge:12e4,hasData:!1};let r=t-s.timestamp;return{isCached:!0,isFresh:r<12e4,age:r,maxAge:12e4,hasData:s.jobs&&Array.isArray(s.jobs),data:s}}async getPaginatedJobs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{page:s=1,limit:t=10,...r}=e,a=this._generateFilterKey(r);try{let e=this._getCacheStatus(a);if(e.isCached&&e.hasData){let l=e.data,n=(s-1)*t,i=l.jobs.slice(n,n+t);if(!this.prefetching.has(a)&&(!e.isFresh||e.age>e.maxAge/2)){let e=this._loadFullDataset(r,a).catch(()=>{}).finally(()=>this.prefetching.delete(a));this.prefetching.set(a,e)}return{jobs:i,total:l.total,controllerStopped:l.controllerStopped,fromCache:!0,cacheStatus:e.isFresh?"local_cache_hit":"local_cache_stale_hit"}}let l=await p.default.get(m.getManagedJobs,[{...r,page:s,limit:t}]),n=(null==l?void 0:l.jobs)||[],i="number"==typeof(null==l?void 0:l.total)?l.total:n.length,c=!!(null==l?void 0:l.controllerStopped);if(!this.prefetching.has(a)){let e=this._loadFullDataset(r,a).catch(e=>{console.warn("Background prefetch of full jobs failed:",e)}).finally(()=>{this.prefetching.delete(a)});this.prefetching.set(a,e)}return{jobs:n,total:i,controllerStopped:c,fromCache:!1,cacheStatus:"server_page_fetch"}}catch(e){return console.error("Error in getPaginatedJobs:",e),{jobs:[],total:0,controllerStopped:!1,fromCache:!1,cacheStatus:"error"}}}async _loadFullDataset(e,s){let t=await p.default.get(m.getManagedJobs,[e]);if(t.controllerStopped||!t.jobs)return t;let r={jobs:t.jobs,total:t.jobs.length,controllerStopped:!1,timestamp:Date.now()};return this.fullDataCache.set(s,r),r}isDataLoading(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e);return this.isLoading.has(s)||this.prefetching.has(s)}isDataCached(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e),t=this._getCacheStatus(s);return t.isCached&&t.isFresh&&t.hasData}getCacheStatus(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=this._generateFilterKey(e);return this._getCacheStatus(s)}invalidateCache(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(e){let s=this._generateFilterKey(e);this.fullDataCache.delete(s),this.isLoading.delete(s),this.prefetching.delete(s)}else this.fullDataCache.clear(),this.isLoading.clear(),this.prefetching.clear();p.default.invalidateFunction(m.getManagedJobs)}getCacheStats(){let e={cachedFilters:Array.from(this.fullDataCache.keys()),loadingFilters:Array.from(this.isLoading.keys()),prefetchingFilters:Array.from(this.prefetching.keys()),cacheSize:this.fullDataCache.size,loadingCount:this.isLoading.size,prefetchingCount:this.prefetching.size};for(let[s,t]of(e.detailedStatus={},this.fullDataCache.entries())){let r=this._getCacheStatus(s);e.detailedStatus[s]={age:r.age,isFresh:r.isFresh,hasData:r.hasData,jobCount:t.jobs?t.jobs.length:0}}return e}constructor(){this.fullDataCache=new Map,this.isLoading=new Map,this.prefetching=new Map}}let f=new j;var g=t(23266),b=t(17324),v=t(53081),w=t(13626),y=t(23293),N=t(6521),k=t(53610),C=t(92128),S=t(94545),L=t(99307),_=t(20546),E=t(23001),R=t(88950);let D=(e,s)=>{let t={...e.query},r=[],a=[],l=[];s.map((e,s)=>{var t;r.push(null!==(t=e.property.toLowerCase())&&void 0!==t?t:""),a.push(e.operator),l.push(e.value)}),t.property=r,t.operator=a,t.value=l,e.replace({pathname:e.pathname,query:t},void 0,{shallow:!0})},M=(e,s)=>{let t={...e.query},r=t.property,a=t.operator,l=t.value;if(void 0===r)return[];let n=[],i=Array.isArray(r)?r.length:1;if(1===i)n.push({property:s.get(r),operator:a,value:l});else for(let e=0;e<i;e++)n.push({property:s.get(r[e]),operator:a[e],value:l[e]});return n},F=e=>{var s,t;let{propertyList:l=[],valueList:n,setFilters:i,updateURLParams:c,placeholder:o="Filter items"}=e,d=(0,a.useRef)(null),h=(0,a.useRef)(null),[u,x]=(0,a.useState)(!1),[m,p]=(0,a.useState)(""),[j,f]=(0,a.useState)((null===(s=l[0])||void 0===s?void 0:s.value)||"status"),[g,b]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&d.current&&!d.current.contains(e.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,a.useEffect)(()=>{let e=[];n&&"object"==typeof n&&(e=n[j]||[]),""!==m.trim()&&(e=e.filter(e=>e&&e.toString().toLowerCase().includes(m.toLowerCase()))),b(e)},[j,n,m]);let v=e=>{let s=l.find(s=>s.value===e);return s?s.label:e},w=e=>{i(s=>{let t=[...s,{property:v(j),operator:":",value:e}];return c(t),t}),x(!1),p(""),d.current.focus()};return(0,r.jsxs)("div",{className:"flex flex-row border border-gray-300 rounded-md overflow-visible",children:[(0,r.jsx)("div",{className:"border-r border-gray-300 flex-shrink-0",children:(0,r.jsxs)(R.Ph,{onValueChange:f,value:j,children:[(0,r.jsx)(R.i4,{"aria-label":"Filter Property",className:"focus:ring-0 focus:ring-offset-0 border-none rounded-l-md rounded-r-none w-20 sm:w-24 md:w-32 h-8 text-xs sm:text-sm",children:(0,r.jsx)(R.ki,{placeholder:(null===(t=l[0])||void 0===t?void 0:t.label)||"Status"})}),(0,r.jsx)(R.Bw,{children:l.map((e,s)=>(0,r.jsx)(R.Ql,{value:e.value,children:e.label},"property-item-".concat(s)))})]})}),(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)("input",{type:"text",ref:d,placeholder:o,value:m,onChange:e=>{p(e.target.value),u||x(!0)},onFocus:()=>{x(!0)},onKeyDown:e=>{"Enter"===e.key&&""!==m.trim()?(i(e=>{let s=[...e,{property:v(j),operator:":",value:m}];return c(s),s}),p(""),x(!1)):"Escape"===e.key&&(x(!1),d.current.blur())},className:"h-8 w-full sm:w-96 px-3 pr-8 text-sm border-none rounded-l-none rounded-r-md focus:ring-0 focus:outline-none",autoComplete:"off"}),m&&(0,r.jsx)("button",{onClick:()=>{p(""),x(!1)},className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear filter",tabIndex:-1,children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),u&&g.length>0&&(0,r.jsx)("div",{ref:h,className:"absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-60 overflow-y-auto",style:{zIndex:9999},children:g.map((e,s)=>(0,r.jsx)("div",{className:"px-3 py-2 cursor-pointer hover:bg-gray-50 text-sm ".concat(s!==g.length-1?"border-b border-gray-100":""),onClick:()=>w(e),children:(0,r.jsx)("span",{className:"text-sm text-gray-700",children:e})},"".concat(e,"-").concat(s)))})]})]})},I=e=>{let{filters:s=[],setFilters:t,updateURLParams:a}=e,l=e=>{t(s=>{let t=s.filter((s,t)=>t!==e);return a(t),t})};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"flex items-center gap-4 py-2 px-2",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-content gap-2",children:[s.map((e,s)=>(0,r.jsx)(A,{filter:e,onRemove:()=>l(s)},"filteritem-".concat(s))),s.length>0&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("button",{onClick:()=>{a([]),t([])},className:"rounded-full px-4 py-1 text-sm text-gray-700 bg-gray-200 hover:bg-gray-300",children:"Clear filters"})})]})})})},A=e=>{let{filter:s,onRemove:t}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"flex items-center text-blue-600 bg-blue-100 px-1 py-1 rounded-full text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2",children:[(0,r.jsx)("span",{children:"".concat(s.property," ")}),(0,r.jsx)("span",{children:"".concat(s.operator," ")}),(0,r.jsx)("span",{children:" ".concat(s.value)})]}),(0,r.jsx)("button",{onClick:()=>t(),className:"p-0.5 ml-1 transform text-gray-400 hover:text-gray-600 bg-blue-500 hover:bg-blue-600 rounded-full flex flex-col items-center",title:"Clear filter",children:(0,r.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"white",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:5,d:"M6 18L18 6M6 6l12 12"})})})]})})},z={active:["PENDING","RUNNING","RECOVERING","SUBMITTED","STARTING","CANCELLING"],finished:["SUCCEEDED","FAILED","CANCELLED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER"]},P=[{label:"Name",value:"name"},{label:"User",value:"user"},{label:"Workspace",value:"workspace"},{label:"Pool",value:"pool"}];function U(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.name||"").toLowerCase().includes(t))}function J(e,s){return s&&"ALL_WORKSPACES"!==s?e.filter(e=>(e.workspace||"default").toLowerCase()===s.toLowerCase()):e}function W(e,s){return s&&"ALL_USERS"!==s?e.filter(e=>(e.user_hash||e.user)===s):e}function O(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.pool||"").toLowerCase().includes(t))}let Z=e=>{if(!e)return"-";let s=e instanceof Date?e:new Date(1e3*e);return(0,r.jsx)(u.Zg,{date:s})};function B(){let e=(0,l.useRouter)(),[s,t]=(0,a.useState)(!1),[n,c]=(0,a.useState)(!0),[o,d]=(0,a.useState)(!0),h=a.useRef(null),x=a.useRef(null),[j,g]=(0,a.useState)([]),[w,y]=(0,a.useState)([]),N=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t(!0),!e&&o&&c(!0);try{let[e]=await Promise.all([p.default.get(m.vs,[{}])]);g(e.pools||[])}catch(e){console.error("Error fetching data:",e)}finally{t(!1),!e&&o&&(c(!1),d(!1))}};(0,a.useEffect)(()=>{N()},[]);let k=s=>{D(e,s)},C=a.useCallback(()=>{let s=new Map;s.set("",""),s.set("status","Status"),s.set("name","Name"),s.set("user","User"),s.set("workspace","Workspace"),s.set("pool","Pool"),y(M(e,s))},[e,y]);return(0,a.useEffect)(()=>{e.isReady&&C()},[e.isReady,e.query.tab,C]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[(0,r.jsx)("div",{className:"text-base",children:(0,r.jsx)(i(),{href:"/jobs",className:"text-sky-blue hover:underline leading-none",children:"Managed Jobs"})}),(0,r.jsx)("div",{className:"w-full sm:w-auto",children:(0,r.jsx)(F,{propertyList:P,valueList:{},setFilters:y,updateURLParams:k,placeholder:"Filter jobs"})})]}),(0,r.jsx)(I,{filters:w,setFilters:y,updateURLParams:k}),(0,r.jsx)(T,{refreshInterval:u.yc,setLoading:t,refreshDataRef:h,filters:w,onRefresh:()=>{f.invalidateCache(),p.default.invalidate(m.vs,[{}]),p.default.invalidate(b.fX),p.default.invalidate(v.R),N(!0),h.current&&h.current(),x.current&&x.current()},poolsData:j,poolsLoading:n}),(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(V,{refreshInterval:u.yc,setLoading:t,refreshDataRef:x})})]})}function T(e){let{refreshInterval:s,setLoading:t,refreshDataRef:l,filters:n,onRefresh:j,poolsData:b,poolsLoading:v}=e,[N,k]=(0,a.useState)([]),[R,D]=(0,a.useState)(0),[M,F]=(0,a.useState)({key:null,direction:"ascending"}),[I,A]=(0,a.useState)(!1),[P,U]=(0,a.useState)(!0),[J,W]=(0,a.useState)(1),[O,B]=(0,a.useState)(10),[T,K]=(0,a.useState)(null),V=(0,a.useRef)(null),[X,Y]=(0,a.useState)([]),[Q,$]=(0,a.useState)({}),[ee,es]=(0,a.useState)(!1),[et,er]=(0,a.useState)(!1),[ea,el]=(0,a.useState)(!1),[en,ei]=(0,a.useState)("all"),[ec,eo]=(0,a.useState)(!0),[ed,eh]=(0,a.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),eu=(0,E.X)(),ex=async()=>{eh({isOpen:!0,title:"Restart Controller",message:"Are you sure you want to restart the controller?",onConfirm:async()=>{try{el(!0),A(!0),await (0,m.Ce)("restartcontroller"),await em()}catch(e){console.error("Error restarting controller:",e)}finally{el(!1),A(!1)}}})},em=a.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=!1!==e.includeStatus;A(!0),t(!0);try{let e;let t=e=>{let s=(n||[]).find(s=>(s.property||"").toLowerCase()===e);return s&&s.value?String(s.value):void 0},r={allUsers:!0,nameMatch:t("name"),userMatch:t("user"),workspaceMatch:t("workspace"),poolMatch:t("pool"),page:J,limit:O},a=null;if(f.isDataCached(r),f.isDataLoading(r),s){let[s,t]=await Promise.all([f.getPaginatedJobs(r),p.default.get(g.getClusters)]);e=s,a=t}else e=await f.getPaginatedJobs(r);let{jobs:l=[],total:i=0,controllerStopped:c=!1,cacheStatus:o="unknown"}=e||{},d=!!c,h=!1;if(s&&a){let e=null==a?void 0:a.find(e=>(0,S.Ym)(e.cluster)),s=e?e.status:"NOT_FOUND";"STOPPED"==s&&c&&(d=!0),"LAUNCHING"==s&&(h=!0)}k(l),D(i||0),es(!!d),er(!!h),U(!1)}catch(e){console.error("Error fetching data:",e),k([]),es(!1),U(!1)}finally{A(!1),t(!1)}},[t,n,J,O]);a.useEffect(()=>{l&&(l.current=em)},[l,em]);let ep=a.useRef(em);a.useEffect(()=>{ep.current=em},[em]),a.useEffect(()=>{em({includeStatus:!0})},[]),a.useEffect(()=>{em({includeStatus:!1})},[J]),a.useEffect(()=>{em({includeStatus:!0})},[n,O]),(0,a.useEffect)(()=>{let e=setInterval(()=>{ep.current&&ep.current({includeStatus:!0})},s);return()=>{clearInterval(e)}},[s]),(0,a.useEffect)(()=>{W(1)},[en]),(0,a.useEffect)(()=>{W(1)},[n,O]),(0,a.useEffect)(()=>{Y([]),eo(!0)},[en]);let ej=e=>{let s="ascending";M.key===e&&"ascending"===M.direction&&(s="descending"),F({key:e,direction:s})},ef=e=>M.key===e?"ascending"===M.direction?" ↑":" ↓":"";a.useMemo(()=>{let e=N||[];return{active:e.filter(e=>z.active.includes(e.status)).length,finished:e.filter(e=>z.finished.includes(e.status)).length}},[N]);let eg=e=>X.length>0?X.includes(e):"all"===en||z[en].includes(e),eb=a.useMemo(()=>X.length>0?N.filter(e=>X.includes(e.status)):ec?"all"===en?N:N.filter(e=>z[en].includes(e.status)):[],[N,en,X,ec]),ev=a.useMemo(()=>M.key?[...eb].sort((e,s)=>e[M.key]<s[M.key]?"ascending"===M.direction?-1:1:e[M.key]>s[M.key]?"ascending"===M.direction?1:-1:0):eb,[eb,M]),ew=(J-1)*O,ey=R>0?Math.ceil(R/O):0,eN=R>0?Math.min(ew+ev.length,R):0,ek=e=>{if(X.includes(e)){let s=X.filter(s=>s!==e);0===s.length?(eo(!0),Y([])):(Y(s),eo(!1))}else Y([...X,e]),eo(!1)};return(0,a.useEffect)(()=>{$((N||[]).reduce((e,s)=>(e[s.status]=(e[s.status]||0)+1,e),{}))},[N]),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"flex flex-col space-y-1 mb-1",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between text-sm mb-1",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center",children:[(0,r.jsx)("span",{className:"mr-2 text-sm font-medium",children:"Statuses:"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[!I&&(!N||0===N.length)&&!P&&(0,r.jsx)("span",{className:"text-gray-500 mr-2",children:"No jobs found"}),Object.entries(Q).map(e=>{let[s,t]=e;return(0,r.jsxs)("button",{onClick:()=>ek(s),className:"px-3 py-0.5 rounded-full flex items-center space-x-2 ".concat(eg(s)||X.includes(s)?(0,L.Cl)(s):"bg-gray-50 text-gray-600 hover:bg-gray-100"),children:[(0,r.jsx)("span",{children:s}),(0,r.jsx)("span",{className:"text-xs ".concat(eg(s)||X.includes(s)?"bg-white/50":"bg-gray-200"," px-1.5 py-0.5 rounded"),children:t})]},s)}),N&&N.length>0&&(0,r.jsxs)("div",{className:"flex items-center ml-2 gap-2",children:[(0,r.jsx)("span",{className:"text-gray-500",children:"("}),(0,r.jsx)("button",{onClick:()=>{ei("all"),Y([]),eo(!0)},className:"text-sm font-medium ".concat("all"===en&&ec?"text-purple-700 underline":"text-gray-600 hover:text-purple-700 hover:underline"),children:"show all jobs"}),(0,r.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,r.jsx)("button",{onClick:()=>{ei("active"),Y([]),eo(!0)},className:"text-sm font-medium ".concat("active"===en&&ec?"text-green-700 underline":"text-gray-600 hover:text-green-700 hover:underline"),children:"show all active jobs"}),(0,r.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,r.jsx)("button",{onClick:()=>{ei("finished"),Y([]),eo(!0)},className:"text-sm font-medium ".concat("finished"===en&&ec?"text-blue-700 underline":"text-gray-600 hover:text-blue-700 hover:underline"),children:"show all finished jobs"}),(0,r.jsx)("span",{className:"text-gray-500",children:")"})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[I&&(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(c.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),(0,r.jsxs)("button",{onClick:()=>{j&&j(),l&&l.current&&l.current()},disabled:I,className:"text-sky-blue hover:text-sky-blue-bright flex items-center text-sm",children:[(0,r.jsx)(w.Z,{className:"h-4 w-4 mr-1.5"}),(0,r.jsx)("span",{children:"Refresh"})]})]})]})}),eu&&ee&&0===ev.length&&!I&&!P&&(0,r.jsx)("div",{className:"mb-4 p-4 bg-gray-50 rounded-lg border",children:(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-3",children:[(0,r.jsxs)("p",{className:"text-gray-700 text-center text-sm",children:["Job controller stopped.",(0,r.jsx)("br",{}),"Restart to check status."]}),(0,r.jsx)(o.z,{variant:"outline",size:"sm",onClick:ex,className:"text-sky-blue hover:text-sky-blue-bright",disabled:I||ea,children:ea?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y.Z,{className:"h-4 w-4 mr-2"}),"Restart"]})})]})}),(0,r.jsx)(d.Zb,{children:(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,r.jsxs)(h.iA,{className:"min-w-full",children:[(0,r.jsx)(h.xD,{children:(0,r.jsxs)(h.SC,{children:[(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("id"),children:["ID",ef("id")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("name"),children:["Name",ef("name")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("user"),children:["User",ef("user")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("workspace"),children:["Workspace",ef("workspace")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("submitted_at"),children:["Submitted",ef("submitted_at")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("job_duration"),children:["Duration",ef("job_duration")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("status"),children:["Status",ef("status")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("resources_str"),children:["Requested",ef("resources_str")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("infra"),children:["Infra",ef("infra")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("cluster"),children:["Resources",ef("cluster")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("recoveries"),children:["Recoveries",ef("recoveries")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>ej("pool"),children:["Worker Pool",ef("pool")]}),(0,r.jsx)(h.ss,{children:"Details"}),(0,r.jsx)(h.ss,{children:"Logs"})]})}),(0,r.jsx)(h.RM,{children:I&&P?(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:12,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(c.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):ev.length>0?(0,r.jsx)(r.Fragment,{children:ev.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)(h.SC,{children:[(0,r.jsx)(h.pj,{children:(0,r.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.name})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(_.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(i(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(h.pj,{children:Z(e.submitted_at)}),(0,r.jsx)(h.pj,{children:(0,u.LU)(e.job_duration)}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(L.OE,{status:e.status})}),(0,r.jsx)(h.pj,{children:e.requested_resources}),(0,r.jsx)(h.pj,{children:e.infra&&"-"!==e.infra?(0,r.jsx)(u.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(i(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud||e.infra.split("(")[0].trim()}),e.infra.includes("(")&&(0,r.jsx)("span",{children:" "+(()=>{let s=x.MO.NAME_TRUNCATE_LENGTH,t=e.infra.substring(e.infra.indexOf("(")),r=t.substring(1,t.length-1);if(r.length<=s)return t;let a="".concat(r.substring(0,Math.floor((s-3)/2)),"...").concat(r.substring(r.length-Math.ceil((s-3)/2)));return"(".concat(a,")")})()})]})}):(0,r.jsx)("span",{children:e.infra||"-"})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(u.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.resources_str})})}),(0,r.jsx)(h.pj,{children:e.recoveries}),(0,r.jsx)(h.pj,{children:(0,r.jsx)("div",{className:v?"blur-sm transition-all duration-300":"",children:v?"-":(0,u.os)(e.pool,e.pool_hash,b)})}),(0,r.jsx)(h.pj,{children:e.details?(0,r.jsx)(G,{text:e.details,rowId:e.id,expandedRowId:T,setExpandedRowId:K}):"-"}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(q,{jobParent:"/jobs",jobId:e.id,managed:!0})})]}),T===e.id&&(0,r.jsx)(H,{text:e.details,colSpan:13,innerRef:V})]},e.id))}):(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:13,className:"text-center py-6",children:(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[et&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,r.jsx)("p",{className:"text-gray-700",children:"The managed job controller is launching. It will be ready shortly."}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(c.Z,{size:12,className:"mr-2"}),(0,r.jsx)("span",{className:"text-gray-500",children:"Launching..."})]})]}),!ee&&!et&&(0,r.jsx)("p",{className:"text-gray-500",children:"No active jobs"}),!eu&&ee&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-3 px-4",children:[(0,r.jsx)("p",{className:"text-gray-700 text-center text-sm sm:text-base max-w-md",children:"The managed job controller has been stopped. Restart to check the latest job status."}),(0,r.jsx)(o.z,{variant:"outline",size:"sm",onClick:ex,className:"text-sky-blue hover:text-sky-blue-bright",disabled:I||ea,children:ea?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y.Z,{className:"h-4 w-4 mr-2"}),"Restart Controller"]})})]})]})})})})]})})}),(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:O,onChange:e=>{B(parseInt(e.target.value,10)),W(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsx)("div",{children:R>0?"".concat(ew+1," – ").concat(eN," of ").concat(R):"0 – 0 of 0"}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{W(e=>Math.max(e-1,1))},disabled:1===J||!ev||0===ev.length,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{ey>0&&J<ey&&W(e=>e+1)},disabled:0===ey||J>=ey||!ev||0===ev.length,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})}),(0,r.jsx)(C.cV,{isOpen:ed.isOpen,onClose:()=>eh({...ed,isOpen:!1}),onConfirm:ed.onConfirm,title:ed.title,message:ed.message,confirmClassName:"bg-blue-600 hover:bg-blue-700 text-white"})]})}function q(e){let{withLabel:s=!1,jobParent:t,jobId:a,managed:n}=e,i=(0,l.useRouter)(),c=(e,s)=>{e.preventDefault(),e.stopPropagation(),i.push({pathname:"".concat(t,"/").concat(a),query:{tab:s}})};return(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)(u.WH,{content:"View Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>c(e,"logs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(N.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-1.5",children:"Logs"})]})},"logs"),n&&(0,r.jsx)(u.WH,{content:"View Controller Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>c(e,"controllerlogs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(k.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-2",children:"Controller Logs"})]})},"controllerlogs")]})}function K(e){let{clusterName:s,clusterJobData:t,loading:l,refreshClusterJobsOnly:n,userFilter:x=null,nameFilter:m=null}=e,[p,j]=(0,a.useState)(null),[f,g]=(0,a.useState)({key:null,direction:"ascending"}),[b,v]=(0,a.useState)(1),[y,N]=(0,a.useState)(10),k=(0,a.useRef)(null),[C,S]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=e=>{p&&k.current&&!k.current.contains(e.target)&&j(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[p]);let E=a.useMemo(()=>{let e=t||[];return x&&"ALL_USERS"!==x&&(e=W(e,x)),m&&(e=U(e,m)),e},[t,x,m]);(0,a.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(C)&&S(t)},[t,C]);let R=a.useMemo(()=>f.key?[...E].sort((e,s)=>e[f.key]<s[f.key]?"ascending"===f.direction?-1:1:e[f.key]>s[f.key]?"ascending"===f.direction?1:-1:0):E,[E,f]),D=e=>{let s="ascending";f.key===e&&"ascending"===f.direction&&(s="descending"),g({key:e,direction:s})},M=e=>f.key===e?"ascending"===f.direction?" ↑":" ↓":"",F=Math.ceil(R.length/y),I=(b-1)*y,A=I+y,z=R.slice(I,A);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)(d.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Cluster Jobs"}),(0,r.jsx)("div",{className:"flex items-center",children:n&&(0,r.jsxs)("button",{onClick:n,disabled:l,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center text-sm ml-2",children:[(0,r.jsx)(w.Z,{className:"w-4 h-4 mr-1"}),"Refresh Jobs"]})})]}),(0,r.jsxs)(h.iA,{children:[(0,r.jsx)(h.xD,{children:(0,r.jsxs)(h.SC,{children:[(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>D("id"),children:["ID",M("id")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>D("job"),children:["Name",M("job")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>D("user"),children:["User",M("user")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>D("workspace"),children:["Workspace",M("workspace")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>D("submitted_at"),children:["Submitted",M("submitted_at")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>D("job_duration"),children:["Duration",M("job_duration")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>D("status"),children:["Status",M("status")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>D("resources"),children:["Resources",M("resources")]}),(0,r.jsx)(h.ss,{className:"whitespace-nowrap",children:"Logs"})]})}),(0,r.jsx)(h.RM,{children:l?(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:9,className:"text-center py-12 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(c.Z,{size:24,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading cluster jobs..."})]})})}):z.length>0?z.map(e=>(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)(h.SC,{className:p===e.id?"selected-row":"",children:[(0,r.jsx)(h.pj,{children:(0,r.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:(0,r.jsx)(G,{text:e.job||"Unnamed job",rowId:e.id,expandedRowId:p,setExpandedRowId:j})})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(_.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(i(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(h.pj,{children:Z(e.submitted_at)}),(0,r.jsx)(h.pj,{children:(0,u.LU)(e.job_duration)}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(L.OE,{status:e.status})}),(0,r.jsx)(h.pj,{children:e.resources}),(0,r.jsx)(h.pj,{className:"flex content-center items-center",children:(0,r.jsx)(q,{jobParent:"/clusters/".concat(s),jobId:e.id,managed:!1})})]}),p===e.id&&(0,r.jsx)(H,{text:e.job||"Unnamed job",colSpan:9,innerRef:k})]},e.id)):(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:"No jobs found"})})})]})]}),R&&R.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:y,onChange:e=>{N(parseInt(e.target.value,10)),v(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:5,children:"5"}),(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:20,children:"20"}),(0,r.jsx)("option",{value:50,children:"50"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[I+1," – ",Math.min(A,R.length)," of"," ",R.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{v(e=>Math.max(e-1,1))},disabled:1===b,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{v(e=>Math.min(e+1,F))},disabled:b===F||0===F,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}function H(e){let{text:s,colSpan:t,innerRef:a}=e;return(0,r.jsx)(h.SC,{className:"expanded-details",children:(0,r.jsx)(h.pj,{colSpan:t,children:(0,r.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border border-gray-200",ref:a,children:(0,r.jsx)("div",{className:"flex justify-between items-start",children:(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Full Details"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-700",style:{whiteSpace:"pre-wrap"},children:s})]})})})})})}function G(e){let{text:s,rowId:t,expandedRowId:l,setExpandedRowId:n}=e,i=s||"",c=i.length>50,o=l===t,d=c?"".concat(i.substring(0,50)):i,h=(0,a.useRef)(null);return(0,r.jsxs)("div",{className:"truncated-details relative max-w-full flex items-center",children:[(0,r.jsx)("span",{className:"truncate",children:d}),c&&(0,r.jsx)("button",{ref:h,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),n(o?null:t)},className:"text-blue-600 hover:text-blue-800 font-medium ml-1 flex-shrink-0","data-button-type":"show-more-less",children:o?"... show less":"... show more"})]})}function V(e){let{refreshInterval:s,setLoading:t,refreshDataRef:l}=e,[n,o]=(0,a.useState)([]),[x,j]=(0,a.useState)({key:null,direction:"ascending"}),[f,g]=(0,a.useState)(!1),[b,v]=(0,a.useState)(!0),[w,y]=(0,a.useState)(1),[N,k]=(0,a.useState)(10),C=a.useCallback(async()=>{g(!0),t(!0);try{let{pools:e=[]}=await p.default.get(m.vs,[{}])||{};o(e),v(!1)}catch(e){console.error("Error fetching pools data:",e),o([]),v(!1)}finally{g(!1),t(!1)}},[t]);a.useEffect(()=>{l&&(l.current=C)},[l,C]),(0,a.useEffect)(()=>{o([]);let e=!0;C();let t=setInterval(()=>{e&&C()},s);return()=>{e=!1,clearInterval(t)}},[s,C]);let S=e=>{let s="ascending";x.key===e&&"ascending"===x.direction&&(s="descending"),j({key:e,direction:s})},_=e=>x.key===e?"ascending"===x.direction?" ↑":" ↓":"",E=a.useMemo(()=>x.key?[...n].sort((e,s)=>e[x.key]<s[x.key]?"ascending"===x.direction?-1:1:e[x.key]>s[x.key]?"ascending"===x.direction?1:-1:0):n,[n,x]),R=Math.ceil(E.length/N),D=(w-1)*N,M=D+N,F=E.slice(D,M),I=e=>{if(!e||!e.replica_info||0===e.replica_info.length)return"0 (target: 0)";let s=e.replica_info.filter(e=>"READY"===e.status).length,t=e.target_num_replicas||0;return"".concat(s," (target: ").concat(t,")")},A=e=>{let{jobCounts:s}=e;return(0,r.jsx)(u.x9,{jobCounts:s,getStatusStyle:L.Cl})},z=e=>{let{replicaInfo:s}=e;return(0,r.jsx)(u.Kl,{replicaInfo:s})};return(0,r.jsxs)(d.Zb,{children:[(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,r.jsxs)(h.iA,{className:"min-w-full table-fixed",children:[(0,r.jsx)(h.xD,{children:(0,r.jsxs)(h.SC,{children:[(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap w-32",onClick:()=>S("name"),children:["Pool",_("name")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap w-40",onClick:()=>S("job_counts"),children:["Jobs",_("job_counts")]}),(0,r.jsx)(h.ss,{className:"whitespace-nowrap w-20",children:"Workers"}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap w-36",onClick:()=>S("requested_resources_str"),children:["Worker Details",_("requested_resources_str")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap w-40",onClick:()=>S("requested_resources_str"),children:["Worker Resources",_("requested_resources_str")]})]})}),(0,r.jsx)(h.RM,{children:f&&b?(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(c.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):F.length>0?F.map(e=>(0,r.jsxs)(h.SC,{children:[(0,r.jsx)(h.pj,{children:(0,r.jsx)(i(),{href:"/jobs/pools/".concat(e.name),className:"text-blue-600 hover:text-blue-800",children:e.name})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(A,{jobCounts:e.jobCounts})}),(0,r.jsx)(h.pj,{children:I(e)}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(z,{replicaInfo:e.replica_info})}),(0,r.jsx)(h.pj,{children:e.requested_resources_str||"-"})]},e.name)):(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:5,className:"text-center py-6 text-gray-500",children:"No pools found"})})})]})}),F.length>0&&R>1&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-200",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("span",{className:"text-sm text-gray-700",children:"Rows per page:"}),(0,r.jsxs)("select",{value:N,onChange:e=>{k(parseInt(e.target.value,10)),y(1)},className:"border border-gray-300 rounded px-2 py-1 text-sm",children:[(0,r.jsx)("option",{value:5,children:"5"}),(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:25,children:"25"}),(0,r.jsx)("option",{value:50,children:"50"})]})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsxs)("span",{className:"text-sm text-gray-700",children:[D+1,"-",Math.min(M,E.length)," of"," ",E.length]}),(0,r.jsx)("button",{onClick:()=>{y(e=>Math.max(e-1,1))},disabled:1===w,className:"px-2 py-1 text-sm border border-gray-300 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"Previous"}),(0,r.jsx)("button",{onClick:()=>{y(e=>Math.min(e+1,R))},disabled:w===R,className:"px-2 py-1 text-sm border border-gray-300 rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50",children:"Next"})]})]})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8969],{68969:function(e,t,o){o.d(t,{Ce:function(){return p},NJ:function(){return h},UA:function(){return u},aT:function(){return i},getManagedJobs:function(){return l},vs:function(){return d}});var r=o(67294),a=o(15821),n=o(93225),c=o(6378),s=o(47145);async function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t;let{allUsers:o=!0,nameMatch:r,userMatch:a,workspaceMatch:c,poolMatch:l,page:i,limit:d}=e,u={all_users:o,verbose:!0};void 0!==r&&(u.name_match=r),void 0!==a&&(u.user_match=a),void 0!==c&&(u.workspace_match=c),void 0!==l&&(u.pool_match=l),void 0!==i&&(u.page=i),void 0!==d&&(u.limit=d);let h=(await s.x.post("/jobs/queue",u)).headers.get("X-Skypilot-Request-ID"),p=await s.x.get("/api/get?request_id=".concat(h));if(500===p.status){try{let e=await p.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t.type&&t.type===n.iW)return{jobs:[],total:0,controllerStopped:!0}}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{jobs:[],total:0,controllerStopped:!1}}let b=await p.json(),f=b.return_value?JSON.parse(b.return_value):[],g=Array.isArray(f)?f:(null==f?void 0:f.jobs)||[],m=Array.isArray(f)?g.length:null!==(t=null==f?void 0:f.total)&&void 0!==t?t:g.length;return{jobs:g.map(e=>{var t;let o=0;e.end_at&&e.submitted_at?o=e.end_at-e.submitted_at:e.submitted_at&&(o=Date.now()/1e3-e.submitted_at);let r=[];e.submitted_at&&r.push({type:"PENDING",timestamp:e.submitted_at}),e.start_at&&r.push({type:"RUNNING",timestamp:e.start_at}),e.end_at&&r.push({type:e.status,timestamp:e.end_at});let a="",n="",c="",s="",l="";try{if(a=e.cloud||"",c=e.cluster_resources,n=e.region||"",a&&(s=a,n&&(s+="/".concat(n))),l=s,e.accelerators){let t=Object.entries(e.accelerators).map(e=>{let[t,o]=e;return"".concat(o,"x").concat(t)}).join(", ");t&&(l+=" (".concat(t,")"))}}catch(t){c=e.cluster_resources}return{id:e.job_id,task:e.task_name,name:e.job_name,job_duration:e.job_duration,total_duration:o,workspace:e.workspace,status:e.status,requested_resources:e.resources,resources_str:c,resources_str_full:e.cluster_resources_full||c,cloud:a,region:e.region,infra:s,full_infra:l,recoveries:e.recovery_count,details:e.details||e.failure_reason,user:e.user_name,user_hash:e.user_hash,submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,events:r,dag_yaml:e.user_yaml,entrypoint:e.entrypoint,git_commit:(null===(t=e.metadata)||void 0===t?void 0:t.git_commit)||"-",pool:e.pool,pool_hash:e.pool_hash,current_cluster_name:e.current_cluster_name,job_id_on_pool_cluster:e.job_id_on_pool_cluster}}),total:m,controllerStopped:!1}}catch(e){return console.error("Error fetching managed job data:",e),{jobs:[],total:0,controllerStopped:!1}}}async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{allUsers:t=!0,nameMatch:o,userMatch:r,workspaceMatch:a,poolMatch:n,page:c=1,limit:s=10,useClientPagination:i=!0}=e;try{if(!i)return await l(e);let d=await l({allUsers:t,nameMatch:o,userMatch:r,workspaceMatch:a,poolMatch:n});if(d.controllerStopped||!d.jobs)return d;let u=d.jobs,h=u.length,p=(c-1)*s;return{jobs:u.slice(p,p+s),total:h,controllerStopped:!1}}catch(e){return console.error("Error fetching managed job data with client pagination:",e),{jobs:[],total:0,controllerStopped:!1}}}async function d(){try{let e=(await s.x.post("/jobs/pool_status",{pool_names:null})).headers.get("X-Skypilot-Request-ID"),t=await s.x.get("/api/get?request_id=".concat(e));if(500===t.status){try{let e=await t.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t.type&&t.type===n.iW)return{pools:[],controllerStopped:!0}}catch(e){console.error("Failed to parse error JSON:",e)}}catch(e){console.error("Failed to parse response JSON:",e)}throw Error("Server error")}let o=await t.json(),r=o.return_value?JSON.parse(o.return_value):[],a={jobs:[]};try{let e=await l({allUsers:!0});e.controllerStopped||(a=e)}catch(e){console.warn("Failed to fetch jobs for pool job counts:",e)}let c={},i=["SUCCEEDED","FAILED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER","CANCELLED"];return a.jobs&&Array.isArray(a.jobs)&&a.jobs.forEach(e=>{let t=e.pool,o=e.status;t&&!i.includes(o)&&(c[t]||(c[t]={}),c[t][o]=(c[t][o]||0)+1)}),{pools:r.map(e=>({...e,jobCounts:c[e.name]||{}})),controllerStopped:!1}}catch(e){throw console.error("Error fetching pools:",e),e}}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[o,a]=(0,r.useState)(null),[n,s]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async function(){if(e)try{var t;s(!0);let o=await c.default.get(l,[{allUsers:!0}]),r=null==o?void 0:null===(t=o.jobs)||void 0===t?void 0:t.find(t=>String(t.id)===String(e));r?a({jobs:[r],controllerStopped:o.controllerStopped||!1}):a({jobs:[],controllerStopped:o.controllerStopped||!1})}catch(e){console.error("Error fetching single managed job data:",e),a({jobs:[],controllerStopped:!1})}finally{s(!1)}})()},[e,t]),{jobData:o,loading:n}}async function h(e){let t,{jobId:o,controller:r=!1,signal:c,onNewLog:s}=e,l=Date.now(),i=new Promise(e=>{let o=()=>{let r=Date.now()-l;r>=3e4?e({timeout:!0}):t=setTimeout(o,3e4-r)};t=setTimeout(o,3e4)}),d=window.location.origin,u="".concat(d).concat(n.f4),h=(async()=>{try{let e=(await fetch("".concat(u,"/jobs/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({controller:r,follow:!1,job_id:o,tail:1e4}),...c?{signal:c}:{}})).body.getReader();try{for(;;){let{done:t,value:o}=await e.read();if(t)break;l=Date.now();let r=new TextDecoder().decode(o);s(r)}}finally{if(!c||!c.aborted)try{e.cancel()}catch(e){"AbortError"!==e.name&&console.warn("Error canceling reader:",e)}t&&clearTimeout(t)}return{timeout:!1}}catch(e){if(t&&clearTimeout(t),"AbortError"===e.name)return{timeout:!1};throw e}})(),p=await Promise.race([h,i]);if(t&&clearTimeout(t),p.timeout){(0,a.C)("Log request for job ".concat(o," timed out after ").concat(30,"s of inactivity"),"warning");return}}async function p(e,t,o){let r="",c="",s="",l={};if("restartcontroller"===e)r="Restarting",c="restarted",s="jobs/queue",l={all_users:!0,refresh:!0},t="controller";else throw Error("Invalid action: ".concat(e));(0,a.C)("".concat(r," job ").concat(t,"..."),"info");let i=window.location.origin,d="".concat(i).concat(n.f4);try{try{let e=(await fetch("".concat(d,"/").concat(s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})).headers.get("X-Skypilot-Request-ID"),i=await fetch("".concat(d,"/api/get?request_id=").concat(e));if(200===i.status)(0,a.C)("Job ".concat(t," ").concat(c," successfully."),"success");else if(500===i.status)try{let e=await i.json();if(e.detail&&e.detail.error)try{let c=JSON.parse(e.detail.error);c.type&&c.type===n.Bo?(0,a.C)("".concat(r," job ").concat(t," is not supported!"),"error",1e4):c.type&&c.type===n.mF?(0,a.C)("Cluster ".concat(o," does not exist."),"error"):c.type&&c.type===n.iW?(0,a.C)("Cluster ".concat(o," is not up."),"error"):(0,a.C)("".concat(r," job ").concat(t," failed: ").concat(c.type),"error")}catch(o){(0,a.C)("".concat(r," job ").concat(t," failed: ").concat(e.detail.error),"error")}else(0,a.C)("".concat(r," job ").concat(t," failed with no details."),"error")}catch(e){(0,a.C)("".concat(r," job ").concat(t," failed with parse error."),"error")}else(0,a.C)("".concat(r," job ").concat(t," failed with status ").concat(i.status,"."),"error")}catch(e){console.error("Fetch error:",e),(0,a.C)("Network error ".concat(r," job ").concat(t,": ").concat(e.message),"error")}}catch(e){console.error("Error in handleStop:",e),(0,a.C)("Critical error ".concat(r," job ").concat(t,": ").concat(e.message),"error")}}},15821:function(e,t,o){o.d(t,{C:function(){return r}});function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=document.getElementById("toast-container");r||((r=document.createElement("div")).id="toast-container",r.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(r));let a=document.createElement("div");switch(a.className="rounded-md border-l-4 p-4 shadow-md flex items-center justify-between max-w-md w-full mb-2 pointer-events-auto",t){case"success":a.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":a.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":a.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:a.className+=" bg-blue-100 border-blue-500 text-blue-800"}return a.innerHTML='\n <div class="flex-1 mr-2">\n <p class="text-sm font-medium">'.concat(e,'</p>\n </div>\n <button class="text-gray-500 hover:text-gray-700 focus:outline-none" aria-label="Close toast">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n '),r.appendChild(a),a.querySelector("button").addEventListener("click",()=>{r.removeChild(a)}),setTimeout(()=>{r.contains(a)&&r.removeChild(a)},o),a}},6378:function(e,t,o){o.r(t),o.d(t,{DashboardCache:function(){return a},dashboardCache:function(){return n}});let r=o(51214).ej.DEFAULT_TTL;class a{async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.ttl||r,n=!1!==o.refreshOnAccess,c=this._generateKey(e,t),s=e.name||"anonymous",l=this.cache.get(c),i=Date.now();if(l&&i-l.lastUpdated<a){let o=Math.round((i-l.lastUpdated)/1e3);return this._debug("Cache HIT for ".concat(s," (age: ").concat(o,"s, TTL: ").concat(Math.round(a/1e3),"s)")),n&&(this.cache.set(c,{data:l.data,lastUpdated:i}),this._debug("Cache TTL refreshed for ".concat(s))),this.backgroundJobs.has(c)||this._refreshInBackground(e,t,c),l.data}try{let o=await e(...t);return this.cache.set(c,{data:o,lastUpdated:i}),o}catch(e){if(l)return console.warn("Failed to fetch fresh data for ".concat(c,", returning stale data:"),e),l.data;throw e}}invalidate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=this._generateKey(e,t);this.cache.delete(o),this.backgroundJobs.delete(o)}invalidateFunction(e){let t=e.name||"anonymous",o=[];for(let e of this.cache.keys())e.startsWith("".concat(t,"_"))&&o.push(e);o.forEach(e=>{this.cache.delete(e),this.backgroundJobs.delete(e)})}clear(){this.cache.clear(),this.backgroundJobs.clear()}getStats(){return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,keys:Array.from(this.cache.keys())}}getDetailedStats(){let e=Date.now(),t=[];for(let[o,r]of this.cache.entries()){let a=e-r.lastUpdated;t.push({key:o,age:Math.round(a/1e3),lastUpdated:new Date(r.lastUpdated).toISOString(),hasBackgroundJob:this.backgroundJobs.has(o)})}return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,entries:t.sort((e,t)=>e.age-t.age)}}setDebugMode(e){this.debugMode=e}_debug(e){for(var t=arguments.length,o=Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];this.debugMode&&console.log("[DashboardCache] ".concat(e),...o)}_refreshInBackground(e,t,o){this.backgroundJobs.set(o,!0),e(...t).then(e=>{this.cache.set(o,{data:e,lastUpdated:Date.now()})}).catch(e=>{console.warn("Background refresh failed for ".concat(o,":"),e)}).finally(()=>{this.backgroundJobs.delete(o)})}_generateKey(e,t){let o=function(e){let t=5381;for(let o=0;o<e.length;o++)t=(t<<5)+t+e.charCodeAt(o);return t>>>0}(e.toString()),r=t.length>0?JSON.stringify(t):"";return"".concat(o,"_").concat(r)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.debugMode=!1}}let n=new a;t.default=n}}]);