intellif-aihub 0.1.5__py3-none-any.whl → 0.1.7__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/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 +182 -149
- aihub/models/quota_schedule_management.py +196 -150
- aihub/models/tag_resource_management.py +30 -24
- aihub/models/task_center.py +43 -38
- 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 +132 -59
- 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.5.dist-info → intellif_aihub-0.1.7.dist-info}/METADATA +4 -4
- intellif_aihub-0.1.7.dist-info/RECORD +42 -0
- intellif_aihub-0.1.5.dist-info/RECORD +0 -36
- {intellif_aihub-0.1.5.dist-info → intellif_aihub-0.1.7.dist-info}/WHEEL +0 -0
- {intellif_aihub-0.1.5.dist-info → intellif_aihub-0.1.7.dist-info}/licenses/LICENSE +0 -0
- {intellif_aihub-0.1.5.dist-info → intellif_aihub-0.1.7.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from enum import IntEnum
|
|
4
|
+
from typing import List, Optional
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, Field
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class User(BaseModel):
|
|
10
|
+
"""用户"""
|
|
11
|
+
id: int = Field(description="用户ID")
|
|
12
|
+
name: str = Field(description="用户名")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ModelType(BaseModel):
|
|
16
|
+
"""模型类型"""
|
|
17
|
+
id: int = Field(description="类型ID")
|
|
18
|
+
name: str = Field(description="类型名称")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class DeployPlatform(BaseModel):
|
|
22
|
+
"""部署平台"""
|
|
23
|
+
id: int = Field(description="部署平台ID")
|
|
24
|
+
name: str = Field(description="部署平台名称")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class QuantLevel(BaseModel):
|
|
28
|
+
"""量化等级"""
|
|
29
|
+
id: int = Field(description="量化等级ID")
|
|
30
|
+
name: str = Field(description="量化等级名称")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ModelStatus(IntEnum):
|
|
34
|
+
"""模型状态"""
|
|
35
|
+
Waiting = 1
|
|
36
|
+
Creating = 2
|
|
37
|
+
Success = 3
|
|
38
|
+
Fail = 4
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class Model(BaseModel):
|
|
42
|
+
"""模型详情"""
|
|
43
|
+
id: int = Field(description="模型ID")
|
|
44
|
+
name: str = Field(description="模型名称")
|
|
45
|
+
description: str = Field(description="描述")
|
|
46
|
+
model_type: ModelType = Field(alias="model_type", description="模型类型")
|
|
47
|
+
model_path: str = Field(alias="model_path", description="模型路径")
|
|
48
|
+
deploy_platform: DeployPlatform = Field(alias="deploy_platform", description="部署平台")
|
|
49
|
+
param_cnt: str = Field(alias="param_cnt", description="参数量")
|
|
50
|
+
quant_level: QuantLevel = Field(alias="quant_level", description="量化等级")
|
|
51
|
+
creator: User = Field(description="创建人")
|
|
52
|
+
status: ModelStatus = Field(description="模型状态")
|
|
53
|
+
created_at: int = Field(alias="created_at", description="创建时间戳 (ms)")
|
|
54
|
+
updated_at: int = Field(alias="updated_at", description="更新时间戳 (ms)")
|
|
55
|
+
|
|
56
|
+
model_config = {"use_enum_values": True}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class ListModelTypesRequest(BaseModel):
|
|
60
|
+
"""查询模型类型列表请求"""
|
|
61
|
+
page_size: int = Field(999, alias="page_size", description="每页数量")
|
|
62
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class ListModelTypesResponse(BaseModel):
|
|
66
|
+
"""查询模型类型列表返回"""
|
|
67
|
+
total: int = Field(description="总条数")
|
|
68
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
69
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
70
|
+
data: List[ModelType] = Field(default_factory=list, description="类型列表")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class ListDeployPlatformsRequest(BaseModel):
|
|
74
|
+
"""查询部署平台列表请求"""
|
|
75
|
+
page_size: int = Field(999, alias="page_size", description="每页数量")
|
|
76
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class ListDeployPlatformsResponse(BaseModel):
|
|
80
|
+
"""查询部署平台列表返回"""
|
|
81
|
+
total: int = Field(description="总条数")
|
|
82
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
83
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
84
|
+
data: List[DeployPlatform] = Field(default_factory=list, description="平台列表")
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class ListQuantLevelsRequest(BaseModel):
|
|
88
|
+
"""查询量化等级列表请求"""
|
|
89
|
+
page_size: int = Field(999, alias="page_size", description="每页数量")
|
|
90
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class ListQuantLevelsResponse(BaseModel):
|
|
94
|
+
"""查询量化等级列表返回"""
|
|
95
|
+
total: int = Field(description="总条数")
|
|
96
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
97
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
98
|
+
data: List[QuantLevel] = Field(default_factory=list, description="量化等级列表")
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class ListModelsRequest(BaseModel):
|
|
102
|
+
"""查询模型列表请求"""
|
|
103
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
104
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
105
|
+
name: Optional[str] = Field(None, description="名称过滤")
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class ListModelsResponse(BaseModel):
|
|
109
|
+
"""查询模型列表返回"""
|
|
110
|
+
total: int = Field(description="总条数")
|
|
111
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
112
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
113
|
+
data: List[Model] = Field(default_factory=list, description="模型列表")
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class CreateModelRequest(BaseModel):
|
|
117
|
+
"""创建模型请求"""
|
|
118
|
+
name: str = Field(description="模型名称")
|
|
119
|
+
description: Optional[str] = Field(None, description="描述")
|
|
120
|
+
model_type_id: int = Field(alias="model_type_id", description="模型类型ID")
|
|
121
|
+
model_path: Optional[str] = Field(None, alias="model_path", description="模型路径")
|
|
122
|
+
deploy_platform_id: Optional[int] = Field(None, alias="deploy_platform_id", description="部署平台ID")
|
|
123
|
+
param_cnt: Optional[str] = Field(None, alias="param_cnt", description="参数量")
|
|
124
|
+
quant_level_id: Optional[int] = Field(None, alias="quant_level_id", description="量化等级ID")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class CreateModelResponse(BaseModel):
|
|
128
|
+
"""创建模型返回"""
|
|
129
|
+
id: int = Field(description="模型ID")
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class EditModelRequest(BaseModel):
|
|
133
|
+
"""编辑模型请求"""
|
|
134
|
+
id: int = Field(description="模型ID")
|
|
135
|
+
name: str = Field(description="模型名称")
|
|
136
|
+
description: Optional[str] = Field(None, description="描述")
|
|
137
|
+
model_type_id: int = Field(alias="model_type_id", description="模型类型ID")
|
|
138
|
+
model_path: Optional[str] = Field(None, alias="model_path", description="模型路径")
|
|
139
|
+
deploy_platform_id: Optional[int] = Field(None, alias="deploy_platform_id", description="部署平台ID")
|
|
140
|
+
param_cnt: Optional[str] = Field(None, alias="param_cnt", description="参数量")
|
|
141
|
+
quant_level_id: Optional[int] = Field(None, alias="quant_level_id", description="量化等级ID")
|
|
@@ -1,234 +1,267 @@
|
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class Mount(BaseModel):
|
|
14
|
-
name: str
|
|
15
|
-
path: str
|
|
10
|
+
"""环境变量"""
|
|
11
|
+
key: str = Field(description="变量名")
|
|
12
|
+
value: str = Field(description="变量值")
|
|
16
13
|
|
|
17
14
|
|
|
18
15
|
class Sku(BaseModel):
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
"""sku"""
|
|
17
|
+
cpu: int = Field(description="CPU数")
|
|
18
|
+
gpu: int = Field(description="GPU数")
|
|
19
|
+
memory: int = Field(description="内存GiB")
|
|
22
20
|
|
|
23
21
|
|
|
24
22
|
class VirtualCluster(BaseModel):
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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")
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
class Storage(BaseModel):
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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="说明")
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
class Category(BaseModel):
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
"""分类"""
|
|
45
|
+
id: int = Field(description="分类ID")
|
|
46
|
+
name: str = Field(description="分类名称")
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
class Project(BaseModel):
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
"""项目"""
|
|
51
|
+
id: int = Field(description="项目ID")
|
|
52
|
+
name: str = Field(description="项目名称")
|
|
53
|
+
description: str = Field(description="项目描述")
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
class User(BaseModel):
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
"""用户"""
|
|
58
|
+
id: int = Field(description="用户ID")
|
|
59
|
+
name: str = Field(description="用户名")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class TrainingStatus(IntEnum):
|
|
63
|
+
"""训练任务状态"""
|
|
64
|
+
Waiting = 1
|
|
65
|
+
Running = 2
|
|
66
|
+
Success = 3
|
|
67
|
+
Failed = 4
|
|
68
|
+
Stopped = 5
|
|
57
69
|
|
|
58
70
|
|
|
59
|
-
class
|
|
60
|
-
|
|
61
|
-
|
|
71
|
+
class PreemptPolicy(IntEnum):
|
|
72
|
+
"""抢占策略"""
|
|
73
|
+
WAIT = 1 # 等待任务完成
|
|
74
|
+
STOP = 2 # 停止任务
|
|
62
75
|
|
|
63
76
|
|
|
64
77
|
class CreateTrainingRequest(BaseModel):
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
"""创建训练任务请求"""
|
|
79
|
+
framework: str = Field(description="训练框架,如PyTorchJob/MpiJobMpiRun/MpiJobDeepspeed")
|
|
80
|
+
name: str = Field(description="任务名称")
|
|
81
|
+
description: Optional[str] = Field(None, description="描述")
|
|
82
|
+
command: Optional[str] = Field(None, description="命令")
|
|
83
|
+
image: str = Field(description="镜像")
|
|
84
|
+
virtual_cluster_id: int = Field(alias="virtual_cluster_id", description="虚拟集群ID")
|
|
85
|
+
sku_cnt: int = Field(alias="sku_cnt", description="sku数量")
|
|
86
|
+
enable_ssh: Optional[bool] = Field(False, alias="enable_ssh", description="是否开启SSH")
|
|
87
|
+
envs: Optional[List[Env]] = Field(default_factory=list, description="环境变量")
|
|
88
|
+
storage_ids: Optional[List[int]] = Field(default_factory=list, alias="storage_ids", description="挂载存储ID列表")
|
|
89
|
+
instances: int = Field(description="实例数")
|
|
90
|
+
use_ib_network: Optional[bool] = Field(False, alias="use_ib_network", description="是否使用IB网络")
|
|
91
|
+
always_pull_image: Optional[bool] = Field(False, alias="always_pull_image", description="每次强制拉镜像")
|
|
92
|
+
shm: Optional[int] = Field(None, description="共享内存")
|
|
93
|
+
category_id: int = Field(alias="category_id", description="分类ID")
|
|
94
|
+
project_id: int = Field(alias="project_id", description="项目ID")
|
|
95
|
+
estimate_run_time: Optional[int] = Field(None, alias="estimate_run_time", description="预计运行时长(s)")
|
|
96
|
+
is_quota_schedule: Optional[bool] = Field(False, alias="is_quota_schedule", description="是否配额调度")
|
|
97
|
+
|
|
98
|
+
model_config = {"use_enum_values": True}
|
|
86
99
|
|
|
87
100
|
|
|
88
101
|
class CreateTrainingResponse(BaseModel):
|
|
89
|
-
|
|
102
|
+
"""创建训练任务返回"""
|
|
103
|
+
id: int = Field(description="训练任务ID")
|
|
90
104
|
|
|
91
105
|
|
|
92
106
|
class ListTrainingsRequest(BaseModel):
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
"""查询训练任务列表请求"""
|
|
108
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
109
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
110
|
+
user_id: Optional[int] = Field(None, alias="user_id", description="用户过滤")
|
|
111
|
+
name: Optional[str] = Field(None, description="名称过滤")
|
|
112
|
+
virtual_cluster_id: Optional[int] = Field(None, alias="virtual_cluster_id", description="虚拟集群过滤")
|
|
113
|
+
status: Optional[TrainingStatus] = Field(None, description="状态过滤")
|
|
114
|
+
category_id: Optional[int] = Field(None, alias="category_id", description="分类过滤")
|
|
115
|
+
project_id: Optional[int] = Field(None, alias="project_id", description="项目过滤")
|
|
116
|
+
is_quota_schedule: Optional[bool] = Field(None, alias="is_quota_schedule", description="配额调度过滤")
|
|
117
|
+
|
|
118
|
+
model_config = {"use_enum_values": True}
|
|
102
119
|
|
|
103
120
|
|
|
104
121
|
class Training(BaseModel):
|
|
105
|
-
"""
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
is_quota_schedule: bool = Field(alias="is_quota_schedule")
|
|
122
|
+
"""训练任务详情"""
|
|
123
|
+
id: int = Field(description="任务ID")
|
|
124
|
+
framework: str = Field(description="训练框架")
|
|
125
|
+
name: str = Field(description="名称")
|
|
126
|
+
description: str = Field(description="描述")
|
|
127
|
+
command: str = Field(description="命令")
|
|
128
|
+
image: str = Field(description="镜像")
|
|
129
|
+
virtual_cluster: VirtualCluster = Field(alias="virtual_cluster", description="虚拟集群")
|
|
130
|
+
sku_cnt: int = Field(alias="sku_cnt", description="SKU数量")
|
|
131
|
+
enable_ssh: bool = Field(alias="enable_ssh", description="SSH开启")
|
|
132
|
+
envs: Optional[List[Env]] = Field(None, description="环境变量")
|
|
133
|
+
storages: Optional[List[Storage]] = Field(None, description="挂载存储")
|
|
134
|
+
instances: int = Field(description="实例数")
|
|
135
|
+
created_at: int = Field(alias="created_at", description="创建时间")
|
|
136
|
+
username: str = Field(description="提交人")
|
|
137
|
+
user_id: int = Field(alias="user_id", description="提交人ID")
|
|
138
|
+
namespace: str = Field(description="K8s Namespace")
|
|
139
|
+
res_name: str = Field(alias="res_name", description="K8s资源名")
|
|
140
|
+
status: TrainingStatus = Field(description="状态")
|
|
141
|
+
use_ib_network: bool = Field(alias="use_ib_network", description="IB网络")
|
|
142
|
+
always_pull_image: bool = Field(alias="always_pull_image", description="每次拉镜像")
|
|
143
|
+
shm: int = Field(description="共享内存")
|
|
144
|
+
category: Category = Field(description="分类")
|
|
145
|
+
project: Project = Field(description="项目")
|
|
146
|
+
avg_gpu_util: float = Field(alias="avg_gpu_util", description="平均GPU利用率")
|
|
147
|
+
finished_at: int = Field(alias="finished_at", description="结束时间")
|
|
148
|
+
started_at: int = Field(alias="started_at", description="开始时间")
|
|
149
|
+
estimate_run_time: int = Field(alias="estimate_run_time", description="预计运行时长")
|
|
150
|
+
cluster_partition: str = Field(alias="cluster_partition", description="集群分区")
|
|
151
|
+
preempt_policy: PreemptPolicy = Field(alias="preempt_policy", description="抢占策略")
|
|
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
|
+
|
|
156
|
+
model_config = {"use_enum_values": True}
|
|
141
157
|
|
|
142
158
|
|
|
143
159
|
class ListTrainingsResponse(BaseModel):
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
160
|
+
"""查询训练任务列表返回"""
|
|
161
|
+
total: int = Field(description="总条数")
|
|
162
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
163
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
164
|
+
data: List[Training] = Field(description="训练列表")
|
|
148
165
|
|
|
149
166
|
|
|
150
167
|
class Pod(BaseModel):
|
|
151
|
-
"""
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
use_new_log: bool = Field(alias="use_new_log")
|
|
168
|
+
"""训练任务Pod"""
|
|
169
|
+
id: int = Field(description="ID")
|
|
170
|
+
namespace: str = Field(description="Namespace")
|
|
171
|
+
name: str = Field(description="名称")
|
|
172
|
+
status: str = Field(description="状态")
|
|
173
|
+
created_at: int = Field(alias="created_at", description="创建时间")
|
|
174
|
+
started_at: int = Field(alias="started_at", description="启动时间")
|
|
175
|
+
finished_at: int = Field(alias="finished_at", description="结束时间")
|
|
176
|
+
host_ip: str = Field(alias="host_ip", description="宿主机IP")
|
|
177
|
+
node_name: str = Field(alias="node_name", description="节点名")
|
|
178
|
+
ssh_port: int = Field(alias="ssh_port", description="SSH端口")
|
|
179
|
+
ssh_info: str = Field(alias="ssh_info", description="SSH连接信息")
|
|
180
|
+
use_new_log: bool = Field(alias="use_new_log", description="是否使用新版日志")
|
|
165
181
|
|
|
166
182
|
|
|
167
183
|
class ListTrainingPodsRequest(BaseModel):
|
|
168
|
-
|
|
169
|
-
|
|
184
|
+
"""查询训练任务Pod列表请求"""
|
|
185
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
186
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
170
187
|
|
|
171
188
|
|
|
172
189
|
class ListTrainingPodsResponse(BaseModel):
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
190
|
+
"""查询训练任务Pod列表返回"""
|
|
191
|
+
total: int = Field(description="总条数")
|
|
192
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
193
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
194
|
+
data: List[Pod] = Field(description="Pod列表")
|
|
177
195
|
|
|
178
196
|
|
|
179
197
|
class PodLogInfo(BaseModel):
|
|
180
|
-
|
|
181
|
-
|
|
198
|
+
"""pod日志信息"""
|
|
199
|
+
name: str = Field(description="日志名称")
|
|
200
|
+
url: str = Field(description="URL")
|
|
182
201
|
|
|
183
202
|
|
|
184
203
|
class GetTrainingPodLogsNewResponse(BaseModel):
|
|
185
|
-
|
|
204
|
+
"""查询训练任务Pod日志返回"""
|
|
205
|
+
logs: List[PodLogInfo] = Field(description="日志列表")
|
|
186
206
|
|
|
187
207
|
|
|
188
208
|
class GetTrainingPodSpecResponse(BaseModel):
|
|
189
|
-
|
|
209
|
+
"""查询训练任务Pod Spec返回"""
|
|
210
|
+
spec: str = Field(description="Pod YAML Spec")
|
|
190
211
|
|
|
191
212
|
|
|
192
213
|
class GetTrainingPodEventsResponse(BaseModel):
|
|
193
|
-
|
|
214
|
+
"""查询训练任务Pod Event返回"""
|
|
215
|
+
events: str = Field(description="事件内容")
|
|
194
216
|
|
|
195
217
|
|
|
196
218
|
class TrainingUser(BaseModel):
|
|
197
|
-
|
|
198
|
-
|
|
219
|
+
"""训练任务用户"""
|
|
220
|
+
user_id: int = Field(alias="user_id", description="用户ID")
|
|
221
|
+
username: str = Field(description="用户名")
|
|
199
222
|
|
|
200
223
|
|
|
201
224
|
class ListTrainingUsersRequest(BaseModel):
|
|
202
|
-
|
|
203
|
-
|
|
225
|
+
"""查询训练任务用户列表请求"""
|
|
226
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
227
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
204
228
|
|
|
205
229
|
|
|
206
230
|
class ListTrainingUsersResponse(BaseModel):
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
231
|
+
"""查询训练任务用户列表返回"""
|
|
232
|
+
total: int = Field(description="总条数")
|
|
233
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
234
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
235
|
+
data: Optional[List[TrainingUser]] = Field(default_factory=list, description="用户列表")
|
|
211
236
|
|
|
212
237
|
|
|
213
238
|
class Container(BaseModel):
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
239
|
+
"""容器"""
|
|
240
|
+
namespace: str = Field(description="Namespace")
|
|
241
|
+
pod_name: str = Field(alias="pod_name", description="Pod名")
|
|
242
|
+
container_name: str = Field(alias="container_name", description="容器名")
|
|
217
243
|
|
|
218
244
|
|
|
219
245
|
class TrainingContainer(BaseModel):
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
246
|
+
"""训练容器"""
|
|
247
|
+
training_id: int = Field(alias="training_id", description="训练ID")
|
|
248
|
+
training_name: str = Field(alias="training_name", description="训练名")
|
|
249
|
+
containers: List[Container] = Field(description="容器列表")
|
|
223
250
|
|
|
224
251
|
|
|
225
252
|
class ListTrainingContainersRequest(BaseModel):
|
|
226
|
-
|
|
227
|
-
|
|
253
|
+
"""查询训练任务容器列表请求"""
|
|
254
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
255
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
228
256
|
|
|
229
257
|
|
|
230
258
|
class ListTrainingContainersResponse(BaseModel):
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
259
|
+
"""查询训练任务容器列表返回"""
|
|
260
|
+
total: int = Field(description="总条数")
|
|
261
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
262
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
263
|
+
data: Optional[List[TrainingContainer]] = Field(default_factory=list, description="训练容器列表")
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
class ListStoragesResponse(BaseModel):
|
|
267
|
+
data: List[Storage] = Field(default_factory=list, description="存储列表")
|