@daocloud-proto/hydra 0.0.0-dev-88ed8f0b → 0.0.0-dev-1afd0f75

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.
@@ -7,8 +7,23 @@
7
7
  import * as HydraCommonCommon from "../../../common/common.pb"
8
8
  import * as fm from "../../../fetch.pb"
9
9
  import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
10
- import * as HydraManagement_apiCoreV1alpha1Permissions from "../../../management-api/core/v1alpha1/permissions.pb"
11
10
  import * as HydraManagement_apiWorkspaceV1alpha1Workspace from "../../../management-api/workspace/v1alpha1/workspace.pb"
11
+
12
+ export enum AdminPermission {
13
+ MODEL_GET = "MODEL_GET",
14
+ MODEL_CREATE = "MODEL_CREATE",
15
+ MODEL_UPDATE = "MODEL_UPDATE",
16
+ MODEL_DELETE = "MODEL_DELETE",
17
+ MAAS_MODEL_GET = "MAAS_MODEL_GET",
18
+ MAAS_MODEL_CREATE = "MAAS_MODEL_CREATE",
19
+ MAAS_MODEL_UPDATE = "MAAS_MODEL_UPDATE",
20
+ CLUSTER_GET = "CLUSTER_GET",
21
+ FILES_STORAGE_GET = "FILES_STORAGE_GET",
22
+ FILES_STORAGE_CREATE = "FILES_STORAGE_CREATE",
23
+ FILES_STORAGE_UPDATE = "FILES_STORAGE_UPDATE",
24
+ FILES_STORAGE_DELETE = "FILES_STORAGE_DELETE",
25
+ }
26
+
12
27
  export type ListClusterRequest = {
13
28
  page?: HydraCommonCommon.Pagination
14
29
  }
@@ -24,7 +39,7 @@ export type ConstantsResponse = {
24
39
  }
25
40
 
26
41
  export type ListPlatformRolePermissionsForCurrentUserResponse = {
27
- permissions?: HydraManagement_apiCoreV1alpha1Permissions.Permission[]
42
+ permissions?: AdminPermission[]
28
43
  }
29
44
 
30
45
  export class CoreService {
@@ -9,6 +9,15 @@ import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
9
9
  import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
10
10
  import * as HydraManagement_apiApikeyV1alpha1Apikey from "../../apikey/v1alpha1/apikey.pb"
11
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
+
12
21
  export enum APIKeyEventType {
13
22
  UNKNOWN = "UNKNOWN",
14
23
  DELETE = "DELETE",
@@ -63,6 +72,33 @@ export type UsageReportResponse = {
63
72
  accepted?: boolean
64
73
  }
65
74
 
75
+
76
+ /* hydra modified */ export type BaseMetricPoint = {
77
+ currentSteps?: number
78
+ totalSteps?: number
79
+ }
80
+
81
+ export type MetricPoint = BaseMetricPoint
82
+ & OneOf<{ loss: number }>
83
+ & OneOf<{ evalLoss: number }>
84
+ & OneOf<{ predictLoss: number }>
85
+ & OneOf<{ reward: number }>
86
+ & OneOf<{ accuracy: number }>
87
+ & OneOf<{ lr: number }>
88
+ & OneOf<{ epoch: number }>
89
+ & OneOf<{ percentage: number }>
90
+ & OneOf<{ elapsedTime: string }>
91
+ & OneOf<{ remainingTime: string }>
92
+
93
+ export type ReportFineTuneMetricsRequest = {
94
+ jobId?: string
95
+ metric?: MetricPoint
96
+ }
97
+
98
+ export type ReportFineTuneMetricsResponse = {
99
+ accepted?: boolean
100
+ }
101
+
66
102
  export class AgentCommunicationService {
67
103
  static FetchAPIKeyByKey(req: FetchAPIKeyRequest, initReq?: fm.InitReq): Promise<HydraManagement_apiApikeyV1alpha1Apikey.APIKey> {
68
104
  return fm.fetchReq<FetchAPIKeyRequest, HydraManagement_apiApikeyV1alpha1Apikey.APIKey>(`/hydra.management_api.agent.v1alpha1.AgentCommunicationService/FetchAPIKeyByKey`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
@@ -73,4 +109,7 @@ export class AgentCommunicationService {
73
109
  static UsageReport(req: UsageReportRequest, initReq?: fm.InitReq): Promise<UsageReportResponse> {
74
110
  return fm.fetchReq<UsageReportRequest, UsageReportResponse>(`/hydra.management_api.agent.v1alpha1.AgentCommunicationService/UsageReport`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
75
111
  }
112
+ static ReportFineTuneMetrics(req: ReportFineTuneMetricsRequest, initReq?: fm.InitReq): Promise<ReportFineTuneMetricsResponse> {
113
+ return fm.fetchReq<ReportFineTuneMetricsRequest, ReportFineTuneMetricsResponse>(`/apis/hydra.io/v1alpha1/agent/fine-tune-metrics:report`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
114
+ }
76
115
  }
@@ -6,14 +6,11 @@
6
6
 
7
7
  import * as fm from "../../../fetch.pb"
8
8
 
9
- export enum Permission {
9
+ export enum UserPermission {
10
10
  MODEL_GET = "MODEL_GET",
11
11
  MODEL_CREATE = "MODEL_CREATE",
12
12
  MODEL_UPDATE = "MODEL_UPDATE",
13
13
  MODEL_DELETE = "MODEL_DELETE",
14
- MAAS_MODEL_GET = "MAAS_MODEL_GET",
15
- MAAS_MODEL_CREATE = "MAAS_MODEL_CREATE",
16
- MAAS_MODEL_UPDATE = "MAAS_MODEL_UPDATE",
17
14
  MODEL_SERVING_GET = "MODEL_SERVING_GET",
18
15
  MODEL_SERVING_CREATE = "MODEL_SERVING_CREATE",
19
16
  MODEL_SERVING_UPDATE = "MODEL_SERVING_UPDATE",
@@ -30,7 +27,14 @@ export enum Permission {
30
27
  QUEUE_CREATE = "QUEUE_CREATE",
31
28
  QUEUE_UPDATE = "QUEUE_UPDATE",
32
29
  QUEUE_DELETE = "QUEUE_DELETE",
33
- ALL = "ALL",
30
+ DATASET_GET = "DATASET_GET",
31
+ DATASET_CREATE = "DATASET_CREATE",
32
+ DATASET_UPDATE = "DATASET_UPDATE",
33
+ DATASET_DELETE = "DATASET_DELETE",
34
+ FINETUNE_GET = "FINETUNE_GET",
35
+ FINETUNE_CREATE = "FINETUNE_CREATE",
36
+ FINETUNE_UPDATE = "FINETUNE_UPDATE",
37
+ FINETUNE_DELETE = "FINETUNE_DELETE",
34
38
  }
35
39
 
36
40
  export type ListRolePermissionsByWorkspaceForCurrentUserRequest = {
@@ -38,7 +42,7 @@ export type ListRolePermissionsByWorkspaceForCurrentUserRequest = {
38
42
  }
39
43
 
40
44
  export type ListRolePermissionsByWorkspaceForCurrentUserResponse = {
41
- permissions?: Permission[]
45
+ permissions?: UserPermission[]
42
46
  }
43
47
 
44
48
  export class Core {
@@ -0,0 +1,14 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ /*
4
+ * This file is a generated Typescript file for GRPC Gateway, DO NOT MODIFY
5
+ */
6
+
7
+ export enum JobStatus {
8
+ UNKNOWN = "UNKNOWN",
9
+ PENDING = "PENDING",
10
+ RUNNING = "RUNNING",
11
+ COMPLETED = "COMPLETED",
12
+ FAILED = "FAILED",
13
+ DELETING = "DELETING",
14
+ }
@@ -0,0 +1,100 @@
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 HydraCommonCommon from "../../../common/common.pb"
8
+ import * as fm from "../../../fetch.pb"
9
+ import * as GoogleProtobufEmpty from "../../../google/protobuf/empty.pb"
10
+ import * as GoogleProtobufStruct from "../../../google/protobuf/struct.pb"
11
+ import * as GoogleProtobufTimestamp from "../../../google/protobuf/timestamp.pb"
12
+ import * as HydraManagement_apiFinetuneV1alpha1Common from "./common.pb"
13
+ import * as HydraManagement_apiFinetuneV1alpha1Finetuneconfig from "./finetuneconfig.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);
23
+
24
+ /* hydra modified */ export type BaseMetricPoint = {
25
+ currentSteps?: number
26
+ totalSteps?: number
27
+ }
28
+
29
+ export type MetricPoint = BaseMetricPoint
30
+ & OneOf<{ loss: number }>
31
+ & OneOf<{ evalLoss: number }>
32
+ & OneOf<{ predictLoss: number }>
33
+ & OneOf<{ reward: number }>
34
+ & OneOf<{ accuracy: number }>
35
+ & OneOf<{ lr: number }>
36
+ & OneOf<{ epoch: number }>
37
+ & OneOf<{ percentage: number }>
38
+ & OneOf<{ elapsedTime: string }>
39
+ & OneOf<{ remainingTime: string }>
40
+
41
+ export type FineTuneJob = {
42
+ id?: string
43
+ name?: string
44
+ configName?: string
45
+ status?: HydraManagement_apiFinetuneV1alpha1Common.JobStatus
46
+ cluster?: string
47
+ namespace?: string
48
+ storageSpec?: GoogleProtobufStruct.Struct
49
+ runtimeType?: string
50
+ resourceConfig?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
51
+ creationTimestamp?: GoogleProtobufTimestamp.Timestamp
52
+ completionTimestamp?: GoogleProtobufTimestamp.Timestamp
53
+ metrics?: MetricPoint[]
54
+ }
55
+
56
+ export type CreateWSFineTuneJobRequest = {
57
+ workspace?: number
58
+ namespace?: string
59
+ name?: string
60
+ configName?: string
61
+ runtimeType?: string
62
+ resourceConfig?: HydraManagement_apiFinetuneV1alpha1Finetuneconfig.ResourceConfig
63
+ }
64
+
65
+ export type GetWSFineTuneJobRequest = {
66
+ workspace?: number
67
+ id?: string
68
+ }
69
+
70
+ export type ListWSFineTuneJobsRequest = {
71
+ workspace?: number
72
+ cluster?: string
73
+ namespace?: string
74
+ page?: HydraCommonCommon.Pagination
75
+ }
76
+
77
+ export type ListWSFineTuneJobsResponse = {
78
+ items?: FineTuneJob[]
79
+ page?: HydraCommonCommon.Pagination
80
+ }
81
+
82
+ export type DeleteWSFineTuneJobRequest = {
83
+ workspace?: number
84
+ id?: string
85
+ }
86
+
87
+ export class WSFineTuneJobManagement {
88
+ static CreateWSFineTuneJob(req: CreateWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<FineTuneJob> {
89
+ return fm.fetchReq<CreateWSFineTuneJobRequest, FineTuneJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs`, {...initReq, method: "POST", body: JSON.stringify(req, fm.replacer)})
90
+ }
91
+ static GetWSFineTuneJob(req: GetWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<FineTuneJob> {
92
+ return fm.fetchReq<GetWSFineTuneJobRequest, FineTuneJob>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs/${req["id"]}?${fm.renderURLSearchParams(req, ["workspace", "id"])}`, {...initReq, method: "GET"})
93
+ }
94
+ static ListWSFineTuneJobs(req: ListWSFineTuneJobsRequest, initReq?: fm.InitReq): Promise<ListWSFineTuneJobsResponse> {
95
+ return fm.fetchReq<ListWSFineTuneJobsRequest, ListWSFineTuneJobsResponse>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs?${fm.renderURLSearchParams(req, ["workspace"])}`, {...initReq, method: "GET"})
96
+ }
97
+ static DeleteWSFineTuneJob(req: DeleteWSFineTuneJobRequest, initReq?: fm.InitReq): Promise<GoogleProtobufEmpty.Empty> {
98
+ return fm.fetchReq<DeleteWSFineTuneJobRequest, GoogleProtobufEmpty.Empty>(`/apis/hydra.io/v1alpha1/workspaces/${req["workspace"]}/finetune/jobs/${req["id"]}`, {...initReq, method: "DELETE"})
99
+ }
100
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daocloud-proto/hydra",
3
- "version": "v0.0.0-dev-88ed8f0b",
3
+ "version": "v0.0.0-dev-1afd0f75",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC"