isolate 0.13.0__py3-none-any.whl → 0.13.2__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 isolate might be problematic. Click here for more details.
- isolate/_isolate_version.py +2 -2
- isolate/backends/container.py +2 -1
- isolate/connections/grpc/_base.py +2 -1
- isolate/connections/grpc/agent.py +3 -1
- isolate/logger.py +17 -0
- {isolate-0.13.0.dist-info → isolate-0.13.2.dist-info}/METADATA +1 -1
- {isolate-0.13.0.dist-info → isolate-0.13.2.dist-info}/RECORD +11 -10
- {isolate-0.13.0.dist-info → isolate-0.13.2.dist-info}/LICENSE +0 -0
- {isolate-0.13.0.dist-info → isolate-0.13.2.dist-info}/WHEEL +0 -0
- {isolate-0.13.0.dist-info → isolate-0.13.2.dist-info}/entry_points.txt +0 -0
- {isolate-0.13.0.dist-info → isolate-0.13.2.dist-info}/top_level.txt +0 -0
isolate/_isolate_version.py
CHANGED
isolate/backends/container.py
CHANGED
|
@@ -17,6 +17,7 @@ class ContainerizedPythonEnvironment(BaseEnvironment[Path]):
|
|
|
17
17
|
|
|
18
18
|
image: dict[str, Any] = field(default_factory=dict)
|
|
19
19
|
python_version: str | None = None
|
|
20
|
+
requirements: list[str] = field(default_factory=list)
|
|
20
21
|
tags: list[str] = field(default_factory=list)
|
|
21
22
|
|
|
22
23
|
@classmethod
|
|
@@ -34,7 +35,7 @@ class ContainerizedPythonEnvironment(BaseEnvironment[Path]):
|
|
|
34
35
|
# dockerfile_str is always there, but the validation is handled by the
|
|
35
36
|
# controller.
|
|
36
37
|
dockerfile_str = self.image.get("dockerfile_str", "")
|
|
37
|
-
return sha256_digest_of(dockerfile_str, *sorted(self.tags))
|
|
38
|
+
return sha256_digest_of(dockerfile_str, *self.requirements, *sorted(self.tags))
|
|
38
39
|
|
|
39
40
|
def create(self, *, force: bool = False) -> Path:
|
|
40
41
|
return Path(sys.exec_prefix)
|
|
@@ -16,6 +16,7 @@ from isolate.connections.common import serialize_object
|
|
|
16
16
|
from isolate.connections.grpc import agent, definitions
|
|
17
17
|
from isolate.connections.grpc.configuration import get_default_options
|
|
18
18
|
from isolate.connections.grpc.interface import from_grpc
|
|
19
|
+
from isolate.logger import logger
|
|
19
20
|
from isolate.logs import LogLevel, LogSource
|
|
20
21
|
|
|
21
22
|
|
|
@@ -148,5 +149,5 @@ class LocalPythonGRPC(PythonExecutionBase[str], GRPCExecutionBase):
|
|
|
148
149
|
]
|
|
149
150
|
|
|
150
151
|
def handle_agent_log(self, line: str, level: LogLevel, source: LogSource) -> None:
|
|
151
|
-
|
|
152
|
+
logger.log(level, line, source)
|
|
152
153
|
self.log(line, level=level, source=source)
|
|
@@ -22,6 +22,8 @@ from isolate.connections.common import SerializationError, serialize_object
|
|
|
22
22
|
from isolate.connections.grpc import definitions
|
|
23
23
|
from isolate.connections.grpc.configuration import get_default_options
|
|
24
24
|
from isolate.connections.grpc.interface import from_grpc
|
|
25
|
+
from isolate.logger import logger
|
|
26
|
+
from isolate.logs import LogLevel, LogSource
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
@dataclass
|
|
@@ -149,7 +151,7 @@ class AgentServicer(definitions.AgentServicer):
|
|
|
149
151
|
definition = serialize_object(serialization_method, result)
|
|
150
152
|
except SerializationError:
|
|
151
153
|
if stringized_tb:
|
|
152
|
-
|
|
154
|
+
logger.log(LogLevel.ERROR, stringized_tb, LogSource.BRIDGE)
|
|
153
155
|
raise AbortException(
|
|
154
156
|
"Error while serializing the execution result "
|
|
155
157
|
f"(object of type {type(result)})."
|
isolate/logger.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# NOTE: we probably should've created a proper `logging.getLogger` here,
|
|
5
|
+
# but it handling `source` would be not trivial, so we are better off
|
|
6
|
+
# just keeping it simple for now.
|
|
7
|
+
class IsolateLogger:
|
|
8
|
+
def log(self, level, message, source):
|
|
9
|
+
record = {
|
|
10
|
+
"isolate_source": source.name,
|
|
11
|
+
"level": level.name,
|
|
12
|
+
"message": message,
|
|
13
|
+
}
|
|
14
|
+
print(json.dumps(record))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
logger = IsolateLogger()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
isolate/__init__.py,sha256=uXOKnONs7sXgARNgElwr4_A1sKoA6ACHVEvs3IDiX1M,127
|
|
2
|
-
isolate/_isolate_version.py,sha256=
|
|
2
|
+
isolate/_isolate_version.py,sha256=ByxP_AGaDBx1nhN9W4fte2GtMXAPh9eMZ4pSGlztQPc,413
|
|
3
3
|
isolate/_version.py,sha256=05pXvy-yr5t3I1m9JMn42Ilzpg7fa8IB2J8a3G7t1cU,274
|
|
4
|
+
isolate/logger.py,sha256=SehnK6rPx-HDqQHJ3sKWqhDGmD3fTDGBIkjnNQYnFJU,453
|
|
4
5
|
isolate/logs.py,sha256=R_AHUVYD18z_PhtK_mDWi9Gch79CxmwHY09hUDShtwg,2079
|
|
5
6
|
isolate/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
7
|
isolate/registry.py,sha256=hpzv4HI7iihG5I7i5r8Pb257ibhEKY18xQcG-w1-BgI,1590
|
|
@@ -8,7 +9,7 @@ isolate/backends/__init__.py,sha256=LLrSM7UnDFW8tIT5oYlE1wVJrxKcaj_v7cFwvTjQTlc,
|
|
|
8
9
|
isolate/backends/_base.py,sha256=Kt5pkhDzXZblq4vxaM3DQTo-Bj-7pIRZFlqJR7OfejY,4112
|
|
9
10
|
isolate/backends/common.py,sha256=Zx0HXnBX_jlOLpFNJzY4ue8NcW-kktqo_WZOJmPSjvI,8481
|
|
10
11
|
isolate/backends/conda.py,sha256=S5q5bdY787AMTck2iMGtwu-LHMH4a1qCIjNHDKTkqok,7649
|
|
11
|
-
isolate/backends/container.py,sha256=
|
|
12
|
+
isolate/backends/container.py,sha256=MCQJbcmQvRUS-tTgTW_pKYBMKwSJO2KZsLeaBMXpPC0,1645
|
|
12
13
|
isolate/backends/local.py,sha256=woxe4dmXuEHxWKsGNndoRA1_sP6yG-dg6tlFZni0mZc,1360
|
|
13
14
|
isolate/backends/pyenv.py,sha256=ZwTYoVPIWhS3Y4hN51x95aIOHi15GF7kEDdKTNhlMTE,5434
|
|
14
15
|
isolate/backends/remote.py,sha256=qUm54mpqk0kaEfbPZl962Td3_P3qcpyVcfGdKfmkJHs,4234
|
|
@@ -22,8 +23,8 @@ isolate/connections/_local/__init__.py,sha256=6FtCKRSFBvTvjm5LNlNA-mieKEq3J7DZZR
|
|
|
22
23
|
isolate/connections/_local/_base.py,sha256=nbeIH25wAZn1WDTGXv2HvAfFggzjJAF8GgGS4_iqNoY,6544
|
|
23
24
|
isolate/connections/_local/agent_startup.py,sha256=swCs6Q0yVkDw7w-RftizHSMyJDM7DQwuP3TB0qI1ucg,1552
|
|
24
25
|
isolate/connections/grpc/__init__.py,sha256=tcesLxlC36P6wSg2lBcO2egsJWMbSKwc8zFXhWac3YU,85
|
|
25
|
-
isolate/connections/grpc/_base.py,sha256=
|
|
26
|
-
isolate/connections/grpc/agent.py,sha256=
|
|
26
|
+
isolate/connections/grpc/_base.py,sha256=qyagLVl4BOmkJvbFDLyA2-IZNkXeTRGOgRGGcvcyQwM,5713
|
|
27
|
+
isolate/connections/grpc/agent.py,sha256=ZmTdEY6SxY5YCYJD8SBh7Ypx1BBL1hT6XSsr5wNv3jw,7552
|
|
27
28
|
isolate/connections/grpc/configuration.py,sha256=50YvGGHA9uyKg74xU_gc73j7bsFk973uIpMhmw2HhxY,788
|
|
28
29
|
isolate/connections/grpc/interface.py,sha256=yt63kytgXRXrTnjePGJVdXz4LJJVSSrNkJCF1yz6FIE,2270
|
|
29
30
|
isolate/connections/grpc/definitions/__init__.py,sha256=Z0453Bbjoq-Oxm2Wfi9fae-BFf8YsZwmuh88strmvxo,459
|
|
@@ -52,9 +53,9 @@ isolate/server/health/health.proto,sha256=wE2_QD0OQAblKkEBG7sALLXEOj1mOLKG-FbC4t
|
|
|
52
53
|
isolate/server/health/health_pb2.py,sha256=onOdP3M4Tpqhqs2PlGcyfoKe2VVKUEDx5ALeRcObb9A,1899
|
|
53
54
|
isolate/server/health/health_pb2.pyi,sha256=CPyvxvDzra-1d-mBsukaJnscMUDBaqSACvo9LiXlFzo,2416
|
|
54
55
|
isolate/server/health/health_pb2_grpc.py,sha256=XgsULrnRBmYIqvKr8eI7bqs6NIea5A0kkqdOOc2JHBY,5303
|
|
55
|
-
isolate-0.13.
|
|
56
|
-
isolate-0.13.
|
|
57
|
-
isolate-0.13.
|
|
58
|
-
isolate-0.13.
|
|
59
|
-
isolate-0.13.
|
|
60
|
-
isolate-0.13.
|
|
56
|
+
isolate-0.13.2.dist-info/LICENSE,sha256=427vuyirL5scgBLqA9UWcdnxKrtSGc0u_JfUupk6lAA,11359
|
|
57
|
+
isolate-0.13.2.dist-info/METADATA,sha256=T7vhuI6kMqiRqcQbYecnTZxrb9MAmGwaXp31kEC2280,3209
|
|
58
|
+
isolate-0.13.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
59
|
+
isolate-0.13.2.dist-info/entry_points.txt,sha256=s3prh2EERaVCbL8R45tfY5WFPZ1TsYOsz305YR7s-Pc,360
|
|
60
|
+
isolate-0.13.2.dist-info/top_level.txt,sha256=W9QJBHcq5WXRkbOXf25bvftzFsOZZN4n1DAatdroZrs,8
|
|
61
|
+
isolate-0.13.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|