isolate 0.12.15__py3-none-any.whl → 0.13.0__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 +5 -2
- isolate/backends/conda.py +1 -1
- isolate/backends/pyenv.py +2 -2
- isolate/backends/virtualenv.py +1 -1
- isolate/connections/_local/_base.py +15 -6
- isolate/connections/grpc/_base.py +7 -3
- isolate/connections/grpc/agent.py +31 -36
- isolate/connections/grpc/definitions/agent_pb2.py +11 -12
- isolate/connections/grpc/definitions/agent_pb2.pyi +8 -32
- isolate/connections/grpc/definitions/agent_pb2_grpc.py +54 -28
- isolate/connections/grpc/definitions/common_pb2.py +18 -21
- isolate/connections/grpc/definitions/common_pb2.pyi +17 -84
- isolate/connections/grpc/definitions/common_pb2_grpc.py +26 -0
- isolate/connections/ipc/_base.py +4 -15
- isolate/connections/ipc/agent.py +29 -10
- isolate/server/definitions/server.proto +12 -0
- isolate/server/definitions/server_pb2.py +19 -17
- isolate/server/definitions/server_pb2.pyi +44 -52
- isolate/server/definitions/server_pb2_grpc.py +95 -28
- isolate/server/health/health_pb2.py +16 -16
- isolate/server/health/health_pb2.pyi +6 -14
- isolate/server/health/health_pb2_grpc.py +74 -53
- isolate/server/server.py +62 -26
- {isolate-0.12.15.dist-info → isolate-0.13.0.dist-info}/METADATA +3 -2
- isolate-0.13.0.dist-info/RECORD +60 -0
- isolate-0.12.15.dist-info/RECORD +0 -60
- {isolate-0.12.15.dist-info → isolate-0.13.0.dist-info}/LICENSE +0 -0
- {isolate-0.12.15.dist-info → isolate-0.13.0.dist-info}/WHEEL +0 -0
- {isolate-0.12.15.dist-info → isolate-0.13.0.dist-info}/entry_points.txt +0 -0
- {isolate-0.12.15.dist-info → isolate-0.13.0.dist-info}/top_level.txt +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
@generated by mypy-protobuf. Do not edit manually!
|
|
3
3
|
isort:skip_file
|
|
4
4
|
"""
|
|
5
|
+
|
|
5
6
|
import builtins
|
|
6
7
|
import collections.abc
|
|
7
8
|
import google.protobuf.descriptor
|
|
@@ -23,10 +24,7 @@ class _LogSource:
|
|
|
23
24
|
ValueType = typing.NewType("ValueType", builtins.int)
|
|
24
25
|
V: typing_extensions.TypeAlias = ValueType
|
|
25
26
|
|
|
26
|
-
class _LogSourceEnumTypeWrapper(
|
|
27
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_LogSource.ValueType],
|
|
28
|
-
builtins.type,
|
|
29
|
-
):
|
|
27
|
+
class _LogSourceEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_LogSource.ValueType], builtins.type):
|
|
30
28
|
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
|
31
29
|
BUILDER: _LogSource.ValueType # 0
|
|
32
30
|
BRIDGE: _LogSource.ValueType # 1
|
|
@@ -43,10 +41,7 @@ class _LogLevel:
|
|
|
43
41
|
ValueType = typing.NewType("ValueType", builtins.int)
|
|
44
42
|
V: typing_extensions.TypeAlias = ValueType
|
|
45
43
|
|
|
46
|
-
class _LogLevelEnumTypeWrapper(
|
|
47
|
-
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_LogLevel.ValueType],
|
|
48
|
-
builtins.type,
|
|
49
|
-
):
|
|
44
|
+
class _LogLevelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_LogLevel.ValueType], builtins.type):
|
|
50
45
|
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
|
51
46
|
TRACE: _LogLevel.ValueType # 0
|
|
52
47
|
DEBUG: _LogLevel.ValueType # 1
|
|
@@ -67,7 +62,7 @@ STDOUT: LogLevel.ValueType # 5
|
|
|
67
62
|
STDERR: LogLevel.ValueType # 6
|
|
68
63
|
global___LogLevel = LogLevel
|
|
69
64
|
|
|
70
|
-
@
|
|
65
|
+
@typing.final
|
|
71
66
|
class SerializedObject(google.protobuf.message.Message):
|
|
72
67
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
73
68
|
|
|
@@ -95,40 +90,13 @@ class SerializedObject(google.protobuf.message.Message):
|
|
|
95
90
|
was_it_raised: builtins.bool = ...,
|
|
96
91
|
stringized_traceback: builtins.str | None = ...,
|
|
97
92
|
) -> None: ...
|
|
98
|
-
def HasField(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"_stringized_traceback",
|
|
102
|
-
b"_stringized_traceback",
|
|
103
|
-
"stringized_traceback",
|
|
104
|
-
b"stringized_traceback",
|
|
105
|
-
],
|
|
106
|
-
) -> builtins.bool: ...
|
|
107
|
-
def ClearField(
|
|
108
|
-
self,
|
|
109
|
-
field_name: typing_extensions.Literal[
|
|
110
|
-
"_stringized_traceback",
|
|
111
|
-
b"_stringized_traceback",
|
|
112
|
-
"definition",
|
|
113
|
-
b"definition",
|
|
114
|
-
"method",
|
|
115
|
-
b"method",
|
|
116
|
-
"stringized_traceback",
|
|
117
|
-
b"stringized_traceback",
|
|
118
|
-
"was_it_raised",
|
|
119
|
-
b"was_it_raised",
|
|
120
|
-
],
|
|
121
|
-
) -> None: ...
|
|
122
|
-
def WhichOneof(
|
|
123
|
-
self,
|
|
124
|
-
oneof_group: typing_extensions.Literal[
|
|
125
|
-
"_stringized_traceback", b"_stringized_traceback"
|
|
126
|
-
],
|
|
127
|
-
) -> typing_extensions.Literal["stringized_traceback"] | None: ...
|
|
93
|
+
def HasField(self, field_name: typing.Literal["_stringized_traceback", b"_stringized_traceback", "stringized_traceback", b"stringized_traceback"]) -> builtins.bool: ...
|
|
94
|
+
def ClearField(self, field_name: typing.Literal["_stringized_traceback", b"_stringized_traceback", "definition", b"definition", "method", b"method", "stringized_traceback", b"stringized_traceback", "was_it_raised", b"was_it_raised"]) -> None: ...
|
|
95
|
+
def WhichOneof(self, oneof_group: typing.Literal["_stringized_traceback", b"_stringized_traceback"]) -> typing.Literal["stringized_traceback"] | None: ...
|
|
128
96
|
|
|
129
97
|
global___SerializedObject = SerializedObject
|
|
130
98
|
|
|
131
|
-
@
|
|
99
|
+
@typing.final
|
|
132
100
|
class PartialRunResult(google.protobuf.message.Message):
|
|
133
101
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
134
102
|
|
|
@@ -138,17 +106,15 @@ class PartialRunResult(google.protobuf.message.Message):
|
|
|
138
106
|
is_complete: builtins.bool
|
|
139
107
|
"""A flag indicating whether the run has completed."""
|
|
140
108
|
@property
|
|
141
|
-
def logs(
|
|
142
|
-
self,
|
|
143
|
-
) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
|
|
144
|
-
global___Log
|
|
145
|
-
]:
|
|
109
|
+
def logs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Log]:
|
|
146
110
|
"""A list of logs collected during this partial execution. It does
|
|
147
111
|
not include old logs.
|
|
148
112
|
"""
|
|
113
|
+
|
|
149
114
|
@property
|
|
150
115
|
def result(self) -> global___SerializedObject:
|
|
151
116
|
"""The result of the run, if it is complete."""
|
|
117
|
+
|
|
152
118
|
def __init__(
|
|
153
119
|
self,
|
|
154
120
|
*,
|
|
@@ -156,32 +122,13 @@ class PartialRunResult(google.protobuf.message.Message):
|
|
|
156
122
|
logs: collections.abc.Iterable[global___Log] | None = ...,
|
|
157
123
|
result: global___SerializedObject | None = ...,
|
|
158
124
|
) -> None: ...
|
|
159
|
-
def HasField(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
"_result", b"_result", "result", b"result"
|
|
163
|
-
],
|
|
164
|
-
) -> builtins.bool: ...
|
|
165
|
-
def ClearField(
|
|
166
|
-
self,
|
|
167
|
-
field_name: typing_extensions.Literal[
|
|
168
|
-
"_result",
|
|
169
|
-
b"_result",
|
|
170
|
-
"is_complete",
|
|
171
|
-
b"is_complete",
|
|
172
|
-
"logs",
|
|
173
|
-
b"logs",
|
|
174
|
-
"result",
|
|
175
|
-
b"result",
|
|
176
|
-
],
|
|
177
|
-
) -> None: ...
|
|
178
|
-
def WhichOneof(
|
|
179
|
-
self, oneof_group: typing_extensions.Literal["_result", b"_result"]
|
|
180
|
-
) -> typing_extensions.Literal["result"] | None: ...
|
|
125
|
+
def HasField(self, field_name: typing.Literal["_result", b"_result", "result", b"result"]) -> builtins.bool: ...
|
|
126
|
+
def ClearField(self, field_name: typing.Literal["_result", b"_result", "is_complete", b"is_complete", "logs", b"logs", "result", b"result"]) -> None: ...
|
|
127
|
+
def WhichOneof(self, oneof_group: typing.Literal["_result", b"_result"]) -> typing.Literal["result"] | None: ...
|
|
181
128
|
|
|
182
129
|
global___PartialRunResult = PartialRunResult
|
|
183
130
|
|
|
184
|
-
@
|
|
131
|
+
@typing.final
|
|
185
132
|
class Log(google.protobuf.message.Message):
|
|
186
133
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
187
134
|
|
|
@@ -202,21 +149,7 @@ class Log(google.protobuf.message.Message):
|
|
|
202
149
|
level: global___LogLevel.ValueType = ...,
|
|
203
150
|
timestamp: google.protobuf.timestamp_pb2.Timestamp | None = ...,
|
|
204
151
|
) -> None: ...
|
|
205
|
-
def HasField(
|
|
206
|
-
|
|
207
|
-
) -> builtins.bool: ...
|
|
208
|
-
def ClearField(
|
|
209
|
-
self,
|
|
210
|
-
field_name: typing_extensions.Literal[
|
|
211
|
-
"level",
|
|
212
|
-
b"level",
|
|
213
|
-
"message",
|
|
214
|
-
b"message",
|
|
215
|
-
"source",
|
|
216
|
-
b"source",
|
|
217
|
-
"timestamp",
|
|
218
|
-
b"timestamp",
|
|
219
|
-
],
|
|
220
|
-
) -> None: ...
|
|
152
|
+
def HasField(self, field_name: typing.Literal["timestamp", b"timestamp"]) -> builtins.bool: ...
|
|
153
|
+
def ClearField(self, field_name: typing.Literal["level", b"level", "message", b"message", "source", b"source", "timestamp", b"timestamp"]) -> None: ...
|
|
221
154
|
|
|
222
155
|
global___Log = Log
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
2
|
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
3
|
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
GRPC_GENERATED_VERSION = '1.64.0'
|
|
8
|
+
GRPC_VERSION = grpc.__version__
|
|
9
|
+
EXPECTED_ERROR_RELEASE = '1.65.0'
|
|
10
|
+
SCHEDULED_RELEASE_DATE = 'June 25, 2024'
|
|
11
|
+
_version_not_supported = False
|
|
12
|
+
|
|
13
|
+
try:
|
|
14
|
+
from grpc._utilities import first_version_is_lower
|
|
15
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
16
|
+
except ImportError:
|
|
17
|
+
_version_not_supported = True
|
|
18
|
+
|
|
19
|
+
if _version_not_supported:
|
|
20
|
+
warnings.warn(
|
|
21
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
22
|
+
+ f' but the generated code in common_pb2_grpc.py depends on'
|
|
23
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
24
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
25
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
26
|
+
+ f' This warning will become an error in {EXPECTED_ERROR_RELEASE},'
|
|
27
|
+
+ f' scheduled for release on {SCHEDULED_RELEASE_DATE}.',
|
|
28
|
+
RuntimeWarning
|
|
29
|
+
)
|
isolate/connections/ipc/_base.py
CHANGED
|
@@ -202,6 +202,7 @@ class PythonIPC(PythonExecutionBase[AgentListener], IsolatedProcessConnection):
|
|
|
202
202
|
self,
|
|
203
203
|
executable: Path,
|
|
204
204
|
connection: AgentListener,
|
|
205
|
+
log_fd: int,
|
|
205
206
|
) -> list[str | Path]:
|
|
206
207
|
assert isinstance(connection.address, tuple)
|
|
207
208
|
return [
|
|
@@ -214,21 +215,9 @@ class PythonIPC(PythonExecutionBase[AgentListener], IsolatedProcessConnection):
|
|
|
214
215
|
# the connection with the bridge.
|
|
215
216
|
"--serialization-backend",
|
|
216
217
|
self.environment.settings.serialization_method,
|
|
218
|
+
"--log-fd",
|
|
219
|
+
str(log_fd),
|
|
217
220
|
]
|
|
218
221
|
|
|
219
|
-
def handle_agent_log(self, line: str, level: LogLevel) -> None:
|
|
220
|
-
# TODO: we probably should create a new fd and pass it as
|
|
221
|
-
# one of the the arguments to the child process. Then everything
|
|
222
|
-
# from that fd can be automatically logged as originating from the
|
|
223
|
-
# bridge.
|
|
224
|
-
|
|
225
|
-
# Agent can produce [trace] messages, so change the log
|
|
226
|
-
# level to it if this does not originate from the user.
|
|
227
|
-
if line.startswith("[trace]"):
|
|
228
|
-
line = line.replace("[trace]", "", 1)
|
|
229
|
-
level = LogLevel.TRACE
|
|
230
|
-
source = LogSource.BRIDGE
|
|
231
|
-
else:
|
|
232
|
-
source = LogSource.USER
|
|
233
|
-
|
|
222
|
+
def handle_agent_log(self, line: str, level: LogLevel, source: LogSource) -> None:
|
|
234
223
|
self.log(line, level=level, source=source)
|
isolate/connections/ipc/agent.py
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
# one being the actual result of the given callable, and the other one is a boolean flag
|
|
16
16
|
# indicating whether the callable has raised an exception or not.
|
|
17
17
|
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
18
20
|
import base64
|
|
19
21
|
import importlib
|
|
20
22
|
import os
|
|
@@ -24,7 +26,7 @@ import traceback
|
|
|
24
26
|
from argparse import ArgumentParser
|
|
25
27
|
from contextlib import closing
|
|
26
28
|
from multiprocessing.connection import Client
|
|
27
|
-
from typing import TYPE_CHECKING, Any, Callable, ContextManager
|
|
29
|
+
from typing import TYPE_CHECKING, Any, Callable, ContextManager
|
|
28
30
|
|
|
29
31
|
if TYPE_CHECKING:
|
|
30
32
|
# Somhow mypy can't figure out that `ConnectionWrapper`
|
|
@@ -47,13 +49,13 @@ else:
|
|
|
47
49
|
from multiprocessing.connection import ConnectionWrapper
|
|
48
50
|
|
|
49
51
|
|
|
50
|
-
def decode_service_address(address: str) ->
|
|
52
|
+
def decode_service_address(address: str) -> tuple[str, int]:
|
|
51
53
|
host, port = base64.b64decode(address).decode("utf-8").rsplit(":", 1)
|
|
52
54
|
return host, int(port)
|
|
53
55
|
|
|
54
56
|
|
|
55
57
|
def child_connection(
|
|
56
|
-
serialization_method: str, address:
|
|
58
|
+
serialization_method: str, address: tuple[str, int]
|
|
57
59
|
) -> ContextManager[ConnectionWrapper]:
|
|
58
60
|
serialization_backend = importlib.import_module(serialization_method)
|
|
59
61
|
return closing(
|
|
@@ -70,7 +72,11 @@ DEBUG_TIMEOUT = 60 * 15
|
|
|
70
72
|
|
|
71
73
|
|
|
72
74
|
def run_client(
|
|
73
|
-
serialization_method: str,
|
|
75
|
+
serialization_method: str,
|
|
76
|
+
address: tuple[str, int],
|
|
77
|
+
*,
|
|
78
|
+
with_pdb: bool = False,
|
|
79
|
+
log_fd: int | None = None,
|
|
74
80
|
) -> None:
|
|
75
81
|
# Debug Mode
|
|
76
82
|
# ==========
|
|
@@ -96,13 +102,22 @@ def run_client(
|
|
|
96
102
|
|
|
97
103
|
pdb.set_trace()
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
if log_fd is None:
|
|
106
|
+
_log = sys.stdout
|
|
107
|
+
else:
|
|
108
|
+
_log = os.fdopen(log_fd, "w")
|
|
109
|
+
|
|
110
|
+
def log(_msg):
|
|
111
|
+
_log.write(_msg)
|
|
112
|
+
_log.flush()
|
|
113
|
+
|
|
114
|
+
log(f"Trying to create a connection to {address}")
|
|
100
115
|
# TODO(feat): this should probably run in a loop instead of
|
|
101
116
|
# receiving a single function and then exitting immediately.
|
|
102
117
|
with child_connection(serialization_method, address) as connection:
|
|
103
|
-
|
|
118
|
+
log(f"Created child connection to {address}")
|
|
104
119
|
callable = connection.recv()
|
|
105
|
-
|
|
120
|
+
log(f"Received the callable at {address}")
|
|
106
121
|
|
|
107
122
|
result = None
|
|
108
123
|
did_it_raise = False
|
|
@@ -149,12 +164,11 @@ def _get_shell_bootstrap() -> str:
|
|
|
149
164
|
|
|
150
165
|
|
|
151
166
|
def main() -> int:
|
|
152
|
-
print(f"[trace] Starting the isolated process at PID {os.getpid()}")
|
|
153
|
-
|
|
154
167
|
parser = ArgumentParser()
|
|
155
168
|
parser.add_argument("listen_at")
|
|
156
169
|
parser.add_argument("--with-pdb", action="store_true", default=False)
|
|
157
170
|
parser.add_argument("--serialization-backend", default="pickle")
|
|
171
|
+
parser.add_argument("--log-fd", type=int)
|
|
158
172
|
|
|
159
173
|
options = parser.parse_args()
|
|
160
174
|
if IS_DEBUG_MODE:
|
|
@@ -178,7 +192,12 @@ def main() -> int:
|
|
|
178
192
|
|
|
179
193
|
serialization_method = options.serialization_backend
|
|
180
194
|
address = decode_service_address(options.listen_at)
|
|
181
|
-
run_client(
|
|
195
|
+
run_client(
|
|
196
|
+
serialization_method,
|
|
197
|
+
address,
|
|
198
|
+
with_pdb=options.with_pdb,
|
|
199
|
+
log_fd=options.log_fd,
|
|
200
|
+
)
|
|
182
201
|
return 0
|
|
183
202
|
|
|
184
203
|
|
|
@@ -7,6 +7,9 @@ service Isolate {
|
|
|
7
7
|
// Run the given function on the specified environment. Streams logs
|
|
8
8
|
// and the result originating from that function.
|
|
9
9
|
rpc Run (BoundFunction) returns (stream PartialRunResult) {}
|
|
10
|
+
|
|
11
|
+
// Submit a function to be run without waiting for results.
|
|
12
|
+
rpc Submit (SubmitRequest) returns (SubmitResponse) {}
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
message BoundFunction {
|
|
@@ -23,3 +26,12 @@ message EnvironmentDefinition {
|
|
|
23
26
|
// Whether to force-create this environment or not.
|
|
24
27
|
bool force = 3;
|
|
25
28
|
}
|
|
29
|
+
|
|
30
|
+
message SubmitRequest {
|
|
31
|
+
// The function to run.
|
|
32
|
+
BoundFunction function = 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message SubmitResponse {
|
|
36
|
+
// Reserved for future use.
|
|
37
|
+
}
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# source: server.proto
|
|
4
|
+
# Protobuf Python Version: 5.26.1
|
|
4
5
|
"""Generated protocol buffer code."""
|
|
5
6
|
from google.protobuf import descriptor as _descriptor
|
|
6
7
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
7
8
|
from google.protobuf import symbol_database as _symbol_database
|
|
8
9
|
from google.protobuf.internal import builder as _builder
|
|
9
|
-
|
|
10
10
|
# @@protoc_insertion_point(imports)
|
|
11
11
|
|
|
12
12
|
_sym_db = _symbol_database.Default()
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
16
|
-
|
|
17
15
|
from isolate.connections.grpc.definitions import common_pb2 as common__pb2
|
|
16
|
+
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
18
17
|
|
|
19
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|
20
|
-
b'\n\x0cserver.proto\x1a\x0c\x63ommon.proto\x1a\x1cgoogle/protobuf/struct.proto"\x9d\x01\n\rBoundFunction\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12#\n\x08\x66unction\x18\x02 \x01(\x0b\x32\x11.SerializedObject\x12*\n\nsetup_func\x18\x03 \x01(\x0b\x32\x11.SerializedObjectH\x00\x88\x01\x01\x42\r\n\x0b_setup_func"d\n\x15\x45nvironmentDefinition\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12.\n\rconfiguration\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\x32\x37\n\x07Isolate\x12,\n\x03Run\x12\x0e.BoundFunction\x1a\x11.PartialRunResult"\x00\x30\x01\x62\x06proto3'
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
|
24
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "server_pb2", globals())
|
|
25
|
-
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
26
18
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cserver.proto\x1a\x0c\x63ommon.proto\x1a\x1cgoogle/protobuf/struct.proto\"\x9d\x01\n\rBoundFunction\x12,\n\x0c\x65nvironments\x18\x01 \x03(\x0b\x32\x16.EnvironmentDefinition\x12#\n\x08\x66unction\x18\x02 \x01(\x0b\x32\x11.SerializedObject\x12*\n\nsetup_func\x18\x03 \x01(\x0b\x32\x11.SerializedObjectH\x00\x88\x01\x01\x42\r\n\x0b_setup_func\"d\n\x15\x45nvironmentDefinition\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12.\n\rconfiguration\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\r\n\x05\x66orce\x18\x03 \x01(\x08\"1\n\rSubmitRequest\x12 \n\x08\x66unction\x18\x01 \x01(\x0b\x32\x0e.BoundFunction\"\x10\n\x0eSubmitResponse2d\n\x07Isolate\x12,\n\x03Run\x12\x0e.BoundFunction\x1a\x11.PartialRunResult\"\x00\x30\x01\x12+\n\x06Submit\x12\x0e.SubmitRequest\x1a\x0f.SubmitResponse\"\x00\x62\x06proto3')
|
|
20
|
+
|
|
21
|
+
_globals = globals()
|
|
22
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
23
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'server_pb2', _globals)
|
|
24
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
25
|
+
DESCRIPTOR._loaded_options = None
|
|
26
|
+
_globals['_BOUNDFUNCTION']._serialized_start=61
|
|
27
|
+
_globals['_BOUNDFUNCTION']._serialized_end=218
|
|
28
|
+
_globals['_ENVIRONMENTDEFINITION']._serialized_start=220
|
|
29
|
+
_globals['_ENVIRONMENTDEFINITION']._serialized_end=320
|
|
30
|
+
_globals['_SUBMITREQUEST']._serialized_start=322
|
|
31
|
+
_globals['_SUBMITREQUEST']._serialized_end=371
|
|
32
|
+
_globals['_SUBMITRESPONSE']._serialized_start=373
|
|
33
|
+
_globals['_SUBMITRESPONSE']._serialized_end=389
|
|
34
|
+
_globals['_ISOLATE']._serialized_start=391
|
|
35
|
+
_globals['_ISOLATE']._serialized_end=491
|
|
34
36
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
@generated by mypy-protobuf. Do not edit manually!
|
|
3
3
|
isort:skip_file
|
|
4
4
|
"""
|
|
5
|
+
|
|
5
6
|
import builtins
|
|
6
7
|
import collections.abc
|
|
7
8
|
from isolate.connections.grpc.definitions import common_pb2
|
|
@@ -9,16 +10,11 @@ import google.protobuf.descriptor
|
|
|
9
10
|
import google.protobuf.internal.containers
|
|
10
11
|
import google.protobuf.message
|
|
11
12
|
import google.protobuf.struct_pb2
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
if sys.version_info >= (3, 8):
|
|
15
|
-
import typing as typing_extensions
|
|
16
|
-
else:
|
|
17
|
-
import typing_extensions
|
|
13
|
+
import typing
|
|
18
14
|
|
|
19
15
|
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
|
20
16
|
|
|
21
|
-
@
|
|
17
|
+
@typing.final
|
|
22
18
|
class BoundFunction(google.protobuf.message.Message):
|
|
23
19
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
24
20
|
|
|
@@ -26,11 +22,7 @@ class BoundFunction(google.protobuf.message.Message):
|
|
|
26
22
|
FUNCTION_FIELD_NUMBER: builtins.int
|
|
27
23
|
SETUP_FUNC_FIELD_NUMBER: builtins.int
|
|
28
24
|
@property
|
|
29
|
-
def environments(
|
|
30
|
-
self,
|
|
31
|
-
) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
|
|
32
|
-
global___EnvironmentDefinition
|
|
33
|
-
]: ...
|
|
25
|
+
def environments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EnvironmentDefinition]: ...
|
|
34
26
|
@property
|
|
35
27
|
def function(self) -> common_pb2.SerializedObject: ...
|
|
36
28
|
@property
|
|
@@ -38,42 +30,17 @@ class BoundFunction(google.protobuf.message.Message):
|
|
|
38
30
|
def __init__(
|
|
39
31
|
self,
|
|
40
32
|
*,
|
|
41
|
-
environments: collections.abc.Iterable[global___EnvironmentDefinition]
|
|
42
|
-
| None = ...,
|
|
33
|
+
environments: collections.abc.Iterable[global___EnvironmentDefinition] | None = ...,
|
|
43
34
|
function: common_pb2.SerializedObject | None = ...,
|
|
44
35
|
setup_func: common_pb2.SerializedObject | None = ...,
|
|
45
36
|
) -> None: ...
|
|
46
|
-
def HasField(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"_setup_func",
|
|
50
|
-
b"_setup_func",
|
|
51
|
-
"function",
|
|
52
|
-
b"function",
|
|
53
|
-
"setup_func",
|
|
54
|
-
b"setup_func",
|
|
55
|
-
],
|
|
56
|
-
) -> builtins.bool: ...
|
|
57
|
-
def ClearField(
|
|
58
|
-
self,
|
|
59
|
-
field_name: typing_extensions.Literal[
|
|
60
|
-
"_setup_func",
|
|
61
|
-
b"_setup_func",
|
|
62
|
-
"environments",
|
|
63
|
-
b"environments",
|
|
64
|
-
"function",
|
|
65
|
-
b"function",
|
|
66
|
-
"setup_func",
|
|
67
|
-
b"setup_func",
|
|
68
|
-
],
|
|
69
|
-
) -> None: ...
|
|
70
|
-
def WhichOneof(
|
|
71
|
-
self, oneof_group: typing_extensions.Literal["_setup_func", b"_setup_func"]
|
|
72
|
-
) -> typing_extensions.Literal["setup_func"] | None: ...
|
|
37
|
+
def HasField(self, field_name: typing.Literal["_setup_func", b"_setup_func", "function", b"function", "setup_func", b"setup_func"]) -> builtins.bool: ...
|
|
38
|
+
def ClearField(self, field_name: typing.Literal["_setup_func", b"_setup_func", "environments", b"environments", "function", b"function", "setup_func", b"setup_func"]) -> None: ...
|
|
39
|
+
def WhichOneof(self, oneof_group: typing.Literal["_setup_func", b"_setup_func"]) -> typing.Literal["setup_func"] | None: ...
|
|
73
40
|
|
|
74
41
|
global___BoundFunction = BoundFunction
|
|
75
42
|
|
|
76
|
-
@
|
|
43
|
+
@typing.final
|
|
77
44
|
class EnvironmentDefinition(google.protobuf.message.Message):
|
|
78
45
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
79
46
|
|
|
@@ -82,11 +49,12 @@ class EnvironmentDefinition(google.protobuf.message.Message):
|
|
|
82
49
|
FORCE_FIELD_NUMBER: builtins.int
|
|
83
50
|
kind: builtins.str
|
|
84
51
|
"""Kind of the isolate environment."""
|
|
52
|
+
force: builtins.bool
|
|
53
|
+
"""Whether to force-create this environment or not."""
|
|
85
54
|
@property
|
|
86
55
|
def configuration(self) -> google.protobuf.struct_pb2.Struct:
|
|
87
56
|
"""A free-form definition of environment properties."""
|
|
88
|
-
|
|
89
|
-
"""Whether to force-create this environment or not."""
|
|
57
|
+
|
|
90
58
|
def __init__(
|
|
91
59
|
self,
|
|
92
60
|
*,
|
|
@@ -94,14 +62,38 @@ class EnvironmentDefinition(google.protobuf.message.Message):
|
|
|
94
62
|
configuration: google.protobuf.struct_pb2.Struct | None = ...,
|
|
95
63
|
force: builtins.bool = ...,
|
|
96
64
|
) -> None: ...
|
|
97
|
-
def HasField(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
65
|
+
def HasField(self, field_name: typing.Literal["configuration", b"configuration"]) -> builtins.bool: ...
|
|
66
|
+
def ClearField(self, field_name: typing.Literal["configuration", b"configuration", "force", b"force", "kind", b"kind"]) -> None: ...
|
|
67
|
+
|
|
68
|
+
global___EnvironmentDefinition = EnvironmentDefinition
|
|
69
|
+
|
|
70
|
+
@typing.final
|
|
71
|
+
class SubmitRequest(google.protobuf.message.Message):
|
|
72
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
73
|
+
|
|
74
|
+
FUNCTION_FIELD_NUMBER: builtins.int
|
|
75
|
+
@property
|
|
76
|
+
def function(self) -> global___BoundFunction:
|
|
77
|
+
"""The function to run."""
|
|
78
|
+
|
|
79
|
+
def __init__(
|
|
80
|
+
self,
|
|
81
|
+
*,
|
|
82
|
+
function: global___BoundFunction | None = ...,
|
|
83
|
+
) -> None: ...
|
|
84
|
+
def HasField(self, field_name: typing.Literal["function", b"function"]) -> builtins.bool: ...
|
|
85
|
+
def ClearField(self, field_name: typing.Literal["function", b"function"]) -> None: ...
|
|
86
|
+
|
|
87
|
+
global___SubmitRequest = SubmitRequest
|
|
88
|
+
|
|
89
|
+
@typing.final
|
|
90
|
+
class SubmitResponse(google.protobuf.message.Message):
|
|
91
|
+
"""Reserved for future use."""
|
|
92
|
+
|
|
93
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
94
|
+
|
|
95
|
+
def __init__(
|
|
101
96
|
self,
|
|
102
|
-
field_name: typing_extensions.Literal[
|
|
103
|
-
"configuration", b"configuration", "force", b"force", "kind", b"kind"
|
|
104
|
-
],
|
|
105
97
|
) -> None: ...
|
|
106
98
|
|
|
107
|
-
|
|
99
|
+
global___SubmitResponse = SubmitResponse
|