intellif-aihub 0.1.3__py3-none-any.whl → 0.1.4__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 +95 -91
- aihub/exceptions.py +18 -18
- aihub/models/artifact.py +137 -137
- aihub/models/common.py +13 -13
- aihub/models/dataset_management.py +99 -99
- aihub/models/document_center.py +28 -28
- aihub/models/eval.py +17 -0
- aihub/models/labelfree.py +53 -31
- aihub/models/model_training_platform.py +234 -230
- aihub/models/quota_schedule_management.py +239 -0
- aihub/models/tag_resource_management.py +50 -50
- aihub/models/task_center.py +117 -117
- aihub/models/user_system.py +262 -262
- aihub/services/artifact.py +353 -353
- aihub/services/dataset_management.py +240 -240
- aihub/services/document_center.py +43 -43
- aihub/services/eval.py +68 -0
- aihub/services/labelfree.py +44 -44
- aihub/services/model_training_platform.py +209 -135
- aihub/services/quota_schedule_management.py +182 -18
- aihub/services/reporter.py +20 -20
- aihub/services/tag_resource_management.py +55 -55
- aihub/services/task_center.py +190 -190
- aihub/services/user_system.py +339 -339
- aihub/utils/download.py +69 -69
- aihub/utils/http.py +13 -13
- aihub/utils/s3.py +77 -77
- {intellif_aihub-0.1.3.dist-info → intellif_aihub-0.1.4.dist-info}/METADATA +1 -1
- intellif_aihub-0.1.4.dist-info/RECORD +36 -0
- {intellif_aihub-0.1.3.dist-info → intellif_aihub-0.1.4.dist-info}/licenses/LICENSE +200 -200
- intellif_aihub-0.1.3.dist-info/RECORD +0 -34
- {intellif_aihub-0.1.3.dist-info → intellif_aihub-0.1.4.dist-info}/WHEEL +0 -0
- {intellif_aihub-0.1.3.dist-info → intellif_aihub-0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -1,230 +1,234 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import List, Optional
|
|
4
|
-
|
|
5
|
-
from pydantic import BaseModel, Field
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Env(BaseModel):
|
|
9
|
-
key: str
|
|
10
|
-
value: str
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class Mount(BaseModel):
|
|
14
|
-
name: str
|
|
15
|
-
path: str
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class Sku(BaseModel):
|
|
19
|
-
cpu: int
|
|
20
|
-
gpu: int
|
|
21
|
-
memory: int
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class VirtualCluster(BaseModel):
|
|
25
|
-
id: int
|
|
26
|
-
name: str
|
|
27
|
-
gpu_type: str = Field(alias="gpu_type")
|
|
28
|
-
label: str
|
|
29
|
-
sku: Sku
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class Storage(BaseModel):
|
|
33
|
-
id: int
|
|
34
|
-
name: str
|
|
35
|
-
path: str
|
|
36
|
-
server_path: str = Field(alias="server_path")
|
|
37
|
-
server_host: str = Field(alias="server_host")
|
|
38
|
-
server_type: str = Field(alias="server_type")
|
|
39
|
-
permission: str
|
|
40
|
-
description: str
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class Category(BaseModel):
|
|
44
|
-
id: int
|
|
45
|
-
name: str
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
class Project(BaseModel):
|
|
49
|
-
id: int
|
|
50
|
-
name: str
|
|
51
|
-
description: str
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class User(BaseModel):
|
|
55
|
-
id: int
|
|
56
|
-
name: str
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class Department(BaseModel):
|
|
60
|
-
id: int
|
|
61
|
-
name: str
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
class CreateTrainingRequest(BaseModel):
|
|
65
|
-
framework: str
|
|
66
|
-
name: str
|
|
67
|
-
description: Optional[str] = None
|
|
68
|
-
command: Optional[str] = None
|
|
69
|
-
image: str
|
|
70
|
-
virtual_cluster_id: int = Field(alias="virtual_cluster_id")
|
|
71
|
-
sku_cnt: int = Field(alias="sku_cnt")
|
|
72
|
-
enable_ssh: Optional[bool] = Field(False, alias="enable_ssh")
|
|
73
|
-
envs: Optional[List[Env]] = Field(default_factory=list, alias="envs")
|
|
74
|
-
storage_ids: Optional[List[int]] = Field(default_factory=list, alias="storage_ids")
|
|
75
|
-
instances: int
|
|
76
|
-
use_ib_network: Optional[bool] = Field(False, alias="use_ib_network")
|
|
77
|
-
always_pull_image: Optional[bool] = Field(False, alias="always_pull_image")
|
|
78
|
-
shm: Optional[int] = None
|
|
79
|
-
category_id: int = Field(alias="category_id")
|
|
80
|
-
project_id: int = Field(alias="project_id")
|
|
81
|
-
estimate_run_time: Optional[int] = Field(None, alias="estimate_run_time")
|
|
82
|
-
is_vip: Optional[bool] = Field(False, alias="is_vip")
|
|
83
|
-
preempt_policy: Optional[int] = Field(None, alias="preempt_policy")
|
|
84
|
-
vip_node_names: Optional[List[str]] = Field(default_factory=list, alias="vip_node_names")
|
|
85
|
-
is_quota_schedule: Optional[bool] = Field(False, alias="is_quota_schedule")
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class CreateTrainingResponse(BaseModel):
|
|
89
|
-
id: int
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class ListTrainingsRequest(BaseModel):
|
|
93
|
-
page_size: int = Field(20, alias="page_size")
|
|
94
|
-
page_num: int = Field(1, alias="page_num")
|
|
95
|
-
user_id: Optional[int] = Field(None, alias="user_id")
|
|
96
|
-
name: Optional[str] = None
|
|
97
|
-
virtual_cluster_id: Optional[int] = Field(None, alias="virtual_cluster_id")
|
|
98
|
-
status: Optional[int] = None
|
|
99
|
-
category_id: Optional[int] = Field(None, alias="category_id")
|
|
100
|
-
project_id: Optional[int] = Field(None, alias="project_id")
|
|
101
|
-
is_quota_schedule: Optional[bool] = Field(None, alias="is_quota_schedule")
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
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
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
class
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
class
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
class
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Env(BaseModel):
|
|
9
|
+
key: str
|
|
10
|
+
value: str
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Mount(BaseModel):
|
|
14
|
+
name: str
|
|
15
|
+
path: str
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Sku(BaseModel):
|
|
19
|
+
cpu: int
|
|
20
|
+
gpu: int
|
|
21
|
+
memory: int
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class VirtualCluster(BaseModel):
|
|
25
|
+
id: int
|
|
26
|
+
name: str
|
|
27
|
+
gpu_type: str = Field(alias="gpu_type")
|
|
28
|
+
label: str
|
|
29
|
+
sku: Sku
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class Storage(BaseModel):
|
|
33
|
+
id: int
|
|
34
|
+
name: str
|
|
35
|
+
path: str
|
|
36
|
+
server_path: str = Field(alias="server_path")
|
|
37
|
+
server_host: str = Field(alias="server_host")
|
|
38
|
+
server_type: str = Field(alias="server_type")
|
|
39
|
+
permission: str
|
|
40
|
+
description: str
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class Category(BaseModel):
|
|
44
|
+
id: int
|
|
45
|
+
name: str
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class Project(BaseModel):
|
|
49
|
+
id: int
|
|
50
|
+
name: str
|
|
51
|
+
description: str
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class User(BaseModel):
|
|
55
|
+
id: int
|
|
56
|
+
name: str
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class Department(BaseModel):
|
|
60
|
+
id: int
|
|
61
|
+
name: str
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class CreateTrainingRequest(BaseModel):
|
|
65
|
+
framework: str
|
|
66
|
+
name: str
|
|
67
|
+
description: Optional[str] = None
|
|
68
|
+
command: Optional[str] = None
|
|
69
|
+
image: str
|
|
70
|
+
virtual_cluster_id: int = Field(alias="virtual_cluster_id")
|
|
71
|
+
sku_cnt: int = Field(alias="sku_cnt")
|
|
72
|
+
enable_ssh: Optional[bool] = Field(False, alias="enable_ssh")
|
|
73
|
+
envs: Optional[List[Env]] = Field(default_factory=list, alias="envs")
|
|
74
|
+
storage_ids: Optional[List[int]] = Field(default_factory=list, alias="storage_ids")
|
|
75
|
+
instances: int
|
|
76
|
+
use_ib_network: Optional[bool] = Field(False, alias="use_ib_network")
|
|
77
|
+
always_pull_image: Optional[bool] = Field(False, alias="always_pull_image")
|
|
78
|
+
shm: Optional[int] = None
|
|
79
|
+
category_id: int = Field(alias="category_id")
|
|
80
|
+
project_id: int = Field(alias="project_id")
|
|
81
|
+
estimate_run_time: Optional[int] = Field(None, alias="estimate_run_time")
|
|
82
|
+
is_vip: Optional[bool] = Field(False, alias="is_vip")
|
|
83
|
+
preempt_policy: Optional[int] = Field(None, alias="preempt_policy")
|
|
84
|
+
vip_node_names: Optional[List[str]] = Field(default_factory=list, alias="vip_node_names")
|
|
85
|
+
is_quota_schedule: Optional[bool] = Field(False, alias="is_quota_schedule")
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class CreateTrainingResponse(BaseModel):
|
|
89
|
+
id: int
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class ListTrainingsRequest(BaseModel):
|
|
93
|
+
page_size: int = Field(20, alias="page_size")
|
|
94
|
+
page_num: int = Field(1, alias="page_num")
|
|
95
|
+
user_id: Optional[int] = Field(None, alias="user_id")
|
|
96
|
+
name: Optional[str] = None
|
|
97
|
+
virtual_cluster_id: Optional[int] = Field(None, alias="virtual_cluster_id")
|
|
98
|
+
status: Optional[int] = None
|
|
99
|
+
category_id: Optional[int] = Field(None, alias="category_id")
|
|
100
|
+
project_id: Optional[int] = Field(None, alias="project_id")
|
|
101
|
+
is_quota_schedule: Optional[bool] = Field(None, alias="is_quota_schedule")
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class Training(BaseModel):
|
|
105
|
+
"""训练任务"""
|
|
106
|
+
|
|
107
|
+
id: int
|
|
108
|
+
framework: str
|
|
109
|
+
name: str
|
|
110
|
+
description: str
|
|
111
|
+
command: str
|
|
112
|
+
image: str
|
|
113
|
+
virtual_cluster: VirtualCluster = Field(alias="virtual_cluster")
|
|
114
|
+
sku_cnt: int = Field(alias="sku_cnt")
|
|
115
|
+
enable_ssh: bool = Field(alias="enable_ssh")
|
|
116
|
+
envs: Optional[List[Env]] = Field(None, alias="envs")
|
|
117
|
+
storages: Optional[List[Storage]] = Field(None, alias="storages")
|
|
118
|
+
instances: int
|
|
119
|
+
created_at: int = Field(alias="created_at")
|
|
120
|
+
username: str
|
|
121
|
+
user_id: int = Field(alias="user_id")
|
|
122
|
+
namespace: str
|
|
123
|
+
res_name: str = Field(alias="res_name")
|
|
124
|
+
status: int
|
|
125
|
+
use_ib_network: bool = Field(alias="use_ib_network")
|
|
126
|
+
always_pull_image: bool = Field(alias="always_pull_image")
|
|
127
|
+
shm: int
|
|
128
|
+
category: Category
|
|
129
|
+
project: Project
|
|
130
|
+
avg_gpu_util: float = Field(alias="avg_gpu_util")
|
|
131
|
+
finished_at: int = Field(alias="finished_at")
|
|
132
|
+
started_at: int = Field(alias="started_at")
|
|
133
|
+
estimate_run_time: int = Field(alias="estimate_run_time")
|
|
134
|
+
is_vip: bool = Field(alias="is_vip")
|
|
135
|
+
cluster_partition: str = Field(alias="cluster_partition")
|
|
136
|
+
preempt_policy: int = Field(alias="preempt_policy")
|
|
137
|
+
vip_node_names: List[str] = Field(alias="vip_node_names")
|
|
138
|
+
stop_op_user: Optional[User] = Field(None, alias="stop_op_user")
|
|
139
|
+
use_new_log: bool = Field(alias="use_new_log")
|
|
140
|
+
is_quota_schedule: bool = Field(alias="is_quota_schedule")
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class ListTrainingsResponse(BaseModel):
|
|
144
|
+
total: int
|
|
145
|
+
page_size: int = Field(alias="page_size")
|
|
146
|
+
page_num: int = Field(alias="page_num")
|
|
147
|
+
data: List[Training]
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class Pod(BaseModel):
|
|
151
|
+
"""训练任务容器"""
|
|
152
|
+
|
|
153
|
+
id: int
|
|
154
|
+
namespace: str
|
|
155
|
+
name: str
|
|
156
|
+
status: str
|
|
157
|
+
created_at: int = Field(alias="created_at")
|
|
158
|
+
started_at: int = Field(alias="started_at")
|
|
159
|
+
finished_at: int = Field(alias="finished_at")
|
|
160
|
+
host_ip: str = Field(alias="host_ip")
|
|
161
|
+
node_name: str = Field(alias="node_name")
|
|
162
|
+
ssh_port: int = Field(alias="ssh_port")
|
|
163
|
+
ssh_info: str = Field(alias="ssh_info")
|
|
164
|
+
use_new_log: bool = Field(alias="use_new_log")
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class ListTrainingPodsRequest(BaseModel):
|
|
168
|
+
page_size: int = Field(20, alias="page_size")
|
|
169
|
+
page_num: int = Field(1, alias="page_num")
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class ListTrainingPodsResponse(BaseModel):
|
|
173
|
+
total: int
|
|
174
|
+
page_size: int = Field(alias="page_size")
|
|
175
|
+
page_num: int = Field(alias="page_num")
|
|
176
|
+
data: List[Pod]
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class PodLogInfo(BaseModel):
|
|
180
|
+
name: str
|
|
181
|
+
url: str
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class GetTrainingPodLogsNewResponse(BaseModel):
|
|
185
|
+
logs: List[PodLogInfo]
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class GetTrainingPodSpecResponse(BaseModel):
|
|
189
|
+
spec: str
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class GetTrainingPodEventsResponse(BaseModel):
|
|
193
|
+
events: str
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class TrainingUser(BaseModel):
|
|
197
|
+
user_id: int = Field(alias="user_id")
|
|
198
|
+
username: str
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
class ListTrainingUsersRequest(BaseModel):
|
|
202
|
+
page_size: int = Field(20, alias="page_size")
|
|
203
|
+
page_num: int = Field(1, alias="page_num")
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class ListTrainingUsersResponse(BaseModel):
|
|
207
|
+
total: int
|
|
208
|
+
page_size: int = Field(alias="page_size")
|
|
209
|
+
page_num: int = Field(alias="page_num")
|
|
210
|
+
data: Optional[List[TrainingUser]] = Field(default_factory=list)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class Container(BaseModel):
|
|
214
|
+
namespace: str
|
|
215
|
+
pod_name: str = Field(alias="pod_name")
|
|
216
|
+
container_name: str = Field(alias="container_name")
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
class TrainingContainer(BaseModel):
|
|
220
|
+
training_id: int = Field(alias="training_id")
|
|
221
|
+
training_name: str = Field(alias="training_name")
|
|
222
|
+
containers: List[Container]
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
class ListTrainingContainersRequest(BaseModel):
|
|
226
|
+
page_size: int = Field(20, alias="page_size")
|
|
227
|
+
page_num: int = Field(1, alias="page_num")
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class ListTrainingContainersResponse(BaseModel):
|
|
231
|
+
total: int
|
|
232
|
+
page_size: int = Field(alias="page_size")
|
|
233
|
+
page_num: int = Field(alias="page_num")
|
|
234
|
+
data: Optional[List[TrainingContainer]] = Field(default_factory=list)
|