@daocloud-proto/baize 0.1.0 → 0.101.0
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.
- package/common/k8s.pb.ts +17 -0
- package/management-api/cluster/v1alpha1/cluster.pb.ts +42 -0
- package/management-api/job/v1alpha1/common.pb.ts +48 -0
- package/management-api/job/v1alpha1/job.pb.ts +99 -0
- package/management-api/job/v1alpha1/pytorch.pb.ts +34 -0
- package/management-api/job/v1alpha1/tfjob.pb.ts +36 -0
- package/management-api/metrics/v1alpha1/metrics.pb.ts +113 -0
- package/management-api/notebook/v1alpha1/notebook.pb.ts +70 -3
- package/package.json +1 -1
package/common/k8s.pb.ts
CHANGED
|
@@ -3,7 +3,24 @@
|
|
|
3
3
|
/*
|
|
4
4
|
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
5
|
*/
|
|
6
|
+
|
|
7
|
+
export enum KubeVolumeVolumeType {
|
|
8
|
+
VOLUME_TYPE_UNSPECIFIED = "VOLUME_TYPE_UNSPECIFIED",
|
|
9
|
+
PERSISTENT_VOLUME_CLAIM = "PERSISTENT_VOLUME_CLAIM",
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
export type Resources = {
|
|
7
13
|
requests?: {[key: string]: string}
|
|
8
14
|
limits?: {[key: string]: string}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type KubeEnv = {
|
|
18
|
+
name?: string
|
|
19
|
+
value?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type KubeVolume = {
|
|
23
|
+
type?: KubeVolumeVolumeType
|
|
24
|
+
name?: string
|
|
25
|
+
mountPath?: string
|
|
9
26
|
}
|
|
@@ -21,8 +21,50 @@ export type ListAIClustersResponse = {
|
|
|
21
21
|
page?: BaizeCommonCommon.Pagination
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export type ListClusterNamespaceRequest = {
|
|
25
|
+
workspace?: number
|
|
26
|
+
cluster?: string
|
|
27
|
+
page?: BaizeCommonCommon.Pagination
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type ClusterNamespace = {
|
|
31
|
+
cluster?: string
|
|
32
|
+
name?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ListClusterNamespaceResponse = {
|
|
36
|
+
items?: ClusterNamespace[]
|
|
37
|
+
page?: BaizeCommonCommon.Pagination
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type PersistentVolumeClaims = {
|
|
41
|
+
cluster?: string
|
|
42
|
+
namespace?: string
|
|
43
|
+
name?: string
|
|
44
|
+
storageClass?: string
|
|
45
|
+
capacity?: string
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type ListPVCsRequest = {
|
|
49
|
+
workspace?: number
|
|
50
|
+
cluster?: string
|
|
51
|
+
namespace?: string
|
|
52
|
+
page?: BaizeCommonCommon.Pagination
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ListPVCsResponse = {
|
|
56
|
+
items?: PersistentVolumeClaims[]
|
|
57
|
+
page?: BaizeCommonCommon.Pagination
|
|
58
|
+
}
|
|
59
|
+
|
|
24
60
|
export class ClusterService {
|
|
25
61
|
static ListClusters(req: ListAIClustersRequest, initReq?: fm.InitReq): Promise<ListAIClustersResponse> {
|
|
26
62
|
return fm.fetchReq<ListAIClustersRequest, ListAIClustersResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
27
63
|
}
|
|
64
|
+
static ListClusterNamespaces(req: ListClusterNamespaceRequest, initReq?: fm.InitReq): Promise<ListClusterNamespaceResponse> {
|
|
65
|
+
return fm.fetchReq<ListClusterNamespaceRequest, ListClusterNamespaceResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces?${fm.renderURLSearchParams(req, ["workspace", "cluster"])}`, {...initReq, method: "GET"})
|
|
66
|
+
}
|
|
67
|
+
static ListPVCs(req: ListPVCsRequest, initReq?: fm.InitReq): Promise<ListPVCsResponse> {
|
|
68
|
+
return fm.fetchReq<ListPVCsRequest, ListPVCsResponse>(`/apis/baize.io/v1alpha1/workspace/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/pvcs?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
|
|
69
|
+
}
|
|
28
70
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as BaizeCommonK8s from "../../../common/k8s.pb"
|
|
8
|
+
|
|
9
|
+
export enum QueueType {
|
|
10
|
+
QUEUE_TYPE_UNSPECIFIED = "QUEUE_TYPE_UNSPECIFIED",
|
|
11
|
+
KUEUE = "KUEUE",
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum TrainingMode {
|
|
15
|
+
TRAINING_MODE_UNSPECIFIED = "TRAINING_MODE_UNSPECIFIED",
|
|
16
|
+
SINGLE = "SINGLE",
|
|
17
|
+
DISTRIBUTED = "DISTRIBUTED",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export enum JobPhase {
|
|
21
|
+
JOB_PHASE_UNSPECIFIED = "JOB_PHASE_UNSPECIFIED",
|
|
22
|
+
CREATED = "CREATED",
|
|
23
|
+
RUNNING = "RUNNING",
|
|
24
|
+
FAILED = "FAILED",
|
|
25
|
+
SUCCEEDED = "SUCCEEDED",
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type CommonConfig = {
|
|
29
|
+
queueType?: QueueType
|
|
30
|
+
taskQueue?: string
|
|
31
|
+
description?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type JobCreationBaseConfig = {
|
|
35
|
+
image?: string
|
|
36
|
+
imagePullSecret?: string
|
|
37
|
+
command?: string[]
|
|
38
|
+
args?: string[]
|
|
39
|
+
labels?: {[key: string]: string}
|
|
40
|
+
annotations?: {[key: string]: string}
|
|
41
|
+
kubeEnvs?: BaizeCommonK8s.KubeEnv[]
|
|
42
|
+
kubeVolumes?: BaizeCommonK8s.KubeVolume[]
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type JobRoleDifferenceConfig = {
|
|
46
|
+
replicas?: number
|
|
47
|
+
resources?: BaizeCommonK8s.Resources
|
|
48
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as BaizeCommonCommon from "../../../common/common.pb"
|
|
8
|
+
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as BaizeManagement_apiJobV1alpha1Pytorch from "./pytorch.pb"
|
|
10
|
+
import * as BaizeManagement_apiJobV1alpha1Tfjob from "./tfjob.pb"
|
|
11
|
+
|
|
12
|
+
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
13
|
+
type OneOf<T> =
|
|
14
|
+
| { [k in keyof T]?: undefined }
|
|
15
|
+
| (
|
|
16
|
+
keyof T extends infer K ?
|
|
17
|
+
(K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
|
|
18
|
+
: never)
|
|
19
|
+
: never);
|
|
20
|
+
|
|
21
|
+
export enum JobType {
|
|
22
|
+
JOB_TYPE_UNSPECIFIED = "JOB_TYPE_UNSPECIFIED",
|
|
23
|
+
PYTORCH = "PYTORCH",
|
|
24
|
+
TENSORFLOW = "TENSORFLOW",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export enum JobActionRequestAction {
|
|
28
|
+
JOB_ACTION_UNSPECIFIED = "JOB_ACTION_UNSPECIFIED",
|
|
29
|
+
STOP = "STOP",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
type BaseJob = {
|
|
34
|
+
type?: JobType
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type Job = BaseJob
|
|
38
|
+
& OneOf<{ pytorch: BaizeManagement_apiJobV1alpha1Pytorch.PyTorchJob; tensorflow: BaizeManagement_apiJobV1alpha1Tfjob.TFJob }>
|
|
39
|
+
|
|
40
|
+
export type ListJobsRequest = {
|
|
41
|
+
workspace?: number
|
|
42
|
+
type?: JobType
|
|
43
|
+
cluster?: string
|
|
44
|
+
namespace?: string
|
|
45
|
+
page?: BaizeCommonCommon.Pagination
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type ListJobsResponse = {
|
|
49
|
+
items?: Job[]
|
|
50
|
+
page?: BaizeCommonCommon.Pagination
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type SingleJobRequest = {
|
|
54
|
+
workspace?: number
|
|
55
|
+
type?: JobType
|
|
56
|
+
cluster?: string
|
|
57
|
+
namespace?: string
|
|
58
|
+
name?: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
type BaseCreateJobRequest = {
|
|
63
|
+
workspace?: number
|
|
64
|
+
type?: JobType
|
|
65
|
+
cluster?: string
|
|
66
|
+
namespace?: string
|
|
67
|
+
name?: string
|
|
68
|
+
description?: string
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type CreateJobRequest = BaseCreateJobRequest
|
|
72
|
+
& OneOf<{ pytorch: BaizeManagement_apiJobV1alpha1Pytorch.PytorchJobCreationConfig; tensorflow: BaizeManagement_apiJobV1alpha1Tfjob.TFJobCreationConfig }>
|
|
73
|
+
|
|
74
|
+
export type JobActionRequest = {
|
|
75
|
+
workspace?: number
|
|
76
|
+
type?: JobType
|
|
77
|
+
cluster?: string
|
|
78
|
+
namespace?: string
|
|
79
|
+
name?: string
|
|
80
|
+
action?: JobActionRequestAction
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export class JobsManagement {
|
|
84
|
+
static ListJobs(req: ListJobsRequest, initReq?: fm.InitReq): Promise<ListJobsResponse> {
|
|
85
|
+
return fm.fetchReq<ListJobsRequest, ListJobsResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/jobs?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
|
|
86
|
+
}
|
|
87
|
+
static GetJob(req: SingleJobRequest, initReq?: fm.InitReq): Promise<Job> {
|
|
88
|
+
return fm.fetchReq<SingleJobRequest, Job>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
89
|
+
}
|
|
90
|
+
static CreateJob(req: CreateJobRequest, initReq?: fm.InitReq): Promise<Job> {
|
|
91
|
+
return fm.fetchReq<CreateJobRequest, Job>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/jobs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
92
|
+
}
|
|
93
|
+
static DeleteJob(req: SingleJobRequest, initReq?: fm.InitReq): Promise<Job> {
|
|
94
|
+
return fm.fetchReq<SingleJobRequest, Job>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
95
|
+
}
|
|
96
|
+
static DoJobAction(req: SingleJobRequest, initReq?: fm.InitReq): Promise<Job> {
|
|
97
|
+
return fm.fetchReq<SingleJobRequest, Job>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as GoogleProtobufStruct from "../../../google/protobuf/struct.pb"
|
|
8
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
9
|
+
import * as BaizeManagement_apiJobV1alpha1Common from "./common.pb"
|
|
10
|
+
|
|
11
|
+
export enum PyTorchRole {
|
|
12
|
+
PYTORCH_ROLE_UNSPECIFIED = "PYTORCH_ROLE_UNSPECIFIED",
|
|
13
|
+
MASTER = "MASTER",
|
|
14
|
+
WORKER = "WORKER",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type PyTorchJob = {
|
|
18
|
+
cluster?: string
|
|
19
|
+
namespace?: string
|
|
20
|
+
name?: string
|
|
21
|
+
trainingMode?: BaizeManagement_apiJobV1alpha1Common.TrainingMode
|
|
22
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
23
|
+
phase?: BaizeManagement_apiJobV1alpha1Common.JobPhase
|
|
24
|
+
labels?: {[key: string]: string}
|
|
25
|
+
annotations?: {[key: string]: string}
|
|
26
|
+
jobSpec?: GoogleProtobufStruct.Struct
|
|
27
|
+
description?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type PytorchJobCreationConfig = {
|
|
31
|
+
trainingMode?: BaizeManagement_apiJobV1alpha1Common.TrainingMode
|
|
32
|
+
baseConfig?: BaizeManagement_apiJobV1alpha1Common.JobCreationBaseConfig
|
|
33
|
+
roleConfig?: {[key: string]: BaizeManagement_apiJobV1alpha1Common.JobRoleDifferenceConfig}
|
|
34
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as GoogleProtobufStruct from "../../../google/protobuf/struct.pb"
|
|
8
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
9
|
+
import * as BaizeManagement_apiJobV1alpha1Common from "./common.pb"
|
|
10
|
+
|
|
11
|
+
export enum TFRole {
|
|
12
|
+
TF_ROLE_UNSPECIFIED = "TF_ROLE_UNSPECIFIED",
|
|
13
|
+
TF_CHIEF = "TF_CHIEF",
|
|
14
|
+
TF_PS = "TF_PS",
|
|
15
|
+
TF_WORKER = "TF_WORKER",
|
|
16
|
+
TF_EVALUATOR = "TF_EVALUATOR",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type TFJob = {
|
|
20
|
+
cluster?: string
|
|
21
|
+
namespace?: string
|
|
22
|
+
name?: string
|
|
23
|
+
trainingMode?: BaizeManagement_apiJobV1alpha1Common.TrainingMode
|
|
24
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
25
|
+
phase?: BaizeManagement_apiJobV1alpha1Common.JobPhase
|
|
26
|
+
labels?: {[key: string]: string}
|
|
27
|
+
annotations?: {[key: string]: string}
|
|
28
|
+
jobSpec?: GoogleProtobufStruct.Struct
|
|
29
|
+
description?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export type TFJobCreationConfig = {
|
|
33
|
+
trainingMode?: BaizeManagement_apiJobV1alpha1Common.TrainingMode
|
|
34
|
+
baseConfig?: BaizeManagement_apiJobV1alpha1Common.JobCreationBaseConfig
|
|
35
|
+
roleConfig?: {[key: string]: BaizeManagement_apiJobV1alpha1Common.JobRoleDifferenceConfig}
|
|
36
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
/*
|
|
4
|
+
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as fm from "../../../fetch.pb"
|
|
8
|
+
|
|
9
|
+
export enum QueryMetric {
|
|
10
|
+
QUERY_METRIC_UNSPECIFIED = "QUERY_METRIC_UNSPECIFIED",
|
|
11
|
+
QUERY_METRIC_GPU_INSTALLED_NODES = "QUERY_METRIC_GPU_INSTALLED_NODES",
|
|
12
|
+
QUERY_METRIC_TOTAL_NODES = "QUERY_METRIC_TOTAL_NODES",
|
|
13
|
+
QUERY_METRIC_INUSE_GPUS = "QUERY_METRIC_INUSE_GPUS",
|
|
14
|
+
QUERY_METRIC_TOTAL_GPUS = "QUERY_METRIC_TOTAL_GPUS",
|
|
15
|
+
QUERY_METRIC_INUSE_CPUS = "QUERY_METRIC_INUSE_CPUS",
|
|
16
|
+
QUERY_METRIC_TOTAL_CPUS = "QUERY_METRIC_TOTAL_CPUS",
|
|
17
|
+
QUERY_METRIC_INUSE_MEM = "QUERY_METRIC_INUSE_MEM",
|
|
18
|
+
QUERY_METRIC_TOTAL_MEM = "QUERY_METRIC_TOTAL_MEM",
|
|
19
|
+
QUERY_METRIC_INUSE_VGPU_MEM = "QUERY_METRIC_INUSE_VGPU_MEM",
|
|
20
|
+
QUERY_METRIC_TOTAL_VGPU_MEM = "QUERY_METRIC_TOTAL_VGPU_MEM",
|
|
21
|
+
QUERY_METRIC_TOTAL_CLUSTERS = "QUERY_METRIC_TOTAL_CLUSTERS",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum QueryTimeSeriesMetric {
|
|
25
|
+
QUERY_TIME_SERIES_UNSPECIFIED = "QUERY_TIME_SERIES_UNSPECIFIED",
|
|
26
|
+
QUERY_TIME_SERIES_METRIC_GPU_DISTRIBUTION = "QUERY_TIME_SERIES_METRIC_GPU_DISTRIBUTION",
|
|
27
|
+
QUERY_TIME_SERIES_METRIC_GPU_UTILIZATION = "QUERY_TIME_SERIES_METRIC_GPU_UTILIZATION",
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export enum QueryTimeSeriesMetricRange {
|
|
31
|
+
QUERY_TIME_SERIES_METRIC_RANGES_UNSPECIFIED = "QUERY_TIME_SERIES_METRIC_RANGES_UNSPECIFIED",
|
|
32
|
+
QUERY_TIME_SERIES_METRIC_RANGES_LAST_3_DAYS = "QUERY_TIME_SERIES_METRIC_RANGES_LAST_3_DAYS",
|
|
33
|
+
QUERY_TIME_SERIES_METRIC_RANGES_LAST_7_DAYS = "QUERY_TIME_SERIES_METRIC_RANGES_LAST_7_DAYS",
|
|
34
|
+
QUERY_TIME_SERIES_METRIC_RANGES_LAST_15_DAYS = "QUERY_TIME_SERIES_METRIC_RANGES_LAST_15_DAYS",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export enum VectorQueryResponseStatus {
|
|
38
|
+
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
|
|
39
|
+
SUCCESS = "SUCCESS",
|
|
40
|
+
FAILURE = "FAILURE",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export enum TimeSeriesVectorQueryResponseStatus {
|
|
44
|
+
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
|
|
45
|
+
SUCCESS = "SUCCESS",
|
|
46
|
+
FAILURE = "FAILURE",
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type Sample = {
|
|
50
|
+
metric?: {[key: string]: string}
|
|
51
|
+
values?: SamplePair
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type SampleStream = {
|
|
55
|
+
metric?: {[key: string]: string}
|
|
56
|
+
values?: SamplePair[]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type SamplePair = {
|
|
60
|
+
timestamp?: string
|
|
61
|
+
value?: string
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type Matrix = {
|
|
65
|
+
matrix?: SampleStream[]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type Vector = {
|
|
69
|
+
vector?: Sample[]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type VectorQueryResponse = {
|
|
73
|
+
vector?: Vector
|
|
74
|
+
error?: string
|
|
75
|
+
status?: VectorQueryResponseStatus
|
|
76
|
+
metric?: QueryMetric
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type TimeSeriesVectorQueryResponse = {
|
|
80
|
+
matrix?: Matrix
|
|
81
|
+
error?: string
|
|
82
|
+
status?: TimeSeriesVectorQueryResponseStatus
|
|
83
|
+
metric?: QueryTimeSeriesMetric
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type QueryMultipleVectorRequest = {
|
|
87
|
+
queryMetrics?: QueryMetric[]
|
|
88
|
+
time?: string
|
|
89
|
+
cluster?: string
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type MultipleVectorQueryResponse = {
|
|
93
|
+
items?: VectorQueryResponse[]
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type QueryTimeSeriesVectorsRequest = {
|
|
97
|
+
queryMetrics?: QueryTimeSeriesMetric[]
|
|
98
|
+
queryMetricRange?: QueryTimeSeriesMetricRange
|
|
99
|
+
cluster?: string
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type QueryTimeSeriesVectorsResponse = {
|
|
103
|
+
items?: TimeSeriesVectorQueryResponse[]
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export class MetricsService {
|
|
107
|
+
static QueryMultipleVectors(req: QueryMultipleVectorRequest, initReq?: fm.InitReq): Promise<MultipleVectorQueryResponse> {
|
|
108
|
+
return fm.fetchReq<QueryMultipleVectorRequest, MultipleVectorQueryResponse>(`/apis/baize.io/v1alpha1/metrics/multiple-queries?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
109
|
+
}
|
|
110
|
+
static QueryTimeSeriesVectors(req: QueryTimeSeriesVectorsRequest, initReq?: fm.InitReq): Promise<QueryTimeSeriesVectorsResponse> {
|
|
111
|
+
return fm.fetchReq<QueryTimeSeriesVectorsRequest, QueryTimeSeriesVectorsResponse>(`/apis/baize.io/v1alpha1/metrics/time-series-queries?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -7,12 +7,24 @@
|
|
|
7
7
|
import * as BaizeCommonCommon from "../../../common/common.pb"
|
|
8
8
|
import * as BaizeCommonK8s from "../../../common/k8s.pb"
|
|
9
9
|
import * as fm from "../../../fetch.pb"
|
|
10
|
+
import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
11
|
|
|
11
12
|
export enum NotebookType {
|
|
12
13
|
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
|
|
13
14
|
JUPYTER = "JUPYTER",
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
export enum NotebookConfigServiceType {
|
|
18
|
+
SERVICE_TYPE_UNSPECIFIED = "SERVICE_TYPE_UNSPECIFIED",
|
|
19
|
+
NODE_PORT = "NODE_PORT",
|
|
20
|
+
LOAD_BALANCER = "LOAD_BALANCER",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export enum NotebookConfigKubeVolumeVolumeType {
|
|
24
|
+
VOLUME_TYPE_UNSPECIFIED = "VOLUME_TYPE_UNSPECIFIED",
|
|
25
|
+
PERSISTENT_VOLUME_CLAIM = "PERSISTENT_VOLUME_CLAIM",
|
|
26
|
+
}
|
|
27
|
+
|
|
16
28
|
export enum NotebookStatusPhase {
|
|
17
29
|
PHASE_UNSPECIFIED = "PHASE_UNSPECIFIED",
|
|
18
30
|
PENDING = "PENDING",
|
|
@@ -21,6 +33,12 @@ export enum NotebookStatusPhase {
|
|
|
21
33
|
FAILED = "FAILED",
|
|
22
34
|
}
|
|
23
35
|
|
|
36
|
+
export enum NotebookActionRequestAction {
|
|
37
|
+
ACTION_UNSPECIFIED = "ACTION_UNSPECIFIED",
|
|
38
|
+
START = "START",
|
|
39
|
+
STOP = "STOP",
|
|
40
|
+
}
|
|
41
|
+
|
|
24
42
|
export type ListNotebooksRequest = {
|
|
25
43
|
workspace?: number
|
|
26
44
|
cluster?: string
|
|
@@ -28,10 +46,31 @@ export type ListNotebooksRequest = {
|
|
|
28
46
|
page?: BaizeCommonCommon.Pagination
|
|
29
47
|
}
|
|
30
48
|
|
|
49
|
+
export type NotebookConfigKubeMetadata = {
|
|
50
|
+
labels?: {[key: string]: string}
|
|
51
|
+
annotations?: {[key: string]: string}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export type NotebookConfigKubeEnv = {
|
|
55
|
+
name?: string
|
|
56
|
+
value?: string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type NotebookConfigKubeVolume = {
|
|
60
|
+
type?: NotebookConfigKubeVolumeVolumeType
|
|
61
|
+
name?: string
|
|
62
|
+
mountPath?: string
|
|
63
|
+
}
|
|
64
|
+
|
|
31
65
|
export type NotebookConfig = {
|
|
32
66
|
resources?: BaizeCommonK8s.Resources
|
|
33
67
|
image?: string
|
|
34
68
|
token?: string
|
|
69
|
+
kubeMetadata?: NotebookConfigKubeMetadata
|
|
70
|
+
kubeEnvs?: NotebookConfigKubeEnv[]
|
|
71
|
+
kubeVolumes?: NotebookConfigKubeVolume[]
|
|
72
|
+
runAsRoot?: boolean
|
|
73
|
+
serviceType?: NotebookConfigServiceType
|
|
35
74
|
}
|
|
36
75
|
|
|
37
76
|
export type NotebookStatus = {
|
|
@@ -47,6 +86,7 @@ export type Notebook = {
|
|
|
47
86
|
name?: string
|
|
48
87
|
type?: NotebookType
|
|
49
88
|
config?: NotebookConfig
|
|
89
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
50
90
|
status?: NotebookStatus
|
|
51
91
|
}
|
|
52
92
|
|
|
@@ -71,17 +111,44 @@ export type CreateNotebookRequest = {
|
|
|
71
111
|
config?: NotebookConfig
|
|
72
112
|
}
|
|
73
113
|
|
|
114
|
+
export type NotebookActionRequest = {
|
|
115
|
+
workspace?: number
|
|
116
|
+
cluster?: string
|
|
117
|
+
namespace?: string
|
|
118
|
+
name?: string
|
|
119
|
+
action?: NotebookActionRequestAction
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type NotebookImage = {
|
|
123
|
+
name?: string
|
|
124
|
+
type?: NotebookType
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type NotebookImageListRequest = {
|
|
128
|
+
type?: NotebookType
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type NotebookImageListResponse = {
|
|
132
|
+
items?: NotebookImage[]
|
|
133
|
+
}
|
|
134
|
+
|
|
74
135
|
export class NotebookService {
|
|
75
136
|
static ListNotebooks(req: ListNotebooksRequest, initReq?: fm.InitReq): Promise<ListNotebooksResponse> {
|
|
76
|
-
return fm.fetchReq<ListNotebooksRequest, ListNotebooksResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/notebooks?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
137
|
+
return fm.fetchReq<ListNotebooksRequest, ListNotebooksResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/notebooks?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
|
|
77
138
|
}
|
|
78
139
|
static GetNotebook(req: SingleNotebookRequest, initReq?: fm.InitReq): Promise<Notebook> {
|
|
79
140
|
return fm.fetchReq<SingleNotebookRequest, Notebook>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/notebooks/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
80
141
|
}
|
|
81
|
-
static CreateNotebook(req:
|
|
82
|
-
return fm.fetchReq<
|
|
142
|
+
static CreateNotebook(req: CreateNotebookRequest, initReq?: fm.InitReq): Promise<Notebook> {
|
|
143
|
+
return fm.fetchReq<CreateNotebookRequest, Notebook>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/notebooks`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
144
|
+
}
|
|
145
|
+
static NotebookDoAction(req: NotebookActionRequest, initReq?: fm.InitReq): Promise<Notebook> {
|
|
146
|
+
return fm.fetchReq<NotebookActionRequest, Notebook>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/notebooks/${req["name"]}/actions`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
83
147
|
}
|
|
84
148
|
static DeleteNotebook(req: SingleNotebookRequest, initReq?: fm.InitReq): Promise<Notebook> {
|
|
85
149
|
return fm.fetchReq<SingleNotebookRequest, Notebook>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/notebooks/${req["name"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
86
150
|
}
|
|
151
|
+
static GetNotebookImageList(req: NotebookImageListRequest, initReq?: fm.InitReq): Promise<NotebookImageListResponse> {
|
|
152
|
+
return fm.fetchReq<NotebookImageListRequest, NotebookImageListResponse>(`/apis/baize.io/v1alpha1/notebook-images?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
153
|
+
}
|
|
87
154
|
}
|