intellif-aihub 0.1.13__tar.gz → 0.1.15__tar.gz
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.
- {intellif_aihub-0.1.13/src/intellif_aihub.egg-info → intellif_aihub-0.1.15}/PKG-INFO +1 -1
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/pyproject.toml +1 -1
- intellif_aihub-0.1.15/src/aihub/__init__.py +1 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/artifact.py +16 -4
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/dataset_management.py +91 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/artifact.py +16 -30
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/dataset_management.py +260 -42
- intellif_aihub-0.1.15/src/aihub/utils/di.py +337 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/utils/download.py +3 -15
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/utils/http.py +6 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15/src/intellif_aihub.egg-info}/PKG-INFO +1 -1
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/intellif_aihub.egg-info/SOURCES.txt +2 -0
- intellif_aihub-0.1.15/tests/test_dataset_management.py +120 -0
- intellif_aihub-0.1.15/tests/test_di.py +160 -0
- intellif_aihub-0.1.13/src/aihub/__init__.py +0 -1
- intellif_aihub-0.1.13/tests/test_dataset_management.py +0 -54
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/LICENSE +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/README.md +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/setup.cfg +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/client.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/exceptions.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/__init__.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/common.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/data_warehouse.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/document_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/eval.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/labelfree.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/model_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/model_training_platform.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/quota_schedule_management.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/tag_resource_management.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/task_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/user_system.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/models/workflow_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/__init__.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/data_warehouse.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/document_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/eval.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/labelfree.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/model_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/model_training_platform.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/quota_schedule_management.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/reporter.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/tag_resource_management.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/task_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/user_system.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/services/workflow_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/utils/__init__.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/aihub/utils/s3.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/intellif_aihub.egg-info/dependency_links.txt +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/intellif_aihub.egg-info/requires.txt +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/src/intellif_aihub.egg-info/top_level.txt +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_artifact.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_data_warehouse.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_document_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_labelfree.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_model_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_model_training_platform.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_quota_schedule_management.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_s3.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_tag_resource_management.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_task_center.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_user_system.py +0 -0
- {intellif_aihub-0.1.13 → intellif_aihub-0.1.15}/tests/test_workflow_center.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.15"
|
|
@@ -14,6 +14,7 @@ from pydantic import BaseModel, Field
|
|
|
14
14
|
|
|
15
15
|
class ArtifactType(str, Enum):
|
|
16
16
|
"""制品类型枚举:"dataset"-数据集类型;"model"-模型类型;"metrics"-指标类型;"log"-日志类型;"checkpoint"-检查点类型;"image"-图像类型;"prediction"-预测结果类型;"other"-其他类型"""
|
|
17
|
+
|
|
17
18
|
dataset = "dataset" # 数据集类型
|
|
18
19
|
model = "model" # 模型类型
|
|
19
20
|
metrics = "metrics" # 指标类型
|
|
@@ -26,24 +27,29 @@ class ArtifactType(str, Enum):
|
|
|
26
27
|
|
|
27
28
|
class CreateArtifactsReq(BaseModel):
|
|
28
29
|
"""创建制品请求"""
|
|
30
|
+
|
|
29
31
|
entity_id: str = Field(alias="entity_id", description="实体ID,通常是运行ID,用于关联制品与特定运行")
|
|
30
|
-
entity_type: ArtifactType = Field(
|
|
31
|
-
|
|
32
|
+
entity_type: ArtifactType = Field(
|
|
33
|
+
default=ArtifactType.other, alias="entity_type", description="制品类型,指定制品的类型,默认为other"
|
|
34
|
+
)
|
|
32
35
|
src_path: str = Field(alias="src_path", description="源路径,制品在系统中的路径标识")
|
|
33
|
-
is_dir: bool = Field(
|
|
34
|
-
|
|
36
|
+
is_dir: bool = Field(
|
|
37
|
+
default=False, alias="is_dir", description="是否为目录,True表示制品是一个目录,False表示是单个文件"
|
|
38
|
+
)
|
|
35
39
|
|
|
36
40
|
model_config = {"use_enum_values": True}
|
|
37
41
|
|
|
38
42
|
|
|
39
43
|
class CreateArtifactsResponseData(BaseModel):
|
|
40
44
|
"""创建制品响应数据"""
|
|
45
|
+
|
|
41
46
|
id: int = Field(description="制品ID")
|
|
42
47
|
s3_path: str = Field(alias="s3_path", description="S3存储路径")
|
|
43
48
|
|
|
44
49
|
|
|
45
50
|
class CreateArtifactsResponseModel(BaseModel):
|
|
46
51
|
"""创建制品响应模型"""
|
|
52
|
+
|
|
47
53
|
code: int = Field(description="响应码,0表示成功")
|
|
48
54
|
msg: str = Field(default="", description="响应消息")
|
|
49
55
|
data: Optional[CreateArtifactsResponseData] = Field(default=None, description="响应数据")
|
|
@@ -51,6 +57,7 @@ class CreateArtifactsResponseModel(BaseModel):
|
|
|
51
57
|
|
|
52
58
|
class CreateEvalReq(BaseModel):
|
|
53
59
|
"""创建评估请求"""
|
|
60
|
+
|
|
54
61
|
dataset_id: int = Field(alias="dataset_id", description="数据集ID")
|
|
55
62
|
dataset_version_id: int = Field(alias="dataset_version_id", description="数据集版本ID")
|
|
56
63
|
prediction_artifact_path: str = Field(alias="prediction_artifact_path", description="预测结果制品路径")
|
|
@@ -62,6 +69,7 @@ class CreateEvalReq(BaseModel):
|
|
|
62
69
|
|
|
63
70
|
class ArtifactResp(BaseModel):
|
|
64
71
|
"""制品响应模型,表示一个制品的详细信息"""
|
|
72
|
+
|
|
65
73
|
id: int = Field(description="制品ID")
|
|
66
74
|
entity_type: str = Field(alias="entity_type", description="实体类型")
|
|
67
75
|
entity_id: str = Field(alias="entity_id", description="实体ID")
|
|
@@ -72,6 +80,7 @@ class ArtifactResp(BaseModel):
|
|
|
72
80
|
|
|
73
81
|
class ArtifactRespData(BaseModel):
|
|
74
82
|
"""制品分页数据"""
|
|
83
|
+
|
|
75
84
|
total: int = Field(description="总记录数")
|
|
76
85
|
page_size: int = Field(alias="page_size", description="每页大小")
|
|
77
86
|
page_num: int = Field(alias="page_num", description="页码")
|
|
@@ -80,6 +89,7 @@ class ArtifactRespData(BaseModel):
|
|
|
80
89
|
|
|
81
90
|
class ArtifactRespModel(BaseModel):
|
|
82
91
|
"""获取制品响应模型"""
|
|
92
|
+
|
|
83
93
|
code: int = Field(description="响应码,0表示成功")
|
|
84
94
|
msg: str = Field(default="", description="响应消息")
|
|
85
95
|
data: ArtifactRespData = Field(description="响应数据")
|
|
@@ -91,8 +101,10 @@ InfinityPageSize = 10000 * 100
|
|
|
91
101
|
|
|
92
102
|
class StsResp(BaseModel):
|
|
93
103
|
"""STS 临时凭证"""
|
|
104
|
+
|
|
94
105
|
access_key_id: Optional[str] = Field(default=None, alias="access_key_id", description="访问密钥ID")
|
|
95
106
|
secret_access_key: Optional[str] = Field(default=None, alias="secret_access_key", description="秘密访问密钥")
|
|
96
107
|
session_token: Optional[str] = Field(default=None, alias="session_token", description="会话令牌")
|
|
97
108
|
expiration: Optional[int] = Field(default=None, alias="expiration", description="过期时间")
|
|
98
109
|
endpoint: Optional[str] = Field(default=None, alias="endpoint", description="端点URL")
|
|
110
|
+
bucket: Optional[str] = Field(default=None, alias="bucket", description="存储桶名称")
|
|
@@ -8,6 +8,7 @@ from pydantic import BaseModel, Field
|
|
|
8
8
|
|
|
9
9
|
class DatasetVersionStatus(IntEnum):
|
|
10
10
|
"""数据集版本状态:1-等待中;2-运行中;3-成功;4-失败;5-加载meta;6-构建index"""
|
|
11
|
+
|
|
11
12
|
Waiting = 1 # 等待中
|
|
12
13
|
Running = 2 # 运行中
|
|
13
14
|
Success = 3 # 成功
|
|
@@ -18,6 +19,7 @@ class DatasetVersionStatus(IntEnum):
|
|
|
18
19
|
|
|
19
20
|
class UploadType(IntEnum):
|
|
20
21
|
"""上传类型:1-本地上传;3-服务器路径上传;4-Labelfree;5-数据接入"""
|
|
22
|
+
|
|
21
23
|
LOCAL = 1 # 本地上传
|
|
22
24
|
SERVER_PATH = 3 # 服务器路径上传
|
|
23
25
|
LABELFREE = 4 # Labelfree
|
|
@@ -26,6 +28,7 @@ class UploadType(IntEnum):
|
|
|
26
28
|
|
|
27
29
|
class CreateDatasetRequest(BaseModel):
|
|
28
30
|
"""创建数据集请求"""
|
|
31
|
+
|
|
29
32
|
name: str = Field(description="数据集名称")
|
|
30
33
|
description: str = Field(description="数据集描述")
|
|
31
34
|
tags: List[int] = Field(description="标签ID列表,通过标签管理系统查询")
|
|
@@ -37,11 +40,13 @@ class CreateDatasetRequest(BaseModel):
|
|
|
37
40
|
|
|
38
41
|
class CreateDatasetResponse(BaseModel):
|
|
39
42
|
"""创建数据集返回"""
|
|
43
|
+
|
|
40
44
|
id: int = Field(alias="id", description="数据集ID")
|
|
41
45
|
|
|
42
46
|
|
|
43
47
|
class DatasetVersionBase(BaseModel):
|
|
44
48
|
"""数据集版本概要"""
|
|
49
|
+
|
|
45
50
|
id: int = Field(description="版本ID")
|
|
46
51
|
version: int = Field(description="版本号")
|
|
47
52
|
status: DatasetVersionStatus = Field(description="版本状态")
|
|
@@ -53,6 +58,7 @@ class DatasetVersionBase(BaseModel):
|
|
|
53
58
|
|
|
54
59
|
class DatasetDetail(BaseModel):
|
|
55
60
|
"""数据集详情"""
|
|
61
|
+
|
|
56
62
|
id: int = Field(description="数据集 ID")
|
|
57
63
|
name: str = Field(description="名称")
|
|
58
64
|
description: str = Field(description="描述")
|
|
@@ -69,6 +75,7 @@ class DatasetDetail(BaseModel):
|
|
|
69
75
|
|
|
70
76
|
class ExtInfo(BaseModel):
|
|
71
77
|
"""扩展信息"""
|
|
78
|
+
|
|
72
79
|
rec_file_path: Optional[str] = Field(None, alias="rec_file_path", description="rec文件路径")
|
|
73
80
|
idx_file_path: Optional[str] = Field(None, alias="idx_file_path", description="idx文件路径")
|
|
74
81
|
json_file_path: Optional[str] = Field(None, alias="json_file_path", description="json文件路径")
|
|
@@ -77,6 +84,7 @@ class ExtInfo(BaseModel):
|
|
|
77
84
|
|
|
78
85
|
class CreateDatasetVersionRequest(BaseModel):
|
|
79
86
|
"""创建版本请求"""
|
|
87
|
+
|
|
80
88
|
upload_path: str = Field(alias="upload_path", description="上传路径")
|
|
81
89
|
description: Optional[str] = Field(None, description="版本描述")
|
|
82
90
|
dataset_id: int = Field(alias="dataset_id", description="数据集ID")
|
|
@@ -91,11 +99,13 @@ class CreateDatasetVersionRequest(BaseModel):
|
|
|
91
99
|
|
|
92
100
|
class CreateDatasetVersionResponse(BaseModel):
|
|
93
101
|
"""创建版本返回"""
|
|
102
|
+
|
|
94
103
|
id: int = Field(alias="id", description="版本ID")
|
|
95
104
|
|
|
96
105
|
|
|
97
106
|
class UploadDatasetVersionRequest(BaseModel):
|
|
98
107
|
"""上传数据集版本请求"""
|
|
108
|
+
|
|
99
109
|
upload_path: str = Field(alias="upload_path", description="上传目录")
|
|
100
110
|
upload_type: UploadType = Field(alias="upload_type", description="上传类型")
|
|
101
111
|
dataset_id: int = Field(alias="dataset_id", description="数据集ID")
|
|
@@ -107,11 +117,13 @@ class UploadDatasetVersionRequest(BaseModel):
|
|
|
107
117
|
|
|
108
118
|
class UploadDatasetVersionResponse(BaseModel):
|
|
109
119
|
"""上传数据集版本返回"""
|
|
120
|
+
|
|
110
121
|
id: int = Field(alias="id", description="版本ID")
|
|
111
122
|
|
|
112
123
|
|
|
113
124
|
class DatasetVersionDetail(BaseModel):
|
|
114
125
|
"""数据集版本详情"""
|
|
126
|
+
|
|
115
127
|
id: int = Field(description="版本ID")
|
|
116
128
|
version: int = Field(description="版本号")
|
|
117
129
|
dataset_id: int = Field(alias="dataset_id", description="数据集ID")
|
|
@@ -133,5 +145,84 @@ class DatasetVersionDetail(BaseModel):
|
|
|
133
145
|
|
|
134
146
|
class FileUploadData(BaseModel):
|
|
135
147
|
"""文件上传数据"""
|
|
148
|
+
|
|
136
149
|
path: str = Field(description="路径")
|
|
137
150
|
url: str = Field(description="URL")
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class ListDatasetReq(BaseModel):
|
|
154
|
+
"""列表查询数据集请求(使用 dataset_management v2)"""
|
|
155
|
+
page_size: int = Field(20, alias="page_size", description="每页大小,默认20")
|
|
156
|
+
page_num: int = Field(1, alias="page_num", description="页码,从1开始")
|
|
157
|
+
name: Optional[str] = Field(None, description="数据集名称筛选")
|
|
158
|
+
tags: Optional[str] = Field(None, description="标签筛选")
|
|
159
|
+
create_by: Optional[int] = Field(None, alias="create_by", description="创建人筛选")
|
|
160
|
+
scope: Optional[str] = Field("all", description="范围筛选:created|shared|all")
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class ListDatasetItem(BaseModel):
|
|
164
|
+
"""列表数据集项"""
|
|
165
|
+
id: int = Field(description="数据集ID")
|
|
166
|
+
name: str = Field(description="数据集名称")
|
|
167
|
+
description: str = Field(description="数据集描述")
|
|
168
|
+
cover_img: str = Field(alias="cover_img", description="封面图片")
|
|
169
|
+
created_at: int = Field(alias="created_at", description="创建时间戳")
|
|
170
|
+
updated_at: int = Field(alias="update_at", description="更新时间戳")
|
|
171
|
+
user_id: int = Field(alias="user_id", description="创建人ID")
|
|
172
|
+
username: str = Field(description="创建人用户名")
|
|
173
|
+
tags: Optional[List[int]] = Field(None, description="标签列表")
|
|
174
|
+
access_user_ids: Optional[List[int]] = Field(None, alias="access_user_ids", description="有访问权限的用户ID列表")
|
|
175
|
+
is_private: bool = Field(alias="is_private", description="是否私有")
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
class ListDatasetResp(BaseModel):
|
|
179
|
+
"""列表查询数据集响应"""
|
|
180
|
+
total: int = Field(description="总数")
|
|
181
|
+
page_size: int = Field(alias="page_size", description="每页大小")
|
|
182
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
183
|
+
data: List[ListDatasetItem] = Field(description="数据集列表")
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class ListDatasetVersionReq(BaseModel):
|
|
187
|
+
"""列表查询数据集版本请求(使用 dataset_management v2)"""
|
|
188
|
+
page_size: int = Field(10000000, alias="page_size", description="每页大小,默认10000000")
|
|
189
|
+
page_num: int = Field(1, alias="page_num", description="页码,从1开始")
|
|
190
|
+
dataset_id: Optional[int] = Field(None, alias="dataset_id", description="数据集ID筛选")
|
|
191
|
+
dataset_version_ids: Optional[str] = Field(None, alias="dataset_version_ids", description="数据集版本ID列表,逗号分隔")
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class ListDatasetVersionItem(BaseModel):
|
|
195
|
+
"""列表数据集版本项"""
|
|
196
|
+
id: int = Field(description="版本ID")
|
|
197
|
+
version: int = Field(description="版本号")
|
|
198
|
+
dataset_id: int = Field(alias="dataset_id", description="数据集ID")
|
|
199
|
+
upload_path: str = Field(alias="upload_path", description="上传路径")
|
|
200
|
+
upload_type: int = Field(alias="upload_type", description="上传类型")
|
|
201
|
+
parent_version_id: Optional[int] = Field(None, alias="parent_version_id", description="父版本ID")
|
|
202
|
+
description: Optional[str] = Field(None, description="版本描述")
|
|
203
|
+
status: int = Field(description="版本状态")
|
|
204
|
+
message: str = Field(description="状态信息")
|
|
205
|
+
created_at: int = Field(alias="created_at", description="创建时间戳")
|
|
206
|
+
user_id: int = Field(alias="user_id", description="创建人ID")
|
|
207
|
+
data_size: int = Field(alias="data_size", description="数据大小")
|
|
208
|
+
data_count: int = Field(alias="data_count", description="数据条数")
|
|
209
|
+
username: str = Field(description="创建人用户名")
|
|
210
|
+
dataset_name: str = Field(alias="dataset_name", description="数据集名称")
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class ListDatasetVersionResp(BaseModel):
|
|
214
|
+
"""列表查询数据集版本响应"""
|
|
215
|
+
total: int = Field(description="总数")
|
|
216
|
+
page_size: int = Field(alias="page_size", description="每页大小")
|
|
217
|
+
page_num: int = Field(alias="page_num", description="当前页码")
|
|
218
|
+
data: List[ListDatasetVersionItem] = Field(description="数据集版本列表")
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class CreateDatasetVersionByDataIngestReqV2(BaseModel):
|
|
222
|
+
"""通过数据集成创建数据集版本请求"""
|
|
223
|
+
|
|
224
|
+
description: Optional[str] = Field(None, description="描述")
|
|
225
|
+
dataset_id: int = Field(..., description="数据集ID")
|
|
226
|
+
s3_object_sheet: str = Field(..., description="S3对象表")
|
|
227
|
+
object_cnt: Optional[int] = Field(None, description="对象数量")
|
|
228
|
+
data_size: Optional[int] = Field(None, description="数据大小")
|
|
@@ -98,9 +98,7 @@ class ArtifactService:
|
|
|
98
98
|
"""
|
|
99
99
|
return self._artifact.get_sts()
|
|
100
100
|
|
|
101
|
-
def get_by_run_id(
|
|
102
|
-
self, run_id: str, artifact_path: Optional[str] = None
|
|
103
|
-
) -> List[ArtifactResp]:
|
|
101
|
+
def get_by_run_id(self, run_id: str, artifact_path: Optional[str] = None) -> List[ArtifactResp]:
|
|
104
102
|
"""根据运行ID获取制品列表
|
|
105
103
|
|
|
106
104
|
Args:
|
|
@@ -116,11 +114,11 @@ class ArtifactService:
|
|
|
116
114
|
return self._artifact.get_by_run_id(run_id, artifact_path)
|
|
117
115
|
|
|
118
116
|
def create_artifact(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
self,
|
|
118
|
+
local_path: str,
|
|
119
|
+
artifact_path: Optional[str] = None,
|
|
120
|
+
run_id: Optional[str] = None,
|
|
121
|
+
artifact_type: ArtifactType = ArtifactType.other,
|
|
124
122
|
) -> None:
|
|
125
123
|
"""创建单个文件制品并上传
|
|
126
124
|
|
|
@@ -171,11 +169,11 @@ class ArtifactService:
|
|
|
171
169
|
return
|
|
172
170
|
|
|
173
171
|
def create_artifacts(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
172
|
+
self,
|
|
173
|
+
local_dir: str,
|
|
174
|
+
artifact_path: Optional[str] = None,
|
|
175
|
+
run_id: Optional[str] = None,
|
|
176
|
+
artifact_type: ArtifactType = ArtifactType.other,
|
|
179
177
|
) -> None:
|
|
180
178
|
"""创建目录制品并上传
|
|
181
179
|
|
|
@@ -223,9 +221,7 @@ class ArtifactService:
|
|
|
223
221
|
logger.info(f"log artifact done: {artifact_path}")
|
|
224
222
|
return
|
|
225
223
|
|
|
226
|
-
def download_artifacts(
|
|
227
|
-
self, run_id: str, artifact_path: Optional[str], local_dir: str
|
|
228
|
-
) -> None:
|
|
224
|
+
def download_artifacts(self, run_id: str, artifact_path: Optional[str], local_dir: str) -> None:
|
|
229
225
|
"""下载制品
|
|
230
226
|
|
|
231
227
|
Args:
|
|
@@ -252,9 +248,7 @@ class ArtifactService:
|
|
|
252
248
|
if artifact_item.is_dir:
|
|
253
249
|
download_dir_from_s3(self.s3_client, bucket, object_name, local_dir)
|
|
254
250
|
else:
|
|
255
|
-
self.s3_client.fget_object(
|
|
256
|
-
bucket, object_name, str(Path(local_dir) / artifact_item.src_path)
|
|
257
|
-
)
|
|
251
|
+
self.s3_client.fget_object(bucket, object_name, str(Path(local_dir) / artifact_item.src_path))
|
|
258
252
|
|
|
259
253
|
logger.info(f"download artifact done: {artifact_path}")
|
|
260
254
|
return
|
|
@@ -311,9 +305,7 @@ class _Artifact:
|
|
|
311
305
|
raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
|
|
312
306
|
return
|
|
313
307
|
|
|
314
|
-
def get_by_run_id(
|
|
315
|
-
self, run_id: str, artifact_path: Optional[str]
|
|
316
|
-
) -> List[ArtifactResp]:
|
|
308
|
+
def get_by_run_id(self, run_id: str, artifact_path: Optional[str]) -> List[ArtifactResp]:
|
|
317
309
|
"""根据运行ID获取制品列表
|
|
318
310
|
|
|
319
311
|
Args:
|
|
@@ -326,18 +318,12 @@ class _Artifact:
|
|
|
326
318
|
Raises:
|
|
327
319
|
APIError: 当API调用失败时抛出
|
|
328
320
|
"""
|
|
329
|
-
resp = self._http.get(
|
|
330
|
-
f"{_Base}/artifacts?entity_id={run_id}&page_num=1&page_size={InfinityPageSize}"
|
|
331
|
-
)
|
|
321
|
+
resp = self._http.get(f"{_Base}/artifacts?entity_id={run_id}&page_num=1&page_size={InfinityPageSize}")
|
|
332
322
|
wrapper = APIWrapper[ArtifactRespData].model_validate(resp.json())
|
|
333
323
|
if wrapper.code != 0:
|
|
334
324
|
raise APIError(f"backend code {wrapper.code}: {wrapper.msg}")
|
|
335
325
|
if artifact_path:
|
|
336
|
-
return [
|
|
337
|
-
artifact
|
|
338
|
-
for artifact in wrapper.data.data
|
|
339
|
-
if artifact.src_path == artifact_path
|
|
340
|
-
]
|
|
326
|
+
return [artifact for artifact in wrapper.data.data if artifact.src_path == artifact_path]
|
|
341
327
|
else:
|
|
342
328
|
return wrapper.data.data
|
|
343
329
|
|