isolate 0.14.1__py3-none-any.whl → 0.14.3__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/common.py +1 -0
- isolate/logger.py +7 -0
- isolate/server/server.py +8 -4
- {isolate-0.14.1.dist-info → isolate-0.14.3.dist-info}/METADATA +1 -1
- {isolate-0.14.1.dist-info → isolate-0.14.3.dist-info}/RECORD +10 -10
- {isolate-0.14.1.dist-info → isolate-0.14.3.dist-info}/WHEEL +1 -1
- {isolate-0.14.1.dist-info → isolate-0.14.3.dist-info}/LICENSE +0 -0
- {isolate-0.14.1.dist-info → isolate-0.14.3.dist-info}/entry_points.txt +0 -0
- {isolate-0.14.1.dist-info → isolate-0.14.3.dist-info}/top_level.txt +0 -0
isolate/_isolate_version.py
CHANGED
isolate/backends/common.py
CHANGED
isolate/logger.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import os
|
|
3
|
+
from datetime import datetime, timezone
|
|
3
4
|
from typing import Dict
|
|
4
5
|
|
|
5
6
|
from isolate.logs import LogLevel, LogSource
|
|
@@ -9,15 +10,21 @@ from isolate.logs import LogLevel, LogSource
|
|
|
9
10
|
# but it handling `source` would be not trivial, so we are better off
|
|
10
11
|
# just keeping it simple for now.
|
|
11
12
|
class IsolateLogger:
|
|
13
|
+
extra_labels: Dict[str, str] = {}
|
|
14
|
+
|
|
12
15
|
def __init__(self, log_labels: Dict[str, str]):
|
|
13
16
|
self.log_labels = log_labels
|
|
14
17
|
|
|
15
18
|
def log(self, level: LogLevel, message: str, source: LogSource) -> None:
|
|
16
19
|
record = {
|
|
20
|
+
# Set the timestamp from source so we can be sure no buffering or
|
|
21
|
+
# latency is affecting the timestamp.
|
|
22
|
+
"logged_at": datetime.now(tz=timezone.utc).isoformat(),
|
|
17
23
|
"isolate_source": source.name,
|
|
18
24
|
"level": level.name,
|
|
19
25
|
"message": message,
|
|
20
26
|
**self.log_labels,
|
|
27
|
+
**self.extra_labels,
|
|
21
28
|
}
|
|
22
29
|
print(json.dumps(record))
|
|
23
30
|
|
isolate/server/server.py
CHANGED
|
@@ -367,9 +367,7 @@ class IsolateServicer(definitions.IsolateServicer):
|
|
|
367
367
|
|
|
368
368
|
task = self.background_tasks[request.task_id]
|
|
369
369
|
|
|
370
|
-
task.logger =
|
|
371
|
-
dict(request.metadata.logger_labels)
|
|
372
|
-
)
|
|
370
|
+
task.logger.extra_labels = dict(request.metadata.logger_labels)
|
|
373
371
|
|
|
374
372
|
return definitions.SetMetadataResponse()
|
|
375
373
|
|
|
@@ -379,13 +377,19 @@ class IsolateServicer(definitions.IsolateServicer):
|
|
|
379
377
|
context: ServicerContext,
|
|
380
378
|
) -> Iterator[definitions.PartialRunResult]:
|
|
381
379
|
try:
|
|
382
|
-
|
|
380
|
+
# HACK: we can support only one task at a time for Run
|
|
381
|
+
# TODO: move away from this when we use submit for env-aware tasks
|
|
382
|
+
task = RunTask(request=request)
|
|
383
|
+
self.background_tasks["RUN"] = task
|
|
384
|
+
yield from self._run_task(task)
|
|
383
385
|
except GRPCException as exc:
|
|
384
386
|
return self.abort_with_msg(
|
|
385
387
|
exc.message,
|
|
386
388
|
context,
|
|
387
389
|
code=exc.code,
|
|
388
390
|
)
|
|
391
|
+
finally:
|
|
392
|
+
self.background_tasks.pop("RUN", None)
|
|
389
393
|
|
|
390
394
|
def List(
|
|
391
395
|
self,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
isolate/__init__.py,sha256=uXOKnONs7sXgARNgElwr4_A1sKoA6ACHVEvs3IDiX1M,127
|
|
2
|
-
isolate/_isolate_version.py,sha256=
|
|
2
|
+
isolate/_isolate_version.py,sha256=3mnQHEW9gizHocB0ULApMUw7E4CZd4qai5GsjMH_Vo4,413
|
|
3
3
|
isolate/_version.py,sha256=05pXvy-yr5t3I1m9JMn42Ilzpg7fa8IB2J8a3G7t1cU,274
|
|
4
|
-
isolate/logger.py,sha256=
|
|
4
|
+
isolate/logger.py,sha256=Z4a03kjFg54H3RDVVp4nQeut0xlxq0PIbbEczCT9ImU,1758
|
|
5
5
|
isolate/logs.py,sha256=R_AHUVYD18z_PhtK_mDWi9Gch79CxmwHY09hUDShtwg,2079
|
|
6
6
|
isolate/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
isolate/registry.py,sha256=hpzv4HI7iihG5I7i5r8Pb257ibhEKY18xQcG-w1-BgI,1590
|
|
8
8
|
isolate/backends/__init__.py,sha256=LLrSM7UnDFW8tIT5oYlE1wVJrxKcaj_v7cFwvTjQTlc,119
|
|
9
9
|
isolate/backends/_base.py,sha256=Kt5pkhDzXZblq4vxaM3DQTo-Bj-7pIRZFlqJR7OfejY,4112
|
|
10
|
-
isolate/backends/common.py,sha256=
|
|
10
|
+
isolate/backends/common.py,sha256=GzmgzIkCY90elMH_7lpj-LwRNu-GLia2j4PrS6zNHwA,8567
|
|
11
11
|
isolate/backends/conda.py,sha256=S5q5bdY787AMTck2iMGtwu-LHMH4a1qCIjNHDKTkqok,7649
|
|
12
12
|
isolate/backends/container.py,sha256=MCQJbcmQvRUS-tTgTW_pKYBMKwSJO2KZsLeaBMXpPC0,1645
|
|
13
13
|
isolate/backends/local.py,sha256=woxe4dmXuEHxWKsGNndoRA1_sP6yG-dg6tlFZni0mZc,1360
|
|
@@ -42,7 +42,7 @@ isolate/connections/ipc/agent.py,sha256=hGlL4x78FhRvMZ4DkVh3dk-EmWQqxHW4LIipgyOk
|
|
|
42
42
|
isolate/server/__init__.py,sha256=7R3GuWmxuqe0q28rVqETJN9OCrP_-Svjv9h0NR1GFL0,79
|
|
43
43
|
isolate/server/health_server.py,sha256=yN7F1Q28DdX8-Zk3gef7XcQEE25XwlHwzV5GBM75aQM,1249
|
|
44
44
|
isolate/server/interface.py,sha256=nGbjdxrN0p9m1LNdeds8NIoJOwPYW2NM6ktmbhfG4_s,687
|
|
45
|
-
isolate/server/server.py,sha256=
|
|
45
|
+
isolate/server/server.py,sha256=41Y_3dtUmeJR8RuQF2VMC5x_kM_k0w1hyzPFl5uW5Do,23477
|
|
46
46
|
isolate/server/definitions/__init__.py,sha256=f_Q3pdjMuZrjgNlbM60btFKiB1Vg8cnVyKEbp0RmU0A,572
|
|
47
47
|
isolate/server/definitions/server.proto,sha256=UihlFbYG8fbwm0IUfKDRH1vNkopzP3C-wplXXcAO1c8,1761
|
|
48
48
|
isolate/server/definitions/server_pb2.py,sha256=TYBJC_z_dNf2J6FgHukY9mDyc3WBt9EPQOVFd_ayQNc,4304
|
|
@@ -53,9 +53,9 @@ isolate/server/health/health.proto,sha256=wE2_QD0OQAblKkEBG7sALLXEOj1mOLKG-FbC4t
|
|
|
53
53
|
isolate/server/health/health_pb2.py,sha256=onOdP3M4Tpqhqs2PlGcyfoKe2VVKUEDx5ALeRcObb9A,1899
|
|
54
54
|
isolate/server/health/health_pb2.pyi,sha256=AK-DPCpJzoYhU6DydD856c0Ywx84x6k-Cs4m6HpNv5A,2459
|
|
55
55
|
isolate/server/health/health_pb2_grpc.py,sha256=XgsULrnRBmYIqvKr8eI7bqs6NIea5A0kkqdOOc2JHBY,5303
|
|
56
|
-
isolate-0.14.
|
|
57
|
-
isolate-0.14.
|
|
58
|
-
isolate-0.14.
|
|
59
|
-
isolate-0.14.
|
|
60
|
-
isolate-0.14.
|
|
61
|
-
isolate-0.14.
|
|
56
|
+
isolate-0.14.3.dist-info/LICENSE,sha256=427vuyirL5scgBLqA9UWcdnxKrtSGc0u_JfUupk6lAA,11359
|
|
57
|
+
isolate-0.14.3.dist-info/METADATA,sha256=LxlsStQM06vUMmDzW2XsnmdrVvm1mgPgBslNnC22W4Q,3191
|
|
58
|
+
isolate-0.14.3.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
59
|
+
isolate-0.14.3.dist-info/entry_points.txt,sha256=s3prh2EERaVCbL8R45tfY5WFPZ1TsYOsz305YR7s-Pc,360
|
|
60
|
+
isolate-0.14.3.dist-info/top_level.txt,sha256=W9QJBHcq5WXRkbOXf25bvftzFsOZZN4n1DAatdroZrs,8
|
|
61
|
+
isolate-0.14.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|