parallelazy 0.0.5__tar.gz → 0.0.6__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.
- {parallelazy-0.0.5 → parallelazy-0.0.6}/PKG-INFO +7 -2
- {parallelazy-0.0.5 → parallelazy-0.0.6}/README.md +6 -1
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/plugin_manager.py +14 -5
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy.egg-info/PKG-INFO +7 -2
- {parallelazy-0.0.5 → parallelazy-0.0.6}/pyproject.toml +1 -1
- {parallelazy-0.0.5 → parallelazy-0.0.6}/LICENSE +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/__init__.py +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/environment_manager.py +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/plugin.py +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/plugin_data.py +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/plugin_rpc.py +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/plugin_transport.py +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/plugin_worker.py +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy/utils.py +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy.egg-info/SOURCES.txt +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy.egg-info/dependency_links.txt +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy.egg-info/requires.txt +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/parallelazy.egg-info/top_level.txt +0 -0
- {parallelazy-0.0.5 → parallelazy-0.0.6}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: parallelazy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: A lightweight multiprocess worker-plugin framework. Topic-based pub/sub, global enviroment, using process spawn and pipes, pytorch and CUDA ready.
|
|
5
5
|
Author: Cesare Montresor
|
|
6
6
|
Project-URL: Homepage, https://github.com/cesare-montresor/parallelazy
|
|
@@ -27,7 +27,12 @@ A lightweight Python plugin/worker framework with:
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
|
|
30
|
+
pip install parallelazy
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
*for development*
|
|
34
|
+
```bash
|
|
35
|
+
pip install -e .
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
## Debug in VSCode
|
|
@@ -52,7 +52,8 @@ class PluginManager:
|
|
|
52
52
|
def __init__(
|
|
53
53
|
self,
|
|
54
54
|
timeout_request: float = 5.0,
|
|
55
|
-
timeout_start: float =
|
|
55
|
+
timeout_start: float = 10.0,
|
|
56
|
+
timeout_start_debug: float = 30.0,
|
|
56
57
|
worker_pydebug: bool = None
|
|
57
58
|
):
|
|
58
59
|
"""
|
|
@@ -61,6 +62,7 @@ class PluginManager:
|
|
|
61
62
|
Args:
|
|
62
63
|
timeout_request: Default timeout for sync requests (seconds)
|
|
63
64
|
timeout_start: Timeout for start command (seconds)
|
|
65
|
+
timeout_start_debug: Timeout for start command in debug mode (seconds)
|
|
64
66
|
worker_pydebug: Whether to enable pydebug for worker processes (optional, for debugging plugins)
|
|
65
67
|
"""
|
|
66
68
|
self._plugins: Dict[str, PluginInfo] = {} # plugin_id -> PluginInfo
|
|
@@ -73,8 +75,9 @@ class PluginManager:
|
|
|
73
75
|
self._env = EnvironmentManager()
|
|
74
76
|
|
|
75
77
|
self.timeout_request = timeout_request
|
|
76
|
-
self.timeout_start = timeout_start
|
|
77
78
|
self.worker_pydebug = False if worker_pydebug is None else bool(worker_pydebug)
|
|
79
|
+
self.timeout_start = timeout_start if not self.worker_pydebug else timeout_start_debug
|
|
80
|
+
|
|
78
81
|
|
|
79
82
|
|
|
80
83
|
def load_plugins(self, descriptors: List[PluginDescriptor], parallel: bool = True) -> None:
|
|
@@ -150,10 +153,16 @@ class PluginManager:
|
|
|
150
153
|
)
|
|
151
154
|
|
|
152
155
|
process.start()
|
|
153
|
-
is_ready =
|
|
156
|
+
is_ready = False
|
|
157
|
+
while process.is_alive():
|
|
158
|
+
is_ready = initialized.wait(timeout=self.timeout_start)
|
|
159
|
+
if is_ready: break
|
|
160
|
+
# If we get here, wait() timed out but the process is still alive
|
|
161
|
+
logger.info(f"Plugin {plugin_id} is still initializing (waiting...)")
|
|
162
|
+
|
|
163
|
+
# If the loop exited and is_ready is False, the process died before setting the event
|
|
154
164
|
if not is_ready:
|
|
155
|
-
logger.error(f"Plugin {plugin_id} failed to initialize
|
|
156
|
-
process.terminate()
|
|
165
|
+
logger.error(f"Plugin {plugin_id} failed to initialize (process terminated unexpectedly).")
|
|
157
166
|
return False
|
|
158
167
|
|
|
159
168
|
logger.info(f"Plugin {plugin_id} loaded")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: parallelazy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: A lightweight multiprocess worker-plugin framework. Topic-based pub/sub, global enviroment, using process spawn and pipes, pytorch and CUDA ready.
|
|
5
5
|
Author: Cesare Montresor
|
|
6
6
|
Project-URL: Homepage, https://github.com/cesare-montresor/parallelazy
|
|
@@ -27,7 +27,12 @@ A lightweight Python plugin/worker framework with:
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
|
|
30
|
+
pip install parallelazy
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
*for development*
|
|
34
|
+
```bash
|
|
35
|
+
pip install -e .
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
## Debug in VSCode
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "parallelazy"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.6"
|
|
8
8
|
description = "A lightweight multiprocess worker-plugin framework. Topic-based pub/sub, global enviroment, using process spawn and pipes, pytorch and CUDA ready."
|
|
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
|