hello-datap-component-base 0.2.1__tar.gz → 0.2.2__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.
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/PKG-INFO +1 -1
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/oss_client.py +6 -6
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/runner.py +3 -1
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base.egg-info/PKG-INFO +1 -1
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/pyproject.toml +1 -1
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/README.md +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/__init__.py +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/base.py +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/cli.py +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/config.py +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/discover.py +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/logger.py +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base/mns_client.py +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base.egg-info/SOURCES.txt +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base.egg-info/dependency_links.txt +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base.egg-info/entry_points.txt +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base.egg-info/requires.txt +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/hello_datap_component_base.egg-info/top_level.txt +0 -0
- {hello_datap_component_base-0.2.1 → hello_datap_component_base-0.2.2}/setup.cfg +0 -0
|
@@ -29,10 +29,10 @@ class OSSClient:
|
|
|
29
29
|
import oss2
|
|
30
30
|
|
|
31
31
|
# 从环境变量获取 OSS 配置
|
|
32
|
-
endpoint = os.environ.get('
|
|
33
|
-
access_key_id = os.environ.get('
|
|
34
|
-
access_key_secret = os.environ.get('
|
|
35
|
-
bucket_name = os.environ.get('
|
|
32
|
+
endpoint = os.environ.get('OSS_ENDPOINT_FOR_LOG')
|
|
33
|
+
access_key_id = os.environ.get('OSS_ACCESS_KEY_ID_FOR_LOG')
|
|
34
|
+
access_key_secret = os.environ.get('OSS_ACCESS_KEY_SECRET_FOR_LOG')
|
|
35
|
+
bucket_name = os.environ.get('OSS_BUCKET_NAME_FOR_LOG')
|
|
36
36
|
|
|
37
37
|
# 如果 OSS_ENDPOINT 不存在,静默跳过(向下兼容)
|
|
38
38
|
if not endpoint:
|
|
@@ -43,7 +43,7 @@ class OSSClient:
|
|
|
43
43
|
if not all([access_key_id, access_key_secret, bucket_name]):
|
|
44
44
|
logger.warning(
|
|
45
45
|
"OSS 配置不完整,无法上传日志文件。"
|
|
46
|
-
"需要设置环境变量:
|
|
46
|
+
"需要设置环境变量: OSS_ACCESS_KEY_ID_FOR_LOG, OSS_ACCESS_KEY_SECRET_FOR_LOG, OSS_BUCKET_NAME_FOR_LOG"
|
|
47
47
|
)
|
|
48
48
|
self._initialized = True
|
|
49
49
|
return
|
|
@@ -139,7 +139,7 @@ def get_oss_client() -> Optional[OSSClient]:
|
|
|
139
139
|
OSSClient 实例,如果配置不完整则返回 None
|
|
140
140
|
"""
|
|
141
141
|
# 如果环境变量中没有 OSS_ENDPOINT 配置,则不使用 OSS,直接返回 None(向下兼容)
|
|
142
|
-
if not os.environ.get('
|
|
142
|
+
if not os.environ.get('OSS_ENDPOINT_FOR_LOG'):
|
|
143
143
|
return None
|
|
144
144
|
|
|
145
145
|
client = OSSClient()
|
|
@@ -124,7 +124,9 @@ class ServiceRunner:
|
|
|
124
124
|
print(f"Starting service: {self.config.name}")
|
|
125
125
|
if self.config.version:
|
|
126
126
|
print(f"Version: {self.config.version}")
|
|
127
|
-
|
|
127
|
+
import json
|
|
128
|
+
params_to_print = self.config.params if self.config.params is not None else {}
|
|
129
|
+
print(f"Param: {json.dumps(params_to_print, indent=2, ensure_ascii=False)}")
|
|
128
130
|
print("\n" + "=" * 60)
|
|
129
131
|
print("Processing request...")
|
|
130
132
|
print("=" * 60 + "\n")
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hello-datap-component-base"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.2"
|
|
8
8
|
description = "A unified server management framework for data processing component"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|