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
|
@@ -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,268 @@
|
|
|
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
|
+
|
|
57
61
|
|
|
62
|
+
class TrainingStatus(IntEnum):
|
|
63
|
+
"""训练任务状态"""
|
|
64
|
+
Waiting = 1
|
|
65
|
+
Running = 2
|
|
66
|
+
Success = 3
|
|
67
|
+
Failed = 4
|
|
68
|
+
Stopped = 5
|
|
58
69
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
|
|
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_vip: Optional[bool] = Field(False, alias="is_vip", description="是否vip任务")
|
|
97
|
+
preempt_policy: Optional[PreemptPolicy] = Field(None, alias="preempt_policy", description="抢占策略")
|
|
98
|
+
vip_node_names: Optional[List[str]] = Field(default_factory=list, alias="vip_node_names", description="VIP节点名字")
|
|
99
|
+
is_quota_schedule: Optional[bool] = Field(False, alias="is_quota_schedule", description="是否配额调度")
|
|
100
|
+
|
|
101
|
+
model_config = {"use_enum_values": True}
|
|
86
102
|
|
|
87
103
|
|
|
88
104
|
class CreateTrainingResponse(BaseModel):
|
|
89
|
-
|
|
105
|
+
"""创建训练任务返回"""
|
|
106
|
+
id: int = Field(description="训练任务ID")
|
|
90
107
|
|
|
91
108
|
|
|
92
109
|
class ListTrainingsRequest(BaseModel):
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
110
|
+
"""查询训练任务列表请求"""
|
|
111
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
112
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
113
|
+
user_id: Optional[int] = Field(None, alias="user_id", description="用户过滤")
|
|
114
|
+
name: Optional[str] = Field(None, description="名称过滤")
|
|
115
|
+
virtual_cluster_id: Optional[int] = Field(None, alias="virtual_cluster_id", description="虚拟集群过滤")
|
|
116
|
+
status: Optional[TrainingStatus] = Field(None, description="状态过滤")
|
|
117
|
+
category_id: Optional[int] = Field(None, alias="category_id", description="分类过滤")
|
|
118
|
+
project_id: Optional[int] = Field(None, alias="project_id", description="项目过滤")
|
|
119
|
+
is_quota_schedule: Optional[bool] = Field(None, alias="is_quota_schedule", description="配额调度过滤")
|
|
120
|
+
|
|
121
|
+
model_config = {"use_enum_values": True}
|
|
102
122
|
|
|
103
123
|
|
|
104
124
|
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
|
-
|
|
125
|
+
"""训练任务详情"""
|
|
126
|
+
id: int = Field(description="任务ID")
|
|
127
|
+
framework: str = Field(description="训练框架")
|
|
128
|
+
name: str = Field(description="名称")
|
|
129
|
+
description: str = Field(description="描述")
|
|
130
|
+
command: str = Field(description="命令")
|
|
131
|
+
image: str = Field(description="镜像")
|
|
132
|
+
virtual_cluster: VirtualCluster = Field(alias="virtual_cluster", description="虚拟集群")
|
|
133
|
+
sku_cnt: int = Field(alias="sku_cnt", description="SKU数量")
|
|
134
|
+
enable_ssh: bool = Field(alias="enable_ssh", description="SSH开启")
|
|
135
|
+
envs: Optional[List[Env]] = Field(None, description="环境变量")
|
|
136
|
+
storages: Optional[List[Storage]] = Field(None, description="挂载存储")
|
|
137
|
+
instances: int = Field(description="实例数")
|
|
138
|
+
created_at: int = Field(alias="created_at", description="创建时间")
|
|
139
|
+
username: str = Field(description="提交人")
|
|
140
|
+
user_id: int = Field(alias="user_id", description="提交人ID")
|
|
141
|
+
namespace: str = Field(description="K8s Namespace")
|
|
142
|
+
res_name: str = Field(alias="res_name", description="K8s资源名")
|
|
143
|
+
status: TrainingStatus = Field(description="状态")
|
|
144
|
+
use_ib_network: bool = Field(alias="use_ib_network", description="IB网络")
|
|
145
|
+
always_pull_image: bool = Field(alias="always_pull_image", description="每次拉镜像")
|
|
146
|
+
shm: int = Field(description="共享内存")
|
|
147
|
+
category: Category = Field(description="分类")
|
|
148
|
+
project: Project = Field(description="项目")
|
|
149
|
+
avg_gpu_util: float = Field(alias="avg_gpu_util", description="平均GPU利用率")
|
|
150
|
+
finished_at: int = Field(alias="finished_at", description="结束时间")
|
|
151
|
+
started_at: int = Field(alias="started_at", description="开始时间")
|
|
152
|
+
estimate_run_time: int = Field(alias="estimate_run_time", description="预计运行时长")
|
|
153
|
+
is_vip: bool = Field(alias="is_vip", description="是否VIP")
|
|
154
|
+
cluster_partition: str = Field(alias="cluster_partition", description="集群分区")
|
|
155
|
+
preempt_policy: PreemptPolicy = Field(alias="preempt_policy", description="抢占策略")
|
|
156
|
+
vip_node_names: List[str] = Field(alias="vip_node_names", description="VIP节点")
|
|
157
|
+
stop_op_user: Optional[User] = Field(None, alias="stop_op_user", description="停止操作人")
|
|
158
|
+
use_new_log: bool = Field(alias="use_new_log", description="是否使用新版日志")
|
|
159
|
+
is_quota_schedule: bool = Field(alias="is_quota_schedule", description="配额调度")
|
|
160
|
+
|
|
161
|
+
model_config = {"use_enum_values": True}
|
|
141
162
|
|
|
142
163
|
|
|
143
164
|
class ListTrainingsResponse(BaseModel):
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
165
|
+
"""查询训练任务列表返回"""
|
|
166
|
+
total: int = Field(description="总条数")
|
|
167
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
168
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
169
|
+
data: List[Training] = Field(description="训练列表")
|
|
148
170
|
|
|
149
171
|
|
|
150
172
|
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")
|
|
173
|
+
"""训练任务Pod"""
|
|
174
|
+
id: int = Field(description="ID")
|
|
175
|
+
namespace: str = Field(description="Namespace")
|
|
176
|
+
name: str = Field(description="名称")
|
|
177
|
+
status: str = Field(description="状态")
|
|
178
|
+
created_at: int = Field(alias="created_at", description="创建时间")
|
|
179
|
+
started_at: int = Field(alias="started_at", description="启动时间")
|
|
180
|
+
finished_at: int = Field(alias="finished_at", description="结束时间")
|
|
181
|
+
host_ip: str = Field(alias="host_ip", description="宿主机IP")
|
|
182
|
+
node_name: str = Field(alias="node_name", description="节点名")
|
|
183
|
+
ssh_port: int = Field(alias="ssh_port", description="SSH端口")
|
|
184
|
+
ssh_info: str = Field(alias="ssh_info", description="SSH连接信息")
|
|
185
|
+
use_new_log: bool = Field(alias="use_new_log", description="是否使用新版日志")
|
|
165
186
|
|
|
166
187
|
|
|
167
188
|
class ListTrainingPodsRequest(BaseModel):
|
|
168
|
-
|
|
169
|
-
|
|
189
|
+
"""查询训练任务Pod列表请求"""
|
|
190
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
191
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
170
192
|
|
|
171
193
|
|
|
172
194
|
class ListTrainingPodsResponse(BaseModel):
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
195
|
+
"""查询训练任务Pod列表返回"""
|
|
196
|
+
total: int = Field(description="总条数")
|
|
197
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
198
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
199
|
+
data: List[Pod] = Field(description="Pod列表")
|
|
177
200
|
|
|
178
201
|
|
|
179
202
|
class PodLogInfo(BaseModel):
|
|
180
|
-
|
|
181
|
-
|
|
203
|
+
"""pod日志信息"""
|
|
204
|
+
name: str = Field(description="日志名称")
|
|
205
|
+
url: str = Field(description="URL")
|
|
182
206
|
|
|
183
207
|
|
|
184
208
|
class GetTrainingPodLogsNewResponse(BaseModel):
|
|
185
|
-
|
|
209
|
+
"""查询训练任务Pod日志返回"""
|
|
210
|
+
logs: List[PodLogInfo] = Field(description="日志列表")
|
|
186
211
|
|
|
187
212
|
|
|
188
213
|
class GetTrainingPodSpecResponse(BaseModel):
|
|
189
|
-
|
|
214
|
+
"""查询训练任务Pod Spec返回"""
|
|
215
|
+
spec: str = Field(description="Pod YAML Spec")
|
|
190
216
|
|
|
191
217
|
|
|
192
218
|
class GetTrainingPodEventsResponse(BaseModel):
|
|
193
|
-
|
|
219
|
+
"""查询训练任务Pod Event返回"""
|
|
220
|
+
events: str = Field(description="事件内容")
|
|
194
221
|
|
|
195
222
|
|
|
196
223
|
class TrainingUser(BaseModel):
|
|
197
|
-
|
|
198
|
-
|
|
224
|
+
"""训练任务用户"""
|
|
225
|
+
user_id: int = Field(alias="user_id", description="用户ID")
|
|
226
|
+
username: str = Field(description="用户名")
|
|
199
227
|
|
|
200
228
|
|
|
201
229
|
class ListTrainingUsersRequest(BaseModel):
|
|
202
|
-
|
|
203
|
-
|
|
230
|
+
"""查询训练任务用户列表请求"""
|
|
231
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
232
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
204
233
|
|
|
205
234
|
|
|
206
235
|
class ListTrainingUsersResponse(BaseModel):
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
236
|
+
"""查询训练任务用户列表返回"""
|
|
237
|
+
total: int = Field(description="总条数")
|
|
238
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
239
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
240
|
+
data: Optional[List[TrainingUser]] = Field(default_factory=list, description="用户列表")
|
|
211
241
|
|
|
212
242
|
|
|
213
243
|
class Container(BaseModel):
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
244
|
+
"""容器"""
|
|
245
|
+
namespace: str = Field(description="Namespace")
|
|
246
|
+
pod_name: str = Field(alias="pod_name", description="Pod名")
|
|
247
|
+
container_name: str = Field(alias="container_name", description="容器名")
|
|
217
248
|
|
|
218
249
|
|
|
219
250
|
class TrainingContainer(BaseModel):
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
251
|
+
"""训练容器"""
|
|
252
|
+
training_id: int = Field(alias="training_id", description="训练ID")
|
|
253
|
+
training_name: str = Field(alias="training_name", description="训练名")
|
|
254
|
+
containers: List[Container] = Field(description="容器列表")
|
|
223
255
|
|
|
224
256
|
|
|
225
257
|
class ListTrainingContainersRequest(BaseModel):
|
|
226
|
-
|
|
227
|
-
|
|
258
|
+
"""查询训练任务容器列表请求"""
|
|
259
|
+
page_size: int = Field(20, alias="page_size", description="每页数量")
|
|
260
|
+
page_num: int = Field(1, alias="page_num", description="当前页码")
|
|
228
261
|
|
|
229
262
|
|
|
230
263
|
class ListTrainingContainersResponse(BaseModel):
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
264
|
+
"""查询训练任务容器列表返回"""
|
|
265
|
+
total: int = Field(description="总条数")
|
|
266
|
+
page_size: int = Field(alias="page_size", description="每页数量")
|
|
267
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
268
|
+
data: Optional[List[TrainingContainer]] = Field(default_factory=list, description="训练容器列表")
|