curl --request GET \
--url https://{host}/api/cluster/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/cluster/status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/cluster/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/cluster/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/cluster/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/cluster/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/cluster/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"gpu": {
"total": 0,
"used": 0,
"free": 0,
"blocked": 0,
"queued": 0,
"blocked_reason": "",
"series": []
},
"storage": {
"measured": false,
"stale": false,
"measured_at": 0,
"total_bytes": 0,
"free_bytes": 0,
"used_bytes": 0,
"runs_bytes": 0,
"cache_bytes": 0,
"watermark_pct": 0,
"root": ""
},
"active_jobs": [],
"active_count": 0,
"profiles": []
}集群概览。
活跃作业读台账而不是问后端:台账是唯一有 project_key/project/owner 的地方, 而这些正是列表要展示与跳转所需的。
curl --request GET \
--url https://{host}/api/cluster/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/cluster/status"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/cluster/status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/cluster/status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/cluster/status"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/cluster/status")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/cluster/status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"gpu": {
"total": 0,
"used": 0,
"free": 0,
"blocked": 0,
"queued": 0,
"blocked_reason": "",
"series": []
},
"storage": {
"measured": false,
"stale": false,
"measured_at": 0,
"total_bytes": 0,
"free_bytes": 0,
"used_bytes": 0,
"runs_bytes": 0,
"cache_bytes": 0,
"watermark_pct": 0,
"root": ""
},
"active_jobs": [],
"active_count": 0,
"profiles": []
}授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
响应
Successful Response
Cluster GPU overview.
★ The four numbers satisfy total = used + free + blocked, from one
source each: the executor says how many cards exist (only it knows the
infrastructure), the ledger says how many are occupied -- counting only
jobs that actually hold cards -- and whatever cannot be scheduled right now
goes to blocked with a reason in plain words. No page should have to
explain "why does it say free when I cannot submit".
queued is the fifth number and sits outside that equation on purpose: a
queued job is demand on the cluster, not a slice of it. Folding it into
used is how the console once showed eight occupied cards on a box where
the platform was running nothing at all.
Show child attributes
Show child attributes
Platform storage overview (admin only).
- The difference from the GPU summary matters and has to reach the page: GPU numbers are computed from the ledger and are exact when asked, while these are a periodic measurement. A training process writes to disk without telling the control plane, so the only way to know is to walk the tree. Hence measured_at / stale — the page must show when this was taken.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes