@daocloud-proto/baize 0.101.4 → 0.102.1
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 +1 -0
- package/management-api/cluster/v1alpha1/cluster.pb.ts +23 -0
- package/management-api/dataset/v1alpha1/dataset.pb.ts +179 -0
- package/management-api/job/v1alpha1/job.pb.ts +28 -5
- package/management-api/metrics/v1alpha1/metrics.pb.ts +62 -0
- package/management-api/notebook/v1alpha1/notebook.pb.ts +15 -1
- package/management-api/queue/v1alpha1/queue.pb.ts +45 -0
- package/package.json +1 -1
package/common/k8s.pb.ts
CHANGED
|
@@ -79,6 +79,26 @@ export type ResourceRange = {
|
|
|
79
79
|
maxDesc?: string
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
export type StorageClass = {
|
|
83
|
+
cluster?: string
|
|
84
|
+
name?: string
|
|
85
|
+
isDefault?: boolean
|
|
86
|
+
provisioner?: string
|
|
87
|
+
allowReclaim?: boolean
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type ListStorageClassesRequest = {
|
|
91
|
+
workspace?: number
|
|
92
|
+
cluster?: string
|
|
93
|
+
namespace?: string
|
|
94
|
+
page?: BaizeCommonCommon.Pagination
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type ListStorageClassesResponse = {
|
|
98
|
+
items?: StorageClass[]
|
|
99
|
+
page?: BaizeCommonCommon.Pagination
|
|
100
|
+
}
|
|
101
|
+
|
|
82
102
|
export type GPUSettingsResponse = {
|
|
83
103
|
items?: GPUSetting[]
|
|
84
104
|
}
|
|
@@ -100,4 +120,7 @@ export class ClusterService {
|
|
|
100
120
|
static GetClusterGPUSettings(req: ClusterSettingsRequest, initReq?: fm.InitReq): Promise<GPUSettingsResponse> {
|
|
101
121
|
return fm.fetchReq<ClusterSettingsRequest, GPUSettingsResponse>(`/apis/baize.io/v1alpha1/clusters/${req["cluster"]}/settings/gpu-resources?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
102
122
|
}
|
|
123
|
+
static ListStorageClasses(req: ListStorageClassesRequest, initReq?: fm.InitReq): Promise<ListStorageClassesResponse> {
|
|
124
|
+
return fm.fetchReq<ListStorageClassesRequest, ListStorageClassesResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/storage-classes?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
|
|
125
|
+
}
|
|
103
126
|
}
|
|
@@ -0,0 +1,179 @@
|
|
|
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 GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
|
|
10
|
+
|
|
11
|
+
type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
|
|
12
|
+
type OneOf<T> =
|
|
13
|
+
| { [k in keyof T]?: undefined }
|
|
14
|
+
| (
|
|
15
|
+
keyof T extends infer K ?
|
|
16
|
+
(K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
|
|
17
|
+
: never)
|
|
18
|
+
: never);
|
|
19
|
+
|
|
20
|
+
export enum DataSourceType {
|
|
21
|
+
DATA_SOURCE_TYPE_UNSPECIFIED = "DATA_SOURCE_TYPE_UNSPECIFIED",
|
|
22
|
+
GIT = "GIT",
|
|
23
|
+
S3 = "S3",
|
|
24
|
+
HTTP = "HTTP",
|
|
25
|
+
PVC = "PVC",
|
|
26
|
+
NFS = "NFS",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum DatasetStatusPhase {
|
|
30
|
+
DATA_SET_PHASE_UNSPECIFIED = "DATA_SET_PHASE_UNSPECIFIED",
|
|
31
|
+
PENDING = "PENDING",
|
|
32
|
+
READY = "READY",
|
|
33
|
+
PROCESSING = "PROCESSING",
|
|
34
|
+
FAILED = "FAILED",
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export enum SecretOptionsAuthType {
|
|
38
|
+
AUTH_TYPE_UNSPECIFIED = "AUTH_TYPE_UNSPECIFIED",
|
|
39
|
+
BASIC = "BASIC",
|
|
40
|
+
SSH = "SSH",
|
|
41
|
+
TOKEN = "TOKEN",
|
|
42
|
+
AK_SK = "AK_SK",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export enum DatasetBoundPVCAccessMode {
|
|
46
|
+
ACCESS_MODE_UNSPECIFIED = "ACCESS_MODE_UNSPECIFIED",
|
|
47
|
+
READ_ONLY_MANY = "READ_ONLY_MANY",
|
|
48
|
+
READ_WRITE_ONCE = "READ_WRITE_ONCE",
|
|
49
|
+
READ_WRITE_MANY = "READ_WRITE_MANY",
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type DataSource = {
|
|
53
|
+
type?: DataSourceType
|
|
54
|
+
uri?: string
|
|
55
|
+
options?: DataSourceOptions
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type DatasetStatus = {
|
|
59
|
+
phase?: DatasetStatusPhase
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export type Dataset = {
|
|
63
|
+
name?: string
|
|
64
|
+
cluster?: string
|
|
65
|
+
namespace?: string
|
|
66
|
+
source?: DataSource
|
|
67
|
+
secretRef?: string
|
|
68
|
+
pvcName?: string
|
|
69
|
+
status?: DatasetStatus
|
|
70
|
+
description?: string
|
|
71
|
+
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
72
|
+
labels?: {[key: string]: string}
|
|
73
|
+
annotations?: {[key: string]: string}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export type DataSourceOptionsGit = {
|
|
77
|
+
branch?: string
|
|
78
|
+
commit?: string
|
|
79
|
+
depth?: number
|
|
80
|
+
submodules?: boolean
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type DataSourceOptionsS3 = {
|
|
84
|
+
region?: string
|
|
85
|
+
endpoint?: string
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type DataSourceOptionsHttp = {
|
|
89
|
+
headers?: {[key: string]: string}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
/* baize modified */ export type BaseDataSourceOptions = {
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type DataSourceOptions = BaseDataSourceOptions
|
|
97
|
+
& OneOf<{ git: DataSourceOptionsGit; s3: DataSourceOptionsS3; http: DataSourceOptionsHttp }>
|
|
98
|
+
|
|
99
|
+
export type SecretOptionsBasicAuth = {
|
|
100
|
+
username?: string
|
|
101
|
+
password?: string
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export type SecretOptionsSSHAuth = {
|
|
105
|
+
privateKey?: string
|
|
106
|
+
passphrase?: string
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type SecretOptionsTokenAuth = {
|
|
110
|
+
token?: string
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type SecretOptionsAkSkAuth = {
|
|
114
|
+
accessKey?: string
|
|
115
|
+
secretKey?: string
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
/* baize modified */ export type BaseSecretOptions = {
|
|
120
|
+
authType?: SecretOptionsAuthType
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type SecretOptions = BaseSecretOptions
|
|
124
|
+
& OneOf<{ basic: SecretOptionsBasicAuth; ssh: SecretOptionsSSHAuth; token: SecretOptionsTokenAuth; akSk: SecretOptionsAkSkAuth }>
|
|
125
|
+
|
|
126
|
+
export type DatasetBoundPVC = {
|
|
127
|
+
storageClassName?: string
|
|
128
|
+
accessMode?: DatasetBoundPVCAccessMode
|
|
129
|
+
labels?: {[key: string]: string}
|
|
130
|
+
annotations?: {[key: string]: string}
|
|
131
|
+
capacity?: string
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export type CreateDatasetRequest = {
|
|
135
|
+
workspace?: number
|
|
136
|
+
cluster?: string
|
|
137
|
+
namespace?: string
|
|
138
|
+
name?: string
|
|
139
|
+
source?: DataSource
|
|
140
|
+
secretOptions?: SecretOptions
|
|
141
|
+
boundPVC?: DatasetBoundPVC
|
|
142
|
+
description?: string
|
|
143
|
+
labels?: {[key: string]: string}
|
|
144
|
+
annotations?: {[key: string]: string}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type ListDatasetRequest = {
|
|
148
|
+
workspace?: number
|
|
149
|
+
cluster?: string
|
|
150
|
+
namespace?: string
|
|
151
|
+
page?: BaizeCommonCommon.Pagination
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export type ListDatasetResponse = {
|
|
155
|
+
items?: Dataset[]
|
|
156
|
+
page?: BaizeCommonCommon.Pagination
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export type SingleDatasetRequest = {
|
|
160
|
+
workspace?: number
|
|
161
|
+
cluster?: string
|
|
162
|
+
namespace?: string
|
|
163
|
+
name?: string
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export class DatasetManagement {
|
|
167
|
+
static ListDatasets(req: ListDatasetRequest, initReq?: fm.InitReq): Promise<ListDatasetResponse> {
|
|
168
|
+
return fm.fetchReq<ListDatasetRequest, ListDatasetResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/datasets?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace"])}`, {...initReq, method: "GET"})
|
|
169
|
+
}
|
|
170
|
+
static GetDataset(req: SingleDatasetRequest, initReq?: fm.InitReq): Promise<Dataset> {
|
|
171
|
+
return fm.fetchReq<SingleDatasetRequest, Dataset>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/datasets/${req["name"]}?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
172
|
+
}
|
|
173
|
+
static CreateDataset(req: CreateDatasetRequest, initReq?: fm.InitReq): Promise<Dataset> {
|
|
174
|
+
return fm.fetchReq<CreateDatasetRequest, Dataset>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/datasets`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
175
|
+
}
|
|
176
|
+
static DeleteDataset(req: SingleDatasetRequest, initReq?: fm.InitReq): Promise<Dataset> {
|
|
177
|
+
return fm.fetchReq<SingleDatasetRequest, Dataset>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/datasets/${req["name"]}`, {...initReq, method: "DELETE"})
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -30,8 +30,10 @@ export enum JobActionRequestAction {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
type BaseJob = {
|
|
33
|
+
/* baize modified */ export type BaseJob = {
|
|
34
34
|
type?: JobType
|
|
35
|
+
queueName?: string
|
|
36
|
+
runningDuration?: number
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export type Job = BaseJob
|
|
@@ -59,13 +61,14 @@ export type SingleJobRequest = {
|
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
|
|
62
|
-
type BaseCreateJobRequest = {
|
|
64
|
+
/* baize modified */ export type BaseCreateJobRequest = {
|
|
63
65
|
workspace?: number
|
|
64
66
|
type?: JobType
|
|
65
67
|
cluster?: string
|
|
66
68
|
namespace?: string
|
|
67
69
|
name?: string
|
|
68
70
|
description?: string
|
|
71
|
+
queueName?: string
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
export type CreateJobRequest = BaseCreateJobRequest
|
|
@@ -80,20 +83,40 @@ export type JobActionRequest = {
|
|
|
80
83
|
action?: JobActionRequestAction
|
|
81
84
|
}
|
|
82
85
|
|
|
86
|
+
export type JobInstanceContainer = {
|
|
87
|
+
name?: string
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type JobInstance = {
|
|
91
|
+
cluster?: string
|
|
92
|
+
namespace?: string
|
|
93
|
+
name?: string
|
|
94
|
+
phase?: string
|
|
95
|
+
containers?: JobInstanceContainer[]
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export type JobInstanceListResponse = {
|
|
99
|
+
items?: JobInstance[]
|
|
100
|
+
page?: BaizeCommonCommon.Pagination
|
|
101
|
+
}
|
|
102
|
+
|
|
83
103
|
export class JobsManagement {
|
|
84
104
|
static ListJobs(req: ListJobsRequest, initReq?: fm.InitReq): Promise<ListJobsResponse> {
|
|
85
|
-
return fm.fetchReq<ListJobsRequest, ListJobsResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/
|
|
105
|
+
return fm.fetchReq<ListJobsRequest, ListJobsResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/jobs?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
86
106
|
}
|
|
87
107
|
static GetJob(req: SingleJobRequest, initReq?: fm.InitReq): Promise<Job> {
|
|
88
108
|
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
109
|
}
|
|
110
|
+
static GetJobInstanceList(req: SingleJobRequest, initReq?: fm.InitReq): Promise<JobInstanceListResponse> {
|
|
111
|
+
return fm.fetchReq<SingleJobRequest, JobInstanceListResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}/instances?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
|
|
112
|
+
}
|
|
90
113
|
static CreateJob(req: CreateJobRequest, initReq?: fm.InitReq): Promise<Job> {
|
|
91
114
|
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
115
|
}
|
|
93
116
|
static DeleteJob(req: SingleJobRequest, initReq?: fm.InitReq): Promise<Job> {
|
|
94
117
|
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
118
|
}
|
|
96
|
-
static DoJobAction(req:
|
|
97
|
-
return fm.fetchReq<
|
|
119
|
+
static DoJobAction(req: JobActionRequest, initReq?: fm.InitReq): Promise<Job> {
|
|
120
|
+
return fm.fetchReq<JobActionRequest, 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
121
|
}
|
|
99
122
|
}
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import * as BaizeCommonCommon from "../../../common/common.pb"
|
|
7
8
|
import * as fm from "../../../fetch.pb"
|
|
9
|
+
import * as BaizeManagement_apiJobV1alpha1Job from "../../job/v1alpha1/job.pb"
|
|
8
10
|
|
|
9
11
|
export enum QueryMetric {
|
|
10
12
|
QUERY_METRIC_UNSPECIFIED = "QUERY_METRIC_UNSPECIFIED",
|
|
@@ -21,6 +23,17 @@ export enum QueryMetric {
|
|
|
21
23
|
QUERY_METRIC_TOTAL_CLUSTERS = "QUERY_METRIC_TOTAL_CLUSTERS",
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
export enum DevDashboardQueryMetric {
|
|
27
|
+
DEV_DASH_QUERY_METRIC_UNSPECIFIED = "DEV_DASH_QUERY_METRIC_UNSPECIFIED",
|
|
28
|
+
DEV_DASH_QUERY_RUNNING_NOTEBOOKS = "DEV_DASH_QUERY_RUNNING_NOTEBOOKS",
|
|
29
|
+
DEV_DASH_QUERY_TOTAL_NOTEBOOKS = "DEV_DASH_QUERY_TOTAL_NOTEBOOKS",
|
|
30
|
+
DEV_DASH_QUERY_RUNNING_PYTORCH_JOBS = "DEV_DASH_QUERY_RUNNING_PYTORCH_JOBS",
|
|
31
|
+
DEV_DASH_QUERY_TOTAL_PYTORCH_JOBS = "DEV_DASH_QUERY_TOTAL_PYTORCH_JOBS",
|
|
32
|
+
DEV_DASH_QUERY_RUNNING_TENSORFLOW_JOBS = "DEV_DASH_QUERY_RUNNING_TENSORFLOW_JOBS",
|
|
33
|
+
DEV_DASH_QUERY_TOTAL_TENSORFLOW_JOBS = "DEV_DASH_QUERY_TOTAL_TENSORFLOW_JOBS",
|
|
34
|
+
DEV_DASH_QUERY_TOTAL_DATASETS = "DEV_DASH_QUERY_TOTAL_DATASETS",
|
|
35
|
+
}
|
|
36
|
+
|
|
24
37
|
export enum QueryTimeSeriesMetric {
|
|
25
38
|
QUERY_TIME_SERIES_UNSPECIFIED = "QUERY_TIME_SERIES_UNSPECIFIED",
|
|
26
39
|
QUERY_TIME_SERIES_METRIC_GPU_DISTRIBUTION = "QUERY_TIME_SERIES_METRIC_GPU_DISTRIBUTION",
|
|
@@ -40,6 +53,12 @@ export enum VectorQueryResponseStatus {
|
|
|
40
53
|
FAILURE = "FAILURE",
|
|
41
54
|
}
|
|
42
55
|
|
|
56
|
+
export enum DevDashboardVectorQueryResponseStatus {
|
|
57
|
+
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
|
|
58
|
+
SUCCESS = "SUCCESS",
|
|
59
|
+
FAILURE = "FAILURE",
|
|
60
|
+
}
|
|
61
|
+
|
|
43
62
|
export enum TimeSeriesVectorQueryResponseStatus {
|
|
44
63
|
STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
|
|
45
64
|
SUCCESS = "SUCCESS",
|
|
@@ -76,6 +95,13 @@ export type VectorQueryResponse = {
|
|
|
76
95
|
metric?: QueryMetric
|
|
77
96
|
}
|
|
78
97
|
|
|
98
|
+
export type DevDashboardVectorQueryResponse = {
|
|
99
|
+
vector?: Vector
|
|
100
|
+
error?: string
|
|
101
|
+
status?: DevDashboardVectorQueryResponseStatus
|
|
102
|
+
metric?: DevDashboardQueryMetric
|
|
103
|
+
}
|
|
104
|
+
|
|
79
105
|
export type TimeSeriesVectorQueryResponse = {
|
|
80
106
|
matrix?: Matrix
|
|
81
107
|
error?: string
|
|
@@ -83,16 +109,46 @@ export type TimeSeriesVectorQueryResponse = {
|
|
|
83
109
|
metric?: QueryTimeSeriesMetric
|
|
84
110
|
}
|
|
85
111
|
|
|
112
|
+
export type TaskStatsBoard = {
|
|
113
|
+
cluster?: string
|
|
114
|
+
namespace?: string
|
|
115
|
+
type?: BaizeManagement_apiJobV1alpha1Job.JobType
|
|
116
|
+
running?: number
|
|
117
|
+
pending?: number
|
|
118
|
+
failed?: number
|
|
119
|
+
total?: number
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export type TaskStatsBoardRequest = {
|
|
123
|
+
workspace?: number
|
|
124
|
+
page?: BaizeCommonCommon.Pagination
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type TaskStatsBoardResponse = {
|
|
128
|
+
items?: TaskStatsBoard[]
|
|
129
|
+
page?: BaizeCommonCommon.Pagination
|
|
130
|
+
}
|
|
131
|
+
|
|
86
132
|
export type QueryMultipleVectorRequest = {
|
|
87
133
|
queryMetrics?: QueryMetric[]
|
|
88
134
|
time?: string
|
|
89
135
|
cluster?: string
|
|
90
136
|
}
|
|
91
137
|
|
|
138
|
+
export type QueryDevDashboardMultipleVectorRequest = {
|
|
139
|
+
queryMetrics?: DevDashboardQueryMetric[]
|
|
140
|
+
time?: string
|
|
141
|
+
workspace?: number
|
|
142
|
+
}
|
|
143
|
+
|
|
92
144
|
export type MultipleVectorQueryResponse = {
|
|
93
145
|
items?: VectorQueryResponse[]
|
|
94
146
|
}
|
|
95
147
|
|
|
148
|
+
export type MultipleDevDashboardVectorQueryResponse = {
|
|
149
|
+
items?: VectorQueryResponse[]
|
|
150
|
+
}
|
|
151
|
+
|
|
96
152
|
export type QueryTimeSeriesVectorsRequest = {
|
|
97
153
|
queryMetrics?: QueryTimeSeriesMetric[]
|
|
98
154
|
queryMetricRange?: QueryTimeSeriesMetricRange
|
|
@@ -110,4 +166,10 @@ export class MetricsService {
|
|
|
110
166
|
static QueryTimeSeriesVectors(req: QueryTimeSeriesVectorsRequest, initReq?: fm.InitReq): Promise<QueryTimeSeriesVectorsResponse> {
|
|
111
167
|
return fm.fetchReq<QueryTimeSeriesVectorsRequest, QueryTimeSeriesVectorsResponse>(`/apis/baize.io/v1alpha1/metrics/time-series-queries?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
112
168
|
}
|
|
169
|
+
static QueryDevDashboardMultipleVectors(req: QueryDevDashboardMultipleVectorRequest, initReq?: fm.InitReq): Promise<DevDashboardVectorQueryResponse> {
|
|
170
|
+
return fm.fetchReq<QueryDevDashboardMultipleVectorRequest, DevDashboardVectorQueryResponse>(`/apis/baize.io/v1alpha1/metrics/dev-dashboard-multiple-queries?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
171
|
+
}
|
|
172
|
+
static QueryDevDashboardTaskStats(req: TaskStatsBoardRequest, initReq?: fm.InitReq): Promise<TaskStatsBoardResponse> {
|
|
173
|
+
return fm.fetchReq<TaskStatsBoardRequest, TaskStatsBoardResponse>(`/apis/baize.io/v1alpha1/metrics/dev-dashboard-task-stats?${fm.renderURLSearchParams(req, [])}`, {...initReq, method: "GET"})
|
|
174
|
+
}
|
|
113
175
|
}
|
|
@@ -43,6 +43,7 @@ export type ListNotebooksRequest = {
|
|
|
43
43
|
workspace?: number
|
|
44
44
|
cluster?: string
|
|
45
45
|
namespace?: string
|
|
46
|
+
queueName?: string
|
|
46
47
|
page?: BaizeCommonCommon.Pagination
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -84,6 +85,7 @@ export type Notebook = {
|
|
|
84
85
|
cluster?: string
|
|
85
86
|
namespace?: string
|
|
86
87
|
name?: string
|
|
88
|
+
queueName?: string
|
|
87
89
|
type?: NotebookType
|
|
88
90
|
config?: NotebookConfig
|
|
89
91
|
creationTimestamp?: GoogleProtobufTimestamp.Timestamp
|
|
@@ -107,10 +109,19 @@ export type CreateNotebookRequest = {
|
|
|
107
109
|
cluster?: string
|
|
108
110
|
namespace?: string
|
|
109
111
|
name?: string
|
|
112
|
+
queueName?: string
|
|
110
113
|
type?: NotebookType
|
|
111
114
|
config?: NotebookConfig
|
|
112
115
|
}
|
|
113
116
|
|
|
117
|
+
export type UpdateNotebookRequest = {
|
|
118
|
+
workspace?: number
|
|
119
|
+
cluster?: string
|
|
120
|
+
namespace?: string
|
|
121
|
+
name?: string
|
|
122
|
+
config?: NotebookConfig
|
|
123
|
+
}
|
|
124
|
+
|
|
114
125
|
export type NotebookActionRequest = {
|
|
115
126
|
workspace?: number
|
|
116
127
|
cluster?: string
|
|
@@ -134,7 +145,7 @@ export type NotebookImageListResponse = {
|
|
|
134
145
|
|
|
135
146
|
export class NotebookService {
|
|
136
147
|
static ListNotebooks(req: ListNotebooksRequest, initReq?: fm.InitReq): Promise<ListNotebooksResponse> {
|
|
137
|
-
return fm.fetchReq<ListNotebooksRequest, ListNotebooksResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/
|
|
148
|
+
return fm.fetchReq<ListNotebooksRequest, ListNotebooksResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/notebooks?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
|
|
138
149
|
}
|
|
139
150
|
static GetNotebook(req: SingleNotebookRequest, initReq?: fm.InitReq): Promise<Notebook> {
|
|
140
151
|
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"})
|
|
@@ -142,6 +153,9 @@ export class NotebookService {
|
|
|
142
153
|
static CreateNotebook(req: CreateNotebookRequest, initReq?: fm.InitReq): Promise<Notebook> {
|
|
143
154
|
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
155
|
}
|
|
156
|
+
static UpdateNotebook(req: UpdateNotebookRequest, initReq?: fm.InitReq): Promise<Notebook> {
|
|
157
|
+
return fm.fetchReq<UpdateNotebookRequest, Notebook>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/notebooks/${req["name"]}`, {...initReq, method: "PUT", body: JSON.stringify(req, fm.replacer)})
|
|
158
|
+
}
|
|
145
159
|
static NotebookDoAction(req: NotebookActionRequest, initReq?: fm.InitReq): Promise<Notebook> {
|
|
146
160
|
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)})
|
|
147
161
|
}
|
|
@@ -17,6 +17,12 @@ export enum QueuePhase {
|
|
|
17
17
|
READY = "READY",
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export enum QueueStrategy {
|
|
21
|
+
QUEUE_STRATEGY_UNSPECIFIED = "QUEUE_STRATEGY_UNSPECIFIED",
|
|
22
|
+
STRICT_FIFO = "STRICT_FIFO",
|
|
23
|
+
BEST_EFFORT_FIFO = "BEST_EFFORT_FIFO",
|
|
24
|
+
}
|
|
25
|
+
|
|
20
26
|
export type QueueResource = {
|
|
21
27
|
name?: string
|
|
22
28
|
value?: string
|
|
@@ -34,7 +40,9 @@ export type Queue = {
|
|
|
34
40
|
workspace?: number
|
|
35
41
|
description?: string
|
|
36
42
|
resources?: QueueResource[]
|
|
43
|
+
resourcesAvailable?: QueueResource[]
|
|
37
44
|
status?: QueueStatus
|
|
45
|
+
strategy?: QueueStrategy
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
export type ListQueueRequest = {
|
|
@@ -55,6 +63,7 @@ export type CreateQueueRequest = {
|
|
|
55
63
|
workspace?: number
|
|
56
64
|
description?: string
|
|
57
65
|
resources?: QueueResource[]
|
|
66
|
+
strategy?: QueueStrategy
|
|
58
67
|
}
|
|
59
68
|
|
|
60
69
|
export type DeleteQueueRequest = {
|
|
@@ -63,6 +72,36 @@ export type DeleteQueueRequest = {
|
|
|
63
72
|
name?: string
|
|
64
73
|
}
|
|
65
74
|
|
|
75
|
+
export type CheckQueueRequest = {
|
|
76
|
+
type?: QueueType
|
|
77
|
+
workspace?: number
|
|
78
|
+
cluster?: string
|
|
79
|
+
namespace?: string
|
|
80
|
+
name?: string
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type CheckQueueResponse = {
|
|
84
|
+
type?: QueueType
|
|
85
|
+
exist?: boolean
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type CreateLocalQueueRequest = {
|
|
89
|
+
type?: QueueType
|
|
90
|
+
workspace?: number
|
|
91
|
+
cluster?: string
|
|
92
|
+
namespace?: string
|
|
93
|
+
name?: string
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type CreateLocalQueueResponse = {
|
|
97
|
+
type?: QueueType
|
|
98
|
+
workspace?: number
|
|
99
|
+
cluster?: string
|
|
100
|
+
namespace?: string
|
|
101
|
+
name?: string
|
|
102
|
+
status?: QueueStatus
|
|
103
|
+
}
|
|
104
|
+
|
|
66
105
|
export class QueueManagement {
|
|
67
106
|
static ListQueues(req: ListQueueRequest, initReq?: fm.InitReq): Promise<ListQueueResponse> {
|
|
68
107
|
return fm.fetchReq<ListQueueRequest, ListQueueResponse>(`/apis/baize.io/v1alpha1/clusters/${req["cluster"]}/queues?${fm.renderURLSearchParams(req, ["cluster"])}`, {...initReq, method: "GET"})
|
|
@@ -73,4 +112,10 @@ export class QueueManagement {
|
|
|
73
112
|
static DeleteQueue(req: DeleteQueueRequest, initReq?: fm.InitReq): Promise<Queue> {
|
|
74
113
|
return fm.fetchReq<DeleteQueueRequest, Queue>(`/apis/baize.io/v1alpha1/clusters/${req["cluster"]}/queues/${req["name"]}`, {...initReq, method: "DELETE", body: JSON.stringify(req, fm.replacer)})
|
|
75
114
|
}
|
|
115
|
+
static CheckQueue(req: CheckQueueRequest, initReq?: fm.InitReq): Promise<CheckQueueResponse> {
|
|
116
|
+
return fm.fetchReq<CheckQueueRequest, CheckQueueResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/queues/${req["name"]}/capacites?${fm.renderURLSearchParams(req, ["workspace", "cluster", "name"])}`, {...initReq, method: "GET"})
|
|
117
|
+
}
|
|
118
|
+
static CreateLocalQueue(req: CreateLocalQueueRequest, initReq?: fm.InitReq): Promise<CreateLocalQueueResponse> {
|
|
119
|
+
return fm.fetchReq<CreateLocalQueueRequest, CreateLocalQueueResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/localqueues`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
|
|
120
|
+
}
|
|
76
121
|
}
|