oocana 0.16.2__tar.gz → 0.16.4__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.
- {oocana-0.16.2 → oocana-0.16.4}/PKG-INFO +1 -1
- {oocana-0.16.2 → oocana-0.16.4}/oocana/context.py +9 -1
- {oocana-0.16.2 → oocana-0.16.4}/oocana/mainframe.py +4 -5
- {oocana-0.16.2 → oocana-0.16.4}/pyproject.toml +1 -1
- {oocana-0.16.2 → oocana-0.16.4}/oocana/__init__.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/oocana/data.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/oocana/handle_data.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/oocana/preview.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/oocana/schema.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/oocana/service.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/oocana/throtter.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/tests/__init__.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/tests/test_data.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/tests/test_handle_data.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/tests/test_json.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/tests/test_mainframe.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/tests/test_performance.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/tests/test_schema.py +0 -0
- {oocana-0.16.2 → oocana-0.16.4}/tests/test_throtter.py +0 -0
@@ -42,9 +42,10 @@ class Context:
|
|
42
42
|
__tmp_dir: str
|
43
43
|
__package_name: str | None = None
|
44
44
|
_logger: Optional[logging.Logger] = None
|
45
|
+
__pkg_dir: str
|
45
46
|
|
46
47
|
def __init__(
|
47
|
-
self, inputs: Dict[str, Any], blockInfo: BlockInfo, mainframe: Mainframe, store, outputs, session_dir: str, tmp_dir: str, package_name: str
|
48
|
+
self, inputs: Dict[str, Any], blockInfo: BlockInfo, mainframe: Mainframe, store, outputs, session_dir: str, tmp_dir: str, package_name: str, pkg_dir: str
|
48
49
|
) -> None:
|
49
50
|
|
50
51
|
self.__block_info = blockInfo
|
@@ -61,6 +62,7 @@ class Context:
|
|
61
62
|
self.__session_dir = session_dir
|
62
63
|
self.__tmp_dir = tmp_dir
|
63
64
|
self.__package_name = package_name
|
65
|
+
self.__pkg_dir = pkg_dir
|
64
66
|
|
65
67
|
@property
|
66
68
|
def logger(self) -> logging.Logger:
|
@@ -90,6 +92,12 @@ class Context:
|
|
90
92
|
"""
|
91
93
|
return os.path.join(self.__tmp_dir, self.__package_name) if self.__package_name else self.__tmp_dir
|
92
94
|
|
95
|
+
@property
|
96
|
+
def pkg_dir(self) -> str:
|
97
|
+
"""a directory for the current package, all blocks in the this package will share the same directory. this directory will be cleaned if this session finish successfully, otherwise it will be kept for debugging or other purpose.
|
98
|
+
"""
|
99
|
+
return self.__pkg_dir
|
100
|
+
|
93
101
|
@property
|
94
102
|
def keepAlive(self):
|
95
103
|
return self.__keep_alive
|
@@ -4,14 +4,12 @@ from paho.mqtt.enums import CallbackAPIVersion
|
|
4
4
|
import operator
|
5
5
|
from urllib.parse import urlparse
|
6
6
|
import uuid
|
7
|
-
from .data import BlockDict, JobDict, dumps
|
7
|
+
from .data import BlockDict, JobDict, dumps, EXECUTOR_NAME
|
8
8
|
import logging
|
9
9
|
from typing import Optional
|
10
10
|
|
11
11
|
__all__ = ["Mainframe"]
|
12
12
|
|
13
|
-
|
14
|
-
|
15
13
|
class Mainframe:
|
16
14
|
address: str
|
17
15
|
client: mqtt.Client
|
@@ -74,13 +72,14 @@ class Mainframe:
|
|
74
72
|
def report(self, block_info: BlockDict, msg: dict) -> mqtt.MQTTMessageInfo:
|
75
73
|
return self.client.publish("report", dumps({**block_info, **msg}), qos=1)
|
76
74
|
|
77
|
-
def notify_executor_ready(self, session_id: str,
|
75
|
+
def notify_executor_ready(self, session_id: str, package: str | None, identifier: str | None, debug_port: int | None) -> None:
|
78
76
|
self.client.publish(f"session/{session_id}", dumps({
|
79
77
|
"type": "ExecutorReady",
|
80
78
|
"session_id": session_id,
|
81
|
-
"executor_name":
|
79
|
+
"executor_name": EXECUTOR_NAME,
|
82
80
|
"package": package,
|
83
81
|
"identifier": identifier,
|
82
|
+
"debug_port": debug_port,
|
84
83
|
}), qos=1)
|
85
84
|
|
86
85
|
def notify_block_ready(self, session_id: str, job_id: str) -> dict:
|
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
|
File without changes
|