funboost 43.4__py3-none-any.whl → 43.5__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 funboost might be problematic. Click here for more details.
- funboost/__init__.py +1 -1
- funboost/core/fabric_deploy_helper.py +12 -12
- {funboost-43.4.dist-info → funboost-43.5.dist-info}/METADATA +1 -1
- {funboost-43.4.dist-info → funboost-43.5.dist-info}/RECORD +8 -8
- {funboost-43.4.dist-info → funboost-43.5.dist-info}/LICENSE +0 -0
- {funboost-43.4.dist-info → funboost-43.5.dist-info}/WHEEL +0 -0
- {funboost-43.4.dist-info → funboost-43.5.dist-info}/entry_points.txt +0 -0
- {funboost-43.4.dist-info → funboost-43.5.dist-info}/top_level.txt +0 -0
funboost/__init__.py
CHANGED
|
@@ -4,7 +4,7 @@ import sys
|
|
|
4
4
|
import threading
|
|
5
5
|
import time
|
|
6
6
|
import os
|
|
7
|
-
|
|
7
|
+
from pathlib import Path
|
|
8
8
|
from fabric2 import Connection
|
|
9
9
|
|
|
10
10
|
# from funboost.core.booster import Booster
|
|
@@ -13,16 +13,12 @@ from funboost.utils.paramiko_util import ParamikoFolderUploader
|
|
|
13
13
|
# import nb_log
|
|
14
14
|
from funboost.core.loggers import get_funboost_file_logger
|
|
15
15
|
from funboost.core.booster import Booster
|
|
16
|
+
|
|
16
17
|
logger = get_funboost_file_logger(__name__)
|
|
17
18
|
|
|
18
|
-
def _remove_drive_letter(path):
|
|
19
|
-
if os.name == 'nt' and len(path) >= 3 and path[1] == ':':
|
|
20
|
-
return path[2:]
|
|
21
|
-
else:
|
|
22
|
-
return path
|
|
23
19
|
|
|
24
20
|
# noinspection PyDefaultArgument
|
|
25
|
-
def fabric_deploy(booster:Booster, host, port, user, password,
|
|
21
|
+
def fabric_deploy(booster: Booster, host, port, user, password,
|
|
26
22
|
path_pattern_exluded_tuple=('/.git/', '/.idea/', '/dist/', '/build/'),
|
|
27
23
|
file_suffix_tuple_exluded=('.pyc', '.log', '.gz'),
|
|
28
24
|
only_upload_within_the_last_modify_time=3650 * 24 * 60 * 60,
|
|
@@ -71,13 +67,17 @@ def fabric_deploy(booster:Booster, host, port, user, password,
|
|
|
71
67
|
task_fun.fabric_deploy('192.168.6.133', 22, 'ydf', '123456', process_num=2) 只需要这样就可以自动部署在远程机器运行,无需任何额外操作。
|
|
72
68
|
"""
|
|
73
69
|
# print(locals())
|
|
74
|
-
python_proj_dir =
|
|
70
|
+
python_proj_dir = sys.path[1].replace('\\', '/') + '/'
|
|
75
71
|
python_proj_dir_short = python_proj_dir.split('/')[-2]
|
|
76
72
|
# 获取被调用函数所在模块文件名
|
|
77
|
-
file_name =
|
|
78
|
-
print(file_name,python_proj_dir)
|
|
79
|
-
|
|
73
|
+
file_name = sys._getframe(2).f_code.co_filename.replace('\\', '/') # noqa\
|
|
74
|
+
# print(file_name,python_proj_dir)
|
|
75
|
+
# print(Path(file_name).relative_to(Path(python_proj_dir)))
|
|
76
|
+
# print(8888)
|
|
77
|
+
# relative_file_name = re.sub(f'^{python_proj_dir}', '', file_name)
|
|
78
|
+
relative_file_name = Path(file_name).relative_to(Path(python_proj_dir)).as_posix()
|
|
80
79
|
relative_module = relative_file_name.replace('/', '.')[:-3] # -3是去掉.py
|
|
80
|
+
print(relative_module)
|
|
81
81
|
if user == 'root': # 文件夹会被自动创建,无需用户创建。
|
|
82
82
|
remote_dir = f'/codes/{python_proj_dir_short}'
|
|
83
83
|
else:
|
|
@@ -101,7 +101,7 @@ def fabric_deploy(booster:Booster, host, port, user, password,
|
|
|
101
101
|
kill_shell = f'''ps -aux|grep {process_mark}|grep -v grep|awk '{{print $2}}' |xargs kill -9'''
|
|
102
102
|
logger.warning(f'{kill_shell} 命令杀死 {process_mark} 标识的进程')
|
|
103
103
|
# uploader.ssh.exec_command(kill_shell)
|
|
104
|
-
conn.run(kill_shell, encoding='utf-8',warn=True) # 不想提示,免得烦扰用户以为有什么异常了。所以用上面的paramiko包的ssh.exec_command
|
|
104
|
+
conn.run(kill_shell, encoding='utf-8', warn=True) # 不想提示,免得烦扰用户以为有什么异常了。所以用上面的paramiko包的ssh.exec_command
|
|
105
105
|
|
|
106
106
|
python_exec_str = f'''export is_funboost_remote_run=1;export PYTHONPATH={remote_dir}:$PYTHONPATH ;{python_interpreter} -c "from {relative_module} import {func_name};{func_name}.multi_process_consume({process_num})" -funboostmark {process_mark} '''
|
|
107
107
|
shell_str = f'''cd {remote_dir}; {python_exec_str}'''
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: funboost
|
|
3
|
-
Version: 43.
|
|
3
|
+
Version: 43.5
|
|
4
4
|
Summary: pip install funboost,python全功能分布式函数调度框架,。支持python所有类型的并发模式和一切知名消息队列中间件,支持如 celery dramatiq等框架整体作为funboost中间件,python函数加速器,框架包罗万象,用户能想到的控制功能全都有。一统编程思维,兼容50% python业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数,99%用过funboost的pythoner 感受是 简易 方便 强劲 强大,相见恨晚
|
|
5
5
|
Home-page: https://github.com/ydf0509/funboost
|
|
6
6
|
Author: bfzs
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
funboost/__init__.py,sha256=
|
|
1
|
+
funboost/__init__.py,sha256=9m4awOfwh6jOpU0vXnRXGjl-v8FAhzH32l_Zf_tcQOc,3832
|
|
2
2
|
funboost/__init__old.py,sha256=07A1MLsxLtuRQQOIfDyphddOwNBrGe34enoHWAnjV14,20379
|
|
3
3
|
funboost/__main__.py,sha256=-6Nogi666Y0LN8fVm3JmHGTOk8xEGWvotW_GDbSaZME,1065
|
|
4
4
|
funboost/constant.py,sha256=Yxt3WJt9D8ybcrgiojOy0qjnq5mffwTnTJplerGL0Oo,7188
|
|
@@ -84,7 +84,7 @@ funboost/core/active_cousumer_info_getter.py,sha256=09fEc-BTEIRfDDfHmOvKnMjLjtOy
|
|
|
84
84
|
funboost/core/booster.py,sha256=Y_HqdK1mOFUyTzuEU070kTWQfXR7j0WVHIOfrAdPhAQ,15831
|
|
85
85
|
funboost/core/current_task.py,sha256=rAIQVLqYqtlHVRkjl17yki-mqvuMb640ssGmto4RSdA,4864
|
|
86
86
|
funboost/core/exceptions.py,sha256=pLF7BkRJAfDiWp2_xGZqencmwdPiSQI1NENbImExknY,1311
|
|
87
|
-
funboost/core/fabric_deploy_helper.py,sha256=
|
|
87
|
+
funboost/core/fabric_deploy_helper.py,sha256=0J8UPVL8djFCteN5W7vDbEjkVBkX0L3Y02DrTJ0rKiI,9198
|
|
88
88
|
funboost/core/func_params_model.py,sha256=ChxvSq_iVuYnGR_CdN9h9qNtvBq8sZ4BocdzCjgsQHc,18167
|
|
89
89
|
funboost/core/function_result_status_config.py,sha256=PyjqAQOiwsLt28sRtH-eYRjiI3edPFO4Nde0ILFRReE,1764
|
|
90
90
|
funboost/core/function_result_status_saver.py,sha256=UdokGSwU630t70AZnT9Ecj7GpYXORBDivlc9kadoI2E,9172
|
|
@@ -264,9 +264,9 @@ funboost/utils/pysnooper_ydf/utils.py,sha256=evSmGi_Oul7vSP47AJ0DLjFwoCYCfunJZ1m
|
|
|
264
264
|
funboost/utils/pysnooper_ydf/variables.py,sha256=QejRDESBA06KG9OH4sBT4J1M55eaU29EIHg8K_igaXo,3693
|
|
265
265
|
funboost/utils/times/__init__.py,sha256=Y4bQD3SIA_E7W2YvHq2Qdi0dGM4H2DxyFNdDOuFOq1w,2417
|
|
266
266
|
funboost/utils/times/version.py,sha256=11XfnZVVzOgIhXXdeN_mYfdXThfrsbQHpA0wCjz-hpg,17
|
|
267
|
-
funboost-43.
|
|
268
|
-
funboost-43.
|
|
269
|
-
funboost-43.
|
|
270
|
-
funboost-43.
|
|
271
|
-
funboost-43.
|
|
272
|
-
funboost-43.
|
|
267
|
+
funboost-43.5.dist-info/LICENSE,sha256=9EPP2ktG_lAPB8PjmWV-c9BiaJHc_FP6pPLcUrUwx0E,11562
|
|
268
|
+
funboost-43.5.dist-info/METADATA,sha256=tHdHWHRRcXgHt2nAXURtwVBPEmM4fIIwnid17re9pxg,30410
|
|
269
|
+
funboost-43.5.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
|
270
|
+
funboost-43.5.dist-info/entry_points.txt,sha256=yMSSAGRzRAAhGyNNQHw24MooKlDZsaJ499_D6fPl58A,96
|
|
271
|
+
funboost-43.5.dist-info/top_level.txt,sha256=K8WuKnS6MRcEWxP1NvbmCeujJq6TEfbsB150YROlRw0,9
|
|
272
|
+
funboost-43.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|