skypilot-nightly 1.0.0.dev20250915__py3-none-any.whl → 1.0.0.dev20250918__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of skypilot-nightly might be problematic. Click here for more details.
- sky/__init__.py +4 -2
- sky/adaptors/primeintellect.py +1 -0
- sky/adaptors/seeweb.py +68 -4
- sky/authentication.py +25 -0
- sky/backends/__init__.py +3 -2
- sky/backends/backend_utils.py +16 -12
- sky/backends/cloud_vm_ray_backend.py +61 -4
- sky/catalog/primeintellect_catalog.py +95 -0
- sky/client/sdk.py +6 -0
- sky/clouds/__init__.py +2 -0
- sky/clouds/primeintellect.py +314 -0
- sky/core.py +10 -3
- sky/dashboard/out/404.html +1 -1
- sky/dashboard/out/_next/static/chunks/3015-ba5be550eb80fd8c.js +1 -0
- sky/dashboard/out/_next/static/chunks/5339.4a881570243431a5.js +51 -0
- sky/dashboard/out/_next/static/chunks/{6856-e0754534b3015377.js → 6856-9a2538f38c004652.js} +1 -1
- sky/dashboard/out/_next/static/chunks/{6990-11c8e9b982e8ffec.js → 6990-f6818c84ed8f1c86.js} +1 -1
- sky/dashboard/out/_next/static/chunks/8969-a3e3f0683e19d340.js +1 -0
- sky/dashboard/out/_next/static/chunks/9037-472ee1222cb1e158.js +6 -0
- sky/dashboard/out/_next/static/chunks/{webpack-d1e29b3aa66bf4cf.js → webpack-487697b47d8c5e50.js} +1 -1
- sky/dashboard/out/_next/static/{dG6B0i0HO4jIoKb4ZFYJ_ → k1mo5xWZrV9djgjd0moOT}/_buildManifest.js +1 -1
- 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/pools/[pool].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 +42 -34
- sky/jobs/server/server.py +14 -1
- sky/jobs/state.py +26 -1
- sky/provision/__init__.py +1 -0
- sky/provision/docker_utils.py +50 -3
- sky/provision/instance_setup.py +15 -1
- sky/provision/lambda_cloud/instance.py +12 -11
- sky/provision/primeintellect/__init__.py +10 -0
- sky/provision/primeintellect/config.py +11 -0
- sky/provision/primeintellect/instance.py +454 -0
- sky/provision/primeintellect/utils.py +398 -0
- sky/resources.py +9 -1
- sky/schemas/generated/servev1_pb2.py +58 -0
- sky/schemas/generated/servev1_pb2.pyi +115 -0
- sky/schemas/generated/servev1_pb2_grpc.py +322 -0
- sky/serve/serve_rpc_utils.py +179 -0
- sky/serve/serve_utils.py +29 -12
- sky/serve/server/core.py +37 -19
- sky/serve/server/impl.py +221 -129
- sky/server/common.py +13 -0
- sky/server/constants.py +3 -0
- sky/server/requests/executor.py +23 -6
- sky/server/server.py +10 -5
- sky/setup_files/dependencies.py +1 -0
- sky/skylet/constants.py +5 -3
- sky/skylet/services.py +98 -0
- sky/skylet/skylet.py +3 -1
- sky/skypilot_config.py +10 -3
- sky/templates/kubernetes-ray.yml.j2 +22 -12
- sky/templates/primeintellect-ray.yml.j2 +71 -0
- {skypilot_nightly-1.0.0.dev20250915.dist-info → skypilot_nightly-1.0.0.dev20250918.dist-info}/METADATA +39 -38
- {skypilot_nightly-1.0.0.dev20250915.dist-info → skypilot_nightly-1.0.0.dev20250918.dist-info}/RECORD +74 -62
- sky/dashboard/out/_next/static/chunks/3015-2ea98b57e318bd6e.js +0 -1
- sky/dashboard/out/_next/static/chunks/5339.c033b29835da0f35.js +0 -51
- sky/dashboard/out/_next/static/chunks/8969-0487dfbf149d9e53.js +0 -1
- sky/dashboard/out/_next/static/chunks/9037-f9800e64eb05dd1c.js +0 -6
- /sky/dashboard/out/_next/static/chunks/pages/{workspaces-7598c33a746cdc91.js → workspaces-7528cc0ef8c522c5.js} +0 -0
- /sky/dashboard/out/_next/static/{dG6B0i0HO4jIoKb4ZFYJ_ → k1mo5xWZrV9djgjd0moOT}/_ssgManifest.js +0 -0
- {skypilot_nightly-1.0.0.dev20250915.dist-info → skypilot_nightly-1.0.0.dev20250918.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20250915.dist-info → skypilot_nightly-1.0.0.dev20250918.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20250915.dist-info → skypilot_nightly-1.0.0.dev20250918.dist-info}/licenses/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20250915.dist-info → skypilot_nightly-1.0.0.dev20250918.dist-info}/top_level.txt +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8969],{68969:function(e,t,o){o.d(t,{Ce:function(){return p},NJ:function(){return h},UA:function(){return u},aT:function(){return i},getManagedJobs:function(){return l},jh:function(){return b},vs:function(){return d}});var r=o(67294),a=o(15821),n=o(93225),c=o(6378),s=o(47145);async function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t;let{allUsers:o=!0,nameMatch:r,userMatch:a,workspaceMatch:c,poolMatch:l,page:i,limit:d,statuses:u}=e,h={all_users:o,verbose:!0};void 0!==r&&(h.name_match=r),void 0!==a&&(h.user_match=a),void 0!==c&&(h.workspace_match=c),void 0!==l&&(h.pool_match=l),void 0!==i&&(h.page=i),void 0!==d&&(h.limit=d),void 0!==u&&u.length>0&&(h.statuses=u);let p=(await s.x.post("/jobs/queue/v2",h)).headers.get("X-Skypilot-Request-ID"),b=await s.x.get("/api/get?request_id=".concat(p));if(500===b.status){try{let e=await b.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t.type&&t.type===n.iW)return{jobs:[],total:0,controllerStopped:!0}}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{jobs:[],total:0,controllerStopped:!1}}let g=await b.json(),f=g.return_value?JSON.parse(g.return_value):[],m=Array.isArray(f)?f:(null==f?void 0:f.jobs)||[],_=Array.isArray(f)?m.length:null!==(t=null==f?void 0:f.total)&&void 0!==t?t:m.length,y=(null==f?void 0:f.total_no_filter)||_,w=(null==f?void 0:f.status_counts)||{};return{jobs:m.map(e=>{var t;let o=0;e.end_at&&e.submitted_at?o=e.end_at-e.submitted_at:e.submitted_at&&(o=Date.now()/1e3-e.submitted_at);let r=[];e.submitted_at&&r.push({type:"PENDING",timestamp:e.submitted_at}),e.start_at&&r.push({type:"RUNNING",timestamp:e.start_at}),e.end_at&&r.push({type:e.status,timestamp:e.end_at});let a="",n="",c="",s="",l="";try{if(a=e.cloud||"",c=e.cluster_resources,n=e.region||"",a&&(s=a,n&&(s+="/".concat(n))),l=s,e.accelerators){let t=Object.entries(e.accelerators).map(e=>{let[t,o]=e;return"".concat(o,"x").concat(t)}).join(", ");t&&(l+=" (".concat(t,")"))}}catch(t){c=e.cluster_resources}return{id:e.job_id,task_job_id:e._job_id,task:e.task_name,name:e.job_name,job_duration:e.job_duration,total_duration:o,workspace:e.workspace,status:e.status,requested_resources:e.resources,resources_str:c,resources_str_full:e.cluster_resources_full||c,cloud:a,region:e.region,infra:s,full_infra:l,recoveries:e.recovery_count,details:e.details||e.failure_reason,user:e.user_name,user_hash:e.user_hash,submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,events:r,dag_yaml:e.user_yaml,entrypoint:e.entrypoint,git_commit:(null===(t=e.metadata)||void 0===t?void 0:t.git_commit)||"-",pool:e.pool,pool_hash:e.pool_hash,current_cluster_name:e.current_cluster_name,job_id_on_pool_cluster:e.job_id_on_pool_cluster}}),total:_,totalNoFilter:y,controllerStopped:!1,statusCounts:w}}catch(e){return console.error("Error fetching managed job data:",e),{jobs:[],total:0,totalNoFilter:0,controllerStopped:!1,statusCounts:{}}}}async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{allUsers:t=!0,nameMatch:o,userMatch:r,workspaceMatch:a,poolMatch:n,page:c=1,limit:s=10,useClientPagination:i=!0}=e;try{if(!i)return await l(e);let d=await l({allUsers:t,nameMatch:o,userMatch:r,workspaceMatch:a,poolMatch:n});if(d.controllerStopped||!d.jobs)return d;let u=d.jobs,h=u.length,p=(c-1)*s;return{jobs:u.slice(p,p+s),total:h,controllerStopped:!1}}catch(e){return console.error("Error fetching managed job data with client pagination:",e),{jobs:[],total:0,controllerStopped:!1}}}async function d(){try{let e=(await s.x.post("/jobs/pool_status",{pool_names:null})).headers.get("X-Skypilot-Request-ID"),t=await s.x.get("/api/get?request_id=".concat(e));if(500===t.status){try{let e=await t.json();if(e.detail&&e.detail.error)try{let t=JSON.parse(e.detail.error);if(t.type&&t.type===n.iW)return{pools:[],controllerStopped:!0}}catch(e){console.error("Failed to parse error JSON:",e)}}catch(e){console.error("Failed to parse response JSON:",e)}throw Error("Server error")}let o=await t.json(),r=o.return_value?JSON.parse(o.return_value):[],a={jobs:[]};try{let e=await l({allUsers:!0});e.controllerStopped||(a=e)}catch(e){console.warn("Failed to fetch jobs for pool job counts:",e)}let c={},i=["SUCCEEDED","FAILED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER","CANCELLED"];return a.jobs&&Array.isArray(a.jobs)&&a.jobs.forEach(e=>{let t=e.pool,o=e.status;t&&!i.includes(o)&&(c[t]||(c[t]={}),c[t][o]=(c[t][o]||0)+1)}),{pools:r.map(e=>({...e,jobCounts:c[e.name]||{}})),controllerStopped:!1}}catch(e){throw console.error("Error fetching pools:",e),e}}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[o,a]=(0,r.useState)(null),[n,s]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async function(){if(e)try{var t;s(!0);let o=await c.default.get(l,[{allUsers:!0}]),r=null==o?void 0:null===(t=o.jobs)||void 0===t?void 0:t.find(t=>String(t.id)===String(e));r?a({jobs:[r],controllerStopped:o.controllerStopped||!1}):a({jobs:[],controllerStopped:o.controllerStopped||!1})}catch(e){console.error("Error fetching single managed job data:",e),a({jobs:[],controllerStopped:!1})}finally{s(!1)}})()},[e,t]),{jobData:o,loading:n}}async function h(e){let t,{jobId:o,controller:r=!1,signal:c,onNewLog:s}=e,l=Date.now(),i=new Promise(e=>{let o=()=>{let r=Date.now()-l;r>=3e4?e({timeout:!0}):t=setTimeout(o,3e4-r)};t=setTimeout(o,3e4)}),d=window.location.origin,u="".concat(d).concat(n.f4),h=(async()=>{try{let e=(await fetch("".concat(u,"/jobs/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({controller:r,follow:!1,job_id:o,tail:1e4}),...c?{signal:c}:{}})).body.getReader();try{for(;;){let{done:t,value:o}=await e.read();if(t)break;l=Date.now();let r=new TextDecoder().decode(o);s(r)}}finally{if(!c||!c.aborted)try{e.cancel()}catch(e){"AbortError"!==e.name&&console.warn("Error canceling reader:",e)}t&&clearTimeout(t)}return{timeout:!1}}catch(e){if(t&&clearTimeout(t),"AbortError"===e.name)return{timeout:!1};throw e}})(),p=await Promise.race([h,i]);if(t&&clearTimeout(t),p.timeout){(0,a.C)("Log request for job ".concat(o," timed out after ").concat(30,"s of inactivity"),"warning");return}}async function p(e,t,o){let r="",c="",s="",l={};if("restartcontroller"===e)r="Restarting",c="restarted",s="jobs/queue/v2",l={all_users:!0,refresh:!0},t="controller";else throw Error("Invalid action: ".concat(e));(0,a.C)("".concat(r," job ").concat(t,"..."),"info");let i=window.location.origin,d="".concat(i).concat(n.f4);try{try{let e=(await fetch("".concat(d,"/").concat(s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})).headers.get("X-Skypilot-Request-ID"),i=await fetch("".concat(d,"/api/get?request_id=").concat(e));if(200===i.status)(0,a.C)("Job ".concat(t," ").concat(c," successfully."),"success");else if(500===i.status)try{let e=await i.json();if(e.detail&&e.detail.error)try{let c=JSON.parse(e.detail.error);c.type&&c.type===n.Bo?(0,a.C)("".concat(r," job ").concat(t," is not supported!"),"error",1e4):c.type&&c.type===n.mF?(0,a.C)("Cluster ".concat(o," does not exist."),"error"):c.type&&c.type===n.iW?(0,a.C)("Cluster ".concat(o," is not up."),"error"):(0,a.C)("".concat(r," job ").concat(t," failed: ").concat(c.type),"error")}catch(o){(0,a.C)("".concat(r," job ").concat(t," failed: ").concat(e.detail.error),"error")}else(0,a.C)("".concat(r," job ").concat(t," failed with no details."),"error")}catch(e){(0,a.C)("".concat(r," job ").concat(t," failed with parse error."),"error")}else(0,a.C)("".concat(r," job ").concat(t," failed with status ").concat(i.status,"."),"error")}catch(e){console.error("Fetch error:",e),(0,a.C)("Network error ".concat(r," job ").concat(t,": ").concat(e.message),"error")}}catch(e){console.error("Error in handleStop:",e),(0,a.C)("Critical error ".concat(r," job ").concat(t,": ").concat(e.message),"error")}}async function b(e){let{jobId:t=null,name:o=null,controller:r=!1}=e;try{let e=await s.x.fetch("/jobs/download_logs",{job_id:t,name:o,controller:r,refresh:!1}),c=Object.values(e||{});if(!c.length){(0,a.C)("No logs found to download.","warning");return}let l=window.location.origin,i="".concat(l).concat(n.f4,"/download"),d=await fetch("".concat(i,"?relative=items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folder_paths:c})});if(!d.ok){let e=await d.text();throw Error("Download failed: ".concat(d.status," ").concat(e))}let u=await d.blob(),h=window.URL.createObjectURL(u),p=document.createElement("a"),b=new Date().toISOString().replace(/[:.]/g,"-"),g=t?"job-".concat(t):o?"job-".concat(o):"job";p.href=h,p.download="managed-".concat(g,"-").concat(r?"controller-logs":"logs","-").concat(b,".zip"),document.body.appendChild(p),p.click(),p.remove(),window.URL.revokeObjectURL(h)}catch(e){console.error("Error downloading managed job logs:",e),(0,a.C)("Error downloading managed job logs: ".concat(e.message),"error")}}},15821:function(e,t,o){o.d(t,{C:function(){return r}});function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=document.getElementById("toast-container");r||((r=document.createElement("div")).id="toast-container",r.className="fixed top-0 right-0 p-4 z-[9999] flex flex-col items-end space-y-2",document.body.appendChild(r));let a=document.createElement("div");switch(a.className="rounded-md border-l-4 p-4 shadow-md flex items-center justify-between max-w-md w-full mb-2 pointer-events-auto",t){case"success":a.className+=" bg-green-100 border-green-500 text-green-800";break;case"error":a.className+=" bg-red-100 border-red-500 text-red-800";break;case"warning":a.className+=" bg-yellow-100 border-yellow-500 text-yellow-800";break;default:a.className+=" bg-blue-100 border-blue-500 text-blue-800"}return a.innerHTML='\n <div class="flex-1 mr-2">\n <p class="text-sm font-medium">'.concat(e,'</p>\n </div>\n <button class="text-gray-500 hover:text-gray-700 focus:outline-none" aria-label="Close toast">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"></line>\n <line x1="6" y1="6" x2="18" y2="18"></line>\n </svg>\n </button>\n '),r.appendChild(a),a.querySelector("button").addEventListener("click",()=>{r.removeChild(a)}),setTimeout(()=>{r.contains(a)&&r.removeChild(a)},o),a}},6378:function(e,t,o){o.r(t),o.d(t,{DashboardCache:function(){return a},dashboardCache:function(){return n}});let r=o(51214).ej.DEFAULT_TTL;class a{setPreloader(e){this.preloader=e}async get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.ttl||r,n=!1!==o.refreshOnAccess,c=this._generateKey(e,t),s=e.name||"anonymous",l=this.cache.get(c),i=Date.now();if(l&&i-l.lastUpdated<a){let o=Math.round((i-l.lastUpdated)/1e3);if(this._debug("Cache HIT for ".concat(s," (age: ").concat(o,"s, TTL: ").concat(Math.round(a/1e3),"s)")),n&&(this.cache.set(c,{data:l.data,lastUpdated:i}),this._debug("Cache TTL refreshed for ".concat(s))),!this.backgroundJobs.has(c)){var d;(null===(d=this.preloader)||void 0===d?void 0:d.wasRecentlyPreloaded(e,t))?this._debug("Skipping background refresh for ".concat(s," - recently preloaded")):this._refreshInBackground(e,t,c)}return l.data}try{let o=await e(...t);return this.cache.set(c,{data:o,lastUpdated:i}),o}catch(e){if(l)return console.warn("Failed to fetch fresh data for ".concat(c,", returning stale data:"),e),l.data;throw e}}invalidate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=this._generateKey(e,t);this.cache.delete(o),this.backgroundJobs.delete(o)}invalidateFunction(e){let t=e.name||"anonymous",o=[];for(let e of this.cache.keys())e.startsWith("".concat(t,"_"))&&o.push(e);o.forEach(e=>{this.cache.delete(e),this.backgroundJobs.delete(e)})}clear(){this.cache.clear(),this.backgroundJobs.clear()}getStats(){return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,keys:Array.from(this.cache.keys())}}getDetailedStats(){let e=Date.now(),t=[];for(let[o,r]of this.cache.entries()){let a=e-r.lastUpdated;t.push({key:o,age:Math.round(a/1e3),lastUpdated:new Date(r.lastUpdated).toISOString(),hasBackgroundJob:this.backgroundJobs.has(o)})}return{cacheSize:this.cache.size,backgroundJobs:this.backgroundJobs.size,entries:t.sort((e,t)=>e.age-t.age)}}setDebugMode(e){this.debugMode=e}_debug(e){for(var t=arguments.length,o=Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];this.debugMode&&console.log("[DashboardCache] ".concat(e),...o)}_refreshInBackground(e,t,o){this.backgroundJobs.set(o,!0),e(...t).then(e=>{this.cache.set(o,{data:e,lastUpdated:Date.now()})}).catch(e=>{console.warn("Background refresh failed for ".concat(o,":"),e)}).finally(()=>{this.backgroundJobs.delete(o)})}_generateKey(e,t){let o=function(e){let t=5381;for(let o=0;o<e.length;o++)t=(t<<5)+t+e.charCodeAt(o);return t>>>0}(e.toString()),r=t.length>0?JSON.stringify(t):"";return"".concat(o,"_").concat(r)}constructor(){this.cache=new Map,this.backgroundJobs=new Map,this.debugMode=!1,this.preloader=null}}let n=new a;t.default=n}}]);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9037],{39037:function(e,s,t){t.r(s),t.d(s,{ClusterTable:function(){return I},Clusters:function(){return _},Status2Actions:function(){return V},enabledActions:function(){return F},handleVSCodeConnection:function(){return H}});var r=t(85893),a=t(67294),l=t(11163),n=t(55739),c=t(36989),i=t(41664),o=t.n(i),u=t(30803),d=t(37673),h=t(68764),x=t(23266),p=t(17324),m=t(94545),f=t(13626),j=t(60998);/**
|
|
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 g=(0,j.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,j.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(6135);var w=t(92128),y=t(99307),b=t(23001),k=t(88950),N=t(6378),C=t(36856);t(1272);var S=t(20546);let L=[{label:"Status",value:"status"},{label:"Cluster",value:"cluster"},{label:"User",value:"user"},{label:"Workspace",value:"workspace"},{label:"Infra",value:"infra"}],M=(e,s)=>{let t="",r="";return e>=0&&(t=e+"m",r=" "),s&&(t+="".concat(r,"(down)")),""===t&&(t="-"),t},R=(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},E=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 a=Math.floor(s/e.value);t+="".concat(a).concat(e.label," "),s%=e.value,r++}return t.trim()||"0s"};function _(){let e=(0,l.useRouter)(),[s,t]=(0,a.useState)(!1),i=a.useRef(null),[u,d]=(0,a.useState)(!1),[h,m]=(0,a.useState)(!1),[j,g]=(0,a.useState)(null),[v,y]=(0,a.useState)(()=>!!e.isReady&&"true"===e.query.history),[k,S]=(0,a.useState)(!0),M=(0,b.X)(),[E,_]=(0,a.useState)([]),[H,O]=(0,a.useState)({status:[],cluster:[],user:[],workspace:[],infra:[]}),[F,W]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(e.isReady){A();let s="true"===e.query.history;v!==s&&(S(!1),y(s),setTimeout(()=>S(!0),50))}},[e.isReady,e.query.history]),(0,a.useEffect)(()=>{(async()=>{try{await C.ZP.preloadForPage("clusters");let e=await N.default.get(p.getWorkspaces),s=Object.keys(e),t=await N.default.get(x.getClusters),r=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],a=new Set(s);r.includes("default")&&a.has("default"),r.forEach(e=>a.add(e));let l=[...new Set(t.map(e=>({userId:e.user_hash||e.user,username:e.user})).filter(e=>e.userId)).values()],n=new Map;l.forEach(e=>{n.set(e.userId,{userId:e.userId,username:e.username,display:R(e.username,e.userId)})}),W(!0)}catch(e){console.error("Error fetching data for filters:",e),W(!0)}})()},[]);let V=s=>{let t={...e.query},r=[],a=[],l=[];s.map((e,s)=>{var t;r.push(null!==(t=e.property.toLowerCase())&&void 0!==t?t:""),a.push(e.operator),l.push(e.value)}),t.property=r,t.operator=a,t.value=l,e.replace({pathname:e.pathname,query:t},void 0,{shallow:!0})},Z=s=>{let t={...e.query};t.history=s.toString(),e.replace({pathname:e.pathname,query:t},void 0,{shallow:!0})},A=()=>{let s={...e.query},t=s.property,r=s.operator,a=s.value;if(void 0===t)return;let l=[],n=Array.isArray(t)?t.length:1,c=new Map;if(c.set("",""),c.set("status","Status"),c.set("cluster","Cluster"),c.set("user","User"),c.set("workspace","Workspace"),c.set("infra","Infra"),1===n)l.push({property:c.get(t),operator:r,value:a});else for(let e=0;e<n;e++)l.push({property:c.get(t[e]),operator:r[e],value:a[e]});_(l)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-1 min-h-[20px]",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)(o(),{href:"/clusters",className:"text-sky-blue hover:underline leading-none text-base",children:"Sky Clusters"})}),(0,r.jsx)("div",{className:"w-full sm:w-auto",children:(0,r.jsx)(q,{propertyList:L,valueList:H,setFilters:_,updateURLParams:V,placeholder:"Filter clusters"})}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[(0,r.jsxs)("label",{className:"flex items-center cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:v,onChange:e=>{let s=e.target.checked;y(s),Z(s)},className:"sr-only"}),(0,r.jsx)("div",{className:"relative inline-flex h-5 w-9 items-center rounded-full ".concat(k?"transition-colors":""," ").concat(v?"bg-sky-600":"bg-gray-300"),children:(0,r.jsx)("span",{className:"inline-block h-3 w-3 transform rounded-full bg-white ".concat(k?"transition-transform":""," ").concat(v?"translate-x-5":"translate-x-1")})}),(0,r.jsx)("span",{className:"ml-2 text-sm text-gray-700",children:"Show history (Last 30 days)"})]}),s&&(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(n.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:()=>{N.default.invalidate(x.getClusters),N.default.invalidate(x.uR),N.default.invalidate(p.getWorkspaces),W(!1),C.ZP.preloadForPage("clusters",{force:!0}).then(()=>{W(!0)}),i.current&&i.current()},disabled:s,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(f.Z,{className:"h-4 w-4 mr-1.5"}),!M&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(z,{filters:E,setFilters:_,updateURLParams:V}),(0,r.jsx)(I,{refreshInterval:c.yc,setLoading:t,refreshDataRef:i,filters:E,showHistory:v,onOpenSSHModal:e=>{g(e),d(!0)},onOpenVSCodeModal:e=>{g(e),m(!0)},setOptionValues:O,preloadingComplete:F}),(0,r.jsx)(w.Oh,{isOpen:u,onClose:()=>d(!1),cluster:j}),(0,r.jsx)(w._R,{isOpen:h,onClose:()=>m(!1),cluster:j})]})}function I(e){let{refreshInterval:s,setLoading:t,refreshDataRef:l,filters:i,showHistory:p,onOpenSSHModal:f,onOpenVSCodeModal:j,setOptionValues:g,preloadingComplete:v}=e,[w,b]=(0,a.useState)([]),[k,C]=(0,a.useState)({key:null,direction:"ascending"}),[L,R]=(0,a.useState)(!1),[_,I]=(0,a.useState)(!0),[H,O]=(0,a.useState)(1),[F,W]=(0,a.useState)(10),q=e=>{let s={status:[],cluster:[],user:[],workspace:[],infra:[]},t=(e,s)=>{e.includes(s)||e.push(s)};return e.map(e=>{t(s.status,e.status),t(s.cluster,e.cluster),t(s.user,e.user),t(s.workspace,e.workspace),t(s.infra,e.infra)}),s},z=a.useCallback(async()=>{t(!0),R(!0);try{let e=await N.default.get(x.getClusters);if(p){let s=await N.default.get(x.uR),t=e.map(e=>({...e,isHistorical:!1})),r=s.map(e=>({...e,isHistorical:!0})),a=[...t];r.forEach(s=>{e.some(e=>e.cluster_hash===s.cluster_hash)||a.push(s)}),g(q(a)),b(a)}else{let s=e.map(e=>({...e,isHistorical:!1}));g(q(s)),b(s)}}catch(e){console.error("Error fetching cluster data:",e),g(q([])),b([])}t(!1),R(!1),I(!1)},[t,p,g]),Z=(e,s)=>{var t;let{property:r,operator:a,value:l}=s;if(!l)return!0;if(!r){let s=l.toLowerCase();return Object.values(e).some(e=>null==e?void 0:e.toString().toLowerCase().includes(s))}let n=null===(t=e[r.toLowerCase()])||void 0===t?void 0:t.toString().toLowerCase(),c=l.toString().toLowerCase();switch(a){case"=":return n===c;case":":return null==n?void 0:n.includes(c);default:return!0}},A=a.useMemo(()=>{let e=0===i.length?w:w.filter(e=>{let s=null;for(let t=0;t<i.length;t++){let r=Z(e,i[t]);s=null===s?r:s&&r}return s});return(0,m.R0)(e,k.key,k.direction)},[w,k,i]);a.useEffect(()=>{l&&(l.current=z)},[l,z]),(0,a.useEffect)(()=>{b([]);let e=!0;if(v){z();let t=setInterval(()=>{e&&z()},s);return()=>{e=!1,clearInterval(t)}}return()=>{e=!1}},[s,z,v]),(0,a.useEffect)(()=>{O(1)},[w.length]);let P=e=>{let s="ascending";k.key===e&&"ascending"===k.direction&&(s="descending"),C({key:e,direction:s})},B=e=>k.key===e?"ascending"===k.direction?" ↑":" ↓":"",U=Math.ceil(A.length/F),D=(H-1)*F,T=D+F,X=A.slice(D,T);return(0,r.jsxs)("div",{children:[(0,r.jsx)(d.Zb,{children:(0,r.jsx)("div",{className:"overflow-x-auto rounded-lg",children:(0,r.jsxs)(h.iA,{className:"min-w-full",children:[(0,r.jsx)(h.xD,{children:(0,r.jsxs)(h.SC,{children:[(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("status"),children:["Status",B("status")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("cluster"),children:["Cluster",B("cluster")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("user"),children:["User",B("user")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("workspace"),children:["Workspace",B("workspace")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("infra"),children:["Infra",B("infra")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("resources_str"),children:["Resources",B("resources_str")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("time"),children:["Started",B("time")]}),p&&(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("duration"),children:["Duration",B("duration")]}),(0,r.jsxs)(h.ss,{className:"sortable whitespace-nowrap",onClick:()=>P("autostop"),children:["Autostop",B("autostop")]}),(0,r.jsx)(h.ss,{className:"md:sticky md:right-0 md:bg-white",children:"Actions"})]})}),(0,r.jsx)(h.RM,{children:L&&_?(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..."})]})})}):X.length>0?X.map((e,s)=>(0,r.jsxs)(h.SC,{children:[(0,r.jsx)(h.pj,{children:(0,r.jsx)(y.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,{children:(0,r.jsx)(S.H,{username:e.user,userHash:e.user_hash})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(o(),{href:"/workspaces",className:"text-gray-700 hover:text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(h.pj,{children:(0,r.jsx)(c.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,{children:(0,r.jsx)(c.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)(c.Zg,{date:e.time})}),p&&(0,r.jsx)(h.pj,{children:E(e.duration)}),(0,r.jsx)(h.pj,{children:e.isHistorical?"-":M(e.autostop,e.to_down)}),(0,r.jsx)(h.pj,{className:"text-left md:sticky md:right-0 md:bg-white",children:!e.isHistorical&&(0,r.jsx)(V,{cluster:e.cluster,status:e.status,onOpenSSHModal:f,onOpenVSCodeModal:j})})]},s)):(0,r.jsx)(h.SC,{children:(0,r.jsx)(h.pj,{colSpan:9,className:"text-center py-6 text-gray-500",children:p?"No clusters found":"No active clusters"})})})]})})}),w.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:F,onChange:e=>{W(parseInt(e.target.value,10)),O(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsx)("div",{children:"".concat(D+1," - ").concat(Math.min(T,A.length)," of ").concat(A.length)}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(u.z,{variant:"ghost",size:"icon",onClick:()=>{O(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:()=>{O(e=>Math.min(e+1,U))},disabled:H===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"})})})]})]})})]})}let H=(e,s)=>{s&&s(e)},O=(e,s)=>{s?s(e):window.open("ssh://".concat(e))},F=e=>"RUNNING"===e?["connect","VSCode"]:[],W={connect:(0,r.jsx)(g,{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 V(e){let{withLabel:s=!1,cluster:t,status:a,onOpenSSHModal:l,onOpenVSCodeModal:n}=e,i=F(a),o=(0,b.X)(),u=e=>{switch(e){case"connect":O(t,l);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(W).map(e=>{let t,a,[l,n]=e;switch(l){case"connect":t="Connect",a="Connect with SSH";break;case"VSCode":t="VSCode",a="Open in VS Code"}return(s||(t=""),i.includes(l))?(0,r.jsx)(c.WH,{content:a,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:()=>u(l),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})]})},l):(0,r.jsx)(c.WH,{content:a,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("span",{className:"opacity-30 flex items-center cursor-not-allowed text-sm",title:l,children:[n,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},l)})})})}let q=e=>{let{propertyList:s=[],valueList:t,setFilters:l,updateURLParams:n,placeholder:c="Filter clusters"}=e,i=(0,a.useRef)(null),o=(0,a.useRef)(null),[u,d]=(0,a.useState)(!1),[h,x]=(0,a.useState)(""),[p,m]=(0,a.useState)("status"),[f,j]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=e=>{o.current&&!o.current.contains(e.target)&&i.current&&!i.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,a.useEffect)(()=>{let e=[];if(t&&"object"==typeof t)switch(p){case"status":e=t.status||[];break;case"user":e=t.user||[];break;case"cluster":e=t.cluster||[];break;case"workspace":e=t.workspace||[];break;case"infra":e=t.infra||[]}""!==h.trim()&&(e=e.filter(e=>e&&e.toString().toLowerCase().includes(h.toLowerCase()))),j(e)},[p,t,h]);let g=e=>{let t=s.find(s=>s.value===e);return t?t.label:e},v=e=>{l(s=>{let t=[...s,{property:g(p),operator:":",value:e}];return n(t),t}),d(!1),x(""),i.current.focus()};return(0,r.jsxs)("div",{className:"flex flex-row border border-gray-300 rounded-md overflow-visible",children:[(0,r.jsx)("div",{className:"border-r border-gray-300 flex-shrink-0",children:(0,r.jsxs)(k.Ph,{onValueChange:m,value:p,children:[(0,r.jsx)(k.i4,{"aria-label":"Filter Property",className:"focus:ring-0 focus:ring-offset-0 border-none rounded-l-md rounded-r-none w-20 sm:w-24 md:w-32 h-8 text-xs sm:text-sm",children:(0,r.jsx)(k.ki,{placeholder:"Status"})}),(0,r.jsx)(k.Bw,{children:s.map((e,s)=>(0,r.jsx)(k.Ql,{value:e.value,children:e.label},"property-item-".concat(s)))})]})}),(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)("input",{type:"text",ref:i,placeholder:c,value:h,onChange:e=>{x(e.target.value),u||d(!0)},onFocus:()=>{d(!0)},onKeyDown:e=>{"Enter"===e.key&&""!==h.trim()?(l(e=>{let s=[...e,{property:g(p),operator:":",value:h}];return n(s),s}),x(""),d(!1)):"Escape"===e.key&&(d(!1),i.current.blur())},className:"h-8 w-full sm:w-96 px-3 pr-8 text-sm border-none rounded-l-none rounded-r-md focus:ring-0 focus:outline-none",autoComplete:"off"}),h&&(0,r.jsx)("button",{onClick:()=>{x(""),d(!1)},className:"absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",title:"Clear filter",tabIndex:-1,children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),u&&f.length>0&&(0,r.jsx)("div",{ref:o,className:"absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-md shadow-lg max-h-60 overflow-y-auto",style:{zIndex:9999},children:f.map((e,s)=>(0,r.jsx)("div",{className:"px-3 py-2 cursor-pointer hover:bg-gray-50 text-sm ".concat(s!==f.length-1?"border-b border-gray-100":""),onClick:()=>v(e),children:(0,r.jsx)("span",{className:"text-sm text-gray-700",children:e})},"".concat(e,"-").concat(s)))})]})]})},z=e=>{let{filters:s=[],setFilters:t,updateURLParams:a}=e,l=e=>{t(s=>{let t=s.filter((s,t)=>t!==e);return a(t),t})};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"flex items-center gap-4 py-2 px-2",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-content gap-2",children:[s.map((e,s)=>(0,r.jsx)(Z,{filter:e,onRemove:()=>l(s)},"filteritem-".concat(s))),s.length>0&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("button",{onClick:()=>{a([]),t([])},className:"rounded-full px-4 py-1 text-sm text-gray-700 bg-gray-200 hover:bg-gray-300",children:"Clear filters"})})]})})})},Z=e=>{let{filter:s,onRemove:t}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"flex items-center text-blue-600 bg-blue-100 px-1 py-1 rounded-full text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2",children:[(0,r.jsx)("span",{children:"".concat(s.property," ")}),(0,r.jsx)("span",{children:"".concat(s.operator," ")}),(0,r.jsx)("span",{children:" ".concat(s.value)})]}),(0,r.jsx)("button",{onClick:()=>t(),className:"p-0.5 ml-1 transform text-gray-400 hover:text-gray-600 bg-blue-500 hover:bg-blue-600 rounded-full flex flex-col items-center",title:"Clear filter",children:(0,r.jsx)("svg",{className:"h-3 w-3",fill:"none",stroke:"white",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:5,d:"M6 18L18 6M6 6l12 12"})})})]})})}}}]);
|
|
File without changes
|
/sky/dashboard/out/_next/static/{dG6B0i0HO4jIoKb4ZFYJ_ → k1mo5xWZrV9djgjd0moOT}/_ssgManifest.js
RENAMED
|
File without changes
|
{skypilot_nightly-1.0.0.dev20250915.dist-info → skypilot_nightly-1.0.0.dev20250918.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|