synapse-sdk 1.0.0a23__py3-none-any.whl → 2025.12.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.
- synapse_sdk/__init__.py +24 -0
- synapse_sdk/cli/__init__.py +310 -5
- synapse_sdk/cli/alias/__init__.py +22 -0
- synapse_sdk/cli/alias/create.py +36 -0
- synapse_sdk/cli/alias/dataclass.py +31 -0
- synapse_sdk/cli/alias/default.py +16 -0
- synapse_sdk/cli/alias/delete.py +15 -0
- synapse_sdk/cli/alias/list.py +19 -0
- synapse_sdk/cli/alias/read.py +15 -0
- synapse_sdk/cli/alias/update.py +17 -0
- synapse_sdk/cli/alias/utils.py +61 -0
- synapse_sdk/cli/code_server.py +687 -0
- synapse_sdk/cli/config.py +440 -0
- synapse_sdk/cli/devtools.py +90 -0
- synapse_sdk/cli/plugin/__init__.py +33 -0
- synapse_sdk/cli/{create_plugin.py → plugin/create.py} +2 -2
- synapse_sdk/{plugins/cli → cli/plugin}/publish.py +23 -15
- synapse_sdk/clients/agent/__init__.py +9 -3
- synapse_sdk/clients/agent/container.py +143 -0
- synapse_sdk/clients/agent/core.py +19 -0
- synapse_sdk/clients/agent/ray.py +298 -9
- synapse_sdk/clients/backend/__init__.py +30 -12
- synapse_sdk/clients/backend/annotation.py +13 -5
- synapse_sdk/clients/backend/core.py +31 -4
- synapse_sdk/clients/backend/data_collection.py +186 -0
- synapse_sdk/clients/backend/hitl.py +17 -0
- synapse_sdk/clients/backend/integration.py +16 -1
- synapse_sdk/clients/backend/ml.py +5 -1
- synapse_sdk/clients/backend/models.py +78 -0
- synapse_sdk/clients/base.py +384 -41
- synapse_sdk/clients/ray/serve.py +2 -0
- synapse_sdk/clients/validators/collections.py +31 -0
- synapse_sdk/devtools/config.py +94 -0
- synapse_sdk/devtools/server.py +41 -0
- synapse_sdk/devtools/streamlit_app/__init__.py +5 -0
- synapse_sdk/devtools/streamlit_app/app.py +128 -0
- synapse_sdk/devtools/streamlit_app/services/__init__.py +11 -0
- synapse_sdk/devtools/streamlit_app/services/job_service.py +233 -0
- synapse_sdk/devtools/streamlit_app/services/plugin_service.py +236 -0
- synapse_sdk/devtools/streamlit_app/services/serve_service.py +95 -0
- synapse_sdk/devtools/streamlit_app/ui/__init__.py +15 -0
- synapse_sdk/devtools/streamlit_app/ui/config_tab.py +76 -0
- synapse_sdk/devtools/streamlit_app/ui/deployment_tab.py +66 -0
- synapse_sdk/devtools/streamlit_app/ui/http_tab.py +125 -0
- synapse_sdk/devtools/streamlit_app/ui/jobs_tab.py +573 -0
- synapse_sdk/devtools/streamlit_app/ui/serve_tab.py +346 -0
- synapse_sdk/devtools/streamlit_app/ui/status_bar.py +118 -0
- synapse_sdk/devtools/streamlit_app/utils/__init__.py +40 -0
- synapse_sdk/devtools/streamlit_app/utils/json_viewer.py +197 -0
- synapse_sdk/devtools/streamlit_app/utils/log_formatter.py +38 -0
- synapse_sdk/devtools/streamlit_app/utils/styles.py +241 -0
- synapse_sdk/devtools/streamlit_app/utils/ui_components.py +289 -0
- synapse_sdk/devtools/streamlit_app.py +10 -0
- synapse_sdk/loggers.py +120 -9
- synapse_sdk/plugins/README.md +1340 -0
- synapse_sdk/plugins/__init__.py +0 -13
- synapse_sdk/plugins/categories/base.py +117 -11
- synapse_sdk/plugins/categories/data_validation/actions/validation.py +72 -0
- synapse_sdk/plugins/categories/data_validation/templates/plugin/validation.py +33 -5
- synapse_sdk/plugins/categories/export/actions/__init__.py +3 -0
- synapse_sdk/plugins/categories/export/actions/export/__init__.py +28 -0
- synapse_sdk/plugins/categories/export/actions/export/action.py +165 -0
- synapse_sdk/plugins/categories/export/actions/export/enums.py +113 -0
- synapse_sdk/plugins/categories/export/actions/export/exceptions.py +53 -0
- synapse_sdk/plugins/categories/export/actions/export/models.py +74 -0
- synapse_sdk/plugins/categories/export/actions/export/run.py +195 -0
- synapse_sdk/plugins/categories/export/actions/export/utils.py +187 -0
- synapse_sdk/plugins/categories/export/templates/config.yaml +21 -0
- synapse_sdk/plugins/categories/export/templates/plugin/__init__.py +390 -0
- synapse_sdk/plugins/categories/export/templates/plugin/export.py +160 -0
- synapse_sdk/plugins/categories/neural_net/actions/deployment.py +13 -12
- synapse_sdk/plugins/categories/neural_net/actions/train.py +1134 -31
- synapse_sdk/plugins/categories/neural_net/actions/tune.py +534 -0
- synapse_sdk/plugins/categories/neural_net/base/inference.py +1 -1
- synapse_sdk/plugins/categories/neural_net/templates/config.yaml +32 -4
- synapse_sdk/plugins/categories/neural_net/templates/plugin/inference.py +26 -10
- synapse_sdk/plugins/categories/pre_annotation/actions/__init__.py +4 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/pre_annotation/__init__.py +3 -0
- synapse_sdk/plugins/categories/{export/actions/export.py → pre_annotation/actions/pre_annotation/action.py} +4 -4
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/__init__.py +28 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/action.py +148 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/enums.py +269 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/exceptions.py +14 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/factory.py +76 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/models.py +100 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/orchestrator.py +248 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/run.py +64 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/strategies/__init__.py +17 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/strategies/annotation.py +265 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/strategies/base.py +170 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/strategies/extraction.py +83 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/strategies/metrics.py +92 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/strategies/preprocessor.py +243 -0
- synapse_sdk/plugins/categories/pre_annotation/actions/to_task/strategies/validation.py +143 -0
- synapse_sdk/plugins/categories/pre_annotation/templates/config.yaml +19 -0
- synapse_sdk/plugins/categories/pre_annotation/templates/plugin/to_task.py +40 -0
- synapse_sdk/plugins/categories/smart_tool/templates/config.yaml +2 -0
- synapse_sdk/plugins/categories/upload/__init__.py +0 -0
- synapse_sdk/plugins/categories/upload/actions/__init__.py +0 -0
- synapse_sdk/plugins/categories/upload/actions/upload/__init__.py +19 -0
- synapse_sdk/plugins/categories/upload/actions/upload/action.py +236 -0
- synapse_sdk/plugins/categories/upload/actions/upload/context.py +185 -0
- synapse_sdk/plugins/categories/upload/actions/upload/enums.py +493 -0
- synapse_sdk/plugins/categories/upload/actions/upload/exceptions.py +36 -0
- synapse_sdk/plugins/categories/upload/actions/upload/factory.py +138 -0
- synapse_sdk/plugins/categories/upload/actions/upload/models.py +214 -0
- synapse_sdk/plugins/categories/upload/actions/upload/orchestrator.py +183 -0
- synapse_sdk/plugins/categories/upload/actions/upload/registry.py +113 -0
- synapse_sdk/plugins/categories/upload/actions/upload/run.py +179 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/__init__.py +1 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/base.py +107 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/cleanup.py +62 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/collection.py +63 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/generate.py +91 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/initialize.py +82 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/metadata.py +235 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/organize.py +201 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/upload.py +104 -0
- synapse_sdk/plugins/categories/upload/actions/upload/steps/validate.py +71 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/__init__.py +1 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/base.py +82 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/__init__.py +1 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/batch.py +39 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/single.py +29 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/__init__.py +1 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/flat.py +300 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/recursive.py +287 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/__init__.py +1 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/excel.py +174 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/none.py +16 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/upload/__init__.py +1 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/upload/sync.py +84 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/validation/__init__.py +1 -0
- synapse_sdk/plugins/categories/upload/actions/upload/strategies/validation/default.py +60 -0
- synapse_sdk/plugins/categories/upload/actions/upload/utils.py +250 -0
- synapse_sdk/plugins/categories/upload/templates/README.md +470 -0
- synapse_sdk/plugins/categories/upload/templates/config.yaml +33 -0
- synapse_sdk/plugins/categories/upload/templates/plugin/__init__.py +310 -0
- synapse_sdk/plugins/categories/upload/templates/plugin/upload.py +102 -0
- synapse_sdk/plugins/enums.py +3 -1
- synapse_sdk/plugins/models.py +148 -11
- synapse_sdk/plugins/templates/plugin-config-schema.json +406 -0
- synapse_sdk/plugins/templates/schema.json +491 -0
- synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/config.yaml +1 -0
- synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/requirements.txt +1 -1
- synapse_sdk/plugins/utils/__init__.py +46 -0
- synapse_sdk/plugins/utils/actions.py +119 -0
- synapse_sdk/plugins/utils/config.py +203 -0
- synapse_sdk/plugins/{utils.py → utils/legacy.py} +26 -46
- synapse_sdk/plugins/utils/ray_gcs.py +66 -0
- synapse_sdk/plugins/utils/registry.py +58 -0
- synapse_sdk/shared/__init__.py +25 -0
- synapse_sdk/shared/enums.py +93 -0
- synapse_sdk/types.py +19 -0
- synapse_sdk/utils/converters/__init__.py +240 -0
- synapse_sdk/utils/converters/coco/__init__.py +0 -0
- synapse_sdk/utils/converters/coco/from_dm.py +322 -0
- synapse_sdk/utils/converters/coco/to_dm.py +215 -0
- synapse_sdk/utils/converters/dm/__init__.py +57 -0
- synapse_sdk/utils/converters/dm/base.py +137 -0
- synapse_sdk/utils/converters/dm/from_v1.py +273 -0
- synapse_sdk/utils/converters/dm/to_v1.py +321 -0
- synapse_sdk/utils/converters/dm/tools/__init__.py +214 -0
- synapse_sdk/utils/converters/dm/tools/answer.py +95 -0
- synapse_sdk/utils/converters/dm/tools/bounding_box.py +132 -0
- synapse_sdk/utils/converters/dm/tools/bounding_box_3d.py +121 -0
- synapse_sdk/utils/converters/dm/tools/classification.py +75 -0
- synapse_sdk/utils/converters/dm/tools/keypoint.py +117 -0
- synapse_sdk/utils/converters/dm/tools/named_entity.py +111 -0
- synapse_sdk/utils/converters/dm/tools/polygon.py +122 -0
- synapse_sdk/utils/converters/dm/tools/polyline.py +124 -0
- synapse_sdk/utils/converters/dm/tools/prompt.py +94 -0
- synapse_sdk/utils/converters/dm/tools/relation.py +86 -0
- synapse_sdk/utils/converters/dm/tools/segmentation.py +141 -0
- synapse_sdk/utils/converters/dm/tools/segmentation_3d.py +83 -0
- synapse_sdk/utils/converters/dm/types.py +168 -0
- synapse_sdk/utils/converters/dm/utils.py +162 -0
- synapse_sdk/utils/converters/dm_legacy/__init__.py +56 -0
- synapse_sdk/utils/converters/dm_legacy/from_v1.py +627 -0
- synapse_sdk/utils/converters/dm_legacy/to_v1.py +367 -0
- synapse_sdk/utils/converters/pascal/__init__.py +0 -0
- synapse_sdk/utils/converters/pascal/from_dm.py +244 -0
- synapse_sdk/utils/converters/pascal/to_dm.py +214 -0
- synapse_sdk/utils/converters/yolo/__init__.py +0 -0
- synapse_sdk/utils/converters/yolo/from_dm.py +384 -0
- synapse_sdk/utils/converters/yolo/to_dm.py +267 -0
- synapse_sdk/utils/dataset.py +46 -0
- synapse_sdk/utils/encryption.py +158 -0
- synapse_sdk/utils/file/__init__.py +58 -0
- synapse_sdk/utils/file/archive.py +32 -0
- synapse_sdk/utils/file/checksum.py +56 -0
- synapse_sdk/utils/file/chunking.py +31 -0
- synapse_sdk/utils/file/download.py +385 -0
- synapse_sdk/utils/file/encoding.py +40 -0
- synapse_sdk/utils/file/io.py +22 -0
- synapse_sdk/utils/file/upload.py +165 -0
- synapse_sdk/utils/file/video/__init__.py +29 -0
- synapse_sdk/utils/file/video/transcode.py +307 -0
- synapse_sdk/utils/file.py.backup +301 -0
- synapse_sdk/utils/http.py +138 -0
- synapse_sdk/utils/network.py +309 -0
- synapse_sdk/utils/storage/__init__.py +72 -0
- synapse_sdk/utils/storage/providers/__init__.py +183 -0
- synapse_sdk/utils/storage/providers/file_system.py +134 -0
- synapse_sdk/utils/storage/providers/gcp.py +13 -0
- synapse_sdk/utils/storage/providers/http.py +190 -0
- synapse_sdk/utils/storage/providers/s3.py +91 -0
- synapse_sdk/utils/storage/providers/sftp.py +47 -0
- synapse_sdk/utils/storage/registry.py +17 -0
- synapse_sdk-2025.12.3.dist-info/METADATA +123 -0
- synapse_sdk-2025.12.3.dist-info/RECORD +279 -0
- {synapse_sdk-1.0.0a23.dist-info → synapse_sdk-2025.12.3.dist-info}/WHEEL +1 -1
- synapse_sdk/clients/backend/dataset.py +0 -51
- synapse_sdk/plugins/categories/import/actions/import.py +0 -10
- synapse_sdk/plugins/cli/__init__.py +0 -21
- synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/.env +0 -24
- synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/.env.dist +0 -24
- synapse_sdk/plugins/templates/synapse-{{cookiecutter.plugin_code}}-plugin/main.py +0 -4
- synapse_sdk/utils/file.py +0 -168
- synapse_sdk/utils/storage.py +0 -91
- synapse_sdk-1.0.0a23.dist-info/METADATA +0 -44
- synapse_sdk-1.0.0a23.dist-info/RECORD +0 -114
- /synapse_sdk/{plugins/cli → cli/plugin}/run.py +0 -0
- /synapse_sdk/{plugins/categories/import → clients/validators}/__init__.py +0 -0
- /synapse_sdk/{plugins/categories/import/actions → devtools}/__init__.py +0 -0
- {synapse_sdk-1.0.0a23.dist-info → synapse_sdk-2025.12.3.dist-info}/entry_points.txt +0 -0
- {synapse_sdk-1.0.0a23.dist-info → synapse_sdk-2025.12.3.dist-info/licenses}/LICENSE +0 -0
- {synapse_sdk-1.0.0a23.dist-info → synapse_sdk-2025.12.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Generator
|
|
4
|
+
|
|
5
|
+
import requests
|
|
6
|
+
|
|
7
|
+
from synapse_sdk.plugins.categories.export.actions.export.enums import ExportStatus
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BaseExporter:
|
|
11
|
+
"""Base class for export plugins with common functionality.
|
|
12
|
+
|
|
13
|
+
This class handles common tasks like progress tracking, logging, and metrics
|
|
14
|
+
that are shared across all export plugins. Plugin developers should inherit
|
|
15
|
+
from this class and implement the required methods for their specific logic.
|
|
16
|
+
|
|
17
|
+
Core Methods:
|
|
18
|
+
export(): Main export method - handles the complete export workflow
|
|
19
|
+
process_data_conversion(): Handle data conversion pipeline
|
|
20
|
+
process_file_saving(): Handle file saving operations (can be overridden)
|
|
21
|
+
setup_output_directories(): Setup output directories (can be overridden)
|
|
22
|
+
|
|
23
|
+
Required Methods (should be implemented by subclasses):
|
|
24
|
+
convert_data(): Transform data during export
|
|
25
|
+
|
|
26
|
+
Optional Methods (can be overridden by subclasses):
|
|
27
|
+
save_original_file(): Save original files from export items
|
|
28
|
+
save_as_json(): Save data as JSON files
|
|
29
|
+
before_convert(): Pre-process data before conversion
|
|
30
|
+
after_convert(): Post-process data after conversion
|
|
31
|
+
process_file_saving(): Custom file saving logic
|
|
32
|
+
|
|
33
|
+
Helper Methods:
|
|
34
|
+
_process_original_file_saving(): Handle original file saving with metrics
|
|
35
|
+
_process_json_file_saving(): Handle JSON file saving with metrics
|
|
36
|
+
|
|
37
|
+
Auto-provided Utilities:
|
|
38
|
+
Progress tracking via self.run.set_progress()
|
|
39
|
+
Logging via self.run.log_message() and other run methods
|
|
40
|
+
Error handling and metrics collection via self.run methods
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def __init__(self, run, export_items: Generator, path_root: Path, **params):
|
|
44
|
+
"""Initialize the base export class.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
run: Plugin run object with logging capabilities.
|
|
48
|
+
export_items (generator): Export items generator
|
|
49
|
+
path_root: pathlib object, the path to export
|
|
50
|
+
**params: Additional parameters
|
|
51
|
+
"""
|
|
52
|
+
self.run = run
|
|
53
|
+
self.export_items = export_items
|
|
54
|
+
self.path_root = path_root
|
|
55
|
+
self.params = params
|
|
56
|
+
|
|
57
|
+
def _create_unique_export_path(self, base_name: str) -> Path:
|
|
58
|
+
"""Create a unique export path to avoid conflicts."""
|
|
59
|
+
export_path = self.path_root / base_name
|
|
60
|
+
unique_export_path = export_path
|
|
61
|
+
counter = 1
|
|
62
|
+
while unique_export_path.exists():
|
|
63
|
+
unique_export_path = export_path.with_name(f'{export_path.name}({counter})')
|
|
64
|
+
counter += 1
|
|
65
|
+
unique_export_path.mkdir(parents=True)
|
|
66
|
+
return unique_export_path
|
|
67
|
+
|
|
68
|
+
def _save_error_list(self, export_path: Path, errors_json_file_list: list, errors_original_file_list: list):
|
|
69
|
+
"""Save error list files if there are any errors."""
|
|
70
|
+
if len(errors_json_file_list) > 0 or len(errors_original_file_list) > 0:
|
|
71
|
+
export_error_file = {'json_file_name': errors_json_file_list, 'origin_file_name': errors_original_file_list}
|
|
72
|
+
with (export_path / 'error_file_list.json').open('w', encoding='utf-8') as f:
|
|
73
|
+
json.dump(export_error_file, f, indent=4, ensure_ascii=False)
|
|
74
|
+
|
|
75
|
+
def get_original_file_name(self, files):
|
|
76
|
+
"""Retrieve the original file path from the given file information.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
files (dict): A dictionary containing file information
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
file_name (str): The original file name extracted from the file information.
|
|
83
|
+
"""
|
|
84
|
+
return files['file_name_original']
|
|
85
|
+
|
|
86
|
+
def save_original_file(self, result, base_path, error_file_list):
|
|
87
|
+
"""Saves the original file.
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
result (dict): API response data containing file information.
|
|
91
|
+
base_path (Path): The directory where the file will be saved.
|
|
92
|
+
error_file_list (list): A list to store error files.
|
|
93
|
+
"""
|
|
94
|
+
file_url = result['files']['url']
|
|
95
|
+
file_name = self.get_original_file_name(result['files'])
|
|
96
|
+
response = requests.get(file_url)
|
|
97
|
+
file_info = {'file_name': file_name}
|
|
98
|
+
error_msg = ''
|
|
99
|
+
try:
|
|
100
|
+
with (base_path / file_name).open('wb') as file:
|
|
101
|
+
file.write(response.content)
|
|
102
|
+
status = ExportStatus.SUCCESS
|
|
103
|
+
except Exception as e:
|
|
104
|
+
error_msg = str(e)
|
|
105
|
+
error_file_list.append([file_name, error_msg])
|
|
106
|
+
status = ExportStatus.FAILED
|
|
107
|
+
|
|
108
|
+
self.run.export_log_original_file(result['id'], file_info, status, error_msg)
|
|
109
|
+
return status
|
|
110
|
+
|
|
111
|
+
def save_as_json(self, result, base_path, error_file_list):
|
|
112
|
+
"""Saves the data as a JSON file.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
result (dict): API response data containing file information.
|
|
116
|
+
base_path (Path): The directory where the file will be saved.
|
|
117
|
+
error_file_list (list): A list to store error files.
|
|
118
|
+
"""
|
|
119
|
+
file_name = Path(self.get_original_file_name(result['files'])).stem
|
|
120
|
+
json_data = result['data']
|
|
121
|
+
file_info = {'file_name': f'{file_name}.json'}
|
|
122
|
+
|
|
123
|
+
if json_data is None:
|
|
124
|
+
error_msg = 'data is Null'
|
|
125
|
+
error_file_list.append([f'{file_name}.json', error_msg])
|
|
126
|
+
status = ExportStatus.FAILED
|
|
127
|
+
self.run.log_export_event('NULL_DATA_DETECTED', result['id'])
|
|
128
|
+
self.run.export_log_json_file(result['id'], file_info, status, error_msg)
|
|
129
|
+
return status
|
|
130
|
+
|
|
131
|
+
error_msg = ''
|
|
132
|
+
try:
|
|
133
|
+
with (base_path / f'{file_name}.json').open('w', encoding='utf-8') as f:
|
|
134
|
+
json.dump(json_data, f, indent=4, ensure_ascii=False)
|
|
135
|
+
status = ExportStatus.SUCCESS
|
|
136
|
+
except Exception as e:
|
|
137
|
+
error_msg = str(e)
|
|
138
|
+
error_file_list.append([f'{file_name}.json', str(e)])
|
|
139
|
+
status = ExportStatus.FAILED
|
|
140
|
+
|
|
141
|
+
self.run.export_log_json_file(result['id'], file_info, status, error_msg)
|
|
142
|
+
return status
|
|
143
|
+
|
|
144
|
+
# Abstract methods that should be implemented by subclasses
|
|
145
|
+
def convert_data(self, data):
|
|
146
|
+
"""Converts the data. Should be implemented by subclasses."""
|
|
147
|
+
return data
|
|
148
|
+
|
|
149
|
+
def before_convert(self, data):
|
|
150
|
+
"""Preprocesses the data before conversion. Should be implemented by subclasses."""
|
|
151
|
+
return data
|
|
152
|
+
|
|
153
|
+
def after_convert(self, data):
|
|
154
|
+
"""Post-processes the data after conversion. Should be implemented by subclasses."""
|
|
155
|
+
return data
|
|
156
|
+
|
|
157
|
+
def _process_original_file_saving(
|
|
158
|
+
self, final_data, origin_files_output_path, errors_original_file_list, original_file_metrics_record, no
|
|
159
|
+
):
|
|
160
|
+
"""Process original file saving with metrics tracking.
|
|
161
|
+
|
|
162
|
+
Args:
|
|
163
|
+
final_data: Converted data to save
|
|
164
|
+
origin_files_output_path: Path to save original files
|
|
165
|
+
errors_original_file_list: List to collect errors
|
|
166
|
+
original_file_metrics_record: Metrics record for tracking
|
|
167
|
+
no: Current item number for logging
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
bool: True if processing should continue, False if should skip to next item
|
|
171
|
+
"""
|
|
172
|
+
if no == 1:
|
|
173
|
+
self.run.log_message('Saving original file.')
|
|
174
|
+
original_status = self.save_original_file(final_data, origin_files_output_path, errors_original_file_list)
|
|
175
|
+
|
|
176
|
+
original_file_metrics_record.stand_by -= 1
|
|
177
|
+
if original_status == ExportStatus.FAILED:
|
|
178
|
+
original_file_metrics_record.failed += 1
|
|
179
|
+
return False # Skip to next item
|
|
180
|
+
else:
|
|
181
|
+
original_file_metrics_record.success += 1
|
|
182
|
+
return True # Continue processing
|
|
183
|
+
|
|
184
|
+
def _process_json_file_saving(
|
|
185
|
+
self, final_data, json_output_path, errors_json_file_list, data_file_metrics_record, no
|
|
186
|
+
):
|
|
187
|
+
"""Process JSON file saving with metrics tracking.
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
final_data: Converted data to save
|
|
191
|
+
json_output_path: Path to save JSON files
|
|
192
|
+
errors_json_file_list: List to collect errors
|
|
193
|
+
data_file_metrics_record: Metrics record for tracking
|
|
194
|
+
no: Current item number for logging
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
bool: True if processing should continue, False if should skip to next item
|
|
198
|
+
"""
|
|
199
|
+
if no == 1:
|
|
200
|
+
self.run.log_message('Saving json file.')
|
|
201
|
+
data_status = self.save_as_json(final_data, json_output_path, errors_json_file_list)
|
|
202
|
+
|
|
203
|
+
data_file_metrics_record.stand_by -= 1
|
|
204
|
+
if data_status == ExportStatus.FAILED:
|
|
205
|
+
data_file_metrics_record.failed += 1
|
|
206
|
+
return False # Skip to next item
|
|
207
|
+
else:
|
|
208
|
+
data_file_metrics_record.success += 1
|
|
209
|
+
return True # Continue processing
|
|
210
|
+
|
|
211
|
+
def setup_output_directories(self, unique_export_path, save_original_file_flag):
|
|
212
|
+
"""Setup output directories for export.
|
|
213
|
+
|
|
214
|
+
This method can be overridden by subclasses to customize directory structure.
|
|
215
|
+
The default implementation creates 'json' and 'origin_files' directories.
|
|
216
|
+
|
|
217
|
+
Args:
|
|
218
|
+
unique_export_path: Base path for export
|
|
219
|
+
save_original_file_flag: Whether original files will be saved
|
|
220
|
+
|
|
221
|
+
Returns:
|
|
222
|
+
dict: Dictionary containing paths for different file types
|
|
223
|
+
Example: {'json_output_path': Path, 'origin_files_output_path': Path}
|
|
224
|
+
"""
|
|
225
|
+
# Path to save JSON files
|
|
226
|
+
json_output_path = unique_export_path / 'json'
|
|
227
|
+
json_output_path.mkdir(parents=True, exist_ok=True)
|
|
228
|
+
|
|
229
|
+
output_paths = {'json_output_path': json_output_path}
|
|
230
|
+
|
|
231
|
+
# Path to save original files
|
|
232
|
+
if save_original_file_flag:
|
|
233
|
+
origin_files_output_path = unique_export_path / 'origin_files'
|
|
234
|
+
origin_files_output_path.mkdir(parents=True, exist_ok=True)
|
|
235
|
+
output_paths['origin_files_output_path'] = origin_files_output_path
|
|
236
|
+
|
|
237
|
+
return output_paths
|
|
238
|
+
|
|
239
|
+
def process_data_conversion(self, export_item):
|
|
240
|
+
"""Process data conversion pipeline for a single export item.
|
|
241
|
+
|
|
242
|
+
This method handles the complete data conversion process:
|
|
243
|
+
before_convert -> convert_data -> after_convert
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
export_item: Single export item to process
|
|
247
|
+
|
|
248
|
+
Returns:
|
|
249
|
+
Final processed data ready for saving
|
|
250
|
+
"""
|
|
251
|
+
preprocessed_data = self.before_convert(export_item)
|
|
252
|
+
converted_data = self.convert_data(preprocessed_data)
|
|
253
|
+
final_data = self.after_convert(converted_data)
|
|
254
|
+
return final_data
|
|
255
|
+
|
|
256
|
+
def process_file_saving(
|
|
257
|
+
self,
|
|
258
|
+
final_data,
|
|
259
|
+
unique_export_path,
|
|
260
|
+
save_original_file_flag,
|
|
261
|
+
errors_json_file_list,
|
|
262
|
+
errors_original_file_list,
|
|
263
|
+
original_file_metrics_record,
|
|
264
|
+
data_file_metrics_record,
|
|
265
|
+
no,
|
|
266
|
+
):
|
|
267
|
+
"""Process file saving operations for a single export item.
|
|
268
|
+
|
|
269
|
+
This method can be overridden by subclasses to implement custom file saving logic.
|
|
270
|
+
The default implementation saves original files and JSON files based on configuration.
|
|
271
|
+
|
|
272
|
+
Args:
|
|
273
|
+
final_data: Converted data ready for saving
|
|
274
|
+
unique_export_path: Base path for export
|
|
275
|
+
save_original_file_flag: Whether to save original files
|
|
276
|
+
errors_json_file_list: List to collect JSON file errors
|
|
277
|
+
errors_original_file_list: List to collect original file errors
|
|
278
|
+
original_file_metrics_record: Metrics record for original files
|
|
279
|
+
data_file_metrics_record: Metrics record for JSON files
|
|
280
|
+
no: Current item number for logging
|
|
281
|
+
|
|
282
|
+
Returns:
|
|
283
|
+
bool: True if processing should continue, False if should skip to next item
|
|
284
|
+
"""
|
|
285
|
+
# Get paths from setup (directories already created)
|
|
286
|
+
json_output_path = unique_export_path / 'json'
|
|
287
|
+
origin_files_output_path = unique_export_path / 'origin_files' if save_original_file_flag else None
|
|
288
|
+
|
|
289
|
+
if save_original_file_flag:
|
|
290
|
+
should_continue = self._process_original_file_saving(
|
|
291
|
+
final_data, origin_files_output_path, errors_original_file_list, original_file_metrics_record, no
|
|
292
|
+
)
|
|
293
|
+
if not should_continue:
|
|
294
|
+
return False
|
|
295
|
+
|
|
296
|
+
self.run.log_metrics(record=original_file_metrics_record, category='original_file')
|
|
297
|
+
|
|
298
|
+
# Extract data as JSON files
|
|
299
|
+
should_continue = self._process_json_file_saving(
|
|
300
|
+
final_data, json_output_path, errors_json_file_list, data_file_metrics_record, no
|
|
301
|
+
)
|
|
302
|
+
if not should_continue:
|
|
303
|
+
return False
|
|
304
|
+
|
|
305
|
+
self.run.log_metrics(record=data_file_metrics_record, category='data_file')
|
|
306
|
+
|
|
307
|
+
return True
|
|
308
|
+
|
|
309
|
+
def additional_file_saving(self, unique_export_path):
|
|
310
|
+
"""Save additional files after processing all export items.
|
|
311
|
+
|
|
312
|
+
This method is called after the main export loop completes and is intended
|
|
313
|
+
for saving files that need to be created based on the collective data from
|
|
314
|
+
all processed export items (e.g., metadata files, configuration files,
|
|
315
|
+
summary files, etc.).
|
|
316
|
+
|
|
317
|
+
Args:
|
|
318
|
+
unique_export_path (str): The unique export directory path where
|
|
319
|
+
additional files should be saved.
|
|
320
|
+
"""
|
|
321
|
+
pass
|
|
322
|
+
|
|
323
|
+
def export(self, export_items=None, results=None, **_kwargs) -> dict:
|
|
324
|
+
"""Main export method that can be overridden by subclasses for custom logic.
|
|
325
|
+
|
|
326
|
+
This default implementation provides standard file saving functionality.
|
|
327
|
+
Subclasses can override this method to implement custom export logic
|
|
328
|
+
while still using the helper methods for specific operations.
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
Subclasses can override process_file_saving() method to implement custom file saving logic.
|
|
332
|
+
|
|
333
|
+
Args:
|
|
334
|
+
export_items: Optional export items to process. If not provided, uses self.export_items.
|
|
335
|
+
results: Optional results data to process alongside export_items.
|
|
336
|
+
**kwargs: Additional parameters for export customization.
|
|
337
|
+
|
|
338
|
+
Returns:
|
|
339
|
+
dict: Export result containing export path and status information.
|
|
340
|
+
"""
|
|
341
|
+
# Use provided export_items or fall back to instance variable
|
|
342
|
+
items_to_process = export_items if export_items is not None else self.export_items
|
|
343
|
+
|
|
344
|
+
unique_export_path = self._create_unique_export_path(self.params['name'])
|
|
345
|
+
|
|
346
|
+
self.run.log_message('Starting export process.')
|
|
347
|
+
|
|
348
|
+
save_original_file_flag = self.params.get('save_original_file')
|
|
349
|
+
errors_json_file_list = []
|
|
350
|
+
errors_original_file_list = []
|
|
351
|
+
|
|
352
|
+
# Setup output directories (can be customized by subclasses)
|
|
353
|
+
self.setup_output_directories(unique_export_path, save_original_file_flag)
|
|
354
|
+
|
|
355
|
+
total = self.params['count']
|
|
356
|
+
|
|
357
|
+
original_file_metrics_record = self.run.MetricsRecord(stand_by=total, success=0, failed=0)
|
|
358
|
+
data_file_metrics_record = self.run.MetricsRecord(stand_by=total, success=0, failed=0)
|
|
359
|
+
|
|
360
|
+
# progress init
|
|
361
|
+
self.run.set_progress(0, total, category='dataset_conversion')
|
|
362
|
+
|
|
363
|
+
for no, export_item in enumerate(items_to_process, start=1):
|
|
364
|
+
self.run.set_progress(min(no, total), total, category='dataset_conversion')
|
|
365
|
+
if no == 1:
|
|
366
|
+
self.run.log_message('Converting dataset.')
|
|
367
|
+
|
|
368
|
+
final_data = self.process_data_conversion(export_item)
|
|
369
|
+
|
|
370
|
+
# Process file saving (can be overridden by subclasses)
|
|
371
|
+
should_continue = self.process_file_saving(
|
|
372
|
+
final_data,
|
|
373
|
+
unique_export_path,
|
|
374
|
+
save_original_file_flag,
|
|
375
|
+
errors_json_file_list,
|
|
376
|
+
errors_original_file_list,
|
|
377
|
+
original_file_metrics_record,
|
|
378
|
+
data_file_metrics_record,
|
|
379
|
+
no,
|
|
380
|
+
)
|
|
381
|
+
if not should_continue:
|
|
382
|
+
continue
|
|
383
|
+
|
|
384
|
+
self.additional_file_saving(unique_export_path)
|
|
385
|
+
self.run.end_log()
|
|
386
|
+
|
|
387
|
+
# Save error list files
|
|
388
|
+
self._save_error_list(unique_export_path, errors_json_file_list, errors_original_file_list)
|
|
389
|
+
|
|
390
|
+
return {'export_path': str(self.path_root)}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
from typing import Generator
|
|
3
|
+
|
|
4
|
+
from . import BaseExporter
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Exporter(BaseExporter):
|
|
8
|
+
"""Plugin export action interface for organizing files.
|
|
9
|
+
|
|
10
|
+
This class provides a minimal interface for plugin developers to implement
|
|
11
|
+
their own export logic.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
def __init__(self, run, export_items: Generator, path_root: Path, **params):
|
|
15
|
+
"""Initialize the plugin export action class.
|
|
16
|
+
Args:
|
|
17
|
+
run: Plugin run object with logging capabilities.
|
|
18
|
+
export_items (generator):
|
|
19
|
+
- data (dict): dm_schema_data information.
|
|
20
|
+
- files (dict): File information. Includes file URL, original file path, metadata, etc.
|
|
21
|
+
- id (int): target ID (ex. assignment id, task id, ground_truth_event id)
|
|
22
|
+
path_root: pathlib object, the path to export
|
|
23
|
+
**params: Additional parameters
|
|
24
|
+
- name (str): The name of the action.
|
|
25
|
+
- description (str | None): The description of the action.
|
|
26
|
+
- storage (int): The storage ID to save the exported data.
|
|
27
|
+
- save_original_file (bool): Whether to save the original file.
|
|
28
|
+
- path (str): The path to save the exported data.
|
|
29
|
+
- target (str): The target source to export data from. (ex. ground_truth, assignment, task)
|
|
30
|
+
- filter (dict): The filter criteria to apply.
|
|
31
|
+
- extra_params (dict | None): Additional parameters for export customization.
|
|
32
|
+
Example: {"include_metadata": True, "compression": "gzip"}
|
|
33
|
+
- count (int): Total number of results.
|
|
34
|
+
- results (list): List of results fetched through the list API.
|
|
35
|
+
- project_id (int): Project ID.
|
|
36
|
+
- configuration (dict): Project configuration.
|
|
37
|
+
"""
|
|
38
|
+
super().__init__(run, export_items, path_root, **params)
|
|
39
|
+
|
|
40
|
+
def export(self, export_items=None, results=None, **kwargs) -> dict:
|
|
41
|
+
"""Executes the export task using the base class implementation.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
export_items: Optional export items to process. If not provided, uses self.export_items.
|
|
45
|
+
results: Optional results data to process alongside export_items.
|
|
46
|
+
**kwargs: Additional parameters for export customization.
|
|
47
|
+
|
|
48
|
+
Returns:
|
|
49
|
+
dict: Result
|
|
50
|
+
"""
|
|
51
|
+
return super().export(export_items, results, **kwargs)
|
|
52
|
+
|
|
53
|
+
def convert_data(self, data):
|
|
54
|
+
"""Converts the data."""
|
|
55
|
+
return data
|
|
56
|
+
|
|
57
|
+
def before_convert(self, data):
|
|
58
|
+
"""Preprocesses the data before conversion."""
|
|
59
|
+
return data
|
|
60
|
+
|
|
61
|
+
def after_convert(self, data):
|
|
62
|
+
"""Post-processes the data after conversion."""
|
|
63
|
+
return data
|
|
64
|
+
|
|
65
|
+
def sample_dev_log(self):
|
|
66
|
+
"""Sample development logging examples for plugin developers.
|
|
67
|
+
|
|
68
|
+
This method demonstrates various ways to use log_dev_event() for debugging,
|
|
69
|
+
monitoring, and tracking plugin execution. The event_type is automatically
|
|
70
|
+
generated as 'export_dev_log' for export actions and cannot be modified.
|
|
71
|
+
|
|
72
|
+
Use Cases:
|
|
73
|
+
1. Process Tracking: Log when important processes start/complete
|
|
74
|
+
2. Error Handling: Capture detailed error information with appropriate severity
|
|
75
|
+
3. Performance Monitoring: Record timing and resource usage
|
|
76
|
+
4. Data Validation: Log validation results and data quality metrics
|
|
77
|
+
5. Debug Information: Track variable states and execution flow
|
|
78
|
+
|
|
79
|
+
Examples show different scenarios where development logging is beneficial:
|
|
80
|
+
- Basic process logging with structured data
|
|
81
|
+
- Error logging with exception details and danger level
|
|
82
|
+
- Performance tracking with timing information
|
|
83
|
+
- Validation logging with success/failure status
|
|
84
|
+
"""
|
|
85
|
+
# Example 1: Basic Process Tracking
|
|
86
|
+
# Use when: Starting important processes that you want to monitor
|
|
87
|
+
# Benefits: Helps track execution flow and identify bottlenecks
|
|
88
|
+
self.run.log_dev_event(
|
|
89
|
+
'Starting data conversion process',
|
|
90
|
+
{'data_type': 'img', 'data_size': 'unknown', 'conversion_method': 'custom_format'},
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Example 2: Error Handling with Detailed Information
|
|
94
|
+
# Use when: Catching exceptions that you want to analyze later
|
|
95
|
+
# Benefits: Provides structured error data for debugging and monitoring
|
|
96
|
+
from synapse_sdk.shared.enums import Context
|
|
97
|
+
|
|
98
|
+
try:
|
|
99
|
+
# Simulated operation that might fail
|
|
100
|
+
pass
|
|
101
|
+
except Exception as e:
|
|
102
|
+
self.run.log_dev_event(
|
|
103
|
+
f'Data conversion failed: {str(e)}',
|
|
104
|
+
{
|
|
105
|
+
'error_type': type(e).__name__,
|
|
106
|
+
'error_details': str(e),
|
|
107
|
+
'operation': 'data_conversion',
|
|
108
|
+
'recovery_attempted': False,
|
|
109
|
+
},
|
|
110
|
+
level=Context.DANGER,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
# Example 3: Performance Monitoring
|
|
114
|
+
# Use when: Tracking processing time for optimization
|
|
115
|
+
# Benefits: Identifies performance bottlenecks and optimization opportunities
|
|
116
|
+
import time
|
|
117
|
+
|
|
118
|
+
start_time = time.time()
|
|
119
|
+
# Simulated processing work
|
|
120
|
+
time.sleep(0.001)
|
|
121
|
+
processing_time = time.time() - start_time
|
|
122
|
+
|
|
123
|
+
self.run.log_dev_event(
|
|
124
|
+
'File processing completed',
|
|
125
|
+
{
|
|
126
|
+
'processing_time_ms': round(processing_time * 1000, 2),
|
|
127
|
+
'files_processed': 1,
|
|
128
|
+
'performance_rating': 'excellent' if processing_time < 0.1 else 'normal',
|
|
129
|
+
},
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
# Example 4: Data Validation Logging
|
|
133
|
+
# Use when: Validating data quality or structure
|
|
134
|
+
# Benefits: Helps identify data issues and track validation metrics
|
|
135
|
+
validation_passed = True # Simulated validation result
|
|
136
|
+
self.run.log_dev_event(
|
|
137
|
+
'Data validation completed',
|
|
138
|
+
{
|
|
139
|
+
'validation_passed': validation_passed,
|
|
140
|
+
'validation_rules': ['format_check', 'required_fields', 'data_types'],
|
|
141
|
+
'data_quality_score': 95.5,
|
|
142
|
+
},
|
|
143
|
+
level=Context.SUCCESS if validation_passed else Context.WARNING,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
# Example 5: Debug Information with Variable States
|
|
147
|
+
# Use when: Debugging complex logic or tracking variable changes
|
|
148
|
+
# Benefits: Provides insight into execution state at specific points
|
|
149
|
+
current_batch_size = 100
|
|
150
|
+
memory_usage = 45.2 # Simulated memory usage in MB
|
|
151
|
+
|
|
152
|
+
self.run.log_dev_event(
|
|
153
|
+
'Processing checkpoint reached',
|
|
154
|
+
{
|
|
155
|
+
'current_batch_size': current_batch_size,
|
|
156
|
+
'memory_usage_mb': memory_usage,
|
|
157
|
+
'checkpoint_location': 'after_data_preprocessing',
|
|
158
|
+
'next_operation': 'file_saving',
|
|
159
|
+
},
|
|
160
|
+
)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from synapse_sdk.clients.exceptions import ClientError
|
|
2
1
|
from synapse_sdk.plugins.categories.base import Action
|
|
3
2
|
from synapse_sdk.plugins.categories.decorators import register_action
|
|
4
3
|
from synapse_sdk.plugins.enums import PluginCategory, RunMethod
|
|
@@ -25,12 +24,17 @@ class DeploymentAction(Action):
|
|
|
25
24
|
|
|
26
25
|
self.ray_init()
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
ray_actor_options = self.get_actor_options()
|
|
28
|
+
|
|
29
|
+
deployment = serve.deployment(ray_actor_options=ray_actor_options)(serve.ingress(app)(self.entrypoint)).bind(
|
|
30
|
+
self.envs['SYNAPSE_PLUGIN_RUN_HOST']
|
|
31
|
+
)
|
|
32
|
+
|
|
29
33
|
serve.delete(self.plugin_release.code)
|
|
30
34
|
|
|
31
35
|
# TODO add run object
|
|
32
36
|
serve.run(
|
|
33
|
-
deployment
|
|
37
|
+
deployment,
|
|
34
38
|
name=self.plugin_release.code,
|
|
35
39
|
route_prefix=f'/{self.plugin_release.checksum}',
|
|
36
40
|
)
|
|
@@ -41,13 +45,10 @@ class DeploymentAction(Action):
|
|
|
41
45
|
|
|
42
46
|
def create_serve_application(self):
|
|
43
47
|
if self.job_id:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
})
|
|
51
|
-
except ClientError:
|
|
52
|
-
pass
|
|
48
|
+
serve_application = self.ray_client.get_serve_application(self.plugin_release.code)
|
|
49
|
+
return self.client.create_serve_application({
|
|
50
|
+
'job': self.job_id,
|
|
51
|
+
'status': serve_application['status'],
|
|
52
|
+
'data': serve_application,
|
|
53
|
+
})
|
|
53
54
|
return None
|