skypilot-nightly 1.0.0.dev20250710__py3-none-any.whl → 1.0.0.dev20250712__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sky/__init__.py +2 -2
- sky/clouds/kubernetes.py +137 -23
- sky/core.py +3 -1
- sky/dashboard/out/404.html +1 -1
- sky/dashboard/out/_next/static/{P2Di1JdUlHuKN2lBws4Mr → Xv9sc7FbOn47FoLhF0fUv}/_buildManifest.js +1 -1
- sky/dashboard/out/_next/static/chunks/{1043-1b39779691bb4030.js → 1043-5e5ef6198735ff7e.js} +1 -1
- sky/dashboard/out/_next/static/chunks/1871-cf1a47986d716dd2.js +6 -0
- sky/dashboard/out/_next/static/chunks/6601-d38d10f957dff832.js +1 -0
- sky/dashboard/out/_next/static/chunks/{6989-6ff4e45dfb49d11d.js → 6989-eab0e9c16b64fd9f.js} +1 -1
- sky/dashboard/out/_next/static/chunks/938-8e25c8ea0baa271a.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-4608dc89f95eba89.js +6 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-980d6f6b64ca7833.js +16 -0
- sky/dashboard/out/_next/static/chunks/{webpack-fd62f17bd9ce1fcc.js → webpack-4d50ce5087a63a95.js} +1 -1
- sky/dashboard/out/_next/static/css/a713705ccc8fe059.css +3 -0
- sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
- sky/dashboard/out/clusters/[cluster].html +1 -1
- sky/dashboard/out/clusters.html +1 -1
- sky/dashboard/out/config.html +1 -1
- sky/dashboard/out/index.html +1 -1
- sky/dashboard/out/infra/[context].html +1 -1
- sky/dashboard/out/infra.html +1 -1
- sky/dashboard/out/jobs/[job].html +1 -1
- sky/dashboard/out/jobs.html +1 -1
- sky/dashboard/out/users.html +1 -1
- sky/dashboard/out/volumes.html +1 -1
- sky/dashboard/out/workspace/new.html +1 -1
- sky/dashboard/out/workspaces/[name].html +1 -1
- sky/dashboard/out/workspaces.html +1 -1
- sky/global_user_state.py +10 -11
- sky/jobs/state.py +10 -11
- sky/jobs/utils.py +11 -3
- sky/optimizer.py +22 -14
- sky/provision/kubernetes/utils.py +132 -0
- sky/setup_files/dependencies.py +1 -0
- sky/skypilot_config.py +4 -1
- sky/templates/kubernetes-ray.yml.j2 +298 -10
- sky/users/permission.py +15 -1
- sky/users/token_service.py +25 -3
- sky/utils/schemas.py +3 -0
- {skypilot_nightly-1.0.0.dev20250710.dist-info → skypilot_nightly-1.0.0.dev20250712.dist-info}/METADATA +3 -1
- {skypilot_nightly-1.0.0.dev20250710.dist-info → skypilot_nightly-1.0.0.dev20250712.dist-info}/RECORD +49 -49
- sky/dashboard/out/_next/static/chunks/1871-80dea41717729fa5.js +0 -6
- sky/dashboard/out/_next/static/chunks/6601-fcfad0ddf92ec7ab.js +0 -1
- sky/dashboard/out/_next/static/chunks/938-044ad21de8b4626b.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-8135aba0712bda37.js +0 -6
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-c4d5cfac7fbc0668.js +0 -16
- sky/dashboard/out/_next/static/css/0da6afe66176678a.css +0 -3
- /sky/dashboard/out/_next/static/{P2Di1JdUlHuKN2lBws4Mr → Xv9sc7FbOn47FoLhF0fUv}/_ssgManifest.js +0 -0
- /sky/dashboard/out/_next/static/chunks/pages/{_app-a37b06ddb64521fd.js → _app-49ff6c04332cc621.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/pages/clusters/{[cluster]-1159f362b960e2b8.js → [cluster]-0fbfb1dd0b08c90c.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/pages/{clusters-9744c271a1642f76.js → clusters-102d169e87913ba1.js} +0 -0
- {skypilot_nightly-1.0.0.dev20250710.dist-info → skypilot_nightly-1.0.0.dev20250712.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20250710.dist-info → skypilot_nightly-1.0.0.dev20250712.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20250710.dist-info → skypilot_nightly-1.0.0.dev20250712.dist-info}/licenses/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20250710.dist-info → skypilot_nightly-1.0.0.dev20250712.dist-info}/top_level.txt +0 -0
{skypilot_nightly-1.0.0.dev20250710.dist-info → skypilot_nightly-1.0.0.dev20250712.dist-info}/RECORD
RENAMED
@@ -1,19 +1,19 @@
|
|
1
|
-
sky/__init__.py,sha256=
|
1
|
+
sky/__init__.py,sha256=PJ9BiF4NpFIlupeHI19EJl28K7uCd6q642ixnOwR_RY,6419
|
2
2
|
sky/admin_policy.py,sha256=FMiizgvVTmD9gFA2OUaveXnuY3lbNU-fCbUYAODBZj4,9427
|
3
3
|
sky/authentication.py,sha256=V7zGSV7bqcAKC_EGOOS0KhJ01ZFLnme0WnjLFO7zavs,25603
|
4
4
|
sky/check.py,sha256=R0pFsTq2v-wr3NFePlX9DmDhsbvWEoFJAXsys3pUmT4,30338
|
5
5
|
sky/cli.py,sha256=VXIZryeTtJPYpPTBKymVPmuOCyh8knfWrq-qnkr6R-4,178
|
6
6
|
sky/cloud_stores.py,sha256=Ln5GBpel-sEs7rVx7bBrMkfLwA_bctI05Rox2uoz7Lo,26388
|
7
|
-
sky/core.py,sha256=
|
7
|
+
sky/core.py,sha256=KbPCVZpCZTJF-vtyWqk1rGFzrT8cGHQI93YN9WRp8P4,56338
|
8
8
|
sky/dag.py,sha256=5MFXlP43y9U54zxfYGhVyBiWEInoFFlt_zJ7ASJntXw,3889
|
9
9
|
sky/exceptions.py,sha256=Vn7VVhyrTaMBTdVxsro325aKSMM4_KRJOghFX31xIVM,19164
|
10
10
|
sky/execution.py,sha256=BhI4paGKpXMhWJoelHFe7LGFbCnW7hl0rIAmdIay-dk,33223
|
11
|
-
sky/global_user_state.py,sha256=
|
11
|
+
sky/global_user_state.py,sha256=L_NMe0e8on_4aRmZ4wuIJP98RXXxaWaV1TozhaTVx14,73098
|
12
12
|
sky/models.py,sha256=Eor-cT4D71QTimogcnJ5ey1G1PXK-OXN-snEtE8Uu_g,3152
|
13
|
-
sky/optimizer.py,sha256=
|
13
|
+
sky/optimizer.py,sha256=rcH6CVix1PJWWSwe1XWItfsmG8igwbKtRE5QVWRlpR4,63804
|
14
14
|
sky/resources.py,sha256=MHdipCUpW2foB2romFIM57b__Lg4WCBfYDNSYAx2MEA,105546
|
15
15
|
sky/sky_logging.py,sha256=cMurxhFExKEFX1frcMR71Ti_s9Obg9WY30veVxsZB6o,7285
|
16
|
-
sky/skypilot_config.py,sha256=
|
16
|
+
sky/skypilot_config.py,sha256=3Tc-o9Xm08WIfRLuky1ZH-QtycVI65RGxfx09loRdzM,36532
|
17
17
|
sky/task.py,sha256=wQelWSNWlB-rVt1GhqwijK9CxTL1f1FN0ESc-ZpjOto,71734
|
18
18
|
sky/adaptors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
19
|
sky/adaptors/aws.py,sha256=4caUTO5nxZQyDVPyQdoPljaF-Lz_Fa6NEnu3FfmLZd4,8633
|
@@ -92,7 +92,7 @@ sky/clouds/fluidstack.py,sha256=TkFHChRa7HH_-f5SDRgtFqKCmUCYcSfPCf4lpQH90do,1322
|
|
92
92
|
sky/clouds/gcp.py,sha256=92qzPagPCabVScWMqbDh4Nd14LzcZnK5ojb_phw9bRA,68430
|
93
93
|
sky/clouds/hyperbolic.py,sha256=cvcYeTs7js36OOXwehme4vzzjtDWqjPyqtxmb4XuUk4,11492
|
94
94
|
sky/clouds/ibm.py,sha256=JQTJQ5wVxVSqH7O05GOld8X5iO16g6Idd_YmRAGZmB8,22567
|
95
|
-
sky/clouds/kubernetes.py,sha256=
|
95
|
+
sky/clouds/kubernetes.py,sha256=Xu9jyJYchGHuaBqGzLBNvpG-PlMh98GcHmERZFwM_r0,54201
|
96
96
|
sky/clouds/lambda_cloud.py,sha256=ZoKSseOGYlZFNhue2OK75dTU836AAE_pkuVod4yZX68,13260
|
97
97
|
sky/clouds/nebius.py,sha256=0ceJUwl1kjwhTJOSDERke8jCrfRxeyb9nLMkQfjBktQ,20926
|
98
98
|
sky/clouds/oci.py,sha256=Tos4hgXhYJ4kNkh6aa8_WsaxcD_JmbarR_1GltV-YrM,28158
|
@@ -108,25 +108,25 @@ sky/clouds/utils/azure_utils.py,sha256=NToRBnhEyuUvb-nBnsKTxjhOBRkMcrelL8LK4w6s4
|
|
108
108
|
sky/clouds/utils/gcp_utils.py,sha256=zpdibyvdROgDGqllcvQuST3pKqj6pzqX-gxCw-DsCfc,9873
|
109
109
|
sky/clouds/utils/oci_utils.py,sha256=yv_Y9oM5WNCnOofu44aKyOPTZZdKfpFLCx3ewZ2VBFY,7994
|
110
110
|
sky/clouds/utils/scp_utils.py,sha256=VGuccVO5uFGr8-yolWSoYrgr11z6cIeDBGcqkBzAyOs,18409
|
111
|
-
sky/dashboard/out/404.html,sha256=
|
112
|
-
sky/dashboard/out/clusters.html,sha256=
|
113
|
-
sky/dashboard/out/config.html,sha256=
|
111
|
+
sky/dashboard/out/404.html,sha256=qSSwFspoKKCWLiR7LVca_Q9xOWnQv8YfPorDwfnb594,1423
|
112
|
+
sky/dashboard/out/clusters.html,sha256=XCUwfq_4eiV1jEGeyCx7j-a8Cnwz9bLcmUqtXwMzhSo,1418
|
113
|
+
sky/dashboard/out/config.html,sha256=UXXtkhwO0LvA96e2AtArsx8Mf8L2dh25KOJSHuj8ZXc,1414
|
114
114
|
sky/dashboard/out/favicon.ico,sha256=XilUZZglAl_1zRsg85QsbQgmQAzGPQjcUIJ-A3AzYn8,93590
|
115
|
-
sky/dashboard/out/index.html,sha256=
|
116
|
-
sky/dashboard/out/infra.html,sha256=
|
117
|
-
sky/dashboard/out/jobs.html,sha256=
|
115
|
+
sky/dashboard/out/index.html,sha256=3G4q4RNYeQiqfX2Fg0Z5TEQDR6JmOE_I8BvnbDV4gOY,1407
|
116
|
+
sky/dashboard/out/infra.html,sha256=JisSBo87MSeFchA5xigVac0bMpUDN0rgjiuG0ZTMNKE,1412
|
117
|
+
sky/dashboard/out/jobs.html,sha256=qCeevNCyhiTlUdPCIQgL_iJehXm4ztAY33kaNcxWv0Y,1410
|
118
118
|
sky/dashboard/out/skypilot.svg,sha256=c0iRtlfLlaUm2p0rG9NFmo5FN0Qhf3pq5Xph-AeMPJw,5064
|
119
|
-
sky/dashboard/out/users.html,sha256=
|
120
|
-
sky/dashboard/out/volumes.html,sha256=
|
121
|
-
sky/dashboard/out/workspaces.html,sha256=
|
122
|
-
sky/dashboard/out/_next/static/
|
123
|
-
sky/dashboard/out/_next/static/
|
124
|
-
sky/dashboard/out/_next/static/chunks/1043-
|
119
|
+
sky/dashboard/out/users.html,sha256=MvXW1i83XTi8eEw90wyl_3QUDKbMcZgKAnJtoF0IwEQ,1412
|
120
|
+
sky/dashboard/out/volumes.html,sha256=NviZEneUSgY60IkIrBf6mA76VOVqiTYMLvP3hvS1pzY,1416
|
121
|
+
sky/dashboard/out/workspaces.html,sha256=bjXWTZVaovqkf5Pj4JoloT0kj_tNbh-u1gqvSyvERIc,1422
|
122
|
+
sky/dashboard/out/_next/static/Xv9sc7FbOn47FoLhF0fUv/_buildManifest.js,sha256=ADYwhgJrpI4Y_llj8b1zhUCnq8_s04Iu3bPSyrYQuYY,2235
|
123
|
+
sky/dashboard/out/_next/static/Xv9sc7FbOn47FoLhF0fUv/_ssgManifest.js,sha256=Z49s4suAsf5y_GfnQSvm4qtq2ggxEbZPfEDTXjy6XgA,80
|
124
|
+
sky/dashboard/out/_next/static/chunks/1043-5e5ef6198735ff7e.js,sha256=-9qAHQCv3B2H3wlAqzPknzAuG0lciC0BbpK2mhx5t9o,18216
|
125
125
|
sky/dashboard/out/_next/static/chunks/1141-726e5a3f00b67185.js,sha256=lEAVPk_18NZpZuPrGx1Xy9VWqE_5n3JuqWbIPS1_ZMw,17823
|
126
126
|
sky/dashboard/out/_next/static/chunks/1272-1ef0bf0237faccdb.js,sha256=VJ6y-Z6Eg2T93hQIRfWAbjAkQ7nQhglmIaVbEpKSILY,38451
|
127
127
|
sky/dashboard/out/_next/static/chunks/1664-d65361e92b85e786.js,sha256=hMjNU7ss4lTqwShmHJ45jVOjTSdq-EI04DeVMnTRvRc,6557
|
128
128
|
sky/dashboard/out/_next/static/chunks/1691.44e378727a41f3b5.js,sha256=t1oN2P9Lsz7sMZy2fvhPrcLwlWAhF9v39t33TaJLerg,51065
|
129
|
-
sky/dashboard/out/_next/static/chunks/1871-
|
129
|
+
sky/dashboard/out/_next/static/chunks/1871-cf1a47986d716dd2.js,sha256=4e3x1AQr-5p5gL_Ye8eokWc_EEu3DOEAp5xekA05goc,19373
|
130
130
|
sky/dashboard/out/_next/static/chunks/2544.27f70672535675ed.js,sha256=93-1mEA2lUkeOp5V7MPh2e6SFTLd_N0exVSiCBnNf9s,307
|
131
131
|
sky/dashboard/out/_next/static/chunks/2875.c24c6d57dc82e436.js,sha256=af3HVjuqsxD6wZyPzEDEb7FMq02fb1XB7O9mobwXTos,10053
|
132
132
|
sky/dashboard/out/_next/static/chunks/3256.7257acd01b481bed.js,sha256=TSlzBVoGlzZE0e6mHhbT-29OEQ7iJXms0k4fnYQFpYU,30514
|
@@ -141,14 +141,14 @@ sky/dashboard/out/_next/static/chunks/5230-df791914b54d91d9.js,sha256=jy8KepJn43
|
|
141
141
|
sky/dashboard/out/_next/static/chunks/5491.918ffed0ba7a5294.js,sha256=zi9QGpZSoMnyZa9F8JB13haVGnx4gI88520-vdp9AXc,8487
|
142
142
|
sky/dashboard/out/_next/static/chunks/5739-5ea3ffa10fc884f2.js,sha256=3X5yHbRwhHhC96Dcx3-jV__MFmMSjar6ZvmYFzKljlE,65357
|
143
143
|
sky/dashboard/out/_next/static/chunks/616-162f3033ffcd3d31.js,sha256=p-UXLnK6MHA4gij1kki4bFdhk8ANfnn-XzCInpzoDj0,179264
|
144
|
-
sky/dashboard/out/_next/static/chunks/6601-
|
145
|
-
sky/dashboard/out/_next/static/chunks/6989-
|
144
|
+
sky/dashboard/out/_next/static/chunks/6601-d38d10f957dff832.js,sha256=349Wv6Ua29bfbBpnCwCjI33UFemyyIeBXzS3obGapw4,9053
|
145
|
+
sky/dashboard/out/_next/static/chunks/6989-eab0e9c16b64fd9f.js,sha256=nUs4DAMCOn7QvwRXZ4MLN0GLkdVcFPK7LBR7cxAcFb0,9433
|
146
146
|
sky/dashboard/out/_next/static/chunks/6990-d0dc765474fa0eca.js,sha256=6yYTJ0jYQvnwON-rVGIdusJM-oEtEx1FVrHFxX7YCBM,16116
|
147
147
|
sky/dashboard/out/_next/static/chunks/804-9f5e98ce84d46bdd.js,sha256=yC-hYtK6OPB30EDHw7JG50eDF5-CufVV-lCg4__Fg-w,11465
|
148
148
|
sky/dashboard/out/_next/static/chunks/8969-13bb52ce3cffa4e3.js,sha256=YrTrcR303uCovqxoDQRUBm8KKUmLGZ2fWIgYEjWVYBQ,9949
|
149
149
|
sky/dashboard/out/_next/static/chunks/8982.a2e214068f30a857.js,sha256=fQlHyU9rqSfks7lbZ-C6FYSRjG_XyaPSw_gojuY7TeU,17059
|
150
150
|
sky/dashboard/out/_next/static/chunks/9025.a7c44babfe56ce09.js,sha256=0ciCX9lNsRd3HNYlFQ29BXu2S-xCuoqUwGcrawVwiZM,10637
|
151
|
-
sky/dashboard/out/_next/static/chunks/938-
|
151
|
+
sky/dashboard/out/_next/static/chunks/938-8e25c8ea0baa271a.js,sha256=2nR5pla_QWFUVhhu_liYREnQC_dIYnZIpisq4kRm03Y,25826
|
152
152
|
sky/dashboard/out/_next/static/chunks/9470-21d059a1dfa03f61.js,sha256=CPmGRW2grevoF93p_jmh9tgO2X15tldm-_xFa4-qXXU,7887
|
153
153
|
sky/dashboard/out/_next/static/chunks/9984.b56614f3c4c5961d.js,sha256=kij2wjmGv52Dl66I9E_Nrc7aG9JN_orwMY-GqPJriN8,41450
|
154
154
|
sky/dashboard/out/_next/static/chunks/fd9d1056-61f2257a9cd8b32b.js,sha256=49S_KmXpB4D3U299iKHRbYnFxJnoeN36awxwhBbUn8U,172832
|
@@ -156,10 +156,10 @@ sky/dashboard/out/_next/static/chunks/framework-efc06c2733009cd3.js,sha256=XKYUV
|
|
156
156
|
sky/dashboard/out/_next/static/chunks/main-app-68c028b1bc5e1b72.js,sha256=zSukg-WO1Xy-B2xEIIGHXYApy2KOY9xWHcLqAYQvF3A,115883
|
157
157
|
sky/dashboard/out/_next/static/chunks/main-c0a4f1ea606d48d2.js,sha256=DPLM6ccDgTnITBgsqZPN3gmcI2szGCi9b_60PJZkTJQ,109885
|
158
158
|
sky/dashboard/out/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js,sha256=6QPOwdWeAVe8x-SsiDrm-Ga6u2DkqgG5SFqglrlyIgA,91381
|
159
|
-
sky/dashboard/out/_next/static/chunks/webpack-
|
160
|
-
sky/dashboard/out/_next/static/chunks/pages/_app-
|
159
|
+
sky/dashboard/out/_next/static/chunks/webpack-4d50ce5087a63a95.js,sha256=0PyZZcb4LwWHds7ZEmDs2wL7_ZD5OzOkW249JaRYz7A,4655
|
160
|
+
sky/dashboard/out/_next/static/chunks/pages/_app-49ff6c04332cc621.js,sha256=H1r6Y8kJC7-I-8jRr71VINRghHy_yaY6scBkjN4cyxw,7587
|
161
161
|
sky/dashboard/out/_next/static/chunks/pages/_error-c72a1f77a3c0be1b.js,sha256=D2OpMaqpdtCPyq6iPhZHuF2ekyMjleRchSNCLR6fqps,250
|
162
|
-
sky/dashboard/out/_next/static/chunks/pages/clusters-
|
162
|
+
sky/dashboard/out/_next/static/chunks/pages/clusters-102d169e87913ba1.js,sha256=wzNhCoIzkSiOuaTm9dGBVIYYIYWf4COJOklBr1aaLxE,859
|
163
163
|
sky/dashboard/out/_next/static/chunks/pages/config-a2673b256b6d416f.js,sha256=DYGB9Imk5FCe9uF7M_4nolQ0KbyaB9OHtI-Btilhk0I,787
|
164
164
|
sky/dashboard/out/_next/static/chunks/pages/index-927ddeebe57a8ac3.js,sha256=HNHKZ1ZGl68cTrJtLgtcXdVxfZpOAb1kU7F-DKbdzDc,516
|
165
165
|
sky/dashboard/out/_next/static/chunks/pages/infra-ae9d2f705ce582c9.js,sha256=VQCeBoIUFxwk21fCG5bRlJCAZGhPJYw6l-ewEXxodU0,829
|
@@ -167,20 +167,20 @@ sky/dashboard/out/_next/static/chunks/pages/jobs-5bbdc71878f0a068.js,sha256=DzFF
|
|
167
167
|
sky/dashboard/out/_next/static/chunks/pages/users-cd43fb3c122eedde.js,sha256=ZmBi5Bo3Nuc8h98X3A1f3Wf5vXXoJhSdf4dMArPfe0s,830
|
168
168
|
sky/dashboard/out/_next/static/chunks/pages/volumes-4ebf6484f7216387.js,sha256=1F6IwI6S3p3hsDBy_fuLwFRz3Elg0IfrWNj5z3fhxdg,827
|
169
169
|
sky/dashboard/out/_next/static/chunks/pages/workspaces-06bde99155fa6292.js,sha256=l9iLMdY_ShOHIo368M98I4mADuUWtiu_ZDHci8ffJjM,874
|
170
|
-
sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-
|
171
|
-
sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-
|
170
|
+
sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-0fbfb1dd0b08c90c.js,sha256=GqMjMN3_Z8kYZWCz01aabcu8epNuKAUihohv9wxF34Y,16659
|
171
|
+
sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-4608dc89f95eba89.js,sha256=ClLqov9b9n96ZNcjlTnUizh15Vv99iTYnfS61KKuyLE,21283
|
172
172
|
sky/dashboard/out/_next/static/chunks/pages/infra/[context]-8b0809f59034d509.js,sha256=2X6wnNqROGTzwZorrDJpUmO6XnUmS9VN3ImpTvhJ4IM,839
|
173
|
-
sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-
|
173
|
+
sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-980d6f6b64ca7833.js,sha256=70rKHgzg09E4f-4BLRsq3lpW9Uz3695K9Rf4TCLFEwM,25266
|
174
174
|
sky/dashboard/out/_next/static/chunks/pages/workspace/new-5629d4e551dba1ee.js,sha256=K9tqKHcB2kiSHTAddLaM2oL1PzmqZNTdLDOuNzCaJNM,765
|
175
175
|
sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-7c0187f43757a548.js,sha256=FsoenC6VRkPLE29KkLd4nlSq2qociH4zFexYMxgetOM,1530
|
176
|
-
sky/dashboard/out/_next/static/css/
|
177
|
-
sky/dashboard/out/clusters/[cluster].html,sha256=
|
178
|
-
sky/dashboard/out/clusters/[cluster]/[job].html,sha256=
|
179
|
-
sky/dashboard/out/infra/[context].html,sha256=
|
180
|
-
sky/dashboard/out/jobs/[job].html,sha256=
|
176
|
+
sky/dashboard/out/_next/static/css/a713705ccc8fe059.css,sha256=M6xEDExt5iFLUOEZxyPOVUE4y4vtcHBhRE0wwuVR4Os,45488
|
177
|
+
sky/dashboard/out/clusters/[cluster].html,sha256=jZQphHNl1lKiXGGCOfnt5FHXDn4uM0iDGxPidKrA0nE,2847
|
178
|
+
sky/dashboard/out/clusters/[cluster]/[job].html,sha256=MGEeT9jmrVmXOyR2LJr69CtqevXe4-wDhAMHfFcTFvE,2160
|
179
|
+
sky/dashboard/out/infra/[context].html,sha256=w5BpgjCjjUTVwOCvMPR6T1kzH3K5fOcedN5rfKhAwIU,1436
|
180
|
+
sky/dashboard/out/jobs/[job].html,sha256=nq4pas_b2Uz2PK5Ser8pdaoMqERNDAtnvnS9vxipxCQ,2304
|
181
181
|
sky/dashboard/out/videos/cursor-small.mp4,sha256=8tRdp1vjawOrXUar1cfjOc-nkaKmcwCPZx_LO0XlCvQ,203285
|
182
|
-
sky/dashboard/out/workspace/new.html,sha256=
|
183
|
-
sky/dashboard/out/workspaces/[name].html,sha256=
|
182
|
+
sky/dashboard/out/workspace/new.html,sha256=3D_DVA-89lxPlXuf8lczo-zMJZyqDXELygl_XNDjslA,1428
|
183
|
+
sky/dashboard/out/workspaces/[name].html,sha256=gPex4qKW9UA7pi-rNfIGoMr9kWXOC53WGirtD-ULFTg,2845
|
184
184
|
sky/data/__init__.py,sha256=Nhaf1NURisXpZuwWANa2IuCyppIuc720FRwqSE2oEwY,184
|
185
185
|
sky/data/data_transfer.py,sha256=N8b0CQebDuHieXjvEVwlYmK6DbQxUGG1RQJEyTbh3dU,12040
|
186
186
|
sky/data/data_utils.py,sha256=CNYPM963qby5ddW0DZNbhiWXkqgB9MHh_jrC5DoBctM,33437
|
@@ -192,8 +192,8 @@ sky/jobs/constants.py,sha256=N7Bw_sSCL8cVd0NmKGXvAhyclR8Y-gJAair597umVo4,3305
|
|
192
192
|
sky/jobs/controller.py,sha256=kKnBMQs2XRg1TN80ToVWFwVdwKTuFE4TjQapb3V0iUI,36073
|
193
193
|
sky/jobs/recovery_strategy.py,sha256=a9A4W-6U3KU-pjkWiFpIdgTHC8W26-jYrmi4vzU9iOg,28818
|
194
194
|
sky/jobs/scheduler.py,sha256=b3RAjEzCXyoikh_BcmmGjoZ9ZeXr-tBnXoLFctt95ko,14375
|
195
|
-
sky/jobs/state.py,sha256=
|
196
|
-
sky/jobs/utils.py,sha256=
|
195
|
+
sky/jobs/state.py,sha256=5yTPI-8NITu1eQwKA6FACPOrhK27t93Bc9K1mQUkVBI,65990
|
196
|
+
sky/jobs/utils.py,sha256=MvCTjR6Bthxs41b010UowWvlnC_a9qph6YSdPbE_RNM,72474
|
197
197
|
sky/jobs/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
198
198
|
sky/jobs/client/sdk.py,sha256=Nw7bP8pJ-uLIi14kMekEtmzqPmdIiN-CbhoNCJlHA7s,11340
|
199
199
|
sky/jobs/server/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
@@ -253,7 +253,7 @@ sky/provision/kubernetes/constants.py,sha256=vZJQsAVjAgwsOskB48tIFSXtNw7IFnJOQE_
|
|
253
253
|
sky/provision/kubernetes/instance.py,sha256=oQ_-QD6uAv4b32Q5kB_fRRE3iO_3xmVqPLbYBA0Wd08,59861
|
254
254
|
sky/provision/kubernetes/network.py,sha256=Dgj8u7IQBHKHt-mSDhYzue1wfDk96FR_8fO89TwuZ2E,12846
|
255
255
|
sky/provision/kubernetes/network_utils.py,sha256=eEbt8acJW3Ohe6qHZNZ9GAQ29kIZEQX7Q5S08yOuvhA,12220
|
256
|
-
sky/provision/kubernetes/utils.py,sha256=
|
256
|
+
sky/provision/kubernetes/utils.py,sha256=bAFjCKtr46Cd4iqBuVjIaFwoHbRWhw4NB8WvRSchQhQ,149396
|
257
257
|
sky/provision/kubernetes/volume.py,sha256=KaYls4QU_QNXoncAiySeUX479zuzeCeW2iB1tWtJe8w,8061
|
258
258
|
sky/provision/kubernetes/manifests/fusermount-server-daemonset.yaml,sha256=S87GNAbDqgTrLuxF-afPAqQ0V-i41El4s_9KBZMuaag,1331
|
259
259
|
sky/provision/lambda_cloud/__init__.py,sha256=6EEvSgtUeEiup9ivIFevHmgv0GqleroO2X0K7TRa2nE,612
|
@@ -348,7 +348,7 @@ sky/server/requests/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
348
348
|
sky/server/requests/serializers/decoders.py,sha256=qphN79pRAaaitCbcsZIrslphgZn1iYndl6JnmergEe4,6361
|
349
349
|
sky/server/requests/serializers/encoders.py,sha256=4bQV5yTg8RTPT_HkRyQpjaBY_uUvBJ4NH189W0-6Pi0,5578
|
350
350
|
sky/setup_files/MANIFEST.in,sha256=BzWGsYZz9fO40HN1Uxm1Ca4pn1FkKn3lcoY1B9-YRiA,644
|
351
|
-
sky/setup_files/dependencies.py,sha256=
|
351
|
+
sky/setup_files/dependencies.py,sha256=Nzs_KTcDHUS8HRuItWi1U3N6ZAHhWfeL78N1Ye9U1XU,7150
|
352
352
|
sky/setup_files/setup.py,sha256=GTXvAi65S4_TSLhQ1GzkmaWf_yzciHiaxMbZumcTtKU,7522
|
353
353
|
sky/skylet/LICENSE,sha256=BnFrJSvUFpMUoH5mOpWnEvaC5R6Uux8W6WXgrte8iYg,12381
|
354
354
|
sky/skylet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -391,7 +391,7 @@ sky/templates/jobs-controller.yaml.j2,sha256=3HxM6p0t50_eZjk-gVThkLtM5hlwU6F1jFm
|
|
391
391
|
sky/templates/kubernetes-ingress.yml.j2,sha256=73iDklVDWBMbItg0IexCa6_ClXPJOxw7PWz3leku4nE,1340
|
392
392
|
sky/templates/kubernetes-loadbalancer.yml.j2,sha256=IxrNYM366N01bbkJEbZ_UPYxUP8wyVEbRNFHRsBuLsw,626
|
393
393
|
sky/templates/kubernetes-port-forward-proxy-command.sh,sha256=iw7mypHszg6Ggq9MbyiYMFOkSlXaQZulaxqC5IWYGCc,3381
|
394
|
-
sky/templates/kubernetes-ray.yml.j2,sha256=
|
394
|
+
sky/templates/kubernetes-ray.yml.j2,sha256=qPesN53KwvwnAQvBAyBgu5Eav8VNtBpiLIGHobLOfxw,57351
|
395
395
|
sky/templates/kubernetes-ssh-jump.yml.j2,sha256=k5W5sOIMppU7dDkJMwPlqsUcb92y7L5_TVG3hkgMy8M,2747
|
396
396
|
sky/templates/lambda-ray.yml.j2,sha256=AeFThho5hPQMncrOWQ6DhEWOsAuZtdxf1gjmp_6kPJA,4747
|
397
397
|
sky/templates/local-ray.yml.j2,sha256=FNHeyHF6nW9nU9QLIZceUWfvrFTTcO51KqhTnYCEFaA,1185
|
@@ -410,10 +410,10 @@ sky/usage/constants.py,sha256=mFrTgrFIfFf4kpcl-M1VDU7_moD5_mJazUJTUDrybms,1102
|
|
410
410
|
sky/usage/usage_lib.py,sha256=PEjQH7do7lrcGMaIqW6bFQvNIFo-ipoF7L0xlt3vmDg,21427
|
411
411
|
sky/users/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
412
412
|
sky/users/model.conf,sha256=nPAaMai2fc-nlnEDTfW5Lyw6vgCcOS32BSms4aFOHoY,259
|
413
|
-
sky/users/permission.py,sha256=
|
413
|
+
sky/users/permission.py,sha256=tK8Lm5pj9OVdpKEkGxKPxuAXJJbC3VkzZN1brDvphiA,15628
|
414
414
|
sky/users/rbac.py,sha256=3ZWukXo85u6zWbPmHcPsF9EtZ3cd_51PLZYf2h-7uAM,3636
|
415
415
|
sky/users/server.py,sha256=59I2WITevRqvo-kEzmP0p0qyEYATnUQXTRvA_81xZYM,27922
|
416
|
-
sky/users/token_service.py,sha256=
|
416
|
+
sky/users/token_service.py,sha256=78Xgm6rkd5M6IMMUekAp2YNLms4teNNvVDPfHh_5jts,7804
|
417
417
|
sky/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
418
418
|
sky/utils/accelerator_registry.py,sha256=I2BLe74i7qBTE4X73N-cVbOJNX1Pcextm9OIRQFfnl0,4803
|
419
419
|
sky/utils/admin_policy_utils.py,sha256=VkE3FGzv5a7KnRO0R1PX0buJ274vF__n1xgXJ_9ykTs,7105
|
@@ -441,7 +441,7 @@ sky/utils/resource_checker.py,sha256=N18XhoVIqjY1VzmKvxQxRchRgC2WIgcEQyHDkLvg4Y8
|
|
441
441
|
sky/utils/resources_utils.py,sha256=zcJXHYQt6WtQHKuWEif1QP1NtSO7XQYJBaEs625yV1Y,15958
|
442
442
|
sky/utils/rich_console_utils.py,sha256=wPvAlshaFHuMZSjiDnaK3OSBppZLBjAn-lj7AvxNBQk,553
|
443
443
|
sky/utils/rich_utils.py,sha256=ZKztFc0D5q7ma_NE2p9UKjVS9zqcJ3L53FRw6SPoUvg,14707
|
444
|
-
sky/utils/schemas.py,sha256=
|
444
|
+
sky/utils/schemas.py,sha256=L-FD12KpFWgch3ynBQjkaOszv_fB_u6f5iTRgg7Zq-A,52466
|
445
445
|
sky/utils/status_lib.py,sha256=QGkd6COD1GX1h30Mk9RMUdyeUOMJs5971GkxTcFgdsU,1705
|
446
446
|
sky/utils/subprocess_utils.py,sha256=tOpFY_1ml7JkVGAN1o473lcKPklGR95qBCW61eu8kEo,15773
|
447
447
|
sky/utils/tempstore.py,sha256=TvCVXnPHzy_BLAXHhWvUcldqOY8iXh1vEWtBGHcpbmo,1725
|
@@ -481,9 +481,9 @@ sky/workspaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
481
481
|
sky/workspaces/core.py,sha256=MkQoVqWN67tf4VRq284U9vgAw4lwb_cpUfwHQT4V9Ow,16598
|
482
482
|
sky/workspaces/server.py,sha256=Box45DS54xXGHy7I3tGKGy-JP0a8G_z6IhfvGlEXtsA,3439
|
483
483
|
sky/workspaces/utils.py,sha256=IIAiFoS6sdb2t0X5YoX9AietpTanZUQNTK8cePun-sY,2143
|
484
|
-
skypilot_nightly-1.0.0.
|
485
|
-
skypilot_nightly-1.0.0.
|
486
|
-
skypilot_nightly-1.0.0.
|
487
|
-
skypilot_nightly-1.0.0.
|
488
|
-
skypilot_nightly-1.0.0.
|
489
|
-
skypilot_nightly-1.0.0.
|
484
|
+
skypilot_nightly-1.0.0.dev20250712.dist-info/licenses/LICENSE,sha256=emRJAvE7ngL6x0RhQvlns5wJzGI3NEQ_WMjNmd9TZc4,12170
|
485
|
+
skypilot_nightly-1.0.0.dev20250712.dist-info/METADATA,sha256=WxfqvyPdTjZe0ZdpSHEy5BSR88fE5oMETSq5aUsBt4g,18952
|
486
|
+
skypilot_nightly-1.0.0.dev20250712.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
487
|
+
skypilot_nightly-1.0.0.dev20250712.dist-info/entry_points.txt,sha256=StA6HYpuHj-Y61L2Ze-hK2IcLWgLZcML5gJu8cs6nU4,36
|
488
|
+
skypilot_nightly-1.0.0.dev20250712.dist-info/top_level.txt,sha256=qA8QuiNNb6Y1OF-pCUtPEr6sLEwy2xJX06Bd_CrtrHY,4
|
489
|
+
skypilot_nightly-1.0.0.dev20250712.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1871,430],{9037:function(e,s,t){"use strict";t.r(s),t.d(s,{ClusterTable:function(){return O},Clusters:function(){return E},Status2Actions:function(){return z},enabledActions:function(){return W},filterClustersByName:function(){return M},handleVSCodeConnection:function(){return H}});var r=t(5893),l=t(7294),a=t(1163),n=t(5739),i=t(6989),c=t(1664),o=t.n(c),u=t(803),d=t(7673),h=t(8764),m=t(3266),x=t(7324),p=t(3081),f=t(4545),j=t(3626),y=t(998);/**
|
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 w=(0,y.Z)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),v=(0,y.Z)("SquareCode",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);t(9470);var g=t(9284),k=t(9307),b=t(3001),N=t(8950),C=t(6378),S=t(6856);t(1272);var _=t(546);let A="__ALL_WORKSPACES__",L="__ALL_USERS__";function M(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.cluster||"").toLowerCase().includes(t))}let q=(e,s)=>{let t="",r="";return e>=0&&(t=e+"m",r=" "),s&&(t+="".concat(r,"(down)")),""===t&&(t="-"),t},I=(e,s)=>{if(e&&e.includes("@")){let t=e.split("@")[0];return s&&s!==t?"".concat(t," (").concat(s,")"):t}let t=e||s||"N/A";return s&&s!==t?"".concat(t," (").concat(s,")"):t},R=e=>{if(!e||0===e)return"-";let s=e=Math.floor(e),t="",r=0;for(let e of[{value:31536e3,label:"y"},{value:2592e3,label:"mo"},{value:86400,label:"d"},{value:3600,label:"h"},{value:60,label:"m"},{value:1,label:"s"}])if(s>=e.value&&r<2){let l=Math.floor(s/e.value);t+="".concat(l).concat(e.label," "),s%=e.value,r++}return t.trim()||"0s"};function E(){var e;let s=(0,a.useRouter)(),[t,c]=(0,l.useState)(!1),u=l.useRef(null),[d,h]=(0,l.useState)(!1),[f,y]=(0,l.useState)(!1),[w,v]=(0,l.useState)(null),[k,_]=(0,l.useState)(A),[M,q]=(0,l.useState)(L),[R,E]=(0,l.useState)(""),[H,V]=(0,l.useState)([]),[W,F]=(0,l.useState)([]),[z,Z]=(0,l.useState)(!1),B=(0,b.X)();(0,l.useEffect)(()=>{s.isReady&&(s.query.workspace&&_(Array.isArray(s.query.workspace)?s.query.workspace[0]:s.query.workspace),s.query.user&&q(Array.isArray(s.query.user)?s.query.user[0]:s.query.user),s.query.name&&E(Array.isArray(s.query.name)?s.query.name[0]:s.query.name))},[s.isReady,s.query.workspace,s.query.user,s.query.name]);let P=(e,t,r)=>{let l={...s.query};e&&e!==A?l.workspace=e:delete l.workspace,t&&t!==L?l.user=t:delete l.user,r&&""!==r.trim()?l.name=r.trim():delete l.name,s.replace({pathname:s.pathname,query:l},void 0,{shallow:!0})},U=e=>{E(e),P(k,M,e)};return(0,l.useEffect)(()=>{(async()=>{try{await S.ZP.preloadForPage("clusters");let e=await C.default.get(x.fX),s=Object.keys(e),t=await C.default.get(m.getClusters),r=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],l=new Set(s);r.includes("default")&&l.has("default"),r.forEach(e=>l.add(e)),V(Array.from(l).sort());let a=await C.default.get(p.R),n=[...new Set(t.map(e=>({userId:e.user_hash||e.user,username:e.user})).filter(e=>e.userId)).values()],i=new Map;a.forEach(e=>{i.set(e.userId,{userId:e.userId,username:e.username,display:I(e.username,e.userId)})}),n.forEach(e=>{i.has(e.userId)||i.set(e.userId,{userId:e.userId,username:e.username,display:I(e.username,e.userId)})}),F(Array.from(i.values()).sort((e,s)=>e.display.localeCompare(s.display)))}catch(e){console.error("Error fetching data for filters:",e),V(["default"]),F([])}})()},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(o(),{href:"/clusters",className:"text-sky-blue hover:underline leading-none",children:"Sky Clusters"}),(0,r.jsx)("div",{className:"flex items-center ml-6 space-x-3",children:(0,r.jsxs)("label",{className:"flex items-center cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:z,onChange:e=>Z(e.target.checked),className:"sr-only"}),(0,r.jsx)("div",{className:"relative inline-flex h-5 w-9 items-center rounded-full transition-colors ".concat(z?"bg-sky-600":"bg-gray-300"),children:(0,r.jsx)("span",{className:"inline-block h-3 w-3 transform rounded-full bg-white transition-transform ".concat(z?"translate-x-5":"translate-x-1")})}),(0,r.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"Show history (Last 30 days)"})]})}),(0,r.jsxs)("div",{className:"relative ml-4 mr-2",children:[(0,r.jsx)("input",{type:"text",placeholder:"Filter by cluster name",value:R,onChange:e=>U(e.target.value),className:"h-8 w-32 sm:w-48 px-3 pr-8 text-sm border border-gray-300 rounded-md focus:ring-1 focus:ring-sky-500 focus:border-sky-500 outline-none"}),R&&(0,r.jsx)("button",{onClick:()=>U(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear filter",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"})})})]}),(0,r.jsxs)(N.Ph,{value:k,onValueChange:e=>{_(e),P(e,M,R)},children:[(0,r.jsx)(N.i4,{className:"h-8 w-48 ml-2 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(N.ki,{placeholder:"Filter by workspace...",children:k===A?"All Workspaces":k})}),(0,r.jsxs)(N.Bw,{children:[(0,r.jsx)(N.Ql,{value:A,children:"All Workspaces"}),H.map(e=>(0,r.jsx)(N.Ql,{value:e,children:e},e))]})]}),(0,r.jsxs)(N.Ph,{value:M,onValueChange:e=>{q(e),P(k,e,R)},children:[(0,r.jsx)(N.i4,{className:"h-8 w-48 ml-2 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(N.ki,{placeholder:"Filter by user...",children:M===L?"All Users":(null===(e=W.find(e=>e.userId===M))||void 0===e?void 0:e.display)||M})}),(0,r.jsxs)(N.Bw,{children:[(0,r.jsx)(N.Ql,{value:L,children:"All Users"}),W.map(e=>(0,r.jsx)(N.Ql,{value:e.userId,children:e.display},e.userId))]})]})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[t&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(n.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsxs)("button",{onClick:()=>{C.default.invalidate(m.getClusters),C.default.invalidate(m.uR),C.default.invalidate(x.fX),C.default.invalidate(p.R),u.current&&u.current()},disabled:t,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(j.Z,{className:"h-4 w-4 mr-1.5"}),!B&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(O,{refreshInterval:i.yc,setLoading:c,refreshDataRef:u,workspaceFilter:k,userFilter:M,nameFilter:R,showHistory:z,onOpenSSHModal:e=>{v(e),h(!0)},onOpenVSCodeModal:e=>{v(e),y(!0)}}),(0,r.jsx)(g.Oh,{isOpen:d,onClose:()=>h(!1),cluster:w}),(0,r.jsx)(g._R,{isOpen:f,onClose:()=>y(!1),cluster:w})]})}function O(e){let{refreshInterval:s,setLoading:t,refreshDataRef:a,workspaceFilter:c,userFilter:x,nameFilter:p,showHistory:j,onOpenSSHModal:y,onOpenVSCodeModal:w}=e,[v,g]=(0,l.useState)([]),[b,N]=(0,l.useState)({key:null,direction:"ascending"}),[S,I]=(0,l.useState)(!1),[E,O]=(0,l.useState)(!0),[H,V]=(0,l.useState)(1),[W,F]=(0,l.useState)(10),Z=l.useCallback(async()=>{t(!0),I(!0);try{let e=await C.default.get(m.getClusters);if(j){let s=await C.default.get(m.uR),t=e.map(e=>({...e,isHistorical:!1})),r=s.map(e=>({...e,isHistorical:!0})),l=[...t];r.forEach(s=>{e.some(e=>(e.cluster||e.name)===(s.cluster||s.name))||l.push(s)}),g(l)}else{let s=e.map(e=>({...e,isHistorical:!1}));g(s)}}catch(e){console.error("Error fetching cluster data:",e),g([])}t(!1),I(!1),O(!1)},[t,j]),B=l.useMemo(()=>{let e=v;return c&&c!==A&&(e=e.filter(e=>(e.workspace||"default").toLowerCase()===c.toLowerCase())),x&&x!==L&&(e=e.filter(e=>(e.user_hash||e.user)===x)),p&&(e=M(e,p)),(0,f.R0)(e,b.key,b.direction)},[v,b,c,x,p]);l.useEffect(()=>{a&&(a.current=Z)},[a,Z]),(0,l.useEffect)(()=>{g([]);let e=!0;Z();let t=setInterval(()=>{e&&Z()},s);return()=>{e=!1,clearInterval(t)}},[s,Z]),(0,l.useEffect)(()=>{V(1)},[v.length]);let P=e=>{let s="ascending";b.key===e&&"ascending"===b.direction&&(s="descending"),N({key:e,direction:s})},U=e=>b.key===e?"ascending"===b.direction?" ↑":" ↓":"",Q=Math.ceil(B.length/W),X=(H-1)*W,D=X+W,T=B.slice(X,D);return(0,r.jsxs)("div",{children:[(0,r.jsx)(d.Zb,{children:(0,r.jsx)("div",{className:"overflow-x-auto",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:()=>P("status"),children:["Status",U("status")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("cluster"),children:["Cluster",U("cluster")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden sm:table-cell",onClick:()=>P("user"),children:["User",U("user")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden md:table-cell",onClick:()=>P("workspace"),children:["Workspace",U("workspace")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden lg:table-cell",onClick:()=>P("infra"),children:["Infra",U("infra")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden xl:table-cell",onClick:()=>P("resources_str"),children:["Resources",U("resources_str")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("time"),children:["Started",U("time")]}),j&&(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden lg:table-cell",onClick:()=>P("duration"),children:["Duration",U("duration")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap hidden md:table-cell",onClick:()=>P("autostop"),children:["Autostop",U("autostop")]}),(0,r.jsx)(h.ss,{className:"sticky right-0 bg-white",children:"Actions"})]})}),(0,r.jsx)(h.RM,{children:S&&E?(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:9,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(n.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):T.length>0?T.map((e,s)=>(0,r.jsxs)(h.SC,{children:[(0,r.jsx)(h.pj,{children:(0,r.jsx)(k.OE,{status:e.status})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(o(),{href:"/clusters/".concat(e.isHistorical?e.cluster_hash:e.cluster||e.name),className:"text-blue-600",children:e.cluster||e.name})}),(0,r.jsx)(h.pj,{className:"hidden sm:table-cell",children:(0,r.jsx)(_.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(h.pj,{className:"hidden md:table-cell",children:(0,r.jsx)(o(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(h.pj,{className:"hidden lg:table-cell",children:(0,r.jsx)(i.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(o(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud}),e.infra.includes("(")&&(0,r.jsx)("span",{children:" "+e.infra.substring(e.infra.indexOf("("))})]})})}),(0,r.jsx)(h.pj,{className:"hidden xl:table-cell",children:(0,r.jsx)(i.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:(0,r.jsx)(i.Zg,{date:e.time})}),j&&(0,r.jsx)(h.pj,{className:"hidden lg:table-cell",children:R(e.duration)}),(0,r.jsx)(h.pj,{className:"hidden md:table-cell",children:e.isHistorical?"-":q(e.autostop,e.to_down)}),(0,r.jsx)(h.pj,{className:"text-left sticky right-0 bg-white",children:!e.isHistorical&&(0,r.jsx)(z,{cluster:e.cluster,status:e.status,onOpenSSHModal:y,onOpenVSCodeModal:w})})]},s)):(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:9,className:"text-center py-6 text-gray-500",children:j?"No clusters found":"No active clusters"})})})]})})}),v.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:W,onChange:e=>{F(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: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.jsxs)("div",{children:[X+1," – ",Math.min(D,v.length)," of"," ",v.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(u.z,{variant:"ghost",size:"icon",onClick:()=>{V(e=>Math.max(e-1,1))},disabled:1===H,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)(u.z,{variant:"ghost",size:"icon",onClick:()=>{V(e=>Math.min(e+1,Q))},disabled:H===Q||0===Q,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"})})})]})]})})]})}let H=(e,s)=>{s&&s(e)},V=(e,s)=>{s?s(e):window.open("ssh://".concat(e))},W=e=>"RUNNING"===e?["connect","VSCode"]:[],F={connect:(0,r.jsx)(w,{className:"w-4 h-4 text-gray-500 inline-block"}),VSCode:(0,r.jsx)(v,{className:"w-4 h-4 text-gray-500 inline-block"})};function z(e){let{withLabel:s=!1,cluster:t,status:l,onOpenSSHModal:a,onOpenVSCodeModal:n}=e,c=W(l),o=(0,b.X)(),u=e=>{switch(e){case"connect":V(t,a);break;case"VSCode":H(t,n);break;default:return}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"flex items-center space-x-4",children:Object.entries(F).map(e=>{let t,l,[a,n]=e;switch(a){case"connect":t="Connect",l="Connect with SSH";break;case"VSCode":t="VSCode",l="Open in VS Code"}return(s||(t=""),c.includes(a))?(0,r.jsx)(i.WH,{content:l,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:()=>u(a),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[n,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},a):(0,r.jsx)(i.WH,{content:l,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("span",{className:"opacity-30 flex items-center cursor-not-allowed text-sm",title:a,children:[n,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},a)})})})}},1163:function(e,s,t){e.exports=t(6036)},2003:function(e,s,t){"use strict";t.d(s,{j:function(){return n}});var r=t(512);let l=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=r.W,n=(e,s)=>t=>{var r;if((null==s?void 0:s.variants)==null)return a(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:n,defaultVariants:i}=s,c=Object.keys(n).map(e=>{let s=null==t?void 0:t[e],r=null==i?void 0:i[e];if(null===s)return null;let a=l(s)||l(r);return n[e][a]}),o=t&&Object.entries(t).reduce((e,s)=>{let[t,r]=s;return void 0===r||(e[t]=r),e},{});return a(e,c,null==s?void 0:null===(r=s.compoundVariants)||void 0===r?void 0:r.reduce((e,s)=>{let{class:t,className:r,...l}=s;return Object.entries(l).every(e=>{let[s,t]=e;return Array.isArray(t)?t.includes({...i,...o}[s]):({...i,...o})[s]===t})?[...e,t,r]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)}}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6601],{9307:function(e,s,t){t.d(s,{Cl:function(){return l},OE:function(){return d}});var r=t(5893);t(7294);var n=t(5739),a=t(6989),c=t(3850);let l=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":default:return"bg-gray-100 text-gray-800";case"PENDING":case"CANCELLED":case"CANCELLING":return"bg-yellow-50 text-yellow-700";case"SUCCEEDED":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return"bg-red-50 text-red-700";case"RECOVERING":return"bg-orange-50 text-orange-700";case"SUBMITTED":case"READY":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700"}},i=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,r.jsx)(n.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,r.jsx)(c.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,r.jsx)(c.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,r.jsx)(c.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,r.jsx)(c.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":return(0,r.jsx)(c.J$,{className:"w-3 h-3 mr-1"})}},o=e=>{let s=l(e),t=i(e);return(0,r.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(s),children:[t,e]})},d=e=>{let{status:s}=e;return(0,r.jsx)(a.WH,{content:s,className:"text-muted-foreground text-sm",children:(0,r.jsx)("span",{children:o(s)})})}},546:function(e,s,t){t.d(s,{H:function(){return d}});var r=t(5893);t(7294);var n=t(1664),a=t.n(n),c=t(5697),l=t.n(c);function i(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let o=()=>(0,r.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),d=e=>{let{username:s,userHash:t,className:n="flex items-center gap-1",linkClassName:c="text-blue-600 hover:underline",showBadge:l=!0}=e,d=i(t),u=i(t)?"/users?tab=service-accounts":"/users";return(0,r.jsxs)("div",{className:n,children:[(0,r.jsx)(a(),{href:u,className:c,children:s}),l&&d&&(0,r.jsx)(o,{})]})};d.propTypes={username:l().string.isRequired,userHash:l().string,className:l().string,linkClassName:l().string,showBadge:l().bool}},9284:function(e,s,t){t.d(s,{Oh:function(){return m},_R:function(){return x},cV:function(){return h}});var r=t(5893),n=t(7294),a=t(326),c=t(803),l=t(7673),i=t(8671),o=t(6989),d=t(3225),u=t(3001);function m(e){let{isOpen:s,onClose:t,cluster:d}=e,[u,m]=n.useState(!1),x=e=>{navigator.clipboard.writeText(e),m(!0),setTimeout(()=>m(!1),2e3)},h=["sky status ".concat(d),"ssh ".concat(d)],f=h.join("\n");return(0,r.jsx)(a.Vq,{open:s,onOpenChange:t,children:(0,r.jsxs)(a.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(a.fK,{children:[(0,r.jsxs)(a.$N,{children:["Connect to: ",(0,r.jsx)("span",{className:"font-light",children:d})]}),(0,r.jsx)(a.Be,{children:"Use these instructions to connect to your cluster via SSH."})]}),(0,r.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:"SSH Command"}),(0,r.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm w-full whitespace-pre-wrap",children:h.map((e,s)=>(0,r.jsx)("code",{className:"block",children:e},s))}),(0,r.jsx)(o.WH,{content:u?"Copied!":"Copy command",children:(0,r.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>x(f),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Additional Information"}),(0,r.jsxs)("p",{className:"text-sm text-secondary-foreground",children:["Make sure to run"," ",(0,r.jsxs)("code",{className:"text-sm",children:["sky status ",d]})," first to have SkyPilot set up the SSH access."]})]})]})]})})}function x(e){let{isOpen:s,onClose:t,cluster:n}=e,m=(0,u.X)();return(0,r.jsx)(a.Vq,{open:s,onOpenChange:t,children:(0,r.jsx)(a.cZ,{className:"sm:max-w-3xl",children:(0,r.jsxs)(a.fK,{children:[(0,r.jsxs)(a.$N,{children:["Connect to: ",(0,r.jsx)("span",{className:"font-light",children:n})]}),(0,r.jsx)(a.Be,{children:(0,r.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Setup SSH access"}),(0,r.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm",children:(0,r.jsxs)("code",{children:["sky status ",n]})}),(0,r.jsx)(o.WH,{content:"Copy command",children:(0,r.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("sky status ".concat(n)),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Connect with VSCode/Cursor"}),(0,r.jsx)(l.Zb,{className:"p-3 bg-gray-50",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("pre",{className:"text-sm",children:(0,r.jsxs)("code",{children:["code --remote ssh-remote+",n]})}),(0,r.jsx)(o.WH,{content:"Copy command",children:(0,r.jsx)(c.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("code --remote ssh-remote+".concat(n)),className:"h-8 w-8 rounded-full",children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})})]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium",children:"Or use the GUI to connect"}),(0,r.jsx)("div",{className:"relative ".concat(m?"-mt-5":"-mt-10"),style:{paddingBottom:"70%"},children:(0,r.jsxs)("video",{className:"absolute top-0 left-0 w-full h-full rounded-lg",controls:!0,autoPlay:!0,muted:!0,preload:"metadata",children:[(0,r.jsx)("source",{src:"".concat(d.GW,"/videos/cursor-small.mp4"),type:"video/mp4"}),"Your browser does not support the video tag."]})})]})]})})]})})})}function h(e){let{isOpen:s,onClose:t,onConfirm:n,title:l,message:i,confirmText:o="Confirm",confirmVariant:d="destructive",confirmClassName:u=null}=e;return(0,r.jsx)(a.Vq,{open:s,onOpenChange:t,children:(0,r.jsxs)(a.cZ,{className:"sm:max-w-md",children:[(0,r.jsxs)(a.fK,{children:[(0,r.jsx)(a.$N,{children:l}),(0,r.jsx)(a.Be,{children:i})]}),(0,r.jsxs)(a.cN,{className:"flex justify-end gap-2 pt-4",children:[(0,r.jsx)(c.z,{variant:"outline",onClick:t,children:"Cancel"}),(0,r.jsx)(c.z,{variant:u?void 0:d,className:u,onClick:()=>{n(),t()},children:o})]})]})})}},8764:function(e,s,t){t.d(s,{RM:function(){return i},SC:function(){return o},iA:function(){return c},pj:function(){return u},ss:function(){return d},xD:function(){return l}});var r=t(5893),n=t(7294),a=t(2350);let c=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("div",{className:"relative w-full overflow-auto",children:(0,r.jsx)("table",{ref:s,className:(0,a.cn)("w-full caption-bottom text-base",t),...n})})});c.displayName="Table";let l=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("thead",{ref:s,className:(0,a.cn)("[&_tr]:border-b",t),...n})});l.displayName="TableHeader";let i=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("tbody",{ref:s,className:(0,a.cn)("[&_tr:last-child]:border-0",t),...n})});i.displayName="TableBody",n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("tfoot",{ref:s,className:(0,a.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...n})}).displayName="TableFooter";let o=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("tr",{ref:s,className:(0,a.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...n})});o.displayName="TableRow";let d=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("th",{ref:s,className:(0,a.cn)("h-12 px-4 text-left align-middle font-medium text-[hsl(var(--text-strong))] [&:has([role=checkbox])]:pr-0",t),...n})});d.displayName="TableHead";let u=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("td",{ref:s,className:(0,a.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...n})});u.displayName="TableCell",n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,r.jsx)("caption",{ref:s,className:(0,a.cn)("mt-4 text-base text-muted-foreground",t),...n})}).displayName="TableCaption"},4545:function(e,s,t){function r(e){return e.startsWith("sky-jobs-controller-")}function n(e,s,t){return null===s?e:[...e].sort((e,r)=>e[s]<r[s]?"ascending"===t?-1:1:e[s]>r[s]?"ascending"===t?1:-1:0)}t.d(s,{R0:function(){return n},Ym:function(){return r}})}}]);
|
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[938],{938:function(e,s,t){t.r(s),t.d(s,{ClusterJobs:function(){return W},ManagedJobs:function(){return U},ManagedJobsTable:function(){return q},Status2Actions:function(){return z},filterJobsByName:function(){return M},filterJobsByUser:function(){return D},filterJobsByWorkspace:function(){return A},statusGroups:function(){return _}});var r=t(5893),n=t(7294),a=t(1163),l=t(1664),i=t.n(l),c=t(5739),o=t(803),d=t(7673),u=t(8764),h=t(6989),x=t(8969),m=t(3266),j=t(7324),p=t(3081);t(9470);var f=t(3626),g=t(3293),b=t(6521),w=t(3610),N=t(9284),y=t(4545),v=t(9307),k=t(546),C=t(3001),S=t(8950),L=t(6378),E=t(6856);let _={active:["PENDING","RUNNING","RECOVERING","SUBMITTED","STARTING","CANCELLING"],finished:["SUCCEEDED","FAILED","CANCELLED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER"]},I="__ALL_WORKSPACES__",R="__ALL_USERS__";function M(e,s){if(!s||""===s.trim())return e;let t=s.toLowerCase().trim();return e.filter(e=>(e.name||"").toLowerCase().includes(t))}function A(e,s){return s&&s!==I?e.filter(e=>(e.workspace||"default").toLowerCase()===s.toLowerCase()):e}function D(e,s){return s&&s!==R?e.filter(e=>(e.user_hash||e.user)===s):e}let O=(e,s)=>{if(e&&e.includes("@")){let t=e.split("@")[0];return s&&s!==t?"".concat(t," (").concat(s,")"):t}let t=e||s||"N/A";return s&&s!==t?"".concat(t," (").concat(s,")"):t},F=e=>{if(!e)return"-";let s=e instanceof Date?e:new Date(1e3*e);return(0,r.jsx)(h.Zg,{date:s})};function U(){var e;let s=(0,a.useRouter)(),[t,l]=(0,n.useState)(!1),o=n.useRef(null),[d,u]=(0,n.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),m=(0,C.X)(),[g,b]=(0,n.useState)(I),[w,y]=(0,n.useState)(R),[v,k]=(0,n.useState)(""),[_,M]=(0,n.useState)([]),[A,D]=(0,n.useState)([]);(0,n.useEffect)(()=>{s.isReady&&(s.query.workspace&&b(Array.isArray(s.query.workspace)?s.query.workspace[0]:s.query.workspace),s.query.user&&y(Array.isArray(s.query.user)?s.query.user[0]:s.query.user),s.query.name&&k(Array.isArray(s.query.name)?s.query.name[0]:s.query.name))},[s.isReady,s.query.workspace,s.query.user,s.query.name]);let F=(e,t,r)=>{let n={...s.query};e&&e!==I?n.workspace=e:delete n.workspace,t&&t!==R?n.user=t:delete n.user,r&&""!==r.trim()?n.name=r.trim():delete n.name,s.replace({pathname:s.pathname,query:n},void 0,{shallow:!0})},U=e=>{k(e),F(g,w,e)};return(0,n.useEffect)(()=>{(async()=>{try{await E.ZP.preloadForPage("jobs");let e=await L.default.get(j.fX),s=Object.keys(e),t=(await L.default.get(x.getManagedJobs,[{allUsers:!0}])).jobs||[],r=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],n=new Set(s);r.forEach(e=>n.add(e)),M(Array.from(n).sort());let a=await L.default.get(p.R),l=[...new Set(t.map(e=>({userId:e.user_hash||e.user,username:e.user})).filter(e=>e.userId)).values()],i=new Map;a.forEach(e=>{i.set(e.userId,{userId:e.userId,username:e.username,display:O(e.username,e.userId)})}),l.forEach(e=>{i.has(e.userId)||i.set(e.userId,{userId:e.userId,username:e.username,display:O(e.username,e.userId)})}),D(Array.from(i.values()).sort((e,s)=>e.display.localeCompare(s.display)))}catch(e){console.error("Error fetching data for filters:",e),M(["default"]),D([])}})()},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(i(),{href:"/jobs",className:"text-sky-blue hover:underline leading-none",children:"Managed Jobs"}),(0,r.jsxs)("div",{className:"relative ml-4 mr-2",children:[(0,r.jsx)("input",{type:"text",placeholder:"Filter by job name",value:v,onChange:e=>U(e.target.value),className:"h-8 w-48 px-3 pr-8 text-sm border border-gray-300 rounded-md focus:ring-1 focus:ring-sky-500 focus:border-sky-500 outline-none"}),v&&(0,r.jsx)("button",{onClick:()=>U(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear filter",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"})})})]}),(0,r.jsxs)(S.Ph,{value:g,onValueChange:e=>{b(e),F(e,w,v)},children:[(0,r.jsx)(S.i4,{className:"h-8 w-48 ml-2 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(S.ki,{placeholder:"Filter by workspace...",children:g===I?"All Workspaces":g})}),(0,r.jsxs)(S.Bw,{children:[(0,r.jsx)(S.Ql,{value:I,children:"All Workspaces"}),_.map(e=>(0,r.jsx)(S.Ql,{value:e,children:e},e))]})]}),(0,r.jsxs)(S.Ph,{value:w,onValueChange:e=>{y(e),F(g,e,v)},children:[(0,r.jsx)(S.i4,{className:"h-8 w-48 ml-2 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(S.ki,{placeholder:"Filter by user...",children:w===R?"All Users":(null===(e=A.find(e=>e.userId===w))||void 0===e?void 0:e.display)||w})}),(0,r.jsxs)(S.Bw,{children:[(0,r.jsx)(S.Ql,{value:R,children:"All Users"}),A.map(e=>(0,r.jsx)(S.Ql,{value:e.userId,children:e.display},e.userId))]})]})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[t&&(0,r.jsxs)("div",{className:"flex items-center mr-2",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:()=>{L.default.invalidate(x.getManagedJobs,[{allUsers:!0}]),L.default.invalidate(j.fX),L.default.invalidate(p.R),o.current&&o.current()},disabled:t,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",title:"Refresh",children:[(0,r.jsx)(f.Z,{className:"h-4 w-4 mr-1.5"}),!m&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(q,{refreshInterval:h.yc,setLoading:l,refreshDataRef:o,workspaceFilter:g,userFilter:w,nameFilter:v}),(0,r.jsx)(N.cV,{isOpen:d.isOpen,onClose:()=>u({...d,isOpen:!1}),onConfirm:d.onConfirm,title:d.title,message:d.message})]})}function q(e){let{refreshInterval:s,setLoading:t,refreshDataRef:a,workspaceFilter:l,userFilter:j,nameFilter:p}=e,[f,b]=(0,n.useState)([]),[w,C]=(0,n.useState)({key:null,direction:"ascending"}),[S,E]=(0,n.useState)(!1),[I,R]=(0,n.useState)(!0),[O,U]=(0,n.useState)(1),[q,W]=(0,n.useState)(10),[Z,B]=(0,n.useState)(null),T=(0,n.useRef)(null),[H,G]=(0,n.useState)([]),[V,Q]=(0,n.useState)({}),[X,K]=(0,n.useState)(!1),[Y,$]=(0,n.useState)(!1),[ee,es]=(0,n.useState)(!1),[et,er]=(0,n.useState)("all"),[en,ea]=(0,n.useState)(!0),[el,ei]=(0,n.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),ec=async()=>{ei({isOpen:!0,title:"Restart Controller",message:"Are you sure you want to restart the controller?",onConfirm:async()=>{try{es(!0),E(!0),await (0,x.Ce)("restartcontroller"),await eo()}catch(e){console.error("Error restarting controller:",e)}finally{es(!1),E(!1)}}})},eo=n.useCallback(async()=>{E(!0),t(!0);try{let[e,s]=await Promise.all([L.default.get(x.getManagedJobs,[{allUsers:!0}]),L.default.get(m.getClusters)]),{jobs:t=[],controllerStopped:r=!1}=e||{},n=null==s?void 0:s.find(e=>(0,y.Ym)(e.cluster)),a=n?n.status:"NOT_FOUND",l=!1;"STOPPED"==a&&r&&(l=!0),"LAUNCHING"==a?$(!0):$(!1),b(t),K(l),R(!1)}catch(e){console.error("Error fetching data:",e),b([]),K(!1),R(!1)}finally{E(!1),t(!1)}},[t]);n.useEffect(()=>{a&&(a.current=eo)},[a,eo]),(0,n.useEffect)(()=>{b([]);let e=!0;eo();let t=setInterval(()=>{e&&eo()},s);return()=>{e=!1,clearInterval(t)}},[s,eo]),(0,n.useEffect)(()=>{U(1)},[et,null==f?void 0:f.length]),(0,n.useEffect)(()=>{G([]),ea(!0)},[et]);let ed=e=>{let s="ascending";w.key===e&&"ascending"===w.direction&&(s="descending"),C({key:e,direction:s})},eu=e=>w.key===e?"ascending"===w.direction?" ↑":" ↓":"";n.useMemo(()=>{let e=f||[];return{active:e.filter(e=>_.active.includes(e.status)).length,finished:e.filter(e=>_.finished.includes(e.status)).length}},[f]);let eh=e=>H.length>0?H.includes(e):"all"===et||_[et].includes(e),ex=n.useMemo(()=>{let e=A(f,l);return(e=M(e=D(e,j),p),H.length>0)?e.filter(e=>H.includes(e.status)):en?"all"===et?e:e.filter(e=>_[et].includes(e.status)):[]},[f,et,H,en,l,j,p]),em=n.useMemo(()=>w.key?[...ex].sort((e,s)=>e[w.key]<s[w.key]?"ascending"===w.direction?-1:1:e[w.key]>s[w.key]?"ascending"===w.direction?1:-1:0):ex,[ex,w]),ej=Math.ceil(em.length/q),ep=(O-1)*q,ef=ep+q,eg=em.slice(ep,ef),eb=e=>{if(H.includes(e)){let s=H.filter(s=>s!==e);0===s.length?(ea(!0),G([])):(G(s),ea(!1))}else G([...H,e]),ea(!1)};return(0,n.useEffect)(()=>{Q((f||[]).reduce((e,s)=>(e[s.status]=(e[s.status]||0)+1,e),{}))},[f]),(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 text-sm mb-1",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:[!S&&(!f||0===f.length)&&!I&&(0,r.jsx)("span",{className:"text-gray-500 mr-2",children:"No jobs found"}),Object.entries(V).map(e=>{let[s,t]=e;return(0,r.jsxs)("button",{onClick:()=>eb(s),className:"px-3 py-1 rounded-full flex items-center space-x-2 ".concat(eh(s)||H.includes(s)?(0,v.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(eh(s)||H.includes(s)?"bg-white/50":"bg-gray-200"," px-1.5 py-0.5 rounded"),children:t})]},s)}),f&&f.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:()=>{er("all"),G([]),ea(!0)},className:"text-sm font-medium ".concat("all"===et&&en?"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:()=>{er("active"),G([]),ea(!0)},className:"text-sm font-medium ".concat("active"===et&&en?"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:()=>{er("finished"),G([]),ea(!0)},className:"text-sm font-medium ".concat("finished"===et&&en?"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.jsx)(d.Zb,{children:(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("id"),children:["ID",eu("id")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("name"),children:["Name",eu("name")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("user"),children:["User",eu("user")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("workspace"),children:["Workspace",eu("workspace")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("submitted_at"),children:["Submitted",eu("submitted_at")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("job_duration"),children:["Duration",eu("job_duration")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("status"),children:["Status",eu("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("resources_str"),children:["Requested",eu("resources_str")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("infra"),children:["Infra",eu("infra")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("cluster"),children:["Resources",eu("cluster")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>ed("recoveries"),children:["Recoveries",eu("recoveries")]}),(0,r.jsx)(u.ss,{children:"Details"}),(0,r.jsx)(u.ss,{children:"Logs"})]})}),(0,r.jsx)(u.RM,{children:S||I?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.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..."})]})})}):eg.length>0?(0,r.jsx)(r.Fragment,{children:eg.map(e=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(u.SC,{children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.name})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(k.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(u.pj,{children:F(e.submitted_at)}),(0,r.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(v.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:e.requested_resources}),(0,r.jsx)(u.pj,{children:e.infra&&"-"!==e.infra?(0,r.jsx)(h.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:" "+e.infra.substring(e.infra.indexOf("("))})]})}):(0,r.jsx)("span",{children:e.infra||"-"})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(h.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)(u.pj,{children:e.recoveries}),(0,r.jsx)(u.pj,{children:e.details?(0,r.jsx)(P,{text:e.details,rowId:e.id,expandedRowId:Z,setExpandedRowId:B}):"-"}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(z,{jobParent:"/jobs",jobId:e.id,managed:!0})})]}),Z===e.id&&(0,r.jsx)(J,{text:e.details,colSpan:12,innerRef:T})]},e.id))}):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:12,className:"text-center py-6",children:(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[Y&&(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..."})]})]}),!X&&!Y&&(0,r.jsx)("p",{className:"text-gray-500",children:"No active jobs"}),X&&(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 has been stopped. Restart to check the latest job status."}),(0,r.jsx)(o.z,{variant:"outline",size:"sm",onClick:ec,className:"text-sky-blue hover:text-sky-blue-bright",disabled:S||ee,children:ee?(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)(g.Z,{className:"h-4 w-4 mr-2"}),"Restart Controller"]})})]})]})})})})]})}),em&&em.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:q,onChange:e=>{W(parseInt(e.target.value,10)),U(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.jsxs)("div",{children:[ep+1," – ",Math.min(ef,em.length)," of"," ",em.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{U(e=>Math.max(e-1,1))},disabled:1===O,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:()=>{U(e=>Math.min(e+1,ej))},disabled:O===ej||0===ej,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)(N.cV,{isOpen:el.isOpen,onClose:()=>ei({...el,isOpen:!1}),onConfirm:el.onConfirm,title:el.title,message:el.message,confirmClassName:"bg-blue-600 hover:bg-blue-700 text-white"})]})}function z(e){let{withLabel:s=!1,jobParent:t,jobId:n,managed:l}=e,i=(0,a.useRouter)(),c=(e,s)=>{e.preventDefault(),e.stopPropagation(),i.push({pathname:"".concat(t,"/").concat(n),query:{tab:s}})};return(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)(h.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)(b.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-1.5",children:"Logs"})]})},"logs"),l&&(0,r.jsx)(h.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)(w.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-2",children:"Controller Logs"})]})},"controllerlogs")]})}function W(e){let{clusterName:s,clusterJobData:t,loading:a,refreshClusterJobsOnly:l,userFilter:x=null,nameFilter:m=null}=e,[j,p]=(0,n.useState)(null),[g,b]=(0,n.useState)({key:null,direction:"ascending"}),[w,N]=(0,n.useState)(1),[y,C]=(0,n.useState)(10),S=(0,n.useRef)(null),[L,E]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=e=>{j&&S.current&&!S.current.contains(e.target)&&p(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[j]);let _=n.useMemo(()=>{let e=t||[];return x&&x!==R&&(e=D(e,x)),m&&(e=M(e,m)),e},[t,x,m]);(0,n.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(L)&&E(t)},[t,L]);let I=n.useMemo(()=>g.key?[..._].sort((e,s)=>e[g.key]<s[g.key]?"ascending"===g.direction?-1:1:e[g.key]>s[g.key]?"ascending"===g.direction?1:-1:0):_,[_,g]),A=e=>{let s="ascending";g.key===e&&"ascending"===g.direction&&(s="descending"),b({key:e,direction:s})},O=e=>g.key===e?"ascending"===g.direction?" ↑":" ↓":"",U=Math.ceil(I.length/y),q=(w-1)*y,W=q+y,Z=I.slice(q,W);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:l&&(0,r.jsxs)("button",{onClick:l,disabled:a,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center text-sm ml-2",children:[(0,r.jsx)(f.Z,{className:"w-4 h-4 mr-1"}),"Refresh Jobs"]})})]}),(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("id"),children:["ID",O("id")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("job"),children:["Name",O("job")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("user"),children:["User",O("user")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("workspace"),children:["Workspace",O("workspace")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("submitted_at"),children:["Submitted",O("submitted_at")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("job_duration"),children:["Duration",O("job_duration")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("status"),children:["Status",O("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>A("resources"),children:["Resources",O("resources")]}),(0,r.jsx)(u.ss,{className:"whitespace-nowrap",children:"Logs"})]})}),(0,r.jsx)(u.RM,{children:a?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.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)(n.Fragment,{children:[(0,r.jsxs)(u.SC,{className:j===e.id?"selected-row":"",children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:(0,r.jsx)(P,{text:e.job||"Unnamed job",rowId:e.id,expandedRowId:j,setExpandedRowId:p})})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(k.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(i(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(u.pj,{children:F(e.submitted_at)}),(0,r.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(v.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:e.resources}),(0,r.jsx)(u.pj,{className:"flex content-center items-center",children:(0,r.jsx)(z,{jobParent:"/clusters/".concat(s),jobId:e.id,managed:!1})})]}),j===e.id&&(0,r.jsx)(J,{text:e.job||"Unnamed job",colSpan:9,innerRef:S})]},e.id)):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:"No jobs found"})})})]})]}),I&&I.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=>{C(parseInt(e.target.value,10)),N(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:[q+1," – ",Math.min(W,I.length)," of"," ",I.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{N(e=>Math.max(e-1,1))},disabled:1===w,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:()=>{N(e=>Math.min(e+1,U))},disabled:w===U||0===U,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 J(e){let{text:s,colSpan:t,innerRef:n}=e;return(0,r.jsx)(u.SC,{className:"expanded-details",children:(0,r.jsx)(u.pj,{colSpan:t,children:(0,r.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border border-gray-200",ref:n,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 P(e){let{text:s,rowId:t,expandedRowId:a,setExpandedRowId:l}=e,i=s||"",c=i.length>50,o=a===t,d=c?"".concat(i.substring(0,50)):i,u=(0,n.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:u,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(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"})]})}}}]);
|
@@ -1,6 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9826,2544],{4966:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clusters/[cluster]/[job]",function(){return s(190)}])},3626:function(e,t,s){"use strict";s.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,s(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"}]])},9307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return l},OE:function(){return u}});var r=s(5893);s(7294);var a=s(5739),n=s(6989),c=s(3850);let l=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":default:return"bg-gray-100 text-gray-800";case"PENDING":case"CANCELLED":case"CANCELLING":return"bg-yellow-50 text-yellow-700";case"SUCCEEDED":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return"bg-red-50 text-red-700";case"RECOVERING":return"bg-orange-50 text-orange-700";case"SUBMITTED":case"READY":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,r.jsx)(a.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,r.jsx)(c.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,r.jsx)(c.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,r.jsx)(c.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,r.jsx)(c.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":return(0,r.jsx)(c.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=l(e),s=o(e);return(0,r.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[s,e]})},u=e=>{let{status:t}=e;return(0,r.jsx)(n.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,r.jsx)("span",{children:i(t)})})}},546:function(e,t,s){"use strict";s.d(t,{H:function(){return u}});var r=s(5893);s(7294);var a=s(1664),n=s.n(a),c=s(5697),l=s.n(c);function o(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let i=()=>(0,r.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),u=e=>{let{username:t,userHash:s,className:a="flex items-center gap-1",linkClassName:c="text-blue-600 hover:underline",showBadge:l=!0}=e,u=o(s),d=o(s)?"/users?tab=service-accounts":"/users";return(0,r.jsxs)("div",{className:a,children:[(0,r.jsx)(n(),{href:d,className:c,children:t}),l&&u&&(0,r.jsx)(i,{})]})};u.propTypes={username:l().string.isRequired,userHash:l().string,className:l().string,linkClassName:l().string,showBadge:l().bool}},7673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return o},aY:function(){return h},eW:function(){return m},ll:function(){return u}});var r=s(5893),a=s(7294),n=s(5697),c=s.n(n),l=s(2350);let o=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,l.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n,children:a})});o.displayName="Card",o.propTypes={className:c().string,children:c().node};let i=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,l.cn)("flex flex-col space-y-1.5 p-6",s),...n,children:a})});i.displayName="CardHeader",i.propTypes={className:c().string,children:c().node};let u=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("h3",{ref:t,className:(0,l.cn)("text-2xl font-semibold leading-none tracking-tight",s),...n,children:a})});u.displayName="CardTitle",u.propTypes={className:c().string,children:c().node};let d=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("p",{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s),...n,children:a})});d.displayName="CardDescription",d.propTypes={className:c().string,children:c().node};let h=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,l.cn)("p-6 pt-0",s),...n,children:a})});h.displayName="CardContent",h.propTypes={className:c().string,children:c().node};let m=a.forwardRef((e,t)=>{let{className:s,children:a,...n}=e;return(0,r.jsx)("div",{ref:t,className:(0,l.cn)("flex items-center p-6 pt-0",s),...n,children:a})});m.displayName="CardFooter",m.propTypes={className:c().string,children:c().node}},7145:function(e,t,s){"use strict";s.d(t,{x:function(){return a}});var r=s(3225);let a={fetch:async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",a=window.location.origin,n="".concat(a).concat(r.f4).concat(e),c=await fetch(n,{method:s,headers:"POST"===s?{"Content-Type":"application/json"}:{},body:"POST"===s?JSON.stringify(t):void 0}),l=c.headers.get("X-Skypilot-Request-ID")||c.headers.get("X-Request-ID"),o=await fetch("".concat(a).concat(r.f4,"/api/get?request_id=").concat(l)),i=await o.json();return i.return_value?JSON.parse(i.return_value):[]},post:async(e,t)=>{let s=window.location.origin,a="".concat(s).concat(r.f4).concat(e);return await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},stream:async(e,t,s)=>{let r=(await a.post(e,t)).body.getReader();try{for(;;){let{done:e,value:t}=await r.read();if(e)break;let a=new TextDecoder().decode(t);s(a)}}catch(e){throw console.error("Error in stream:",e),e}},get:async e=>{let t=window.location.origin,s="".concat(t).concat(r.f4).concat(e);return await fetch(s)}}},3266:function(e,t,s){"use strict";s.d(t,{QL:function(){return h},Sl:function(){return u},getClusters:function(){return o},uR:function(){return i}});var r=s(7294),a=s(5821),n=s(7145),c=s(6378);let l={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function o(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return(await n.x.fetch("/status",{cluster_names:e,all_users:!0})).map(e=>{let t="",s=t=e.zone?e.zone:e.region;return t&&t.length>25&&(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e||e.length<=t)return e;if(t<=3)return"...";let s=Math.floor((t-3)/2),r=s+(t-3)%2;return 0===s?e.substring(0,r)+"...":e.substring(0,r)+"..."+e.substring(e.length-s)}(t,25)),{status:l[e.status],cluster:e.name,user:e.user_name,user_hash:e.user_hash,cloud:e.cloud,region:e.region,infra:t?e.cloud+" ("+t+")":e.cloud,full_infra:s?"".concat(e.cloud," (").concat(s,")"):e.cloud,cpus:e.cpus,mem:e.memory,gpus:e.accelerators,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:new Date(1e3*e.launched_at),num_nodes:e.nodes,workspace:e.workspace,autostop:e.autostop,to_down:e.to_down,jobs:[],command:e.last_creation_command||e.last_use,task_yaml:e.last_creation_yaml||"{}",events:[{time:new Date(1e3*e.launched_at),event:"Cluster created."}]}})}catch(e){return console.error("Error fetching clusters:",e),[]}}async function i(){try{let e=await n.x.fetch("/cost_report",{days:30});console.log("Raw cluster history data:",e);let t=e.map(e=>{let t="Unknown";e.cloud?t=e.cloud:e.resources&&e.resources.cloud&&(t=e.resources.cloud);let s=e.user_name||"-";return{status:e.status?l[e.status]:"TERMINATED",cluster:e.name,user:s,user_hash:e.user_hash,cloud:t,region:"",infra:t,full_infra:t,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:e.launched_at?new Date(1e3*e.launched_at):null,num_nodes:e.num_nodes||1,duration:e.duration,total_cost:e.total_cost,workspace:e.workspace||"default",autostop:-1,to_down:!1,cluster_hash:e.cluster_hash,usage_intervals:e.usage_intervals,command:e.last_creation_command||"",task_yaml:e.last_creation_yaml||"{}",events:[{time:e.launched_at?new Date(1e3*e.launched_at):new Date,event:"Cluster created."}]}});return console.log("Processed cluster history data:",t),t}catch(e){return console.error("Error fetching cluster history:",e),[]}}async function u(e){let{clusterName:t,jobId:s,onNewLog:r,workspace:c}=e;try{await n.x.stream("/logs",{follow:!1,cluster_name:t,job_id:s,override_skypilot_config:{active_workspace:c||"default"}},r)}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,a.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function d(e){let{clusterName:t,workspace:s}=e;try{return(await n.x.fetch("/queue",{cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:s}})).map(e=>{let r=e.end_at?e.end_at:Date.now()/1e3,a=0,n=0;return e.submitted_at&&(a=r-e.submitted_at),e.start_at&&(n=r-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,user_hash:e.user_hash,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:a,job_duration:n,infra:"",logs:"",workspace:s||"default"}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function h(e){let{cluster:t,job:s=null}=e,[a,n]=(0,r.useState)(null),[l,i]=(0,r.useState)(null),[u,h]=(0,r.useState)(!0),[m,f]=(0,r.useState)(!0),x=(0,r.useCallback)(async()=>{if(t)try{h(!0);let e=await c.default.get(o,[{clusterNames:[t]}]);return n(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{h(!1)}return null},[t]),g=(0,r.useCallback)(async e=>{if(t)try{f(!0);let s=await c.default.get(d,[{clusterName:t,workspace:e||"default"}]);i(s)}catch(e){console.error("Error fetching cluster job data:",e)}finally{f(!1)}},[t]),b=(0,r.useCallback)(async()=>{c.default.invalidate(o,[{clusterNames:[t]}]);let e=await x();e&&(c.default.invalidate(d,[{clusterName:t,workspace:e.workspace||"default"}]),await g(e.workspace))},[x,g,t]),N=(0,r.useCallback)(async()=>{a&&(c.default.invalidate(d,[{clusterName:t,workspace:a.workspace||"default"}]),await g(a.workspace))},[g,a,t]);return(0,r.useEffect)(()=>{(async()=>{let e=await x();e&&g(e.workspace)})()},[t,s,x,g]),{clusterData:a,clusterJobData:l,loading:u,clusterDetailsLoading:u,clusterJobsLoading:m,refreshData:b,refreshClusterJobsOnly:N}}},5821:function(e,t,s){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=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)},s),a}s.d(t,{C:function(){return r}})},6378:function(e,t,s){"use strict";s.r(t),s.d(t,{DashboardCache:function(){return a},dashboardCache:function(){return n}});let r=s(1214).ej.DEFAULT_TTL;class a{async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=s.ttl||r,n=!1!==s.refreshOnAccess,c=this._generateKey(e,t),l=e.name||"anonymous",o=this.cache.get(c),i=Date.now();if(o&&i-o.lastUpdated<a){let s=Math.round((i-o.lastUpdated)/1e3);return this._debug("Cache HIT for ".concat(l," (age: ").concat(s,"s, TTL: ").concat(Math.round(a/1e3),"s)")),n&&(this.cache.set(c,{data:o.data,lastUpdated:i}),this._debug("Cache TTL refreshed for ".concat(l))),this.backgroundJobs.has(c)||this._refreshInBackground(e,t,c),o.data}try{let s=await e(...t);return this.cache.set(c,{data:s,lastUpdated:i}),s}catch(e){if(o)return console.warn("Failed to fetch fresh data for ".concat(c,", returning stale data:"),e),o.data;throw e}}invalidate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=this._generateKey(e,t);this.cache.delete(s),this.backgroundJobs.delete(s)}invalidateFunction(e){let t=e.name||"anonymous",s=[];for(let e of this.cache.keys())e.startsWith("".concat(t,"_"))&&s.push(e);s.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[s,r]of this.cache.entries()){let a=e-r.lastUpdated;t.push({key:s,age:Math.round(a/1e3),lastUpdated:new Date(r.lastUpdated).toISOString(),hasBackgroundJob:this.backgroundJobs.has(s)})}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,s=Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];this.debugMode&&console.log("[DashboardCache] ".concat(e),...s)}_refreshInBackground(e,t,s){this.backgroundJobs.set(s,!0),e(...t).then(e=>{this.cache.set(s,{data:e,lastUpdated:Date.now()})}).catch(e=>{console.warn("Background refresh failed for ".concat(s,":"),e)}).finally(()=>{this.backgroundJobs.delete(s)})}_generateKey(e,t){let s=function(e){let t=5381;for(let s=0;s<e.length;s++)t=(t<<5)+t+e.charCodeAt(s);return t>>>0}(e.toString()),r=t.length>0?JSON.stringify(t):"";return"".concat(s,"_").concat(r)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.debugMode=!1}}let n=new a;t.default=n},2350:function(e,t,s){"use strict";s.d(t,{cn:function(){return n}});var r=s(512),a=s(8388);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.m6)((0,r.W)(t))}},190:function(e,t,s){"use strict";s.r(t),s.d(t,{JobDetailPage:function(){return p}});var r=s(5893),a=s(7294);s(9470);var n=s(7673),c=s(1664),l=s.n(c),o=s(1163),i=s(3266),u=s(6989),d=s(3626),h=s(5739),m=s(9307),f=s(3001),x=s(9008),g=s.n(x),b=s(546);function N(e){let{cluster:t,job:s,jobData:a,onRefresh:n,isRefreshing:c,loading:o}=e,i=(0,f.X)();return(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(l(),{href:"/clusters",className:"text-sky-blue hover:underline",children:"Sky Clusters"}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsx)(l(),{href:"/clusters/".concat(t),className:"text-sky-blue hover:underline",children:t}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsxs)(l(),{href:"/clusters/".concat(t,"/").concat(s),className:"text-sky-blue hover:underline",children:[s,a.job&&"-"!=a.job?" (".concat(a.job,")"):""]})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[(o||c)&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(h.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"text-sm ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsx)(u.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,r.jsxs)("button",{onClick:n,disabled:o||c,className:"text-sm text-sky-blue hover:text-sky-blue-bright font-medium mx-2 flex items-center",children:[(0,r.jsx)(d.Z,{className:"w-4 h-4 mr-1.5"}),!i&&(0,r.jsx)("span",{children:"Refresh"})]})})]})]})}function p(){let e=(0,o.useRouter)(),{cluster:t,job:s}=e.query,{clusterData:c,clusterJobData:f,loading:x,refreshData:p}=(0,i.QL)({cluster:t}),[y,j]=(0,a.useState)(!1),[_,w]=(0,a.useState)(!0),[v,E]=(0,a.useState)(!1),[k,C]=(0,a.useState)([]),[D,T]=(0,a.useState)(!1),S=(0,a.useMemo)(()=>["INIT","PENDING","SETTING_UP"],[]),I=(0,a.useMemo)(()=>{if(!f||!s)return!0;let e=f.find(e=>e.id==s);return e&&S.includes(e.status)},[f,s,S]);a.useEffect(()=>{!x&&_&&w(!1)},[x,_]),(0,a.useEffect)(()=>{let e=!0;return t&&s&&!I?(E(!0),(0,i.Sl)({clusterName:t,jobId:s,onNewLog:t=>{if(e){let e=(0,u.q8)(t);C(t=>[...t,e])}},workspace:null==c?void 0:c.workspace}).then(()=>{e&&E(!1)}).catch(t=>{e&&(console.error("Error streaming logs:",t),E(!1))})):E(!1),()=>{e=!1}},[t,s,D,I,c]);let R=async()=>{j(!0),T(e=>!e),C([]);try{p&&await p()}catch(e){console.error("Error refreshing data:",e)}finally{j(!1)}};if(!e.isReady)return(0,r.jsx)("div",{children:"Loading..."});let L={id:s};if(c&&f){let e=f.find(e=>e.id==s);e&&(L={...e,infra:c.infra,cluster:c.cluster,user:c.user,user_hash:c.user_hash})}let A=t&&s?"Job: ".concat(s," @ ").concat(t," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g(),{children:(0,r.jsx)("title",{children:A})}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{cluster:t,job:s,jobData:L,onRefresh:R,isRefreshing:y,loading:x}),x&&_?(0,r.jsxs)("div",{className:"flex items-center justify-center h-64",children:[(0,r.jsx)(h.Z,{size:24,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]}):(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)("div",{id:"details",children:(0,r.jsxs)(n.Zb,{children:[(0,r.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Details"})}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job ID"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.id})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job Name"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.job})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(m.OE,{status:L.status})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(b.H,{username:L.user,userHash:L.user_hash})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Submitted"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.submitted_at?(0,u.xn)(L.submitted_at):"N/A"})]}),L.resources&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Requested Resources"}),(0,r.jsx)("div",{className:"text-base mt-1",children:L.resources||"N/A"})]}),L.cluster&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Cluster"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(l(),{href:"/clusters/".concat(L.cluster),className:"text-sky-blue hover:underline",children:L.cluster})})]})]})})]})}),(0,r.jsx)("div",{id:"logs",className:"mt-6",children:(0,r.jsxs)(n.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Logs"}),(0,r.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,r.jsx)(u.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{T(e=>!e),C([])},disabled:v,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(d.Z,{className:"w-4 h-4 ".concat(v?"animate-spin":"")})})})]}),(0,r.jsx)("div",{className:"p-4",children:I?(0,r.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,r.jsx)("span",{children:"Waiting for the job to start; refresh in a few moments."})}):v?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(h.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]}):(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",children:(0,r.jsx)(u.$B,{logs:k.join("")})})})]})})]})]})]})}t.default=p},9008:function(e,t,s){e.exports=s(7219)},1163:function(e,t,s){e.exports=s(6036)}},function(e){e.O(0,[616,5230,5739,1664,804,6989,3698,9470,2888,9774,179],function(){return e(e.s=4966)}),_N_E=e.O()}]);
|
@@ -1,16 +0,0 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9315,2544],{479:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/jobs/[job]",function(){return s(8099)}])},6639:function(e,t,s){"use strict";s.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,s(998).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},8671:function(e,t,s){"use strict";s.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,s(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"}]])},3626:function(e,t,s){"use strict";s.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,s(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"}]])},9307:function(e,t,s){"use strict";s.d(t,{Cl:function(){return c},OE:function(){return d}});var r=s(5893);s(7294);var n=s(5739),a=s(6989),l=s(3850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":case"IN_USE":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":default:return"bg-gray-100 text-gray-800";case"PENDING":case"CANCELLED":case"CANCELLING":return"bg-yellow-50 text-yellow-700";case"SUCCEEDED":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return"bg-red-50 text-red-700";case"RECOVERING":return"bg-orange-50 text-orange-700";case"SUBMITTED":case"READY":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700"}},o=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,r.jsx)(n.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":case"IN_USE":default:return(0,r.jsx)(l.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,r.jsx)(l.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,r.jsx)(l.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,r.jsx)(l.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":case"READY":return(0,r.jsx)(l.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=c(e),s=o(e);return(0,r.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[s,e]})},d=e=>{let{status:t}=e;return(0,r.jsx)(a.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,r.jsx)("span",{children:i(t)})})}},546:function(e,t,s){"use strict";s.d(t,{H:function(){return d}});var r=s(5893);s(7294);var n=s(1664),a=s.n(n),l=s(5697),c=s.n(l);function o(e){return!!e&&"string"==typeof e&&e.toLowerCase().startsWith("sa-")}let i=()=>(0,r.jsx)("span",{className:"px-2 py-0.5 text-xs bg-blue-100 text-blue-700 rounded font-medium ml-1",children:"SA"}),d=e=>{let{username:t,userHash:s,className:n="flex items-center gap-1",linkClassName:l="text-blue-600 hover:underline",showBadge:c=!0}=e,d=o(s),u=o(s)?"/users?tab=service-accounts":"/users";return(0,r.jsxs)("div",{className:n,children:[(0,r.jsx)(a(),{href:u,className:l,children:t}),c&&d&&(0,r.jsx)(i,{})]})};d.propTypes={username:c().string.isRequired,userHash:c().string,className:c().string,linkClassName:c().string,showBadge:c().bool}},7673:function(e,t,s){"use strict";s.d(t,{Ol:function(){return i},Zb:function(){return o},aY:function(){return m},eW:function(){return x},ll:function(){return d}});var r=s(5893),n=s(7294),a=s(5697),l=s.n(a),c=s(2350);let o=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...a,children:n})});o.displayName="Card",o.propTypes={className:l().string,children:l().node};let i=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",s),...a,children:n})});i.displayName="CardHeader",i.propTypes={className:l().string,children:l().node};let d=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("h3",{ref:t,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",s),...a,children:n})});d.displayName="CardTitle",d.propTypes={className:l().string,children:l().node};let u=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("p",{ref:t,className:(0,c.cn)("text-sm text-muted-foreground",s),...a,children:n})});u.displayName="CardDescription",u.propTypes={className:l().string,children:l().node};let m=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("p-6 pt-0",s),...a,children:n})});m.displayName="CardContent",m.propTypes={className:l().string,children:l().node};let x=n.forwardRef((e,t)=>{let{className:s,children:n,...a}=e;return(0,r.jsx)("div",{ref:t,className:(0,c.cn)("flex items-center p-6 pt-0",s),...a,children:n})});x.displayName="CardFooter",x.propTypes={className:l().string,children:l().node}},7145:function(e,t,s){"use strict";s.d(t,{x:function(){return n}});var r=s(3225);let n={fetch:async function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"POST",n=window.location.origin,a="".concat(n).concat(r.f4).concat(e),l=await fetch(a,{method:s,headers:"POST"===s?{"Content-Type":"application/json"}:{},body:"POST"===s?JSON.stringify(t):void 0}),c=l.headers.get("X-Skypilot-Request-ID")||l.headers.get("X-Request-ID"),o=await fetch("".concat(n).concat(r.f4,"/api/get?request_id=").concat(c)),i=await o.json();return i.return_value?JSON.parse(i.return_value):[]},post:async(e,t)=>{let s=window.location.origin,n="".concat(s).concat(r.f4).concat(e);return await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},stream:async(e,t,s)=>{let r=(await n.post(e,t)).body.getReader();try{for(;;){let{done:e,value:t}=await r.read();if(e)break;let n=new TextDecoder().decode(t);s(n)}}catch(e){throw console.error("Error in stream:",e),e}},get:async e=>{let t=window.location.origin,s="".concat(t).concat(r.f4).concat(e);return await fetch(s)}}},2350:function(e,t,s){"use strict";s.d(t,{cn:function(){return a}});var r=s(512),n=s(8388);function a(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.m6)((0,r.W)(t))}},4303:function(e,t,s){"use strict";s.d(t,{_q:function(){return n},pJ:function(){return c}});var r=s(1272);let n=e=>{if(!e)return"No YAML available";try{let t=r.ZP.load(e),s=r.ZP.dump(t,{lineWidth:-1,styles:{"!!str":"literal"},quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2}).split("\n"),n=[],a=-1;for(let e=0;e<s.length;e++){let t=s[e],r=t.search(/\S/);0===r&&a>=0&&e>0&&n.push(""),n.push(t),a=r}return n.join("\n").trim()}catch(t){return console.error("YAML formatting error:",t),e}},a=e=>"string"==typeof e?e.substring(0,50)+"...":e&&e.name?"name: ".concat(e.name):e&&e.resources?"Task configuration":"YAML document",l=(e,t)=>{try{let s=r.ZP.load(e),n=r.ZP.dump(s,{lineWidth:-1,styles:{"!!str":"literal"},quotingType:"'",forceQuotes:!1,noRefs:!0,sortKeys:!1,condenseFlow:!1,indent:2}).split("\n"),l=[],c=-1;for(let e=0;e<n.length;e++){let t=n[e],s=t.search(/\S/);0===s&&c>=0&&e>0&&l.push(""),l.push(t),c=s}return{index:t,content:l.join("\n").trim(),preview:a(s)}}catch(s){return console.error("YAML formatting error for document ".concat(t,":"),s),{index:t,content:e,preview:"Invalid YAML"}}},c=e=>{if(!e)return[];try{let t=[],s=e.split(/^---$/m);for(let e=0;e<s.length;e++){let r=s[e].trim();r&&""!==r&&t.push(r)}return(t.length>1?t.slice(1):t).map((e,t)=>l(e,t))}catch(t){return console.error("YAML formatting error:",t),[{index:0,content:e,preview:"Invalid YAML"}]}}},8099:function(e,t,s){"use strict";s.r(t);var r=s(5893),n=s(7294),a=s(5739),l=s(1163);s(9470);var c=s(7673),o=s(8969),i=s(1664),d=s.n(i),u=s(3626),m=s(282),x=s(8671),f=s(5895),g=s(6639),h=s(6989),j=s(9307),p=s(3001),N=s(9008),y=s.n(N),b=s(4303),v=s(546);function w(e){let{jobData:t,activeTab:s,setIsLoadingLogs:l,setIsLoadingControllerLogs:c,isLoadingLogs:i,isLoadingControllerLogs:u,refreshFlag:p}=e,[N,y]=(0,n.useState)(""),[w,E]=(0,n.useState)(""),[L,C]=(0,n.useState)(!1),[S,R]=(0,n.useState)({}),[T,I]=(0,n.useState)(!1),[k,A]=(0,n.useState)(!1),[D,_]=(0,n.useState)(0),[Z,P]=(0,n.useState)(0),[O,q]=(0,n.useState)(!1),[F,M]=(0,n.useState)(!1),[U,H]=(0,n.useState)(!1),[G,W]=(0,n.useState)(!1),Y=(0,n.useRef)(null),J=(0,n.useRef)(null),B=(0,n.useRef)(new WeakSet),z=(0,n.useRef)(null),$=(0,n.useRef)(null),V=(0,n.useRef)(""),X=(0,n.useRef)(""),K=(0,n.useRef)(null);(0,n.useRef)(0);let Q=(0,n.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"request";if(e){if(B.current.has(e)){console.log("".concat(t," controller already aborted previously, skipping"));return}try{if("function"!=typeof e.abort){console.warn("Controller for ".concat(t," does not have abort method"));return}if(e.signal&&e.signal.aborted){console.log("".concat(t," already aborted via signal, skipping")),B.current.add(e);return}e.abort(),B.current.add(e),console.log("Successfully aborted ".concat(t))}catch(s){console.log("Caught error while aborting ".concat(t,":"),s.name,s.message),B.current.add(e),"AbortError"!==s.name&&"InvalidStateError"!==s.name&&console.warn("Unexpected error aborting ".concat(t,":"),s)}}},[]),ee=(0,n.useCallback)(e=>{let t="logs"===e?z:$;if(t.current)for(let s of[()=>t.current.querySelector(".logs-container"),()=>t.current.querySelector('[class*="logs-container"]'),()=>t.current.querySelector('div[style*="overflow"]'),()=>t.current]){let t=s();if(t&&t.scrollHeight>t.clientHeight){t.scrollTop=t.scrollHeight,console.log("Auto-scrolled ".concat(e," to bottom"));break}}},[]),et=["PENDING","SUBMITTED","STARTING"].includes(t.status),es=["PENDING","SUBMITTED"].includes(t.status),er=["RECOVERING"].includes(t.status),en=e=>{R(t=>({...t,[e]:!t[e]}))},ea=async()=>{try{let e=(0,b.pJ)(t.dag_yaml),s="";s=1===e.length?e[0].content:e.length>1?e.map(e=>e.content).join("\n---\n"):t.dag_yaml,await navigator.clipboard.writeText(s),I(!0),setTimeout(()=>I(!1),2e3)}catch(e){console.error("Failed to copy YAML to clipboard:",e)}},el=async()=>{try{await navigator.clipboard.writeText(t.entrypoint),A(!0),setTimeout(()=>A(!1),2e3)}catch(e){console.error("Failed to copy command to clipboard:",e)}};(0,n.useEffect)(()=>{y(""),_(0),W(!1)},[s,t.id]),(0,n.useEffect)(()=>{E(""),P(0),W(!1)},[s,t.id]);let ec=(0,n.useCallback)((e,t)=>{("logs"===e?y:E)(e=>e+t),requestAnimationFrame(()=>{ee(e)})},[ee]),eo=(0,n.useCallback)(function(e,t,s,r){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a="logs"===e?Y:J;if(a.current)return console.log("Request already active for ".concat(e,", skipping...")),()=>{};let l=!0,c=new AbortController;return"logs"===e&&(et||er)?(r(!1),n&&q(!1),()=>{}):"controllerlogs"===e&&es?(r(!1),n&&M(!1),()=>{}):t?(a.current=c,r(!0),H(!0),n&&(s(""),"logs"===e?_(0):P(0)),(0,o.NJ)({jobId:t,controller:"controllerlogs"===e,signal:c.signal,onNewLog:t=>{if(l){let s=(0,h.q8)(t);G||W(!0),ec(e,s),"logs"===e?_(e=>e+s.length):P(e=>e+s.length)}}}).then(()=>{l&&(r(!1),n&&("logs"===e?q(!1):M(!1)),requestAnimationFrame(()=>{ee(e)}))}).catch(t=>{l&&("AbortError"!==t.name&&(console.error("Error streaming ".concat(e,":"),t),t.message&&s(e=>e+"Error fetching logs: ".concat(t.message,"\n"))),r(!1),n&&("logs"===e?q(!1):M(!1)))}).finally(()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(Q(c,e),a.current=null),"logs"===e?V.current="":X.current="",K.current&&(clearTimeout(K.current),K.current=null)}),()=>{console.log("Cleaning up ".concat(e," request")),l=!1,a.current===c&&(Q(c,"".concat(e," cleanup")),a.current=null),"logs"===e?V.current="":X.current="",K.current&&(clearTimeout(K.current),K.current=null)}):()=>{l=!1}},[et,es,er,G,Q,ee,ec]);return((0,n.useEffect)(()=>{if(Y.current&&(Q(Y.current,"logs"),Y.current=null),!et&&!er)return eo("logs",t.id,y,l)},[t.id,eo,l,et,er,Q]),(0,n.useEffect)(()=>{if(J.current&&(Q(J.current,"controller logs"),J.current=null),!es)return eo("controllerlogs",t.id,E,c)},[t.id,eo,c,es,Q]),(0,n.useEffect)(()=>{if(p>0&&"logs"===s)return Y.current&&(Q(Y.current,"logs refresh"),Y.current=null),q(!0),eo("logs",t.id,y,l,!0)},[p,s,t.id,eo,l,Q]),(0,n.useEffect)(()=>{if(p>0&&"controllerlogs"===s)return J.current&&(Q(J.current,"controller logs refresh"),J.current=null),M(!0),eo("controllerlogs",t.id,E,c,!0)},[p,s,t.id,eo,c,Q]),(0,n.useEffect)(()=>()=>{console.log("Cleaning up managed job log requests..."),Y.current&&(Q(Y.current,"logs cleanup"),Y.current=null),J.current&&(Q(J.current,"controller logs cleanup"),J.current=null),K.current&&(clearTimeout(K.current),K.current=null),V.current="",X.current="",l(!1),c(!1),q(!1),M(!1)},[Q,l,c]),(0,n.useEffect)(()=>{let e=()=>{document.hidden?(console.log("Page hidden - pausing log streaming for performance"),K.current&&(clearTimeout(K.current),K.current=null)):console.log("Page visible - resuming normal operation")};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),(0,n.useEffect)(()=>{let e=()=>{("logs"===s&&N||"controllerlogs"===s&&w)&&ee("logs"===s?"logs":"controllerlogs")};requestAnimationFrame(()=>{requestAnimationFrame(e)})},[s,N,w,ee]),"logs"===s)?(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",ref:z,children:et?(0,r.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,r.jsx)("span",{children:"Waiting for the job to start; refresh in a few moments."})}):er?(0,r.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,r.jsx)("span",{children:"Waiting for the job to recover; refresh in a few moments."})}):G||N?(0,r.jsx)(h.$B,{logs:N}):i?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(a.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading logs..."})]}):(0,r.jsx)(h.$B,{logs:N})}):"controllerlogs"===s?(0,r.jsx)("div",{className:"max-h-96 overflow-y-auto",ref:$,children:es?(0,r.jsx)("div",{className:"bg-[#f7f7f7] flex items-center justify-center py-4 text-gray-500",children:(0,r.jsx)("span",{children:"Waiting for the job controller process to start; refresh in a few moments."})}):G||w?(0,r.jsx)(h.$B,{logs:w,controller:!0}):u?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(a.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading logs..."})]}):(0,r.jsx)(h.$B,{logs:w,controller:!0})}):(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Job ID (Name)"}),(0,r.jsxs)("div",{className:"text-base mt-1",children:[t.id," ",t.name?"(".concat(t.name,")"):""]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Status"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(j.OE,{status:t.status})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"User"}),(0,r.jsx)("div",{className:"text-base mt-1",children:(0,r.jsx)(v.H,{username:t.user,userHash:t.user_hash})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Submitted"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.submitted_at?(0,h.xn)(t.submitted_at):"N/A"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Requested Resources"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.requested_resources||"N/A"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Infra"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.infra?(0,r.jsx)(h.Md,{content:t.full_infra||t.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(d(),{href:"/infra",className:"text-blue-600 hover:underline",children:t.cloud||t.infra.split("(")[0].trim()}),t.infra.includes("(")&&(0,r.jsx)("span",{children:" "+t.infra.substring(t.infra.indexOf("("))})]})}):"-"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Resources"}),(0,r.jsx)("div",{className:"text-base mt-1",children:t.resources_str_full||t.resources_str||"-"})]}),(t.entrypoint||t.dag_yaml)&&(0,r.jsxs)("div",{className:"col-span-2",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"text-gray-600 font-medium text-base",children:"Entrypoint"}),t.entrypoint&&(0,r.jsx)(h.WH,{content:k?"Copied!":"Copy command",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:el,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:k?(0,r.jsx)(m.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(x.Z,{className:"w-4 h-4"})})})]}),(0,r.jsxs)("div",{className:"space-y-4 mt-3",children:[t.entrypoint&&(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3",children:(0,r.jsx)("code",{className:"text-sm text-gray-800 font-mono break-all",children:t.entrypoint})})}),t.dag_yaml&&"{}"!==t.dag_yaml&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center mb-2",children:[(0,r.jsxs)("button",{onClick:()=>{C(!L)},className:"flex items-center text-left focus:outline-none text-gray-700 hover:text-gray-900 transition-colors duration-200",children:[L?(0,r.jsx)(f.Z,{className:"w-4 h-4 mr-1"}):(0,r.jsx)(g.Z,{className:"w-4 h-4 mr-1"}),(0,r.jsx)("span",{className:"text-base",children:"Show SkyPilot YAML"})]}),(0,r.jsx)(h.WH,{content:T?"Copied!":"Copy YAML",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:ea,className:"flex items-center text-gray-500 hover:text-gray-700 transition-colors duration-200 p-1 ml-2",children:T?(0,r.jsx)(m.Z,{className:"w-4 h-4 text-green-600"}):(0,r.jsx)(x.Z,{className:"w-4 h-4"})})})]}),L&&(0,r.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-md p-3 max-h-96 overflow-y-auto",children:(()=>{let e=(0,b.pJ)(t.dag_yaml);return 0===e.length?(0,r.jsx)("div",{className:"text-gray-500",children:"No YAML available"}):1===e.length?(0,r.jsx)("pre",{className:"text-sm text-gray-800 font-mono whitespace-pre-wrap",children:e[0].content}):(0,r.jsx)("div",{className:"space-y-4",children:e.map((e,t)=>(0,r.jsxs)("div",{className:"border-b border-gray-200 pb-4 last:border-b-0",children:[(0,r.jsx)("button",{onClick:()=>en(t),className:"flex items-center justify-between w-full text-left focus:outline-none",children:(0,r.jsxs)("div",{className:"flex items-center",children:[S[t]?(0,r.jsx)(f.Z,{className:"w-4 h-4 mr-2"}):(0,r.jsx)(g.Z,{className:"w-4 h-4 mr-2"}),(0,r.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Task ",t+1,": ",e.preview]})]})}),S[t]&&(0,r.jsx)("div",{className:"mt-3 ml-6",children:(0,r.jsx)("pre",{className:"text-sm text-gray-800 font-mono whitespace-pre-wrap",children:e.content})})]},t))})})()})]})]})]})]})}t.default=function(){var e;let t=(0,l.useRouter)(),{job:s,tab:i}=t.query,[m,x]=(0,n.useState)(0),{jobData:f,loading:g}=(0,o.UA)(s,m),[j,N]=(0,n.useState)(!1),[b,v]=(0,n.useState)(!0),[E,L]=(0,n.useState)(!1),[C,S]=(0,n.useState)(!1),[R,T]=(0,n.useState)(!1),[I,k]=(0,n.useState)(!1),[A,D]=(0,n.useState)(!1),[_,Z]=(0,n.useState)(0),[P,O]=(0,n.useState)(0),q=(0,p.X)();n.useEffect(()=>{!g&&b&&v(!1)},[g,b]);let F=e=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})};(0,n.useEffect)(()=>{k(!0)},[]),(0,n.useEffect)(()=>{if(!A){let e=new MutationObserver(()=>{let t=document.getElementById("logs-section"),s=document.getElementById("controller-logs-section");("logs"===i&&t||"controllerlogs"===i&&s)&&(D(!0),e.disconnect())});return e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()}},[A,i]),(0,n.useEffect)(()=>{if(t.isReady&&I&&A&&!R){let e=setTimeout(()=>{"logs"===i?(F("logs-section"),T(!0)):"controllerlogs"===i&&(F("controller-logs-section"),T(!0))},800);return()=>clearTimeout(e)}},[t.isReady,i,R,I,A]),(0,n.useEffect)(()=>{T(!1),D(!1)},[i]);let M=async()=>{N(!0);try{x(e=>e+1),Z(e=>e+1),O(e=>e+1)}catch(e){console.error("Error refreshing data:",e)}finally{N(!1)}};if(!t.isReady)return(0,r.jsx)("div",{children:"Loading..."});let U=null==f?void 0:null===(e=f.jobs)||void 0===e?void 0:e.find(e=>String(e.id)===String(s)),H=s?"Job: ".concat(s," | SkyPilot Dashboard"):"Job Details | SkyPilot Dashboard";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y(),{children:(0,r.jsx)("title",{children:H})}),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(d(),{href:"/jobs",className:"text-sky-blue hover:underline",children:"Managed Jobs"}),(0,r.jsx)("span",{className:"mx-2 text-gray-500",children:"›"}),(0,r.jsxs)(d(),{href:"/jobs/".concat(s),className:"text-sky-blue hover:underline",children:[s," ",(null==U?void 0:U.name)?"(".concat(U.name,")"):""]})]}),(0,r.jsxs)("div",{className:"text-sm flex items-center",children:[(g||j||E||C)&&(0,r.jsxs)("div",{className:"flex items-center mr-4",children:[(0,r.jsx)(a.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsx)(h.WH,{content:"Refresh",className:"text-muted-foreground",children:(0,r.jsxs)("button",{onClick:M,disabled:g||j,className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(u.Z,{className:"w-4 h-4 mr-1.5"}),!q&&(0,r.jsx)("span",{children:"Refresh"})]})})]})]}),g&&b?(0,r.jsxs)("div",{className:"flex items-center justify-center py-32",children:[(0,r.jsx)(a.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]}):U?(0,r.jsxs)("div",{className:"space-y-8",children:[(0,r.jsx)("div",{id:"details-section",children:(0,r.jsxs)(c.Zb,{children:[(0,r.jsx)("div",{className:"flex items-center justify-between px-4 pt-4",children:(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Details"})}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(w,{jobData:U,activeTab:"info",setIsLoadingLogs:L,setIsLoadingControllerLogs:S,isLoadingLogs:E,isLoadingControllerLogs:C,refreshFlag:0})})]})}),(0,r.jsx)("div",{id:"logs-section",className:"mt-6",children:(0,r.jsxs)(c.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Logs"}),(0,r.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,r.jsx)(h.WH,{content:"Refresh logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{Z(e=>e+1)},disabled:E,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat(E?"animate-spin":"")})})})]}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(w,{jobData:U,activeTab:"logs",setIsLoadingLogs:L,setIsLoadingControllerLogs:S,isLoadingLogs:E,isLoadingControllerLogs:C,refreshFlag:_})})]})}),(0,r.jsx)("div",{id:"controller-logs-section",className:"mt-6",children:(0,r.jsxs)(c.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Controller Logs"}),(0,r.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"(Logs are not streaming; click refresh to fetch the latest logs.)"})]}),(0,r.jsx)(h.WH,{content:"Refresh controller logs",className:"text-muted-foreground",children:(0,r.jsx)("button",{onClick:()=>{O(e=>e+1)},disabled:C,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:(0,r.jsx)(u.Z,{className:"w-4 h-4 ".concat(C?"animate-spin":"")})})})]}),(0,r.jsx)("div",{className:"p-4",children:(0,r.jsx)(w,{jobData:U,activeTab:"controllerlogs",setIsLoadingLogs:L,setIsLoadingControllerLogs:S,isLoadingLogs:E,isLoadingControllerLogs:C,refreshFlag:P})})]})})]}):(0,r.jsx)("div",{className:"flex items-center justify-center py-32",children:(0,r.jsx)("span",{children:"Job not found"})})]})]})}},9008:function(e,t,s){e.exports=s(7219)},1163:function(e,t,s){e.exports=s(6036)}},function(e){e.O(0,[616,5230,5739,1664,804,1272,6989,3698,9470,8969,2888,9774,179],function(){return e(e.s=479)}),_N_E=e.O()}]);
|