intellif-aihub 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl
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.
Potentially problematic release.
This version of intellif-aihub might be problematic. Click here for more details.
- aihub/__init__.py +1 -1
- aihub/client.py +35 -12
- aihub/models/artifact.py +1 -1
- aihub/models/data_warehouse.py +95 -0
- aihub/models/dataset_management.py +99 -61
- aihub/models/document_center.py +26 -18
- aihub/models/eval.py +20 -11
- aihub/models/labelfree.py +12 -38
- aihub/models/model_center.py +141 -0
- aihub/models/model_training_platform.py +183 -149
- aihub/models/quota_schedule_management.py +201 -150
- aihub/models/tag_resource_management.py +30 -24
- aihub/models/task_center.py +39 -36
- aihub/models/user_system.py +159 -125
- aihub/models/workflow_center.py +461 -0
- aihub/services/artifact.py +22 -15
- aihub/services/data_warehouse.py +97 -0
- aihub/services/dataset_management.py +142 -23
- aihub/services/document_center.py +24 -5
- aihub/services/eval.py +14 -7
- aihub/services/labelfree.py +11 -0
- aihub/services/model_center.py +183 -0
- aihub/services/model_training_platform.py +99 -29
- aihub/services/quota_schedule_management.py +104 -7
- aihub/services/tag_resource_management.py +33 -2
- aihub/services/task_center.py +23 -9
- aihub/services/user_system.py +237 -2
- aihub/services/workflow_center.py +522 -0
- aihub/utils/download.py +19 -3
- {intellif_aihub-0.1.4.dist-info → intellif_aihub-0.1.6.dist-info}/METADATA +3 -3
- intellif_aihub-0.1.6.dist-info/RECORD +42 -0
- intellif_aihub-0.1.4.dist-info/RECORD +0 -36
- {intellif_aihub-0.1.4.dist-info → intellif_aihub-0.1.6.dist-info}/WHEEL +0 -0
- {intellif_aihub-0.1.4.dist-info → intellif_aihub-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {intellif_aihub-0.1.4.dist-info → intellif_aihub-0.1.6.dist-info}/top_level.txt +0 -0
|
@@ -1,239 +1,290 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from enum import IntEnum
|
|
3
4
|
from typing import List, Optional
|
|
4
5
|
|
|
5
6
|
from pydantic import BaseModel, Field
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
class Env(BaseModel):
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
"""环境变量"""
|
|
11
|
+
key: str = Field(description="变量名")
|
|
12
|
+
value: str = Field(description="变量值")
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
class Sku(BaseModel):
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
"""sku"""
|
|
17
|
+
cpu: int = Field(description="CPU数")
|
|
18
|
+
gpu: int = Field(description="GPU数")
|
|
19
|
+
memory: int = Field(description="内存GiB")
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
class VirtualCluster(BaseModel):
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
"""虚拟集群"""
|
|
24
|
+
id: int = Field(description="ID")
|
|
25
|
+
name: str = Field(description="名称")
|
|
26
|
+
gpu_type: str = Field(alias="gpu_type", description="GPU类型,A800/4090/3090/2080")
|
|
27
|
+
label: str = Field(description="标签")
|
|
28
|
+
sku: Sku = Field(description="SKU")
|
|
25
29
|
|
|
26
30
|
|
|
27
31
|
class Storage(BaseModel):
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
"""存储"""
|
|
33
|
+
id: int = Field(description="存储ID")
|
|
34
|
+
name: str = Field(description="存储名称")
|
|
35
|
+
path: str = Field(description="挂载路径")
|
|
36
|
+
server_path: str = Field(alias="server_path", description="服务器路径")
|
|
37
|
+
server_host: str = Field(alias="server_host", description="服务器地址")
|
|
38
|
+
server_type: str = Field(alias="server_type", description="服务器类型")
|
|
39
|
+
permission: str = Field(description="权限")
|
|
40
|
+
description: str = Field(description="说明")
|
|
36
41
|
|
|
37
42
|
|
|
38
43
|
class Category(BaseModel):
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
"""分类"""
|
|
45
|
+
id: int = Field(description="分类ID")
|
|
46
|
+
name: str = Field(description="分类名称")
|
|
41
47
|
|
|
42
48
|
|
|
43
49
|
class Project(BaseModel):
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
"""项目"""
|
|
51
|
+
id: int = Field(description="项目ID")
|
|
52
|
+
name: str = Field(description="项目名称")
|
|
53
|
+
description: str = Field(description="项目描述")
|
|
47
54
|
|
|
48
55
|
|
|
49
56
|
class User(BaseModel):
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
"""用户"""
|
|
58
|
+
id: int = Field(description="用户ID")
|
|
59
|
+
name: str = Field(description="用户名")
|
|
52
60
|
|
|
53
61
|
|
|
54
62
|
class SourceTask(BaseModel):
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
"""来源任务"""
|
|
64
|
+
id: int = Field(description="来源任务ID")
|
|
65
|
+
name: str = Field(description="来源任务名称")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class TaskStatus(IntEnum):
|
|
69
|
+
"""任务状态"""
|
|
70
|
+
Waiting = 1
|
|
71
|
+
Running = 2
|
|
72
|
+
Success = 3
|
|
73
|
+
Failed = 4
|
|
74
|
+
Stopped = 5
|
|
75
|
+
Stopping = 6
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class PreemptPolicy(IntEnum):
|
|
79
|
+
"""抢占策略"""
|
|
80
|
+
WAIT = 1 # 等待任务完成
|
|
81
|
+
STOP = 2 # 停止任务
|
|
57
82
|
|
|
58
83
|
|
|
59
84
|
class CreateTaskRequest(BaseModel):
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
"""创建配额任务请求"""
|
|
86
|
+
priority: int = Field(description="优先级,1-低优先级,2-高优先级")
|
|
87
|
+
framework: str = Field(description="训练框架,如PyTorchJob/MpiJobMpiRun/MpiJobDeepspeed")
|
|
88
|
+
name: str = Field(description="任务名称")
|
|
89
|
+
description: Optional[str] = Field(None, description="任务描述")
|
|
90
|
+
command: Optional[str] = Field(None, description="命令")
|
|
91
|
+
image: str = Field(description="镜像")
|
|
92
|
+
virtual_cluster_id: int = Field(alias="virtual_cluster_id", description="虚拟集群ID")
|
|
93
|
+
sku_cnt: int = Field(alias="sku_cnt", description="sku数量")
|
|
94
|
+
enable_ssh: Optional[bool] = Field(False, alias="enable_ssh", description="SSH开启")
|
|
95
|
+
envs: Optional[List[Env]] = Field(default_factory=list, description="环境变量")
|
|
96
|
+
storage_ids: Optional[List[int]] = Field(default_factory=list, alias="storage_ids", description="挂载存储")
|
|
97
|
+
instances: int = Field(description="实例数")
|
|
98
|
+
use_ib_network: Optional[bool] = Field(False, alias="use_ib_network", description="是否使用IB网络")
|
|
99
|
+
always_pull_image: Optional[bool] = Field(False, alias="always_pull_image", description="每次拉镜像")
|
|
100
|
+
shm: Optional[int] = Field(None, description="共享内存MB")
|
|
101
|
+
category_id: int = Field(alias="category_id", description="分类ID")
|
|
102
|
+
project_id: int = Field(alias="project_id", description="项目ID")
|
|
103
|
+
estimate_run_time: Optional[int] = Field(None, alias="estimate_run_time", description="预计运行时长(s)")
|
|
104
|
+
is_vip: Optional[bool] = Field(False, alias="is_vip", description="是否VIP")
|
|
105
|
+
preempt_policy: Optional[PreemptPolicy] = Field(None, alias="preempt_policy", description="抢占策略")
|
|
106
|
+
vip_node_names: Optional[List[str]] = Field(default_factory=list, alias="vip_node_names", description="VIP节点名字")
|
|
107
|
+
enable_reschedule: Optional[bool] = Field(False, alias="enable_reschedule", description="启用失败重调度")
|
|
108
|
+
|
|
109
|
+
model_config = {"use_enum_values": True}
|
|
82
110
|
|
|
83
111
|
|
|
84
112
|
class CreateTaskResponse(BaseModel):
|
|
85
|
-
|
|
113
|
+
"""创建配额任务返回"""
|
|
114
|
+
id: int = Field(description="任务ID")
|
|
86
115
|
|
|
87
116
|
|
|
88
117
|
class Task(BaseModel):
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
"""配额任务详情"""
|
|
119
|
+
id: int = Field(description="任务ID")
|
|
120
|
+
priority: int = Field(description="优先级,1-低优先级,2-高优先级")
|
|
121
|
+
mtp_id: int = Field(alias="mtp_id", description="训练平台关联ID")
|
|
122
|
+
framework: str = Field(description="框架")
|
|
123
|
+
name: str = Field(description="名称")
|
|
124
|
+
description: str = Field(description="描述")
|
|
125
|
+
command: str = Field(description="命令")
|
|
126
|
+
image: str = Field(description="镜像")
|
|
127
|
+
virtual_cluster: VirtualCluster = Field(alias="virtual_cluster", description="虚拟集群")
|
|
128
|
+
sku_cnt: int = Field(alias="sku_cnt", description="sku数量")
|
|
129
|
+
enable_ssh: bool = Field(alias="enable_ssh", description="SSH开启")
|
|
130
|
+
envs: Optional[List[Env]] = Field(default_factory=list, description="环境变量")
|
|
131
|
+
storages: Optional[List[Storage]] = Field(default_factory=list, description="挂载存储")
|
|
132
|
+
instances: int = Field(description="实例数")
|
|
133
|
+
created_at: int = Field(alias="created_at", description="创建时间")
|
|
134
|
+
username: str = Field(description="提交人")
|
|
135
|
+
user_id: int = Field(alias="user_id", description="提交人ID")
|
|
136
|
+
namespace: str = Field(description="K8s Namespace")
|
|
137
|
+
res_name: str = Field(alias="res_name", description="K8s 资源名")
|
|
138
|
+
status: TaskStatus = Field(description="状态")
|
|
139
|
+
use_ib_network: bool = Field(alias="use_ib_network", description="IB网络")
|
|
140
|
+
always_pull_image: bool = Field(alias="always_pull_image", description="每次拉镜像")
|
|
141
|
+
shm: int = Field(description="共享内存MB")
|
|
142
|
+
category: Category = Field(description="分类")
|
|
143
|
+
project: Project = Field(description="项目")
|
|
144
|
+
avg_gpu_util: float = Field(alias="avg_gpu_util", description="平均GPU利用率")
|
|
145
|
+
finished_at: int = Field(alias="finished_at", description="结束时间")
|
|
146
|
+
started_at: int = Field(alias="started_at", description="开始时间")
|
|
147
|
+
estimate_run_time: int = Field(alias="estimate_run_time", description="预计运行时长")
|
|
148
|
+
is_vip: bool = Field(alias="is_vip", description="是否vip")
|
|
149
|
+
cluster_partition: str = Field(alias="cluster_partition", description="集群分区")
|
|
150
|
+
preempt_policy: PreemptPolicy = Field(alias="preempt_policy", description="抢占策略")
|
|
151
|
+
vip_node_names: Optional[List[str]] = Field(None, alias="vip_node_names", description="VIP节点")
|
|
152
|
+
stop_op_user: Optional[User] = Field(None, alias="stop_op_user", description="停止操作人")
|
|
153
|
+
use_new_log: bool = Field(alias="use_new_log", description="新版日志")
|
|
154
|
+
is_quota_schedule: bool = Field(alias="is_quota_schedule", description="是否配额调度")
|
|
155
|
+
enable_reschedule: bool = Field(alias="enable_reschedule", description="允许重调度")
|
|
156
|
+
remain_schedule_cnt: int = Field(alias="remain_schedule_cnt", description="剩余可调度次数")
|
|
157
|
+
source_task: Optional[SourceTask] = Field(None, alias="source_task", description="来源任务")
|
|
158
|
+
|
|
159
|
+
model_config = {"use_enum_values": True}
|
|
128
160
|
|
|
129
161
|
|
|
130
162
|
class ListTasksRequest(BaseModel):
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
163
|
+
"""查询任务列表请求"""
|
|
164
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
165
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
166
|
+
user_id: Optional[int] = Field(None, alias="user_id", description="用户过滤")
|
|
167
|
+
name: Optional[str] = Field(None, description="名称过滤")
|
|
168
|
+
virtual_cluster_id: Optional[int] = Field(None, alias="virtual_cluster_id", description="虚拟集群过滤")
|
|
169
|
+
status: Optional[TaskStatus] = Field(None, description="状态过滤")
|
|
170
|
+
category_id: Optional[int] = Field(None, alias="category_id", description="分类过滤")
|
|
171
|
+
project_id: Optional[int] = Field(None, alias="project_id", description="项目过滤")
|
|
172
|
+
priority: Optional[int] = Field(None, description="优先级过滤")
|
|
173
|
+
|
|
174
|
+
model_config = {"use_enum_values": True}
|
|
140
175
|
|
|
141
176
|
|
|
142
177
|
class ListTasksResponse(BaseModel):
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
178
|
+
"""查询任务列表返回"""
|
|
179
|
+
total: int = Field(description="总条数")
|
|
180
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
181
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
182
|
+
data: List[Task] = Field(default_factory=list, description="任务列表")
|
|
147
183
|
|
|
148
184
|
|
|
149
185
|
class Pod(BaseModel):
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
186
|
+
"""任务Pod"""
|
|
187
|
+
id: int = Field(description="ID")
|
|
188
|
+
namespace: str = Field(description="Namespace")
|
|
189
|
+
name: str = Field(description="名称")
|
|
190
|
+
status: str = Field(description="状态")
|
|
191
|
+
created_at: int = Field(alias="created_at", description="创建时间")
|
|
192
|
+
started_at: int = Field(alias="started_at", description="启动时间")
|
|
193
|
+
finished_at: int = Field(alias="finished_at", description="结束时间")
|
|
194
|
+
host_ip: str = Field(alias="host_ip", description="宿主机IP")
|
|
195
|
+
node_name: str = Field(alias="node_name", description="节点名")
|
|
196
|
+
ssh_port: int = Field(alias="ssh_port", description="SSH端口")
|
|
197
|
+
ssh_info: str = Field(alias="ssh_info", description="SSH连接信息")
|
|
198
|
+
use_new_log: bool = Field(alias="use_new_log", description="是否使用新版日志")
|
|
162
199
|
|
|
163
200
|
|
|
164
201
|
class ListTaskPodsRequest(BaseModel):
|
|
165
|
-
|
|
166
|
-
|
|
202
|
+
"""查询任务Pod列表请求"""
|
|
203
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
204
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
167
205
|
|
|
168
206
|
|
|
169
207
|
class ListTaskPodsResponse(BaseModel):
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
208
|
+
"""查询任务Pod列表返回"""
|
|
209
|
+
total: int = Field(description="总条数")
|
|
210
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
211
|
+
page_num: int = Field(alias="page_num", description="页码")
|
|
212
|
+
data: List[Pod] = Field(default_factory=list, description="Pod 列表")
|
|
174
213
|
|
|
175
214
|
|
|
176
215
|
class PodLogInfo(BaseModel):
|
|
177
|
-
|
|
178
|
-
|
|
216
|
+
"""pod日志信息"""
|
|
217
|
+
name: str = Field(description="日志名称")
|
|
218
|
+
url: str = Field(description="URL")
|
|
179
219
|
|
|
180
220
|
|
|
181
221
|
class GetTaskPodLogsNewResponse(BaseModel):
|
|
182
|
-
|
|
222
|
+
"""查询任务Pod日志返回"""
|
|
223
|
+
logs: List[PodLogInfo] = Field(description="日志列表")
|
|
183
224
|
|
|
184
225
|
|
|
185
226
|
class GetTaskPodSpecResponse(BaseModel):
|
|
186
|
-
|
|
227
|
+
"""查询任务Pod Spec返回"""
|
|
228
|
+
spec: str = Field(description="Pod YAML Spec")
|
|
187
229
|
|
|
188
230
|
|
|
189
231
|
class GetTaskPodEventsResponse(BaseModel):
|
|
190
|
-
|
|
232
|
+
"""查询任务Pod Event返回"""
|
|
233
|
+
events: str = Field(description="事件内容")
|
|
191
234
|
|
|
192
235
|
|
|
193
236
|
class MachineOverview(BaseModel):
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
237
|
+
"""机器概况"""
|
|
238
|
+
high: int = Field(description="高优先级")
|
|
239
|
+
low: int = Field(description="低优先级")
|
|
240
|
+
free: int = Field(description="空闲")
|
|
197
241
|
|
|
198
242
|
|
|
199
243
|
class HighPrioritySummary(BaseModel):
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
244
|
+
"""高优先级概况"""
|
|
245
|
+
group_id: int = Field(alias="group_id", description="组ID")
|
|
246
|
+
group_name: str = Field(alias="group_name", description="组名称")
|
|
247
|
+
used: int = Field(description="已用GPU")
|
|
248
|
+
total: int = Field(description="总GPU")
|
|
204
249
|
|
|
205
250
|
|
|
206
251
|
class MetricsOverview(BaseModel):
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
252
|
+
"""指标概况"""
|
|
253
|
+
vc_id: int = Field(alias="vc_id", description="虚拟集群ID")
|
|
254
|
+
vc_name: str = Field(alias="vc_name", description="虚拟集群名称")
|
|
255
|
+
machine: MachineOverview = Field(description="机器概览")
|
|
256
|
+
high_priority: List[HighPrioritySummary] = Field(alias="high_priority", description="高优先级概览")
|
|
211
257
|
|
|
212
258
|
|
|
213
259
|
class GetMetricsOverviewRequest(BaseModel):
|
|
214
|
-
|
|
215
|
-
|
|
260
|
+
"""查询指标概况请求"""
|
|
261
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
262
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
216
263
|
|
|
217
264
|
|
|
218
265
|
class GetMetricsOverviewResponse(BaseModel):
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
266
|
+
"""查询指标概况返回"""
|
|
267
|
+
total: int = Field(description="总条数")
|
|
268
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
269
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
270
|
+
data: List[MetricsOverview] = Field(default_factory=list, description="指标列表")
|
|
223
271
|
|
|
224
272
|
|
|
225
273
|
class TaskUser(BaseModel):
|
|
226
|
-
|
|
227
|
-
|
|
274
|
+
"""任务用户"""
|
|
275
|
+
user_id: int = Field(alias="user_id", description="用户ID")
|
|
276
|
+
username: str = Field(description="用户名")
|
|
228
277
|
|
|
229
278
|
|
|
230
279
|
class ListTaskUsersRequest(BaseModel):
|
|
231
|
-
|
|
232
|
-
|
|
280
|
+
"""查询任务用户列表请求"""
|
|
281
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
282
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
233
283
|
|
|
234
284
|
|
|
235
285
|
class ListTaskUsersResponse(BaseModel):
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
286
|
+
"""查询任务用户列表返回"""
|
|
287
|
+
total: int = Field(description="总条数")
|
|
288
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
289
|
+
page_num: int = Field(alias="page_num", description="页码")
|
|
290
|
+
data: List[TaskUser] = Field(default_factory=list, description="用户列表")
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
# !/usr/bin/env python
|
|
2
|
-
# -*-coding:utf-8 -*-
|
|
3
|
-
|
|
4
1
|
from __future__ import annotations
|
|
5
2
|
|
|
6
3
|
from typing import List, Optional
|
|
@@ -9,42 +6,51 @@ from pydantic import BaseModel, Field
|
|
|
9
6
|
|
|
10
7
|
|
|
11
8
|
class Project(BaseModel):
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
"""项目"""
|
|
10
|
+
id: int = Field(description="项目ID")
|
|
11
|
+
name: str = Field(description="项目名称")
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
class ProjectListData(BaseModel):
|
|
17
|
-
|
|
15
|
+
"""项目列表数据"""
|
|
16
|
+
data: List[Project] = Field(description="项目列表")
|
|
18
17
|
|
|
19
18
|
|
|
20
19
|
class SelectProjectsResponse(BaseModel):
|
|
21
|
-
|
|
20
|
+
"""选择项目返回"""
|
|
21
|
+
data: List[Project] = Field(description="项目列表")
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class SkuBrief(BaseModel):
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
"""SKU信息"""
|
|
26
|
+
id: int = Field(description="SKU ID")
|
|
27
|
+
description: str = Field(description="SKU 描述")
|
|
28
|
+
cpu: int = Field(description="CPU 核数")
|
|
29
|
+
memory: int = Field(description="内存 GiB")
|
|
30
|
+
gpu_type: int = Field(alias="gpu_type", description="GPU类型,1-A800,2-4090,3-3090,4-2080,5-None")
|
|
31
|
+
gpu_memory: int = Field(alias="gpu_memory", description="GPU 显存 GiB")
|
|
32
|
+
network: int = Field(description="网络,0-Other,1-ROCE,2-IB")
|
|
33
|
+
created_at: int = Field(alias="created_at", description="创建时间戳(ms)")
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
class VirtualClusterBrief(BaseModel):
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
"""虚拟集群信息"""
|
|
38
|
+
id: int = Field(description="虚拟集群ID")
|
|
39
|
+
name: str = Field(description="虚拟集群名称")
|
|
40
|
+
uuid: str = Field(description="虚拟集群UUID")
|
|
41
|
+
sku: Optional[SkuBrief] = Field(None, description="SKU")
|
|
42
|
+
created_at: int = Field(alias="created_at", description="创建时间戳(ms)")
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
class SelectVirtualClustersRequest(BaseModel):
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
"""选择虚拟集群请求"""
|
|
47
|
+
user_id: int = Field(alias="user_id", description="用户ID")
|
|
48
|
+
module_type: Optional[int] = Field(None, alias="module_type",
|
|
49
|
+
description="模块类型 (int),0-部署,1-训练,2-工作流,3-配额调度")
|
|
50
|
+
new_module_type: Optional[str] = Field(None, alias="new_module_type",
|
|
51
|
+
description="新版模块类型 (字符串),仅前端使用")
|
|
47
52
|
|
|
48
53
|
|
|
49
54
|
class SelectVirtualClustersResponse(BaseModel):
|
|
50
|
-
|
|
55
|
+
"""选择虚拟集群返回"""
|
|
56
|
+
data: Optional[List[VirtualClusterBrief]] = Field(default_factory=list, description="虚拟集群列表")
|