modal 1.1.5.dev85__py3-none-any.whl → 1.1.5.dev87__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 modal might be problematic. Click here for more details.
- modal/client.pyi +2 -2
- {modal-1.1.5.dev85.dist-info → modal-1.1.5.dev87.dist-info}/METADATA +1 -1
- {modal-1.1.5.dev85.dist-info → modal-1.1.5.dev87.dist-info}/RECORD +21 -22
- modal_proto/api.proto +15 -0
- modal_proto/api_grpc.py +16 -0
- modal_proto/api_pb2.py +201 -181
- modal_proto/api_pb2.pyi +38 -0
- modal_proto/api_pb2_grpc.py +33 -0
- modal_proto/api_pb2_grpc.pyi +10 -0
- modal_proto/modal_api_grpc.py +1 -0
- modal_proto/task_command_router.proto +144 -0
- modal_proto/task_command_router_grpc.py +105 -0
- modal_proto/task_command_router_pb2.py +149 -0
- modal_proto/task_command_router_pb2.pyi +333 -0
- modal_proto/task_command_router_pb2_grpc.py +203 -0
- modal_proto/task_command_router_pb2_grpc.pyi +75 -0
- modal_version/__init__.py +1 -1
- modal_proto/modal_options_grpc.py +0 -3
- modal_proto/options.proto +0 -19
- modal_proto/options_grpc.py +0 -3
- modal_proto/options_pb2.py +0 -35
- modal_proto/options_pb2.pyi +0 -20
- modal_proto/options_pb2_grpc.py +0 -4
- modal_proto/options_pb2_grpc.pyi +0 -7
- {modal-1.1.5.dev85.dist-info → modal-1.1.5.dev87.dist-info}/WHEEL +0 -0
- {modal-1.1.5.dev85.dist-info → modal-1.1.5.dev87.dist-info}/entry_points.txt +0 -0
- {modal-1.1.5.dev85.dist-info → modal-1.1.5.dev87.dist-info}/licenses/LICENSE +0 -0
- {modal-1.1.5.dev85.dist-info → modal-1.1.5.dev87.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"""
|
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
|
3
|
+
isort:skip_file
|
|
4
|
+
"""
|
|
5
|
+
import builtins
|
|
6
|
+
import collections.abc
|
|
7
|
+
import google.protobuf.descriptor
|
|
8
|
+
import google.protobuf.internal.containers
|
|
9
|
+
import google.protobuf.internal.enum_type_wrapper
|
|
10
|
+
import google.protobuf.message
|
|
11
|
+
import modal_proto.api_pb2
|
|
12
|
+
import sys
|
|
13
|
+
import typing
|
|
14
|
+
|
|
15
|
+
if sys.version_info >= (3, 10):
|
|
16
|
+
import typing as typing_extensions
|
|
17
|
+
else:
|
|
18
|
+
import typing_extensions
|
|
19
|
+
|
|
20
|
+
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
|
|
21
|
+
|
|
22
|
+
class _TaskExecStderrConfig:
|
|
23
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
|
24
|
+
V: typing_extensions.TypeAlias = ValueType
|
|
25
|
+
|
|
26
|
+
class _TaskExecStderrConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStderrConfig.ValueType], builtins.type): # noqa: F821
|
|
27
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
|
28
|
+
TASK_EXEC_STDERR_CONFIG_DEVNULL: _TaskExecStderrConfig.ValueType # 0
|
|
29
|
+
"""The output will be discarded."""
|
|
30
|
+
TASK_EXEC_STDERR_CONFIG_PIPE: _TaskExecStderrConfig.ValueType # 1
|
|
31
|
+
"""The output will be streamed to the client."""
|
|
32
|
+
TASK_EXEC_STDERR_CONFIG_STDOUT: _TaskExecStderrConfig.ValueType # 2
|
|
33
|
+
"""A special value that can be used to indicate that the stderr stream should
|
|
34
|
+
be merged with the stdout stream.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
class TaskExecStderrConfig(_TaskExecStderrConfig, metaclass=_TaskExecStderrConfigEnumTypeWrapper): ...
|
|
38
|
+
|
|
39
|
+
TASK_EXEC_STDERR_CONFIG_DEVNULL: TaskExecStderrConfig.ValueType # 0
|
|
40
|
+
"""The output will be discarded."""
|
|
41
|
+
TASK_EXEC_STDERR_CONFIG_PIPE: TaskExecStderrConfig.ValueType # 1
|
|
42
|
+
"""The output will be streamed to the client."""
|
|
43
|
+
TASK_EXEC_STDERR_CONFIG_STDOUT: TaskExecStderrConfig.ValueType # 2
|
|
44
|
+
"""A special value that can be used to indicate that the stderr stream should
|
|
45
|
+
be merged with the stdout stream.
|
|
46
|
+
"""
|
|
47
|
+
global___TaskExecStderrConfig = TaskExecStderrConfig
|
|
48
|
+
|
|
49
|
+
class _TaskExecStdioFileDescriptor:
|
|
50
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
|
51
|
+
V: typing_extensions.TypeAlias = ValueType
|
|
52
|
+
|
|
53
|
+
class _TaskExecStdioFileDescriptorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStdioFileDescriptor.ValueType], builtins.type): # noqa: F821
|
|
54
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
|
55
|
+
TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: _TaskExecStdioFileDescriptor.ValueType # 0
|
|
56
|
+
"""Read from stdout."""
|
|
57
|
+
TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: _TaskExecStdioFileDescriptor.ValueType # 1
|
|
58
|
+
"""Read from stderr."""
|
|
59
|
+
|
|
60
|
+
class TaskExecStdioFileDescriptor(_TaskExecStdioFileDescriptor, metaclass=_TaskExecStdioFileDescriptorEnumTypeWrapper): ...
|
|
61
|
+
|
|
62
|
+
TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: TaskExecStdioFileDescriptor.ValueType # 0
|
|
63
|
+
"""Read from stdout."""
|
|
64
|
+
TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: TaskExecStdioFileDescriptor.ValueType # 1
|
|
65
|
+
"""Read from stderr."""
|
|
66
|
+
global___TaskExecStdioFileDescriptor = TaskExecStdioFileDescriptor
|
|
67
|
+
|
|
68
|
+
class _TaskExecStdoutConfig:
|
|
69
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
|
70
|
+
V: typing_extensions.TypeAlias = ValueType
|
|
71
|
+
|
|
72
|
+
class _TaskExecStdoutConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStdoutConfig.ValueType], builtins.type): # noqa: F821
|
|
73
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
|
74
|
+
TASK_EXEC_STDOUT_CONFIG_DEVNULL: _TaskExecStdoutConfig.ValueType # 0
|
|
75
|
+
"""The output will be discarded."""
|
|
76
|
+
TASK_EXEC_STDOUT_CONFIG_PIPE: _TaskExecStdoutConfig.ValueType # 1
|
|
77
|
+
"""The output will be streamed to the client."""
|
|
78
|
+
|
|
79
|
+
class TaskExecStdoutConfig(_TaskExecStdoutConfig, metaclass=_TaskExecStdoutConfigEnumTypeWrapper): ...
|
|
80
|
+
|
|
81
|
+
TASK_EXEC_STDOUT_CONFIG_DEVNULL: TaskExecStdoutConfig.ValueType # 0
|
|
82
|
+
"""The output will be discarded."""
|
|
83
|
+
TASK_EXEC_STDOUT_CONFIG_PIPE: TaskExecStdoutConfig.ValueType # 1
|
|
84
|
+
"""The output will be streamed to the client."""
|
|
85
|
+
global___TaskExecStdoutConfig = TaskExecStdoutConfig
|
|
86
|
+
|
|
87
|
+
class TaskExecPollRequest(google.protobuf.message.Message):
|
|
88
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
89
|
+
|
|
90
|
+
TASK_ID_FIELD_NUMBER: builtins.int
|
|
91
|
+
EXEC_ID_FIELD_NUMBER: builtins.int
|
|
92
|
+
task_id: builtins.str
|
|
93
|
+
"""The ID of the task running the exec'd command."""
|
|
94
|
+
exec_id: builtins.str
|
|
95
|
+
"""The execution ID of the command to wait on."""
|
|
96
|
+
def __init__(
|
|
97
|
+
self,
|
|
98
|
+
*,
|
|
99
|
+
task_id: builtins.str = ...,
|
|
100
|
+
exec_id: builtins.str = ...,
|
|
101
|
+
) -> None: ...
|
|
102
|
+
def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "task_id", b"task_id"]) -> None: ...
|
|
103
|
+
|
|
104
|
+
global___TaskExecPollRequest = TaskExecPollRequest
|
|
105
|
+
|
|
106
|
+
class TaskExecPollResponse(google.protobuf.message.Message):
|
|
107
|
+
"""The response to a TaskExecPollRequest. If the exec'd command has not
|
|
108
|
+
completed, exit_status will be unset.
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
112
|
+
|
|
113
|
+
CODE_FIELD_NUMBER: builtins.int
|
|
114
|
+
SIGNAL_FIELD_NUMBER: builtins.int
|
|
115
|
+
code: builtins.int
|
|
116
|
+
"""The exit code of the command."""
|
|
117
|
+
signal: builtins.int
|
|
118
|
+
"""The signal that terminated the command."""
|
|
119
|
+
def __init__(
|
|
120
|
+
self,
|
|
121
|
+
*,
|
|
122
|
+
code: builtins.int = ...,
|
|
123
|
+
signal: builtins.int = ...,
|
|
124
|
+
) -> None: ...
|
|
125
|
+
def HasField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> builtins.bool: ...
|
|
126
|
+
def ClearField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> None: ...
|
|
127
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["exit_status", b"exit_status"]) -> typing_extensions.Literal["code", "signal"] | None: ...
|
|
128
|
+
|
|
129
|
+
global___TaskExecPollResponse = TaskExecPollResponse
|
|
130
|
+
|
|
131
|
+
class TaskExecStartRequest(google.protobuf.message.Message):
|
|
132
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
133
|
+
|
|
134
|
+
TASK_ID_FIELD_NUMBER: builtins.int
|
|
135
|
+
EXEC_ID_FIELD_NUMBER: builtins.int
|
|
136
|
+
COMMAND_ARGS_FIELD_NUMBER: builtins.int
|
|
137
|
+
STDOUT_CONFIG_FIELD_NUMBER: builtins.int
|
|
138
|
+
STDERR_CONFIG_FIELD_NUMBER: builtins.int
|
|
139
|
+
TIMEOUT_SECS_FIELD_NUMBER: builtins.int
|
|
140
|
+
WORKDIR_FIELD_NUMBER: builtins.int
|
|
141
|
+
SECRET_IDS_FIELD_NUMBER: builtins.int
|
|
142
|
+
PTY_INFO_FIELD_NUMBER: builtins.int
|
|
143
|
+
RUNTIME_DEBUG_FIELD_NUMBER: builtins.int
|
|
144
|
+
task_id: builtins.str
|
|
145
|
+
"""The ID of the task to execute the command in."""
|
|
146
|
+
exec_id: builtins.str
|
|
147
|
+
"""Execution ID. This ID will be used to identify the execution for other
|
|
148
|
+
requests and ensure exec commands are idempotent.
|
|
149
|
+
"""
|
|
150
|
+
@property
|
|
151
|
+
def command_args(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
|
|
152
|
+
"""Command arguments to execute."""
|
|
153
|
+
stdout_config: global___TaskExecStdoutConfig.ValueType
|
|
154
|
+
"""Configures how the stdout of the command will be handled."""
|
|
155
|
+
stderr_config: global___TaskExecStderrConfig.ValueType
|
|
156
|
+
"""Configures how the stderr of the command will be handled."""
|
|
157
|
+
timeout_secs: builtins.int
|
|
158
|
+
"""Timeout in seconds for the exec'd command to exit. If the command does not
|
|
159
|
+
exit within this duration, the command will be killed. This is NOT the
|
|
160
|
+
timeout for the ExecStartRequest RPC to complete.
|
|
161
|
+
"""
|
|
162
|
+
workdir: builtins.str
|
|
163
|
+
"""Working directory for the command."""
|
|
164
|
+
@property
|
|
165
|
+
def secret_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
|
|
166
|
+
"""Secret IDs to mount into the task."""
|
|
167
|
+
@property
|
|
168
|
+
def pty_info(self) -> modal_proto.api_pb2.PTYInfo:
|
|
169
|
+
"""PTY info for the command."""
|
|
170
|
+
runtime_debug: builtins.bool
|
|
171
|
+
"""Enable debugging capabilities on the container runtime. Used only for
|
|
172
|
+
internal debugging.
|
|
173
|
+
"""
|
|
174
|
+
def __init__(
|
|
175
|
+
self,
|
|
176
|
+
*,
|
|
177
|
+
task_id: builtins.str = ...,
|
|
178
|
+
exec_id: builtins.str = ...,
|
|
179
|
+
command_args: collections.abc.Iterable[builtins.str] | None = ...,
|
|
180
|
+
stdout_config: global___TaskExecStdoutConfig.ValueType = ...,
|
|
181
|
+
stderr_config: global___TaskExecStderrConfig.ValueType = ...,
|
|
182
|
+
timeout_secs: builtins.int | None = ...,
|
|
183
|
+
workdir: builtins.str | None = ...,
|
|
184
|
+
secret_ids: collections.abc.Iterable[builtins.str] | None = ...,
|
|
185
|
+
pty_info: modal_proto.api_pb2.PTYInfo | None = ...,
|
|
186
|
+
runtime_debug: builtins.bool = ...,
|
|
187
|
+
) -> None: ...
|
|
188
|
+
def HasField(self, field_name: typing_extensions.Literal["_pty_info", b"_pty_info", "_timeout_secs", b"_timeout_secs", "_workdir", b"_workdir", "pty_info", b"pty_info", "timeout_secs", b"timeout_secs", "workdir", b"workdir"]) -> builtins.bool: ...
|
|
189
|
+
def ClearField(self, field_name: typing_extensions.Literal["_pty_info", b"_pty_info", "_timeout_secs", b"_timeout_secs", "_workdir", b"_workdir", "command_args", b"command_args", "exec_id", b"exec_id", "pty_info", b"pty_info", "runtime_debug", b"runtime_debug", "secret_ids", b"secret_ids", "stderr_config", b"stderr_config", "stdout_config", b"stdout_config", "task_id", b"task_id", "timeout_secs", b"timeout_secs", "workdir", b"workdir"]) -> None: ...
|
|
190
|
+
@typing.overload
|
|
191
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_pty_info", b"_pty_info"]) -> typing_extensions.Literal["pty_info"] | None: ...
|
|
192
|
+
@typing.overload
|
|
193
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_timeout_secs", b"_timeout_secs"]) -> typing_extensions.Literal["timeout_secs"] | None: ...
|
|
194
|
+
@typing.overload
|
|
195
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["_workdir", b"_workdir"]) -> typing_extensions.Literal["workdir"] | None: ...
|
|
196
|
+
|
|
197
|
+
global___TaskExecStartRequest = TaskExecStartRequest
|
|
198
|
+
|
|
199
|
+
class TaskExecStartResponse(google.protobuf.message.Message):
|
|
200
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
201
|
+
|
|
202
|
+
def __init__(
|
|
203
|
+
self,
|
|
204
|
+
) -> None: ...
|
|
205
|
+
|
|
206
|
+
global___TaskExecStartResponse = TaskExecStartResponse
|
|
207
|
+
|
|
208
|
+
class TaskExecStdinWriteRequest(google.protobuf.message.Message):
|
|
209
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
210
|
+
|
|
211
|
+
TASK_ID_FIELD_NUMBER: builtins.int
|
|
212
|
+
EXEC_ID_FIELD_NUMBER: builtins.int
|
|
213
|
+
OFFSET_FIELD_NUMBER: builtins.int
|
|
214
|
+
DATA_FIELD_NUMBER: builtins.int
|
|
215
|
+
EOF_FIELD_NUMBER: builtins.int
|
|
216
|
+
task_id: builtins.str
|
|
217
|
+
"""The ID of the task running the exec'd command."""
|
|
218
|
+
exec_id: builtins.str
|
|
219
|
+
"""The execution ID of the command to write to."""
|
|
220
|
+
offset: builtins.int
|
|
221
|
+
"""The offset to start writing to. This is used to resume writing from the
|
|
222
|
+
last write position if the connection is closed and reopened.
|
|
223
|
+
"""
|
|
224
|
+
data: builtins.bytes
|
|
225
|
+
eof: builtins.bool
|
|
226
|
+
"""If true, close the stdin stream after writing any provided data.
|
|
227
|
+
This signals EOF to the exec'd process.
|
|
228
|
+
"""
|
|
229
|
+
def __init__(
|
|
230
|
+
self,
|
|
231
|
+
*,
|
|
232
|
+
task_id: builtins.str = ...,
|
|
233
|
+
exec_id: builtins.str = ...,
|
|
234
|
+
offset: builtins.int = ...,
|
|
235
|
+
data: builtins.bytes = ...,
|
|
236
|
+
eof: builtins.bool = ...,
|
|
237
|
+
) -> None: ...
|
|
238
|
+
def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "eof", b"eof", "exec_id", b"exec_id", "offset", b"offset", "task_id", b"task_id"]) -> None: ...
|
|
239
|
+
|
|
240
|
+
global___TaskExecStdinWriteRequest = TaskExecStdinWriteRequest
|
|
241
|
+
|
|
242
|
+
class TaskExecStdinWriteResponse(google.protobuf.message.Message):
|
|
243
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
244
|
+
|
|
245
|
+
def __init__(
|
|
246
|
+
self,
|
|
247
|
+
) -> None: ...
|
|
248
|
+
|
|
249
|
+
global___TaskExecStdinWriteResponse = TaskExecStdinWriteResponse
|
|
250
|
+
|
|
251
|
+
class TaskExecStdioReadRequest(google.protobuf.message.Message):
|
|
252
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
253
|
+
|
|
254
|
+
TASK_ID_FIELD_NUMBER: builtins.int
|
|
255
|
+
EXEC_ID_FIELD_NUMBER: builtins.int
|
|
256
|
+
OFFSET_FIELD_NUMBER: builtins.int
|
|
257
|
+
FILE_DESCRIPTOR_FIELD_NUMBER: builtins.int
|
|
258
|
+
task_id: builtins.str
|
|
259
|
+
"""The ID of the task running the exec'd command."""
|
|
260
|
+
exec_id: builtins.str
|
|
261
|
+
"""The execution ID of the command to read from."""
|
|
262
|
+
offset: builtins.int
|
|
263
|
+
"""The offset to start reading from. This is used to resume reading from the
|
|
264
|
+
last read position if the connection is closed and reopened.
|
|
265
|
+
"""
|
|
266
|
+
file_descriptor: global___TaskExecStdioFileDescriptor.ValueType
|
|
267
|
+
"""Which file descriptor to read from."""
|
|
268
|
+
def __init__(
|
|
269
|
+
self,
|
|
270
|
+
*,
|
|
271
|
+
task_id: builtins.str = ...,
|
|
272
|
+
exec_id: builtins.str = ...,
|
|
273
|
+
offset: builtins.int = ...,
|
|
274
|
+
file_descriptor: global___TaskExecStdioFileDescriptor.ValueType = ...,
|
|
275
|
+
) -> None: ...
|
|
276
|
+
def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "file_descriptor", b"file_descriptor", "offset", b"offset", "task_id", b"task_id"]) -> None: ...
|
|
277
|
+
|
|
278
|
+
global___TaskExecStdioReadRequest = TaskExecStdioReadRequest
|
|
279
|
+
|
|
280
|
+
class TaskExecStdioReadResponse(google.protobuf.message.Message):
|
|
281
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
282
|
+
|
|
283
|
+
DATA_FIELD_NUMBER: builtins.int
|
|
284
|
+
data: builtins.bytes
|
|
285
|
+
"""The data read from the file descriptor."""
|
|
286
|
+
def __init__(
|
|
287
|
+
self,
|
|
288
|
+
*,
|
|
289
|
+
data: builtins.bytes = ...,
|
|
290
|
+
) -> None: ...
|
|
291
|
+
def ClearField(self, field_name: typing_extensions.Literal["data", b"data"]) -> None: ...
|
|
292
|
+
|
|
293
|
+
global___TaskExecStdioReadResponse = TaskExecStdioReadResponse
|
|
294
|
+
|
|
295
|
+
class TaskExecWaitRequest(google.protobuf.message.Message):
|
|
296
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
297
|
+
|
|
298
|
+
TASK_ID_FIELD_NUMBER: builtins.int
|
|
299
|
+
EXEC_ID_FIELD_NUMBER: builtins.int
|
|
300
|
+
task_id: builtins.str
|
|
301
|
+
"""The ID of the task running the exec'd command."""
|
|
302
|
+
exec_id: builtins.str
|
|
303
|
+
"""The execution ID of the command to wait on."""
|
|
304
|
+
def __init__(
|
|
305
|
+
self,
|
|
306
|
+
*,
|
|
307
|
+
task_id: builtins.str = ...,
|
|
308
|
+
exec_id: builtins.str = ...,
|
|
309
|
+
) -> None: ...
|
|
310
|
+
def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "task_id", b"task_id"]) -> None: ...
|
|
311
|
+
|
|
312
|
+
global___TaskExecWaitRequest = TaskExecWaitRequest
|
|
313
|
+
|
|
314
|
+
class TaskExecWaitResponse(google.protobuf.message.Message):
|
|
315
|
+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
|
316
|
+
|
|
317
|
+
CODE_FIELD_NUMBER: builtins.int
|
|
318
|
+
SIGNAL_FIELD_NUMBER: builtins.int
|
|
319
|
+
code: builtins.int
|
|
320
|
+
"""The exit code of the command."""
|
|
321
|
+
signal: builtins.int
|
|
322
|
+
"""The signal that terminated the command."""
|
|
323
|
+
def __init__(
|
|
324
|
+
self,
|
|
325
|
+
*,
|
|
326
|
+
code: builtins.int = ...,
|
|
327
|
+
signal: builtins.int = ...,
|
|
328
|
+
) -> None: ...
|
|
329
|
+
def HasField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> builtins.bool: ...
|
|
330
|
+
def ClearField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> None: ...
|
|
331
|
+
def WhichOneof(self, oneof_group: typing_extensions.Literal["exit_status", b"exit_status"]) -> typing_extensions.Literal["code", "signal"] | None: ...
|
|
332
|
+
|
|
333
|
+
global___TaskExecWaitResponse = TaskExecWaitResponse
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from modal_proto import task_command_router_pb2 as modal__proto_dot_task__command__router__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TaskRouterStub(object):
|
|
9
|
+
"""Missing associated documentation comment in .proto file."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, channel):
|
|
12
|
+
"""Constructor.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
channel: A grpc.Channel.
|
|
16
|
+
"""
|
|
17
|
+
self.TaskExecPoll = channel.unary_unary(
|
|
18
|
+
'/modal.task_command_router.TaskRouter/TaskExecPoll',
|
|
19
|
+
request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecPollRequest.SerializeToString,
|
|
20
|
+
response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecPollResponse.FromString,
|
|
21
|
+
)
|
|
22
|
+
self.TaskExecStart = channel.unary_unary(
|
|
23
|
+
'/modal.task_command_router.TaskRouter/TaskExecStart',
|
|
24
|
+
request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStartRequest.SerializeToString,
|
|
25
|
+
response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStartResponse.FromString,
|
|
26
|
+
)
|
|
27
|
+
self.TaskExecStdinWrite = channel.unary_unary(
|
|
28
|
+
'/modal.task_command_router.TaskRouter/TaskExecStdinWrite',
|
|
29
|
+
request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteRequest.SerializeToString,
|
|
30
|
+
response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteResponse.FromString,
|
|
31
|
+
)
|
|
32
|
+
self.TaskExecStdioRead = channel.unary_stream(
|
|
33
|
+
'/modal.task_command_router.TaskRouter/TaskExecStdioRead',
|
|
34
|
+
request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStdioReadRequest.SerializeToString,
|
|
35
|
+
response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStdioReadResponse.FromString,
|
|
36
|
+
)
|
|
37
|
+
self.TaskExecWait = channel.unary_unary(
|
|
38
|
+
'/modal.task_command_router.TaskRouter/TaskExecWait',
|
|
39
|
+
request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecWaitRequest.SerializeToString,
|
|
40
|
+
response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecWaitResponse.FromString,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class TaskRouterServicer(object):
|
|
45
|
+
"""Missing associated documentation comment in .proto file."""
|
|
46
|
+
|
|
47
|
+
def TaskExecPoll(self, request, context):
|
|
48
|
+
"""Poll for the exit status of an exec'd command.
|
|
49
|
+
"""
|
|
50
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
51
|
+
context.set_details('Method not implemented!')
|
|
52
|
+
raise NotImplementedError('Method not implemented!')
|
|
53
|
+
|
|
54
|
+
def TaskExecStart(self, request, context):
|
|
55
|
+
"""Execute a command in the task.
|
|
56
|
+
"""
|
|
57
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
58
|
+
context.set_details('Method not implemented!')
|
|
59
|
+
raise NotImplementedError('Method not implemented!')
|
|
60
|
+
|
|
61
|
+
def TaskExecStdinWrite(self, request, context):
|
|
62
|
+
"""Write to the stdin stream of an exec'd command.
|
|
63
|
+
"""
|
|
64
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
65
|
+
context.set_details('Method not implemented!')
|
|
66
|
+
raise NotImplementedError('Method not implemented!')
|
|
67
|
+
|
|
68
|
+
def TaskExecStdioRead(self, request, context):
|
|
69
|
+
"""Get a stream of output from the stdout or stderr stream of an exec'd command.
|
|
70
|
+
"""
|
|
71
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
72
|
+
context.set_details('Method not implemented!')
|
|
73
|
+
raise NotImplementedError('Method not implemented!')
|
|
74
|
+
|
|
75
|
+
def TaskExecWait(self, request, context):
|
|
76
|
+
"""Wait for an exec'd command to exit and return the exit code.
|
|
77
|
+
"""
|
|
78
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
79
|
+
context.set_details('Method not implemented!')
|
|
80
|
+
raise NotImplementedError('Method not implemented!')
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def add_TaskRouterServicer_to_server(servicer, server):
|
|
84
|
+
rpc_method_handlers = {
|
|
85
|
+
'TaskExecPoll': grpc.unary_unary_rpc_method_handler(
|
|
86
|
+
servicer.TaskExecPoll,
|
|
87
|
+
request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecPollRequest.FromString,
|
|
88
|
+
response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecPollResponse.SerializeToString,
|
|
89
|
+
),
|
|
90
|
+
'TaskExecStart': grpc.unary_unary_rpc_method_handler(
|
|
91
|
+
servicer.TaskExecStart,
|
|
92
|
+
request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStartRequest.FromString,
|
|
93
|
+
response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStartResponse.SerializeToString,
|
|
94
|
+
),
|
|
95
|
+
'TaskExecStdinWrite': grpc.unary_unary_rpc_method_handler(
|
|
96
|
+
servicer.TaskExecStdinWrite,
|
|
97
|
+
request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteRequest.FromString,
|
|
98
|
+
response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteResponse.SerializeToString,
|
|
99
|
+
),
|
|
100
|
+
'TaskExecStdioRead': grpc.unary_stream_rpc_method_handler(
|
|
101
|
+
servicer.TaskExecStdioRead,
|
|
102
|
+
request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStdioReadRequest.FromString,
|
|
103
|
+
response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStdioReadResponse.SerializeToString,
|
|
104
|
+
),
|
|
105
|
+
'TaskExecWait': grpc.unary_unary_rpc_method_handler(
|
|
106
|
+
servicer.TaskExecWait,
|
|
107
|
+
request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecWaitRequest.FromString,
|
|
108
|
+
response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecWaitResponse.SerializeToString,
|
|
109
|
+
),
|
|
110
|
+
}
|
|
111
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
112
|
+
'modal.task_command_router.TaskRouter', rpc_method_handlers)
|
|
113
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# This class is part of an EXPERIMENTAL API.
|
|
117
|
+
class TaskRouter(object):
|
|
118
|
+
"""Missing associated documentation comment in .proto file."""
|
|
119
|
+
|
|
120
|
+
@staticmethod
|
|
121
|
+
def TaskExecPoll(request,
|
|
122
|
+
target,
|
|
123
|
+
options=(),
|
|
124
|
+
channel_credentials=None,
|
|
125
|
+
call_credentials=None,
|
|
126
|
+
insecure=False,
|
|
127
|
+
compression=None,
|
|
128
|
+
wait_for_ready=None,
|
|
129
|
+
timeout=None,
|
|
130
|
+
metadata=None):
|
|
131
|
+
return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskRouter/TaskExecPoll',
|
|
132
|
+
modal__proto_dot_task__command__router__pb2.TaskExecPollRequest.SerializeToString,
|
|
133
|
+
modal__proto_dot_task__command__router__pb2.TaskExecPollResponse.FromString,
|
|
134
|
+
options, channel_credentials,
|
|
135
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
136
|
+
|
|
137
|
+
@staticmethod
|
|
138
|
+
def TaskExecStart(request,
|
|
139
|
+
target,
|
|
140
|
+
options=(),
|
|
141
|
+
channel_credentials=None,
|
|
142
|
+
call_credentials=None,
|
|
143
|
+
insecure=False,
|
|
144
|
+
compression=None,
|
|
145
|
+
wait_for_ready=None,
|
|
146
|
+
timeout=None,
|
|
147
|
+
metadata=None):
|
|
148
|
+
return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskRouter/TaskExecStart',
|
|
149
|
+
modal__proto_dot_task__command__router__pb2.TaskExecStartRequest.SerializeToString,
|
|
150
|
+
modal__proto_dot_task__command__router__pb2.TaskExecStartResponse.FromString,
|
|
151
|
+
options, channel_credentials,
|
|
152
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
153
|
+
|
|
154
|
+
@staticmethod
|
|
155
|
+
def TaskExecStdinWrite(request,
|
|
156
|
+
target,
|
|
157
|
+
options=(),
|
|
158
|
+
channel_credentials=None,
|
|
159
|
+
call_credentials=None,
|
|
160
|
+
insecure=False,
|
|
161
|
+
compression=None,
|
|
162
|
+
wait_for_ready=None,
|
|
163
|
+
timeout=None,
|
|
164
|
+
metadata=None):
|
|
165
|
+
return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskRouter/TaskExecStdinWrite',
|
|
166
|
+
modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteRequest.SerializeToString,
|
|
167
|
+
modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteResponse.FromString,
|
|
168
|
+
options, channel_credentials,
|
|
169
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
170
|
+
|
|
171
|
+
@staticmethod
|
|
172
|
+
def TaskExecStdioRead(request,
|
|
173
|
+
target,
|
|
174
|
+
options=(),
|
|
175
|
+
channel_credentials=None,
|
|
176
|
+
call_credentials=None,
|
|
177
|
+
insecure=False,
|
|
178
|
+
compression=None,
|
|
179
|
+
wait_for_ready=None,
|
|
180
|
+
timeout=None,
|
|
181
|
+
metadata=None):
|
|
182
|
+
return grpc.experimental.unary_stream(request, target, '/modal.task_command_router.TaskRouter/TaskExecStdioRead',
|
|
183
|
+
modal__proto_dot_task__command__router__pb2.TaskExecStdioReadRequest.SerializeToString,
|
|
184
|
+
modal__proto_dot_task__command__router__pb2.TaskExecStdioReadResponse.FromString,
|
|
185
|
+
options, channel_credentials,
|
|
186
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
187
|
+
|
|
188
|
+
@staticmethod
|
|
189
|
+
def TaskExecWait(request,
|
|
190
|
+
target,
|
|
191
|
+
options=(),
|
|
192
|
+
channel_credentials=None,
|
|
193
|
+
call_credentials=None,
|
|
194
|
+
insecure=False,
|
|
195
|
+
compression=None,
|
|
196
|
+
wait_for_ready=None,
|
|
197
|
+
timeout=None,
|
|
198
|
+
metadata=None):
|
|
199
|
+
return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskRouter/TaskExecWait',
|
|
200
|
+
modal__proto_dot_task__command__router__pb2.TaskExecWaitRequest.SerializeToString,
|
|
201
|
+
modal__proto_dot_task__command__router__pb2.TaskExecWaitResponse.FromString,
|
|
202
|
+
options, channel_credentials,
|
|
203
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""
|
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
|
3
|
+
isort:skip_file
|
|
4
|
+
"""
|
|
5
|
+
import abc
|
|
6
|
+
import collections.abc
|
|
7
|
+
import grpc
|
|
8
|
+
import modal_proto.task_command_router_pb2
|
|
9
|
+
|
|
10
|
+
class TaskRouterStub:
|
|
11
|
+
def __init__(self, channel: grpc.Channel) -> None: ...
|
|
12
|
+
TaskExecPoll: grpc.UnaryUnaryMultiCallable[
|
|
13
|
+
modal_proto.task_command_router_pb2.TaskExecPollRequest,
|
|
14
|
+
modal_proto.task_command_router_pb2.TaskExecPollResponse,
|
|
15
|
+
]
|
|
16
|
+
"""Poll for the exit status of an exec'd command."""
|
|
17
|
+
TaskExecStart: grpc.UnaryUnaryMultiCallable[
|
|
18
|
+
modal_proto.task_command_router_pb2.TaskExecStartRequest,
|
|
19
|
+
modal_proto.task_command_router_pb2.TaskExecStartResponse,
|
|
20
|
+
]
|
|
21
|
+
"""Execute a command in the task."""
|
|
22
|
+
TaskExecStdinWrite: grpc.UnaryUnaryMultiCallable[
|
|
23
|
+
modal_proto.task_command_router_pb2.TaskExecStdinWriteRequest,
|
|
24
|
+
modal_proto.task_command_router_pb2.TaskExecStdinWriteResponse,
|
|
25
|
+
]
|
|
26
|
+
"""Write to the stdin stream of an exec'd command."""
|
|
27
|
+
TaskExecStdioRead: grpc.UnaryStreamMultiCallable[
|
|
28
|
+
modal_proto.task_command_router_pb2.TaskExecStdioReadRequest,
|
|
29
|
+
modal_proto.task_command_router_pb2.TaskExecStdioReadResponse,
|
|
30
|
+
]
|
|
31
|
+
"""Get a stream of output from the stdout or stderr stream of an exec'd command."""
|
|
32
|
+
TaskExecWait: grpc.UnaryUnaryMultiCallable[
|
|
33
|
+
modal_proto.task_command_router_pb2.TaskExecWaitRequest,
|
|
34
|
+
modal_proto.task_command_router_pb2.TaskExecWaitResponse,
|
|
35
|
+
]
|
|
36
|
+
"""Wait for an exec'd command to exit and return the exit code."""
|
|
37
|
+
|
|
38
|
+
class TaskRouterServicer(metaclass=abc.ABCMeta):
|
|
39
|
+
@abc.abstractmethod
|
|
40
|
+
def TaskExecPoll(
|
|
41
|
+
self,
|
|
42
|
+
request: modal_proto.task_command_router_pb2.TaskExecPollRequest,
|
|
43
|
+
context: grpc.ServicerContext,
|
|
44
|
+
) -> modal_proto.task_command_router_pb2.TaskExecPollResponse:
|
|
45
|
+
"""Poll for the exit status of an exec'd command."""
|
|
46
|
+
@abc.abstractmethod
|
|
47
|
+
def TaskExecStart(
|
|
48
|
+
self,
|
|
49
|
+
request: modal_proto.task_command_router_pb2.TaskExecStartRequest,
|
|
50
|
+
context: grpc.ServicerContext,
|
|
51
|
+
) -> modal_proto.task_command_router_pb2.TaskExecStartResponse:
|
|
52
|
+
"""Execute a command in the task."""
|
|
53
|
+
@abc.abstractmethod
|
|
54
|
+
def TaskExecStdinWrite(
|
|
55
|
+
self,
|
|
56
|
+
request: modal_proto.task_command_router_pb2.TaskExecStdinWriteRequest,
|
|
57
|
+
context: grpc.ServicerContext,
|
|
58
|
+
) -> modal_proto.task_command_router_pb2.TaskExecStdinWriteResponse:
|
|
59
|
+
"""Write to the stdin stream of an exec'd command."""
|
|
60
|
+
@abc.abstractmethod
|
|
61
|
+
def TaskExecStdioRead(
|
|
62
|
+
self,
|
|
63
|
+
request: modal_proto.task_command_router_pb2.TaskExecStdioReadRequest,
|
|
64
|
+
context: grpc.ServicerContext,
|
|
65
|
+
) -> collections.abc.Iterator[modal_proto.task_command_router_pb2.TaskExecStdioReadResponse]:
|
|
66
|
+
"""Get a stream of output from the stdout or stderr stream of an exec'd command."""
|
|
67
|
+
@abc.abstractmethod
|
|
68
|
+
def TaskExecWait(
|
|
69
|
+
self,
|
|
70
|
+
request: modal_proto.task_command_router_pb2.TaskExecWaitRequest,
|
|
71
|
+
context: grpc.ServicerContext,
|
|
72
|
+
) -> modal_proto.task_command_router_pb2.TaskExecWaitResponse:
|
|
73
|
+
"""Wait for an exec'd command to exit and return the exit code."""
|
|
74
|
+
|
|
75
|
+
def add_TaskRouterServicer_to_server(servicer: TaskRouterServicer, server: grpc.Server) -> None: ...
|
modal_version/__init__.py
CHANGED
modal_proto/options.proto
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Defines custom options used internally at Modal.
|
|
2
|
-
// Custom options must be in the range 50000-99999.
|
|
3
|
-
// Reference: https://protobuf.dev/programming-guides/proto2/#customoptions
|
|
4
|
-
syntax = "proto3";
|
|
5
|
-
|
|
6
|
-
option go_package = "github.com/modal-labs/modal/go/proto";
|
|
7
|
-
|
|
8
|
-
import "google/protobuf/descriptor.proto";
|
|
9
|
-
|
|
10
|
-
package modal.options;
|
|
11
|
-
|
|
12
|
-
extend google.protobuf.FieldOptions {
|
|
13
|
-
optional bool audit_target_attr = 50000;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
extend google.protobuf.MethodOptions {
|
|
17
|
-
optional string audit_event_name = 50000;
|
|
18
|
-
optional string audit_event_description = 50001;
|
|
19
|
-
}
|
modal_proto/options_grpc.py
DELETED