@daocloud-proto/baize 0.104.3 → 0.105.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.
@@ -6,15 +6,6 @@
6
6
 
7
7
  import * as BaizeCommonK8s from "../../../common/k8s.pb"
8
8
 
9
- type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
10
- type OneOf<T> =
11
- | { [k in keyof T]?: undefined }
12
- | (
13
- keyof T extends infer K ?
14
- (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
15
- : never)
16
- : never);
17
-
18
9
  export enum QueueType {
19
10
  QUEUE_TYPE_UNSPECIFIED = "QUEUE_TYPE_UNSPECIFIED",
20
11
  KUEUE = "KUEUE",
@@ -35,28 +26,34 @@ export enum JobPhase {
35
26
  SUSPENDED = "SUSPENDED",
36
27
  }
37
28
 
29
+ export enum JobRole {
30
+ JOB_ROLE_UNSPECIFIED = "JOB_ROLE_UNSPECIFIED",
31
+ MASTER = "MASTER",
32
+ WORKER = "WORKER",
33
+ TF_CHIEF = "TF_CHIEF",
34
+ TF_PS = "TF_PS",
35
+ TF_WORKER = "TF_WORKER",
36
+ TF_EVALUATOR = "TF_EVALUATOR",
37
+ PD_MASTER = "PD_MASTER",
38
+ PD_WORKER = "PD_WORKER",
39
+ }
40
+
38
41
  export type CommonConfig = {
39
42
  queueType?: QueueType
40
43
  taskQueue?: string
41
44
  description?: string
42
45
  }
43
46
 
44
-
45
- /* baize modified */ export type BaseJobCreationBaseConfig = {
47
+ export type JobCreationBaseConfig = {
46
48
  image?: string
47
49
  imagePullSecret?: string
48
50
  command?: string[]
49
51
  args?: string[]
52
+ podConfig?: BaizeCommonK8s.PodConfig
50
53
  labels?: {[key: string]: string}
51
54
  annotations?: {[key: string]: string}
52
- kubeEnvs?: BaizeCommonK8s.KubeEnv[]
53
- kubeVolumes?: BaizeCommonK8s.KubeVolume[]
54
- affinity?: BaizeCommonK8s.Affinity
55
55
  }
56
56
 
57
- export type JobCreationBaseConfig = BaseJobCreationBaseConfig
58
- & OneOf<{ tolerationSeconds: string }>
59
-
60
57
  export type JobRoleDifferenceConfig = {
61
58
  replicas?: number
62
59
  resources?: BaizeCommonK8s.Resources
@@ -7,19 +7,10 @@
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 GoogleProtobufStruct from "../../../google/protobuf/struct.pb"
11
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
12
  import * as BaizeManagement_apiAnalysisV1alpha1Analysis from "../../analysis/v1alpha1/analysis.pb"
11
- import * as BaizeManagement_apiJobV1alpha1Paddle from "./paddle.pb"
12
- import * as BaizeManagement_apiJobV1alpha1Pytorch from "./pytorch.pb"
13
- import * as BaizeManagement_apiJobV1alpha1Tfjob from "./tfjob.pb"
14
-
15
- type Absent<T, K extends keyof T> = { [k in Exclude<keyof T, K>]?: undefined };
16
- type OneOf<T> =
17
- | { [k in keyof T]?: undefined }
18
- | (
19
- keyof T extends infer K ?
20
- (K extends string & keyof T ? { [k in K]: T[K] } & Absent<T, K>
21
- : never)
22
- : never);
13
+ import * as BaizeManagement_apiJobV1alpha1Common from "./common.pb"
23
14
 
24
15
  export enum JobType {
25
16
  JOB_TYPE_UNSPECIFIED = "JOB_TYPE_UNSPECIFIED",
@@ -33,21 +24,30 @@ export enum JobActionRequestAction {
33
24
  STOP = "STOP",
34
25
  }
35
26
 
27
+ export enum JobSchedulersResponseSchedulerFeature {
28
+ FEATURE_UNSPECIFIED = "FEATURE_UNSPECIFIED",
29
+ BINPACK = "BINPACK",
30
+ GANG = "GANG",
31
+ FAIR = "FAIR",
32
+ }
36
33
 
37
- /* baize modified */ export type BaseJob = {
34
+ export type Job = {
38
35
  type?: JobType
39
- queueName?: string
40
- priorityClass?: string
36
+ cluster?: string
37
+ namespace?: string
38
+ name?: string
39
+ trainingMode?: BaizeManagement_apiJobV1alpha1Common.TrainingMode
40
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
41
+ jobSpec?: GoogleProtobufStruct.Struct
42
+ description?: string
43
+ baseConfig?: BaizeManagement_apiJobV1alpha1Common.JobCreationBaseConfig
44
+ roleConfig?: {[key: string]: BaizeManagement_apiJobV1alpha1Common.JobRoleDifferenceConfig}
45
+ phase?: BaizeManagement_apiJobV1alpha1Common.JobPhase
41
46
  runningDuration?: number
42
47
  totalResources?: BaizeCommonK8s.Resources
43
- affinity?: BaizeCommonK8s.Affinity
44
48
  analysis?: BaizeManagement_apiAnalysisV1alpha1Analysis.AnalysisConfig
45
49
  }
46
50
 
47
- export type Job = BaseJob
48
- & OneOf<{ pytorch: BaizeManagement_apiJobV1alpha1Pytorch.PyTorchJob; tensorflow: BaizeManagement_apiJobV1alpha1Tfjob.TFJob; paddle: BaizeManagement_apiJobV1alpha1Paddle.PaddleJob }>
49
- & OneOf<{ tolerationSeconds: string }>
50
-
51
51
  export type ListJobsRequest = {
52
52
  workspace?: number
53
53
  type?: JobType
@@ -69,22 +69,19 @@ export type SingleJobRequest = {
69
69
  name?: string
70
70
  }
71
71
 
72
-
73
- /* baize modified */ export type BaseCreateJobRequest = {
72
+ export type CreateJobRequest = {
74
73
  workspace?: number
75
74
  type?: JobType
76
75
  cluster?: string
77
76
  namespace?: string
78
77
  name?: string
79
78
  description?: string
80
- queueName?: string
81
- priorityClass?: string
79
+ baseConfig?: BaizeManagement_apiJobV1alpha1Common.JobCreationBaseConfig
80
+ trainingMode?: BaizeManagement_apiJobV1alpha1Common.TrainingMode
81
+ roleConfig?: {[key: string]: BaizeManagement_apiJobV1alpha1Common.JobRoleDifferenceConfig}
82
82
  analysis?: BaizeManagement_apiAnalysisV1alpha1Analysis.AnalysisConfig
83
83
  }
84
84
 
85
- export type CreateJobRequest = BaseCreateJobRequest
86
- & OneOf<{ pytorch: BaizeManagement_apiJobV1alpha1Pytorch.PytorchJobCreationConfig; tensorflow: BaizeManagement_apiJobV1alpha1Tfjob.TFJobCreationConfig; paddle: BaizeManagement_apiJobV1alpha1Paddle.PaddleJobCreationConfig }>
87
-
88
85
  export type JobActionRequest = {
89
86
  workspace?: number
90
87
  type?: JobType
@@ -94,6 +91,17 @@ export type JobActionRequest = {
94
91
  action?: JobActionRequestAction
95
92
  }
96
93
 
94
+ export type JobSchedulersResponseScheduler = {
95
+ default?: boolean
96
+ name?: string
97
+ alias?: string
98
+ enabledFeatures?: JobSchedulersResponseSchedulerFeature[]
99
+ }
100
+
101
+ export type JobSchedulersResponse = {
102
+ items?: JobSchedulersResponseScheduler[]
103
+ }
104
+
97
105
  export class JobsManagement {
98
106
  static ListJobs(req: ListJobsRequest, initReq?: fm.InitReq): Promise<ListJobsResponse> {
99
107
  return fm.fetchReq<ListJobsRequest, ListJobsResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/jobs?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
@@ -110,4 +118,7 @@ export class JobsManagement {
110
118
  static DoJobAction(req: JobActionRequest, initReq?: fm.InitReq): Promise<Job> {
111
119
  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)})
112
120
  }
121
+ static ListSchedulers(req: CreateJobRequest, initReq?: fm.InitReq): Promise<JobSchedulersResponse> {
122
+ return fm.fetchReq<CreateJobRequest, JobSchedulersResponse>(`/apis/baize.io/v1alpha1/workspaces/${req["workspace"]}/clusters/${req["cluster"]}/namespaces/${req["namespace"]}/jobs/${req["name"]}/schedulers?${fm.renderURLSearchParams(req, ["workspace", "cluster", "namespace", "name"])}`, {...initReq, method: "GET"})
123
+ }
113
124
  }
@@ -57,6 +57,7 @@ export type NotebookConfig = {
57
57
  kubeVolumes?: BaizeCommonK8s.KubeVolume[]
58
58
  runAsRoot?: boolean
59
59
  serviceType?: NotebookConfigServiceType
60
+ enableSSH?: boolean
60
61
  }
61
62
 
62
63
  export type NotebookStatus = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/baize",
3
- "version": "v0.104.3",
3
+ "version": "v0.105.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"
@@ -1,34 +0,0 @@
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 PaddleRole {
12
- PADDLE_ROLE_UNSPECIFIED = "PADDLE_ROLE_UNSPECIFIED",
13
- PD_MASTER = "PD_MASTER",
14
- PD_WORKER = "PD_WORKER",
15
- }
16
-
17
- export type PaddleJob = {
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 PaddleJobCreationConfig = {
31
- trainingMode?: BaizeManagement_apiJobV1alpha1Common.TrainingMode
32
- baseConfig?: BaizeManagement_apiJobV1alpha1Common.JobCreationBaseConfig
33
- roleConfig?: {[key: string]: BaizeManagement_apiJobV1alpha1Common.JobRoleDifferenceConfig}
34
- }
@@ -1,34 +0,0 @@
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
- }
@@ -1,36 +0,0 @@
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
- }