tfduck-bsd 0.18.8__tar.gz → 0.19.0__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 tfduck-bsd might be problematic. Click here for more details.

Files changed (50) hide show
  1. {tfduck-bsd-0.18.8/tfduck_bsd.egg-info → tfduck-bsd-0.19.0}/PKG-INFO +1 -1
  2. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/setup.py +1 -1
  3. tfduck-bsd-0.19.0/tfduck/__init__.py +1 -0
  4. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/serverless_k8s/k8s_manage.py +24 -21
  5. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/serverless_k8s/k8s_task.py +9 -2
  6. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0/tfduck_bsd.egg-info}/PKG-INFO +1 -1
  7. tfduck-bsd-0.18.8/tfduck/__init__.py +0 -1
  8. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/LICENSE +0 -0
  9. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/README.md +0 -0
  10. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/bin/tfduck +0 -0
  11. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/setup.cfg +0 -0
  12. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/bdp_sdk_py/__init__.py +0 -0
  13. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/bdp_sdk_py/config/__init__.py +0 -0
  14. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/bdp_sdk_py/config/bdpmanager.py +0 -0
  15. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/bdp_sdk_py/config/table_config.py +0 -0
  16. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/bdp_sdk_py/example.py +0 -0
  17. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/bdp_sdk_py/opends/__init__.py +0 -0
  18. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/bdp_sdk_py/opends/opends.py +0 -0
  19. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/bdp_sdk_py/opends/sdk.py +0 -0
  20. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/common/__init__.py +0 -0
  21. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/common/defines.py +0 -0
  22. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/common/defines_clean.py +0 -0
  23. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/common/extendEncoder.py +0 -0
  24. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/main.py +0 -0
  25. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/oss/__init__.py +0 -0
  26. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/oss/oss.py +0 -0
  27. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/pyspark_k8s/__init__.py +0 -0
  28. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/pyspark_k8s/k8s_manage.py +0 -0
  29. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/pyspark_k8s/spark_manage.py +0 -0
  30. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/s3/__init__.py +0 -0
  31. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/s3/s3oper.py +0 -0
  32. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/sagemaker/__init__.py +0 -0
  33. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/sagemaker/saoper.py +0 -0
  34. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/serverless_k8s/__init__.py +0 -0
  35. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/__init__.py +0 -0
  36. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/base_tga.py +0 -0
  37. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/predict_sql_ltv.py +0 -0
  38. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/predict_sql_retain.py +0 -0
  39. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/predict_sql_yh.py +0 -0
  40. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/tga.py +0 -0
  41. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/tga_test.py +0 -0
  42. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/train_sql_ltv.py +0 -0
  43. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/train_sql_retain.py +0 -0
  44. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/tga/train_sql_yh.py +0 -0
  45. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/thinkdata/__init__.py +0 -0
  46. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck/thinkdata/query.py +0 -0
  47. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck_bsd.egg-info/SOURCES.txt +0 -0
  48. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck_bsd.egg-info/dependency_links.txt +0 -0
  49. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck_bsd.egg-info/requires.txt +0 -0
  50. {tfduck-bsd-0.18.8 → tfduck-bsd-0.19.0}/tfduck_bsd.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tfduck-bsd
3
- Version: 0.18.8
3
+ Version: 0.19.0
4
4
  Summary: A small example package
5
5
  Home-page: UNKNOWN
6
6
  Author: yuanxiao
@@ -8,7 +8,7 @@ with open("README.md", "r") as fh:
8
8
 
9
9
  setuptools.setup(
10
10
  name="tfduck-bsd",
11
- version="0.18.8",
11
+ version="0.19.0",
12
12
  author="yuanxiao",
13
13
  author_email="yuan6785@163.com",
14
14
  description="A small example package",
@@ -0,0 +1 @@
1
+ __version__="0.19.0"
@@ -10,27 +10,30 @@ pip install kubernetes==12.0.1 oss2==2.19.1
10
10
  """
11
11
 
12
12
  if 1:
13
- # 解决 【CA_KEY_TOO_SMALL】的报错,利用猴子补丁[monkey Patching ] ,适用于urllib3==2.x版本
14
- import urllib3
15
- from urllib3.util.ssl_ import create_urllib3_context
16
-
17
- # 创建自定义 SSL 上下文(复用 urllib3 默认配置基础上修改)
18
- ctx = create_urllib3_context()
19
- ctx.set_ciphers("DEFAULT@SECLEVEL=0") # 例如降低安全级别
20
- ctx.load_default_certs() # 确保加载系统证书
21
-
22
- # 保存原始 PoolManager 初始化方法(便于回滚)
23
- _original_poolmanager_init = urllib3.PoolManager.__init__
24
-
25
- def _patched_poolmanager_init(self, *args, **kwargs):
26
- # 仅在未显式传递 ssl_context 时注入自定义上下文
27
- if "ssl_context" not in kwargs:
28
- kwargs["ssl_context"] = ctx
29
- _original_poolmanager_init(self, *args, **kwargs)
30
-
31
- # 应用补丁(确保只执行一次)
32
- if urllib3.PoolManager.__init__ != _patched_poolmanager_init:
33
- urllib3.PoolManager.__init__ = _patched_poolmanager_init
13
+ try:
14
+ # 解决 【CA_KEY_TOO_SMALL】的报错,利用猴子补丁[monkey Patching ] ,适用于urllib3==2.x版本
15
+ import urllib3
16
+ from urllib3.util.ssl_ import create_urllib3_context
17
+
18
+ # 创建自定义 SSL 上下文(复用 urllib3 默认配置基础上修改)
19
+ ctx = create_urllib3_context()
20
+ ctx.set_ciphers("DEFAULT@SECLEVEL=0") # 例如降低安全级别
21
+ ctx.load_default_certs() # 确保加载系统证书
22
+
23
+ # 保存原始 PoolManager 初始化方法(便于回滚)
24
+ _original_poolmanager_init = urllib3.PoolManager.__init__
25
+
26
+ def _patched_poolmanager_init(self, *args, **kwargs):
27
+ # 仅在未显式传递 ssl_context 时注入自定义上下文
28
+ if "ssl_context" not in kwargs:
29
+ kwargs["ssl_context"] = ctx
30
+ _original_poolmanager_init(self, *args, **kwargs)
31
+
32
+ # 应用补丁(确保只执行一次)
33
+ if urllib3.PoolManager.__init__ != _patched_poolmanager_init:
34
+ urllib3.PoolManager.__init__ = _patched_poolmanager_init
35
+ except Exception as _:
36
+ pass
34
37
 
35
38
  import json
36
39
 
@@ -72,6 +72,8 @@ class ServerlessTaskManage(object):
72
72
  "pvc_name": "tfduck-k8s-pvc",
73
73
  # pypi的源,如果为空字符串,则使用官方源
74
74
  "pypi_mirror": "https://pypi.tuna.tsinghua.edu.cn/simple",
75
+ # 执行python脚本参数---最好是base64编码的json字符串
76
+ "params": "xxx",
75
77
  },
76
78
  #
77
79
  is_debug=False,
@@ -86,6 +88,11 @@ class ServerlessTaskManage(object):
86
88
  code_path: 代码路径
87
89
  project_configs: 所有项目配置
88
90
  project_name: 项目名称,在project_configs里面找到对应的key
91
+ params: 用法
92
+ param_b64_content = base64.b64encode(json.dumps(self.task_params).encode(
93
+ 'utf8')).decode() # 将参数编辑为base64,防止出现特殊字符分割参数
94
+ # 解码
95
+ # ds = json.loads(base64.b64decode(param_b64_content).decode('utf8'))
89
96
  ######################################
90
97
  """
91
98
  """
@@ -213,7 +220,7 @@ class ServerlessTaskManage(object):
213
220
  pip install -U pip {pypi_i} && \
214
221
  pip install arrow {pypi_i} && \
215
222
  pip install -r requirements.txt {pypi_i} && \
216
- python main.py
223
+ python main.py --params {self.task_config["params"]}
217
224
  """
218
225
  ],
219
226
  "resources": {
@@ -278,7 +285,7 @@ class ServerlessTaskManage(object):
278
285
  wait_time = 0
279
286
  # 第一阶段判断--进入Running状态--
280
287
  pd_1 = 0
281
- pd_1_status = ["Running"]
288
+ pd_1_status = ["Running", "Succeeded", "Failed"]
282
289
  max_pd_1 = 30 # 最大等待次数
283
290
  while pod_obj.status.phase not in pd_1_status and pd_1 < max_pd_1:
284
291
  time.sleep(10)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tfduck-bsd
3
- Version: 0.18.8
3
+ Version: 0.19.0
4
4
  Summary: A small example package
5
5
  Home-page: UNKNOWN
6
6
  Author: yuanxiao
@@ -1 +0,0 @@
1
- __version__="0.18.8"
File without changes
File without changes
File without changes
File without changes
File without changes