intellif-aihub 0.1.2__py3-none-any.whl → 0.1.3__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 +91 -87
- 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/labelfree.py +31 -31
- aihub/models/model_training_platform.py +230 -0
- aihub/models/tag_resource_management.py +50 -0
- aihub/models/task_center.py +117 -117
- aihub/models/user_system.py +262 -0
- aihub/services/artifact.py +353 -332
- aihub/services/dataset_management.py +240 -240
- aihub/services/document_center.py +43 -43
- aihub/services/labelfree.py +44 -44
- aihub/services/model_training_platform.py +135 -0
- aihub/services/quota_schedule_management.py +18 -18
- aihub/services/reporter.py +20 -20
- aihub/services/tag_resource_management.py +55 -0
- aihub/services/task_center.py +190 -190
- aihub/services/user_system.py +339 -0
- aihub/utils/download.py +69 -69
- aihub/utils/http.py +13 -13
- aihub/utils/s3.py +77 -77
- {intellif_aihub-0.1.2.dist-info → intellif_aihub-0.1.3.dist-info}/METADATA +2 -2
- intellif_aihub-0.1.3.dist-info/RECORD +34 -0
- {intellif_aihub-0.1.2.dist-info → intellif_aihub-0.1.3.dist-info}/licenses/LICENSE +200 -200
- aihub/models/tag_management.py +0 -21
- aihub/models/user.py +0 -46
- aihub/services/tag_management.py +0 -35
- aihub/services/user.py +0 -47
- intellif_aihub-0.1.2.dist-info/RECORD +0 -32
- {intellif_aihub-0.1.2.dist-info → intellif_aihub-0.1.3.dist-info}/WHEEL +0 -0
- {intellif_aihub-0.1.2.dist-info → intellif_aihub-0.1.3.dist-info}/top_level.txt +0 -0
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import List, Optional
|
|
4
|
-
|
|
5
|
-
from pydantic import BaseModel, Field
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class CreateDatasetRequest(BaseModel):
|
|
9
|
-
name: str
|
|
10
|
-
description: str
|
|
11
|
-
tags: List[int]
|
|
12
|
-
cover_img: Optional[str] = Field(None, alias="cover_img")
|
|
13
|
-
create_by: Optional[int] = Field(None, alias="create_by")
|
|
14
|
-
is_private: Optional[bool] = Field(None, alias="is_private")
|
|
15
|
-
access_user_ids: Optional[List[int]] = Field(None, alias="access_user_ids")
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class CreateDatasetResponse(BaseModel):
|
|
19
|
-
id: int = Field(alias="id")
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class DatasetVersionBase(BaseModel):
|
|
23
|
-
id: int
|
|
24
|
-
version: int
|
|
25
|
-
status: int
|
|
26
|
-
parquet_index_path: Optional[str] = Field(None, alias="parquet_index_path")
|
|
27
|
-
data_count: int = Field(alias="data_count")
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class DatasetDetail(BaseModel):
|
|
31
|
-
id: int
|
|
32
|
-
name: str
|
|
33
|
-
description: str
|
|
34
|
-
cover_img: Optional[str] = Field(None, alias="cover_img")
|
|
35
|
-
created_at: int = Field(alias="created_at")
|
|
36
|
-
updated_at: int = Field(alias="update_at")
|
|
37
|
-
user_id: int = Field(alias="user_id")
|
|
38
|
-
username: str
|
|
39
|
-
tags: List[int]
|
|
40
|
-
access_user_ids: Optional[List[int]] = Field(None, alias="access_user_ids")
|
|
41
|
-
is_private: Optional[bool] = Field(None, alias="is_private")
|
|
42
|
-
versions: List[DatasetVersionBase]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class ExtInfo(BaseModel):
|
|
46
|
-
rec_file_path: Optional[str] = Field(None, alias="rec_file_path")
|
|
47
|
-
idx_file_path: Optional[str] = Field(None, alias="idx_file_path")
|
|
48
|
-
json_file_path: Optional[str] = Field(None, alias="json_file_path")
|
|
49
|
-
image_dir_path: Optional[str] = Field(None, alias="image_dir_path")
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class CreateDatasetVersionRequest(BaseModel):
|
|
53
|
-
upload_path: str = Field(alias="upload_path")
|
|
54
|
-
description: Optional[str] = None
|
|
55
|
-
dataset_id: int = Field(alias="dataset_id")
|
|
56
|
-
object_cnt: Optional[int] = Field(None, alias="object_cnt")
|
|
57
|
-
data_size: Optional[int] = Field(None, alias="data_size")
|
|
58
|
-
create_by: Optional[int] = Field(None, alias="create_by")
|
|
59
|
-
upload_type: Optional[int] = Field(4, alias="upload_type")
|
|
60
|
-
ext_info: Optional[ExtInfo] = Field(None, alias="ext_info")
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class CreateDatasetVersionResponse(BaseModel):
|
|
64
|
-
id: int = Field(alias="id")
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class UploadDatasetVersionRequest(BaseModel):
|
|
68
|
-
upload_path: str = Field(alias="upload_path")
|
|
69
|
-
upload_type: int = Field(alias="upload_type")
|
|
70
|
-
dataset_id: int = Field(alias="dataset_id")
|
|
71
|
-
parent_version_id: Optional[int] = Field(None, alias="parent_version_id")
|
|
72
|
-
description: Optional[str] = Field(None, alias="description")
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
class UploadDatasetVersionResponse(BaseModel):
|
|
76
|
-
id: int = Field(alias="id")
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class DatasetVersionDetail(BaseModel):
|
|
80
|
-
id: int
|
|
81
|
-
version: int
|
|
82
|
-
dataset_id: int = Field(alias="dataset_id")
|
|
83
|
-
upload_path: str = Field(alias="upload_path")
|
|
84
|
-
upload_type: int = Field(alias="upload_type")
|
|
85
|
-
parent_version_id: Optional[int] = Field(None, alias="parent_version_id")
|
|
86
|
-
description: Optional[str] = None
|
|
87
|
-
status: int
|
|
88
|
-
message: Optional[str] = None
|
|
89
|
-
created_at: int = Field(alias="created_at")
|
|
90
|
-
user_id: int = Field(alias="user_id")
|
|
91
|
-
data_size: Optional[int] = Field(None, alias="data_size")
|
|
92
|
-
data_count: Optional[int] = Field(None, alias="data_count")
|
|
93
|
-
parquet_index_path: Optional[str] = Field(None, alias="parquet_index_path")
|
|
94
|
-
ext_info: Optional[ExtInfo] = Field(None, alias="ext_info")
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class FileUploadData(BaseModel):
|
|
98
|
-
path: str
|
|
99
|
-
url: str
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CreateDatasetRequest(BaseModel):
|
|
9
|
+
name: str
|
|
10
|
+
description: str
|
|
11
|
+
tags: List[int]
|
|
12
|
+
cover_img: Optional[str] = Field(None, alias="cover_img")
|
|
13
|
+
create_by: Optional[int] = Field(None, alias="create_by")
|
|
14
|
+
is_private: Optional[bool] = Field(None, alias="is_private")
|
|
15
|
+
access_user_ids: Optional[List[int]] = Field(None, alias="access_user_ids")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class CreateDatasetResponse(BaseModel):
|
|
19
|
+
id: int = Field(alias="id")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class DatasetVersionBase(BaseModel):
|
|
23
|
+
id: int
|
|
24
|
+
version: int
|
|
25
|
+
status: int
|
|
26
|
+
parquet_index_path: Optional[str] = Field(None, alias="parquet_index_path")
|
|
27
|
+
data_count: int = Field(alias="data_count")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class DatasetDetail(BaseModel):
|
|
31
|
+
id: int
|
|
32
|
+
name: str
|
|
33
|
+
description: str
|
|
34
|
+
cover_img: Optional[str] = Field(None, alias="cover_img")
|
|
35
|
+
created_at: int = Field(alias="created_at")
|
|
36
|
+
updated_at: int = Field(alias="update_at")
|
|
37
|
+
user_id: int = Field(alias="user_id")
|
|
38
|
+
username: str
|
|
39
|
+
tags: List[int]
|
|
40
|
+
access_user_ids: Optional[List[int]] = Field(None, alias="access_user_ids")
|
|
41
|
+
is_private: Optional[bool] = Field(None, alias="is_private")
|
|
42
|
+
versions: List[DatasetVersionBase]
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class ExtInfo(BaseModel):
|
|
46
|
+
rec_file_path: Optional[str] = Field(None, alias="rec_file_path")
|
|
47
|
+
idx_file_path: Optional[str] = Field(None, alias="idx_file_path")
|
|
48
|
+
json_file_path: Optional[str] = Field(None, alias="json_file_path")
|
|
49
|
+
image_dir_path: Optional[str] = Field(None, alias="image_dir_path")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class CreateDatasetVersionRequest(BaseModel):
|
|
53
|
+
upload_path: str = Field(alias="upload_path")
|
|
54
|
+
description: Optional[str] = None
|
|
55
|
+
dataset_id: int = Field(alias="dataset_id")
|
|
56
|
+
object_cnt: Optional[int] = Field(None, alias="object_cnt")
|
|
57
|
+
data_size: Optional[int] = Field(None, alias="data_size")
|
|
58
|
+
create_by: Optional[int] = Field(None, alias="create_by")
|
|
59
|
+
upload_type: Optional[int] = Field(4, alias="upload_type")
|
|
60
|
+
ext_info: Optional[ExtInfo] = Field(None, alias="ext_info")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class CreateDatasetVersionResponse(BaseModel):
|
|
64
|
+
id: int = Field(alias="id")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class UploadDatasetVersionRequest(BaseModel):
|
|
68
|
+
upload_path: str = Field(alias="upload_path")
|
|
69
|
+
upload_type: int = Field(alias="upload_type")
|
|
70
|
+
dataset_id: int = Field(alias="dataset_id")
|
|
71
|
+
parent_version_id: Optional[int] = Field(None, alias="parent_version_id")
|
|
72
|
+
description: Optional[str] = Field(None, alias="description")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class UploadDatasetVersionResponse(BaseModel):
|
|
76
|
+
id: int = Field(alias="id")
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class DatasetVersionDetail(BaseModel):
|
|
80
|
+
id: int
|
|
81
|
+
version: int
|
|
82
|
+
dataset_id: int = Field(alias="dataset_id")
|
|
83
|
+
upload_path: str = Field(alias="upload_path")
|
|
84
|
+
upload_type: int = Field(alias="upload_type")
|
|
85
|
+
parent_version_id: Optional[int] = Field(None, alias="parent_version_id")
|
|
86
|
+
description: Optional[str] = None
|
|
87
|
+
status: int
|
|
88
|
+
message: Optional[str] = None
|
|
89
|
+
created_at: int = Field(alias="created_at")
|
|
90
|
+
user_id: int = Field(alias="user_id")
|
|
91
|
+
data_size: Optional[int] = Field(None, alias="data_size")
|
|
92
|
+
data_count: Optional[int] = Field(None, alias="data_count")
|
|
93
|
+
parquet_index_path: Optional[str] = Field(None, alias="parquet_index_path")
|
|
94
|
+
ext_info: Optional[ExtInfo] = Field(None, alias="ext_info")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class FileUploadData(BaseModel):
|
|
98
|
+
path: str
|
|
99
|
+
url: str
|
aihub/models/document_center.py
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
# !/usr/bin/env python
|
|
2
|
-
# -*-coding:utf-8 -*-
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
from typing import List, Optional, Any
|
|
7
|
-
|
|
8
|
-
from pydantic import BaseModel
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Document(BaseModel):
|
|
12
|
-
id: int
|
|
13
|
-
title: str
|
|
14
|
-
type: int
|
|
15
|
-
edit_time: int
|
|
16
|
-
need_update: bool
|
|
17
|
-
content: str
|
|
18
|
-
username: str
|
|
19
|
-
user_id: int
|
|
20
|
-
created_at: int
|
|
21
|
-
comments: Optional[Any] = None
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class GetDocumentsResponse(BaseModel):
|
|
25
|
-
total: int
|
|
26
|
-
page_size: int
|
|
27
|
-
page_num: int
|
|
28
|
-
data: List[Document]
|
|
1
|
+
# !/usr/bin/env python
|
|
2
|
+
# -*-coding:utf-8 -*-
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import List, Optional, Any
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Document(BaseModel):
|
|
12
|
+
id: int
|
|
13
|
+
title: str
|
|
14
|
+
type: int
|
|
15
|
+
edit_time: int
|
|
16
|
+
need_update: bool
|
|
17
|
+
content: str
|
|
18
|
+
username: str
|
|
19
|
+
user_id: int
|
|
20
|
+
created_at: int
|
|
21
|
+
comments: Optional[Any] = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class GetDocumentsResponse(BaseModel):
|
|
25
|
+
total: int
|
|
26
|
+
page_size: int
|
|
27
|
+
page_num: int
|
|
28
|
+
data: List[Document]
|
aihub/models/labelfree.py
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Optional
|
|
4
|
-
|
|
5
|
-
from pydantic import BaseModel, Field
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Stats(BaseModel):
|
|
9
|
-
"""标注统计信息"""
|
|
10
|
-
|
|
11
|
-
total_annotations: int = Field(alias="total_annotations")
|
|
12
|
-
labeled_annotations: int = Field(alias="labeled_annotations")
|
|
13
|
-
total_labels: int = Field(alias="total_labels")
|
|
14
|
-
total_reviews: Optional[int] = Field(None, alias="total_reviews")
|
|
15
|
-
unlabeled_reviews: Optional[int] = Field(None, alias="unlabeled_reviews")
|
|
16
|
-
labeled_reviews: Optional[int] = Field(None, alias="labeled_reviews")
|
|
17
|
-
accepted_count: Optional[int] = Field(None, alias="accepted_count")
|
|
18
|
-
rejected_count: Optional[int] = Field(None, alias="rejected_count")
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class GetGlobalStatsResponse(BaseModel):
|
|
22
|
-
"""
|
|
23
|
-
标注统计概况
|
|
24
|
-
"""
|
|
25
|
-
|
|
26
|
-
global_stats: Stats = Field(alias="global_stats")
|
|
27
|
-
valid_ten_percent: bool = Field(alias="valid_ten_percent")
|
|
28
|
-
valid_fifty_percent: bool = Field(alias="valid_fifty_percent")
|
|
29
|
-
valid_hundred_percent: bool = Field(alias="valid_hundred_percent")
|
|
30
|
-
data_exported_count: int = Field(alias="data_exported_count")
|
|
31
|
-
exported_dataset_name: str = Field(alias="exported_dataset_name")
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Stats(BaseModel):
|
|
9
|
+
"""标注统计信息"""
|
|
10
|
+
|
|
11
|
+
total_annotations: int = Field(alias="total_annotations")
|
|
12
|
+
labeled_annotations: int = Field(alias="labeled_annotations")
|
|
13
|
+
total_labels: int = Field(alias="total_labels")
|
|
14
|
+
total_reviews: Optional[int] = Field(None, alias="total_reviews")
|
|
15
|
+
unlabeled_reviews: Optional[int] = Field(None, alias="unlabeled_reviews")
|
|
16
|
+
labeled_reviews: Optional[int] = Field(None, alias="labeled_reviews")
|
|
17
|
+
accepted_count: Optional[int] = Field(None, alias="accepted_count")
|
|
18
|
+
rejected_count: Optional[int] = Field(None, alias="rejected_count")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class GetGlobalStatsResponse(BaseModel):
|
|
22
|
+
"""
|
|
23
|
+
标注统计概况
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
global_stats: Stats = Field(alias="global_stats")
|
|
27
|
+
valid_ten_percent: bool = Field(alias="valid_ten_percent")
|
|
28
|
+
valid_fifty_percent: bool = Field(alias="valid_fifty_percent")
|
|
29
|
+
valid_hundred_percent: bool = Field(alias="valid_hundred_percent")
|
|
30
|
+
data_exported_count: int = Field(alias="data_exported_count")
|
|
31
|
+
exported_dataset_name: str = Field(alias="exported_dataset_name")
|
|
@@ -0,0 +1,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
|
+
id: int
|
|
106
|
+
framework: str
|
|
107
|
+
name: str
|
|
108
|
+
description: str
|
|
109
|
+
command: str
|
|
110
|
+
image: str
|
|
111
|
+
virtual_cluster: VirtualCluster = Field(alias="virtual_cluster")
|
|
112
|
+
sku_cnt: int = Field(alias="sku_cnt")
|
|
113
|
+
enable_ssh: bool = Field(alias="enable_ssh")
|
|
114
|
+
envs: Optional[List[Env]] = Field(None, alias="envs")
|
|
115
|
+
storages: Optional[List[Storage]] = Field(None, alias="storages")
|
|
116
|
+
instances: int
|
|
117
|
+
created_at: int = Field(alias="created_at")
|
|
118
|
+
username: str
|
|
119
|
+
user_id: int = Field(alias="user_id")
|
|
120
|
+
namespace: str
|
|
121
|
+
res_name: str = Field(alias="res_name")
|
|
122
|
+
status: int
|
|
123
|
+
use_ib_network: bool = Field(alias="use_ib_network")
|
|
124
|
+
always_pull_image: bool = Field(alias="always_pull_image")
|
|
125
|
+
shm: int
|
|
126
|
+
category: Category
|
|
127
|
+
project: Project
|
|
128
|
+
avg_gpu_util: float = Field(alias="avg_gpu_util")
|
|
129
|
+
finished_at: int = Field(alias="finished_at")
|
|
130
|
+
started_at: int = Field(alias="started_at")
|
|
131
|
+
estimate_run_time: int = Field(alias="estimate_run_time")
|
|
132
|
+
is_vip: bool = Field(alias="is_vip")
|
|
133
|
+
cluster_partition: str = Field(alias="cluster_partition")
|
|
134
|
+
preempt_policy: int = Field(alias="preempt_policy")
|
|
135
|
+
vip_node_names: List[str] = Field(alias="vip_node_names")
|
|
136
|
+
stop_op_user: Optional[User] = Field(None, alias="stop_op_user")
|
|
137
|
+
use_new_log: bool = Field(alias="use_new_log")
|
|
138
|
+
is_quota_schedule: bool = Field(alias="is_quota_schedule")
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class ListTrainingsResponse(BaseModel):
|
|
142
|
+
total: int
|
|
143
|
+
page_size: int = Field(alias="page_size")
|
|
144
|
+
page_num: int = Field(alias="page_num")
|
|
145
|
+
data: List[Training]
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class Pod(BaseModel):
|
|
149
|
+
id: int
|
|
150
|
+
namespace: str
|
|
151
|
+
name: str
|
|
152
|
+
status: str
|
|
153
|
+
created_at: int = Field(alias="created_at")
|
|
154
|
+
started_at: int = Field(alias="started_at")
|
|
155
|
+
finished_at: int = Field(alias="finished_at")
|
|
156
|
+
host_ip: str = Field(alias="host_ip")
|
|
157
|
+
node_name: str = Field(alias="node_name")
|
|
158
|
+
ssh_port: int = Field(alias="ssh_port")
|
|
159
|
+
ssh_info: str = Field(alias="ssh_info")
|
|
160
|
+
use_new_log: bool = Field(alias="use_new_log")
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class ListTrainingPodsRequest(BaseModel):
|
|
164
|
+
page_size: int = Field(20, alias="page_size")
|
|
165
|
+
page_num: int = Field(1, alias="page_num")
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class ListTrainingPodsResponse(BaseModel):
|
|
169
|
+
total: int
|
|
170
|
+
page_size: int = Field(alias="page_size")
|
|
171
|
+
page_num: int = Field(alias="page_num")
|
|
172
|
+
data: List[Pod]
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class PodLogInfo(BaseModel):
|
|
176
|
+
name: str
|
|
177
|
+
url: str
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class GetTrainingPodLogsNewResponse(BaseModel):
|
|
181
|
+
logs: List[PodLogInfo]
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class GetTrainingPodSpecResponse(BaseModel):
|
|
185
|
+
spec: str
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
class GetTrainingPodEventsResponse(BaseModel):
|
|
189
|
+
events: str
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class TrainingUser(BaseModel):
|
|
193
|
+
user_id: int = Field(alias="user_id")
|
|
194
|
+
username: str
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
class ListTrainingUsersRequest(BaseModel):
|
|
198
|
+
page_size: int = Field(20, alias="page_size")
|
|
199
|
+
page_num: int = Field(1, alias="page_num")
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class ListTrainingUsersResponse(BaseModel):
|
|
203
|
+
total: int
|
|
204
|
+
page_size: int = Field(alias="page_size")
|
|
205
|
+
page_num: int = Field(alias="page_num")
|
|
206
|
+
data: Optional[List[TrainingUser]] = Field(default_factory=list)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class Container(BaseModel):
|
|
210
|
+
namespace: str
|
|
211
|
+
pod_name: str = Field(alias="pod_name")
|
|
212
|
+
container_name: str = Field(alias="container_name")
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class TrainingContainer(BaseModel):
|
|
216
|
+
training_id: int = Field(alias="training_id")
|
|
217
|
+
training_name: str = Field(alias="training_name")
|
|
218
|
+
containers: List[Container]
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class ListTrainingContainersRequest(BaseModel):
|
|
222
|
+
page_size: int = Field(20, alias="page_size")
|
|
223
|
+
page_num: int = Field(1, alias="page_num")
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
class ListTrainingContainersResponse(BaseModel):
|
|
227
|
+
total: int
|
|
228
|
+
page_size: int = Field(alias="page_size")
|
|
229
|
+
page_num: int = Field(alias="page_num")
|
|
230
|
+
data: Optional[List[TrainingContainer]] = Field(default_factory=list)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# !/usr/bin/env python
|
|
2
|
+
# -*-coding:utf-8 -*-
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from typing import List, Optional
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, Field
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Project(BaseModel):
|
|
12
|
+
id: int
|
|
13
|
+
name: str
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ProjectListData(BaseModel):
|
|
17
|
+
data: List[Project]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class SelectProjectsResponse(BaseModel):
|
|
21
|
+
data: List[Project]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class SkuBrief(BaseModel):
|
|
25
|
+
id: int
|
|
26
|
+
description: str
|
|
27
|
+
cpu: int
|
|
28
|
+
memory: int
|
|
29
|
+
gpu_type: int = Field(alias="gpu_type")
|
|
30
|
+
gpu_memory: int = Field(alias="gpu_memory")
|
|
31
|
+
network: int
|
|
32
|
+
created_at: int = Field(alias="created_at")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class VirtualClusterBrief(BaseModel):
|
|
36
|
+
id: int
|
|
37
|
+
name: str
|
|
38
|
+
uuid: str
|
|
39
|
+
sku: Optional[SkuBrief] = None
|
|
40
|
+
created_at: int = Field(alias="created_at")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class SelectVirtualClustersRequest(BaseModel):
|
|
44
|
+
user_id: int = Field(alias="user_id")
|
|
45
|
+
module_type: Optional[int] = Field(None, alias="module_type")
|
|
46
|
+
new_module_type: Optional[str] = Field(None, alias="new_module_type")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class SelectVirtualClustersResponse(BaseModel):
|
|
50
|
+
data: Optional[List[VirtualClusterBrief]] = Field(default_factory=list)
|