modAL 1.2.5.dev25__py3-none-any.whl → 1.2.5.dev26__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.
modal/client.pyi CHANGED
@@ -32,7 +32,7 @@ class _Client:
32
32
  server_url: str,
33
33
  client_type: int,
34
34
  credentials: typing.Optional[tuple[str, str]],
35
- version: str = "1.2.5.dev25",
35
+ version: str = "1.2.5.dev26",
36
36
  ):
37
37
  """mdmd:hidden
38
38
  The Modal client object is not intended to be instantiated directly by users.
@@ -163,7 +163,7 @@ class Client:
163
163
  server_url: str,
164
164
  client_type: int,
165
165
  credentials: typing.Optional[tuple[str, str]],
166
- version: str = "1.2.5.dev25",
166
+ version: str = "1.2.5.dev26",
167
167
  ):
168
168
  """mdmd:hidden
169
169
  The Modal client object is not intended to be instantiated directly by users.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modal
3
- Version: 1.2.5.dev25
3
+ Version: 1.2.5.dev26
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -26,7 +26,7 @@ modal/app.pyi,sha256=nI_Tibj-rI5I7dJFJnczbHvcmVzCvvCih0tMzoQlr_Y,50835
26
26
  modal/billing.py,sha256=zmQ3bcCJlwa4KD1IA_QgdWpm1pn13c-7qfy79iEauYI,195
27
27
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
28
28
  modal/client.py,sha256=k1CqQ_0t4-vHylkqYZgYCnClg-FT0QrTPAKivL01A_k,14354
29
- modal/client.pyi,sha256=4ayE1w6tzXcr1vPAhMLYEP8JthQBFrE4PyI0Agy9YJM,13148
29
+ modal/client.pyi,sha256=TEaW0lozAoWfvbNPNpDbB6_0aMeQiSUNPg7TxH3oC9Q,13148
30
30
  modal/cloud_bucket_mount.py,sha256=cvVj5Rt4nDHoQbTneoJPTaAcnl_Ab_mrsjnnzd0v9OI,6013
31
31
  modal/cloud_bucket_mount.pyi,sha256=vXusGMOUk9HjCs4lhxteuCK4xLQclPfugGWKo7LECEA,7539
32
32
  modal/cls.py,sha256=4T__mtYlQUnkatif1Wnr8Ld9DN_ySydHj2UwhRg89ok,41984
@@ -160,7 +160,7 @@ modal/experimental/__init__.py,sha256=GOuo3t4-Le0ZVddiHIOw0MQxkdTJge-bVbhDvgnblm
160
160
  modal/experimental/flash.py,sha256=GJZwSr-4OHlP6gCIZdcbsSb8D8WX9xJwMphjwcfsRoU,31262
161
161
  modal/experimental/flash.pyi,sha256=q4a3mdgL0jzATPL2tS7LpuyulYzF1vUSE453S9xc8n8,16965
162
162
  modal/experimental/ipython.py,sha256=TrCfmol9LGsRZMeDoeMPx3Hv3BFqQhYnmD_iH0pqdhk,2904
163
- modal-1.2.5.dev25.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
163
+ modal-1.2.5.dev26.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
164
164
  modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
165
165
  modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
166
166
  modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
@@ -176,22 +176,16 @@ modal_proto/api_pb2_grpc.py,sha256=Hqw9jcbhpr-W6jsfog_tGU55ouZjITxGvA-DGNBqOLA,2
176
176
  modal_proto/api_pb2_grpc.pyi,sha256=QLJ58ANCx147HeGJva58h0MTCLIDs9JmVjrx8bDdwlg,67776
177
177
  modal_proto/modal_api_grpc.py,sha256=MqaBZB2ZqYj6XTIgI_p5dOPjt9gKT4pAJNd_WXR3W84,21295
178
178
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
179
- modal_proto/sandbox_router.proto,sha256=o6LZWekz2h7uAhBlHcu_EqXnc5ptxm-4j_ZUFVGAJFk,5161
180
- modal_proto/sandbox_router_grpc.py,sha256=27daOTX2N5hADDG-5Qnn4Yj3VfekyJwrDUkrQ12mPuU,5004
181
- modal_proto/sandbox_router_pb2.py,sha256=-AuG6ZRjGDjKgS1J4nSleqkS1W0HgpLjs7ahPnYwUHc,10860
182
- modal_proto/sandbox_router_pb2.pyi,sha256=9KzzS0-goV3p12hWZrLUHGzZEgrzpa4AazEUOd_xK9g,14899
183
- modal_proto/sandbox_router_pb2_grpc.py,sha256=8kPFo84rpRHfeRdZuHyoWuuIAphGmjM0s3ygGJSBVck,10006
184
- modal_proto/sandbox_router_pb2_grpc.pyi,sha256=iAr1ornlIEYP7pfrFMrw91-F3PNs7amH6z6J2oCwYxk,3276
185
179
  modal_proto/task_command_router.proto,sha256=xAVsFyIff6Yvp-PoS3kwyag2G73tBht2KtF4CWKeewI,5000
186
180
  modal_proto/task_command_router_grpc.py,sha256=qxuVUaVwLtCUZGHnYYqUHPvzYepEwt_hXaq2KndPwys,5097
187
181
  modal_proto/task_command_router_pb2.py,sha256=_pD2ZpU0bNzhwBdzmLoLyLtAtftI_AgxwnowxvQbtvk,10616
188
182
  modal_proto/task_command_router_pb2.pyi,sha256=EyDgXPLr7alqjXYERV8w_MPuO404x0uCppmSkrfE9IE,14589
189
183
  modal_proto/task_command_router_pb2_grpc.py,sha256=uEQ0HdrCp8v-9bB5yIic9muA8spCShLHY6Bz9cCgOUE,10114
190
184
  modal_proto/task_command_router_pb2_grpc.pyi,sha256=s3Yxsrawdj4nr8vqQqsAxyX6ilWaGbdECy425KKbLIA,3301
191
- modal_version/__init__.py,sha256=-etaRaNaDPMtSgduiHoS1BHtJ-b3tv_L-BwSmNQoxks,121
185
+ modal_version/__init__.py,sha256=QwcxGoIGazH2S3MlRUTbpYKS43JrnMyY_BDVYdiOW94,121
192
186
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
193
- modal-1.2.5.dev25.dist-info/METADATA,sha256=evkNwlrHZZRwWDDf-FLWtLJ9yn81nse_iGMzgZIXuwA,2490
194
- modal-1.2.5.dev25.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
195
- modal-1.2.5.dev25.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
196
- modal-1.2.5.dev25.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
197
- modal-1.2.5.dev25.dist-info/RECORD,,
187
+ modal-1.2.5.dev26.dist-info/METADATA,sha256=wSCg8IoU-NwUTlR_rZVB9iJciNtLqlhffzil6k9fy8Y,2490
188
+ modal-1.2.5.dev26.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
189
+ modal-1.2.5.dev26.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
190
+ modal-1.2.5.dev26.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
191
+ modal-1.2.5.dev26.dist-info/RECORD,,
modal_version/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # Copyright Modal Labs 2025
2
2
  """Supplies the current version of the modal client library."""
3
3
 
4
- __version__ = "1.2.5.dev25"
4
+ __version__ = "1.2.5.dev26"
@@ -1,145 +0,0 @@
1
- syntax = "proto3";
2
-
3
- option go_package = "github.com/modal-labs/modal/go/proto";
4
-
5
- import "modal_proto/api.proto";
6
-
7
- package modal.sandbox_router;
8
-
9
- enum SandboxExecStderrConfig {
10
- // The output will be discarded.
11
- SANDBOX_EXEC_STDERR_CONFIG_DEVNULL = 0;
12
- // The output will be streamed to the client.
13
- SANDBOX_EXEC_STDERR_CONFIG_PIPE = 1;
14
- // A special value that can be used to indicate that the stderr stream should
15
- // be merged with the stdout stream.
16
- SANDBOX_EXEC_STDERR_CONFIG_STDOUT = 2;
17
- }
18
-
19
- enum SandboxExecStdioFileDescriptor {
20
- // Read from stdout.
21
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT = 0;
22
- // Read from stderr.
23
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDERR = 1;
24
- }
25
-
26
- enum SandboxExecStdoutConfig {
27
- // The output will be discarded.
28
- SANDBOX_EXEC_STDOUT_CONFIG_DEVNULL = 0;
29
- // The output will be streamed to the client.
30
- SANDBOX_EXEC_STDOUT_CONFIG_PIPE = 1;
31
- }
32
-
33
- message SandboxExecPollRequest {
34
- // The task ID of the sandbox running the exec'd command.
35
- string task_id = 1;
36
- // The execution ID of the command to wait on.
37
- string exec_id = 2;
38
- }
39
-
40
- // The response to a SandboxExecPollRequest. If the exec'd command has not
41
- // completed, exit_status will be unset.
42
- message SandboxExecPollResponse {
43
- oneof exit_status {
44
- // The exit code of the command.
45
- int32 code = 1;
46
- // The signal that terminated the command.
47
- int32 signal = 2;
48
- }
49
- // TODO(saltzm): Give a way for the user to distinguish between normal exit
50
- // and termination by Modal (due to sandbox timeout, exec exceeded deadline, etc.)
51
- }
52
-
53
- message SandboxExecStartRequest {
54
- // The task ID of the sandbox to execute the command in.
55
- string task_id = 1;
56
- // Execution ID. This ID will be used to identify the execution for other
57
- // requests and ensure exec commands are idempotent.
58
- string exec_id = 2;
59
- // Command arguments to execute.
60
- repeated string command_args= 3;
61
- // Configures how the stdout of the command will be handled.
62
- SandboxExecStdoutConfig stdout_config = 4;
63
- // Configures how the stderr of the command will be handled.
64
- SandboxExecStderrConfig stderr_config = 5;
65
- // Timeout in seconds for the exec'd command to exit. If the command does not
66
- // exit within this duration, the command will be killed. This is NOT the
67
- // timeout for the ExecStartRequest RPC to complete.
68
- optional uint32 timeout_secs = 6;
69
- // Working directory for the command.
70
- optional string workdir = 7;
71
- // Secret IDs to mount into the sandbox.
72
- repeated string secret_ids = 8;
73
- // PTY info for the command.
74
- optional modal.client.PTYInfo pty_info = 9;
75
- // Enable debugging capabilities on the container runtime. Used only for
76
- // internal debugging.
77
- bool runtime_debug = 10;
78
- }
79
-
80
- message SandboxExecStartResponse { }
81
-
82
- message SandboxExecStdinWriteRequest {
83
- // The task ID of the sandbox running the exec'd command.
84
- string task_id = 1;
85
- // The execution ID of the command to write to.
86
- string exec_id = 2;
87
- // The offset to start writing to. This is used to resume writing from the
88
- // last write position if the connection is closed and reopened.
89
- uint64 offset = 3;
90
- bytes data = 4;
91
- // If true, close the stdin stream after writing any provided data.
92
- // This signals EOF to the exec'd process.
93
- bool eof = 5;
94
- }
95
-
96
- message SandboxExecStdinWriteResponse { }
97
-
98
-
99
- message SandboxExecStdioReadRequest {
100
- // The task ID of the sandbox running the exec'd command.
101
- string task_id = 1;
102
- // The execution ID of the command to read from.
103
- string exec_id = 2;
104
- // The offset to start reading from. This is used to resume reading from the
105
- // last read position if the connection is closed and reopened.
106
- uint64 offset = 3;
107
- // Which file descriptor to read from.
108
- SandboxExecStdioFileDescriptor file_descriptor = 4;
109
- }
110
-
111
- message SandboxExecStdioReadResponse {
112
- // The data read from the file descriptor.
113
- bytes data = 1;
114
- }
115
-
116
- message SandboxExecWaitRequest {
117
- // The task ID of the sandbox running the exec'd command.
118
- string task_id = 1;
119
- // The execution ID of the command to wait on.
120
- string exec_id = 2;
121
- }
122
-
123
- message SandboxExecWaitResponse {
124
- oneof exit_status {
125
- // The exit code of the command.
126
- int32 code = 1;
127
- // The signal that terminated the command.
128
- int32 signal = 2;
129
- }
130
- // TODO(saltzm): Give a way for the user to distinguish between normal exit
131
- // and termination by Modal (due to sandbox timeout, exec exceeded deadline, etc.)
132
- }
133
-
134
- service SandboxRouter {
135
- // Poll for the exit status of an exec'd command.
136
- rpc SandboxExecPoll(SandboxExecPollRequest) returns (SandboxExecPollResponse);
137
- // Execute a command in the sandbox.
138
- rpc SandboxExecStart(SandboxExecStartRequest) returns (SandboxExecStartResponse);
139
- // Write to the stdin stream of an exec'd command.
140
- rpc SandboxExecStdinWrite(SandboxExecStdinWriteRequest) returns (SandboxExecStdinWriteResponse);
141
- // Get a stream of output from the stdout or stderr stream of an exec'd command.
142
- rpc SandboxExecStdioRead(SandboxExecStdioReadRequest) returns (stream SandboxExecStdioReadResponse);
143
- // Wait for an exec'd command to exit and return the exit code.
144
- rpc SandboxExecWait(SandboxExecWaitRequest) returns (SandboxExecWaitResponse);
145
- }
@@ -1,105 +0,0 @@
1
- # Generated by the Protocol Buffers compiler. DO NOT EDIT!
2
- # source: modal_proto/sandbox_router.proto
3
- # plugin: grpclib.plugin.main
4
- import abc
5
- import typing
6
-
7
- import grpclib.const
8
- import grpclib.client
9
- if typing.TYPE_CHECKING:
10
- import grpclib.server
11
-
12
- import modal_proto.api_pb2
13
- import modal_proto.sandbox_router_pb2
14
-
15
-
16
- class SandboxRouterBase(abc.ABC):
17
-
18
- @abc.abstractmethod
19
- async def SandboxExecPoll(self, stream: 'grpclib.server.Stream[modal_proto.sandbox_router_pb2.SandboxExecPollRequest, modal_proto.sandbox_router_pb2.SandboxExecPollResponse]') -> None:
20
- pass
21
-
22
- @abc.abstractmethod
23
- async def SandboxExecStart(self, stream: 'grpclib.server.Stream[modal_proto.sandbox_router_pb2.SandboxExecStartRequest, modal_proto.sandbox_router_pb2.SandboxExecStartResponse]') -> None:
24
- pass
25
-
26
- @abc.abstractmethod
27
- async def SandboxExecStdinWrite(self, stream: 'grpclib.server.Stream[modal_proto.sandbox_router_pb2.SandboxExecStdinWriteRequest, modal_proto.sandbox_router_pb2.SandboxExecStdinWriteResponse]') -> None:
28
- pass
29
-
30
- @abc.abstractmethod
31
- async def SandboxExecStdioRead(self, stream: 'grpclib.server.Stream[modal_proto.sandbox_router_pb2.SandboxExecStdioReadRequest, modal_proto.sandbox_router_pb2.SandboxExecStdioReadResponse]') -> None:
32
- pass
33
-
34
- @abc.abstractmethod
35
- async def SandboxExecWait(self, stream: 'grpclib.server.Stream[modal_proto.sandbox_router_pb2.SandboxExecWaitRequest, modal_proto.sandbox_router_pb2.SandboxExecWaitResponse]') -> None:
36
- pass
37
-
38
- def __mapping__(self) -> typing.Dict[str, grpclib.const.Handler]:
39
- return {
40
- '/modal.sandbox_router.SandboxRouter/SandboxExecPoll': grpclib.const.Handler(
41
- self.SandboxExecPoll,
42
- grpclib.const.Cardinality.UNARY_UNARY,
43
- modal_proto.sandbox_router_pb2.SandboxExecPollRequest,
44
- modal_proto.sandbox_router_pb2.SandboxExecPollResponse,
45
- ),
46
- '/modal.sandbox_router.SandboxRouter/SandboxExecStart': grpclib.const.Handler(
47
- self.SandboxExecStart,
48
- grpclib.const.Cardinality.UNARY_UNARY,
49
- modal_proto.sandbox_router_pb2.SandboxExecStartRequest,
50
- modal_proto.sandbox_router_pb2.SandboxExecStartResponse,
51
- ),
52
- '/modal.sandbox_router.SandboxRouter/SandboxExecStdinWrite': grpclib.const.Handler(
53
- self.SandboxExecStdinWrite,
54
- grpclib.const.Cardinality.UNARY_UNARY,
55
- modal_proto.sandbox_router_pb2.SandboxExecStdinWriteRequest,
56
- modal_proto.sandbox_router_pb2.SandboxExecStdinWriteResponse,
57
- ),
58
- '/modal.sandbox_router.SandboxRouter/SandboxExecStdioRead': grpclib.const.Handler(
59
- self.SandboxExecStdioRead,
60
- grpclib.const.Cardinality.UNARY_STREAM,
61
- modal_proto.sandbox_router_pb2.SandboxExecStdioReadRequest,
62
- modal_proto.sandbox_router_pb2.SandboxExecStdioReadResponse,
63
- ),
64
- '/modal.sandbox_router.SandboxRouter/SandboxExecWait': grpclib.const.Handler(
65
- self.SandboxExecWait,
66
- grpclib.const.Cardinality.UNARY_UNARY,
67
- modal_proto.sandbox_router_pb2.SandboxExecWaitRequest,
68
- modal_proto.sandbox_router_pb2.SandboxExecWaitResponse,
69
- ),
70
- }
71
-
72
-
73
- class SandboxRouterStub:
74
-
75
- def __init__(self, channel: grpclib.client.Channel) -> None:
76
- self.SandboxExecPoll = grpclib.client.UnaryUnaryMethod(
77
- channel,
78
- '/modal.sandbox_router.SandboxRouter/SandboxExecPoll',
79
- modal_proto.sandbox_router_pb2.SandboxExecPollRequest,
80
- modal_proto.sandbox_router_pb2.SandboxExecPollResponse,
81
- )
82
- self.SandboxExecStart = grpclib.client.UnaryUnaryMethod(
83
- channel,
84
- '/modal.sandbox_router.SandboxRouter/SandboxExecStart',
85
- modal_proto.sandbox_router_pb2.SandboxExecStartRequest,
86
- modal_proto.sandbox_router_pb2.SandboxExecStartResponse,
87
- )
88
- self.SandboxExecStdinWrite = grpclib.client.UnaryUnaryMethod(
89
- channel,
90
- '/modal.sandbox_router.SandboxRouter/SandboxExecStdinWrite',
91
- modal_proto.sandbox_router_pb2.SandboxExecStdinWriteRequest,
92
- modal_proto.sandbox_router_pb2.SandboxExecStdinWriteResponse,
93
- )
94
- self.SandboxExecStdioRead = grpclib.client.UnaryStreamMethod(
95
- channel,
96
- '/modal.sandbox_router.SandboxRouter/SandboxExecStdioRead',
97
- modal_proto.sandbox_router_pb2.SandboxExecStdioReadRequest,
98
- modal_proto.sandbox_router_pb2.SandboxExecStdioReadResponse,
99
- )
100
- self.SandboxExecWait = grpclib.client.UnaryUnaryMethod(
101
- channel,
102
- '/modal.sandbox_router.SandboxRouter/SandboxExecWait',
103
- modal_proto.sandbox_router_pb2.SandboxExecWaitRequest,
104
- modal_proto.sandbox_router_pb2.SandboxExecWaitResponse,
105
- )
@@ -1,149 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Generated by the protocol buffer compiler. DO NOT EDIT!
3
- # source: modal_proto/sandbox_router.proto
4
- """Generated protocol buffer code."""
5
- from google.protobuf.internal import enum_type_wrapper
6
- from google.protobuf import descriptor as _descriptor
7
- from google.protobuf import descriptor_pool as _descriptor_pool
8
- from google.protobuf import message as _message
9
- from google.protobuf import reflection as _reflection
10
- from google.protobuf import symbol_database as _symbol_database
11
- # @@protoc_insertion_point(imports)
12
-
13
- _sym_db = _symbol_database.Default()
14
-
15
-
16
- from modal_proto import api_pb2 as modal__proto_dot_api__pb2
17
-
18
-
19
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n modal_proto/sandbox_router.proto\x12\x14modal.sandbox_router\x1a\x15modal_proto/api.proto\":\n\x16SandboxExecPollRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\"J\n\x17SandboxExecPollResponse\x12\x0e\n\x04\x63ode\x18\x01 \x01(\x05H\x00\x12\x10\n\x06signal\x18\x02 \x01(\x05H\x00\x42\r\n\x0b\x65xit_status\"\x91\x03\n\x17SandboxExecStartRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\x12\x14\n\x0c\x63ommand_args\x18\x03 \x03(\t\x12\x44\n\rstdout_config\x18\x04 \x01(\x0e\x32-.modal.sandbox_router.SandboxExecStdoutConfig\x12\x44\n\rstderr_config\x18\x05 \x01(\x0e\x32-.modal.sandbox_router.SandboxExecStderrConfig\x12\x19\n\x0ctimeout_secs\x18\x06 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07workdir\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x12\n\nsecret_ids\x18\x08 \x03(\t\x12,\n\x08pty_info\x18\t \x01(\x0b\x32\x15.modal.client.PTYInfoH\x02\x88\x01\x01\x12\x15\n\rruntime_debug\x18\n \x01(\x08\x42\x0f\n\r_timeout_secsB\n\n\x08_workdirB\x0b\n\t_pty_info\"\x1a\n\x18SandboxExecStartResponse\"k\n\x1cSandboxExecStdinWriteRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x04 \x01(\x0c\x12\x0b\n\x03\x65of\x18\x05 \x01(\x08\"\x1f\n\x1dSandboxExecStdinWriteResponse\"\x9e\x01\n\x1bSandboxExecStdioReadRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\x12\x0e\n\x06offset\x18\x03 \x01(\x04\x12M\n\x0f\x66ile_descriptor\x18\x04 \x01(\x0e\x32\x34.modal.sandbox_router.SandboxExecStdioFileDescriptor\",\n\x1cSandboxExecStdioReadResponse\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\":\n\x16SandboxExecWaitRequest\x12\x0f\n\x07task_id\x18\x01 \x01(\t\x12\x0f\n\x07\x65xec_id\x18\x02 \x01(\t\"J\n\x17SandboxExecWaitResponse\x12\x0e\n\x04\x63ode\x18\x01 \x01(\x05H\x00\x12\x10\n\x06signal\x18\x02 \x01(\x05H\x00\x42\r\n\x0b\x65xit_status*\x8d\x01\n\x17SandboxExecStderrConfig\x12&\n\"SANDBOX_EXEC_STDERR_CONFIG_DEVNULL\x10\x00\x12#\n\x1fSANDBOX_EXEC_STDERR_CONFIG_PIPE\x10\x01\x12%\n!SANDBOX_EXEC_STDERR_CONFIG_STDOUT\x10\x02*~\n\x1eSandboxExecStdioFileDescriptor\x12-\n)SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT\x10\x00\x12-\n)SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDERR\x10\x01*f\n\x17SandboxExecStdoutConfig\x12&\n\"SANDBOX_EXEC_STDOUT_CONFIG_DEVNULL\x10\x00\x12#\n\x1fSANDBOX_EXEC_STDOUT_CONFIG_PIPE\x10\x01\x32\xe6\x04\n\rSandboxRouter\x12n\n\x0fSandboxExecPoll\x12,.modal.sandbox_router.SandboxExecPollRequest\x1a-.modal.sandbox_router.SandboxExecPollResponse\x12q\n\x10SandboxExecStart\x12-.modal.sandbox_router.SandboxExecStartRequest\x1a..modal.sandbox_router.SandboxExecStartResponse\x12\x80\x01\n\x15SandboxExecStdinWrite\x12\x32.modal.sandbox_router.SandboxExecStdinWriteRequest\x1a\x33.modal.sandbox_router.SandboxExecStdinWriteResponse\x12\x7f\n\x14SandboxExecStdioRead\x12\x31.modal.sandbox_router.SandboxExecStdioReadRequest\x1a\x32.modal.sandbox_router.SandboxExecStdioReadResponse0\x01\x12n\n\x0fSandboxExecWait\x12,.modal.sandbox_router.SandboxExecWaitRequest\x1a-.modal.sandbox_router.SandboxExecWaitResponseB&Z$github.com/modal-labs/modal/go/protob\x06proto3')
20
-
21
- _SANDBOXEXECSTDERRCONFIG = DESCRIPTOR.enum_types_by_name['SandboxExecStderrConfig']
22
- SandboxExecStderrConfig = enum_type_wrapper.EnumTypeWrapper(_SANDBOXEXECSTDERRCONFIG)
23
- _SANDBOXEXECSTDIOFILEDESCRIPTOR = DESCRIPTOR.enum_types_by_name['SandboxExecStdioFileDescriptor']
24
- SandboxExecStdioFileDescriptor = enum_type_wrapper.EnumTypeWrapper(_SANDBOXEXECSTDIOFILEDESCRIPTOR)
25
- _SANDBOXEXECSTDOUTCONFIG = DESCRIPTOR.enum_types_by_name['SandboxExecStdoutConfig']
26
- SandboxExecStdoutConfig = enum_type_wrapper.EnumTypeWrapper(_SANDBOXEXECSTDOUTCONFIG)
27
- SANDBOX_EXEC_STDERR_CONFIG_DEVNULL = 0
28
- SANDBOX_EXEC_STDERR_CONFIG_PIPE = 1
29
- SANDBOX_EXEC_STDERR_CONFIG_STDOUT = 2
30
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT = 0
31
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDERR = 1
32
- SANDBOX_EXEC_STDOUT_CONFIG_DEVNULL = 0
33
- SANDBOX_EXEC_STDOUT_CONFIG_PIPE = 1
34
-
35
-
36
- _SANDBOXEXECPOLLREQUEST = DESCRIPTOR.message_types_by_name['SandboxExecPollRequest']
37
- _SANDBOXEXECPOLLRESPONSE = DESCRIPTOR.message_types_by_name['SandboxExecPollResponse']
38
- _SANDBOXEXECSTARTREQUEST = DESCRIPTOR.message_types_by_name['SandboxExecStartRequest']
39
- _SANDBOXEXECSTARTRESPONSE = DESCRIPTOR.message_types_by_name['SandboxExecStartResponse']
40
- _SANDBOXEXECSTDINWRITEREQUEST = DESCRIPTOR.message_types_by_name['SandboxExecStdinWriteRequest']
41
- _SANDBOXEXECSTDINWRITERESPONSE = DESCRIPTOR.message_types_by_name['SandboxExecStdinWriteResponse']
42
- _SANDBOXEXECSTDIOREADREQUEST = DESCRIPTOR.message_types_by_name['SandboxExecStdioReadRequest']
43
- _SANDBOXEXECSTDIOREADRESPONSE = DESCRIPTOR.message_types_by_name['SandboxExecStdioReadResponse']
44
- _SANDBOXEXECWAITREQUEST = DESCRIPTOR.message_types_by_name['SandboxExecWaitRequest']
45
- _SANDBOXEXECWAITRESPONSE = DESCRIPTOR.message_types_by_name['SandboxExecWaitResponse']
46
- SandboxExecPollRequest = _reflection.GeneratedProtocolMessageType('SandboxExecPollRequest', (_message.Message,), {
47
- 'DESCRIPTOR' : _SANDBOXEXECPOLLREQUEST,
48
- '__module__' : 'modal_proto.sandbox_router_pb2'
49
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecPollRequest)
50
- })
51
- _sym_db.RegisterMessage(SandboxExecPollRequest)
52
-
53
- SandboxExecPollResponse = _reflection.GeneratedProtocolMessageType('SandboxExecPollResponse', (_message.Message,), {
54
- 'DESCRIPTOR' : _SANDBOXEXECPOLLRESPONSE,
55
- '__module__' : 'modal_proto.sandbox_router_pb2'
56
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecPollResponse)
57
- })
58
- _sym_db.RegisterMessage(SandboxExecPollResponse)
59
-
60
- SandboxExecStartRequest = _reflection.GeneratedProtocolMessageType('SandboxExecStartRequest', (_message.Message,), {
61
- 'DESCRIPTOR' : _SANDBOXEXECSTARTREQUEST,
62
- '__module__' : 'modal_proto.sandbox_router_pb2'
63
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecStartRequest)
64
- })
65
- _sym_db.RegisterMessage(SandboxExecStartRequest)
66
-
67
- SandboxExecStartResponse = _reflection.GeneratedProtocolMessageType('SandboxExecStartResponse', (_message.Message,), {
68
- 'DESCRIPTOR' : _SANDBOXEXECSTARTRESPONSE,
69
- '__module__' : 'modal_proto.sandbox_router_pb2'
70
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecStartResponse)
71
- })
72
- _sym_db.RegisterMessage(SandboxExecStartResponse)
73
-
74
- SandboxExecStdinWriteRequest = _reflection.GeneratedProtocolMessageType('SandboxExecStdinWriteRequest', (_message.Message,), {
75
- 'DESCRIPTOR' : _SANDBOXEXECSTDINWRITEREQUEST,
76
- '__module__' : 'modal_proto.sandbox_router_pb2'
77
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecStdinWriteRequest)
78
- })
79
- _sym_db.RegisterMessage(SandboxExecStdinWriteRequest)
80
-
81
- SandboxExecStdinWriteResponse = _reflection.GeneratedProtocolMessageType('SandboxExecStdinWriteResponse', (_message.Message,), {
82
- 'DESCRIPTOR' : _SANDBOXEXECSTDINWRITERESPONSE,
83
- '__module__' : 'modal_proto.sandbox_router_pb2'
84
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecStdinWriteResponse)
85
- })
86
- _sym_db.RegisterMessage(SandboxExecStdinWriteResponse)
87
-
88
- SandboxExecStdioReadRequest = _reflection.GeneratedProtocolMessageType('SandboxExecStdioReadRequest', (_message.Message,), {
89
- 'DESCRIPTOR' : _SANDBOXEXECSTDIOREADREQUEST,
90
- '__module__' : 'modal_proto.sandbox_router_pb2'
91
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecStdioReadRequest)
92
- })
93
- _sym_db.RegisterMessage(SandboxExecStdioReadRequest)
94
-
95
- SandboxExecStdioReadResponse = _reflection.GeneratedProtocolMessageType('SandboxExecStdioReadResponse', (_message.Message,), {
96
- 'DESCRIPTOR' : _SANDBOXEXECSTDIOREADRESPONSE,
97
- '__module__' : 'modal_proto.sandbox_router_pb2'
98
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecStdioReadResponse)
99
- })
100
- _sym_db.RegisterMessage(SandboxExecStdioReadResponse)
101
-
102
- SandboxExecWaitRequest = _reflection.GeneratedProtocolMessageType('SandboxExecWaitRequest', (_message.Message,), {
103
- 'DESCRIPTOR' : _SANDBOXEXECWAITREQUEST,
104
- '__module__' : 'modal_proto.sandbox_router_pb2'
105
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecWaitRequest)
106
- })
107
- _sym_db.RegisterMessage(SandboxExecWaitRequest)
108
-
109
- SandboxExecWaitResponse = _reflection.GeneratedProtocolMessageType('SandboxExecWaitResponse', (_message.Message,), {
110
- 'DESCRIPTOR' : _SANDBOXEXECWAITRESPONSE,
111
- '__module__' : 'modal_proto.sandbox_router_pb2'
112
- # @@protoc_insertion_point(class_scope:modal.sandbox_router.SandboxExecWaitResponse)
113
- })
114
- _sym_db.RegisterMessage(SandboxExecWaitResponse)
115
-
116
- _SANDBOXROUTER = DESCRIPTOR.services_by_name['SandboxRouter']
117
- if _descriptor._USE_C_DESCRIPTORS == False:
118
-
119
- DESCRIPTOR._options = None
120
- DESCRIPTOR._serialized_options = b'Z$github.com/modal-labs/modal/go/proto'
121
- _SANDBOXEXECSTDERRCONFIG._serialized_start=1135
122
- _SANDBOXEXECSTDERRCONFIG._serialized_end=1276
123
- _SANDBOXEXECSTDIOFILEDESCRIPTOR._serialized_start=1278
124
- _SANDBOXEXECSTDIOFILEDESCRIPTOR._serialized_end=1404
125
- _SANDBOXEXECSTDOUTCONFIG._serialized_start=1406
126
- _SANDBOXEXECSTDOUTCONFIG._serialized_end=1508
127
- _SANDBOXEXECPOLLREQUEST._serialized_start=81
128
- _SANDBOXEXECPOLLREQUEST._serialized_end=139
129
- _SANDBOXEXECPOLLRESPONSE._serialized_start=141
130
- _SANDBOXEXECPOLLRESPONSE._serialized_end=215
131
- _SANDBOXEXECSTARTREQUEST._serialized_start=218
132
- _SANDBOXEXECSTARTREQUEST._serialized_end=619
133
- _SANDBOXEXECSTARTRESPONSE._serialized_start=621
134
- _SANDBOXEXECSTARTRESPONSE._serialized_end=647
135
- _SANDBOXEXECSTDINWRITEREQUEST._serialized_start=649
136
- _SANDBOXEXECSTDINWRITEREQUEST._serialized_end=756
137
- _SANDBOXEXECSTDINWRITERESPONSE._serialized_start=758
138
- _SANDBOXEXECSTDINWRITERESPONSE._serialized_end=789
139
- _SANDBOXEXECSTDIOREADREQUEST._serialized_start=792
140
- _SANDBOXEXECSTDIOREADREQUEST._serialized_end=950
141
- _SANDBOXEXECSTDIOREADRESPONSE._serialized_start=952
142
- _SANDBOXEXECSTDIOREADRESPONSE._serialized_end=996
143
- _SANDBOXEXECWAITREQUEST._serialized_start=998
144
- _SANDBOXEXECWAITREQUEST._serialized_end=1056
145
- _SANDBOXEXECWAITRESPONSE._serialized_start=1058
146
- _SANDBOXEXECWAITRESPONSE._serialized_end=1132
147
- _SANDBOXROUTER._serialized_start=1511
148
- _SANDBOXROUTER._serialized_end=2125
149
- # @@protoc_insertion_point(module_scope)
@@ -1,333 +0,0 @@
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 _SandboxExecStderrConfig:
23
- ValueType = typing.NewType("ValueType", builtins.int)
24
- V: typing_extensions.TypeAlias = ValueType
25
-
26
- class _SandboxExecStderrConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SandboxExecStderrConfig.ValueType], builtins.type): # noqa: F821
27
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
28
- SANDBOX_EXEC_STDERR_CONFIG_DEVNULL: _SandboxExecStderrConfig.ValueType # 0
29
- """The output will be discarded."""
30
- SANDBOX_EXEC_STDERR_CONFIG_PIPE: _SandboxExecStderrConfig.ValueType # 1
31
- """The output will be streamed to the client."""
32
- SANDBOX_EXEC_STDERR_CONFIG_STDOUT: _SandboxExecStderrConfig.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 SandboxExecStderrConfig(_SandboxExecStderrConfig, metaclass=_SandboxExecStderrConfigEnumTypeWrapper): ...
38
-
39
- SANDBOX_EXEC_STDERR_CONFIG_DEVNULL: SandboxExecStderrConfig.ValueType # 0
40
- """The output will be discarded."""
41
- SANDBOX_EXEC_STDERR_CONFIG_PIPE: SandboxExecStderrConfig.ValueType # 1
42
- """The output will be streamed to the client."""
43
- SANDBOX_EXEC_STDERR_CONFIG_STDOUT: SandboxExecStderrConfig.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___SandboxExecStderrConfig = SandboxExecStderrConfig
48
-
49
- class _SandboxExecStdioFileDescriptor:
50
- ValueType = typing.NewType("ValueType", builtins.int)
51
- V: typing_extensions.TypeAlias = ValueType
52
-
53
- class _SandboxExecStdioFileDescriptorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SandboxExecStdioFileDescriptor.ValueType], builtins.type): # noqa: F821
54
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
55
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: _SandboxExecStdioFileDescriptor.ValueType # 0
56
- """Read from stdout."""
57
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: _SandboxExecStdioFileDescriptor.ValueType # 1
58
- """Read from stderr."""
59
-
60
- class SandboxExecStdioFileDescriptor(_SandboxExecStdioFileDescriptor, metaclass=_SandboxExecStdioFileDescriptorEnumTypeWrapper): ...
61
-
62
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: SandboxExecStdioFileDescriptor.ValueType # 0
63
- """Read from stdout."""
64
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: SandboxExecStdioFileDescriptor.ValueType # 1
65
- """Read from stderr."""
66
- global___SandboxExecStdioFileDescriptor = SandboxExecStdioFileDescriptor
67
-
68
- class _SandboxExecStdoutConfig:
69
- ValueType = typing.NewType("ValueType", builtins.int)
70
- V: typing_extensions.TypeAlias = ValueType
71
-
72
- class _SandboxExecStdoutConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SandboxExecStdoutConfig.ValueType], builtins.type): # noqa: F821
73
- DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
74
- SANDBOX_EXEC_STDOUT_CONFIG_DEVNULL: _SandboxExecStdoutConfig.ValueType # 0
75
- """The output will be discarded."""
76
- SANDBOX_EXEC_STDOUT_CONFIG_PIPE: _SandboxExecStdoutConfig.ValueType # 1
77
- """The output will be streamed to the client."""
78
-
79
- class SandboxExecStdoutConfig(_SandboxExecStdoutConfig, metaclass=_SandboxExecStdoutConfigEnumTypeWrapper): ...
80
-
81
- SANDBOX_EXEC_STDOUT_CONFIG_DEVNULL: SandboxExecStdoutConfig.ValueType # 0
82
- """The output will be discarded."""
83
- SANDBOX_EXEC_STDOUT_CONFIG_PIPE: SandboxExecStdoutConfig.ValueType # 1
84
- """The output will be streamed to the client."""
85
- global___SandboxExecStdoutConfig = SandboxExecStdoutConfig
86
-
87
- class SandboxExecPollRequest(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 task ID of the sandbox 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___SandboxExecPollRequest = SandboxExecPollRequest
105
-
106
- class SandboxExecPollResponse(google.protobuf.message.Message):
107
- """The response to a SandboxExecPollRequest. 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___SandboxExecPollResponse = SandboxExecPollResponse
130
-
131
- class SandboxExecStartRequest(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 task ID of the sandbox 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___SandboxExecStdoutConfig.ValueType
154
- """Configures how the stdout of the command will be handled."""
155
- stderr_config: global___SandboxExecStderrConfig.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 sandbox."""
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___SandboxExecStdoutConfig.ValueType = ...,
181
- stderr_config: global___SandboxExecStderrConfig.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___SandboxExecStartRequest = SandboxExecStartRequest
198
-
199
- class SandboxExecStartResponse(google.protobuf.message.Message):
200
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
201
-
202
- def __init__(
203
- self,
204
- ) -> None: ...
205
-
206
- global___SandboxExecStartResponse = SandboxExecStartResponse
207
-
208
- class SandboxExecStdinWriteRequest(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 task ID of the sandbox 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___SandboxExecStdinWriteRequest = SandboxExecStdinWriteRequest
241
-
242
- class SandboxExecStdinWriteResponse(google.protobuf.message.Message):
243
- DESCRIPTOR: google.protobuf.descriptor.Descriptor
244
-
245
- def __init__(
246
- self,
247
- ) -> None: ...
248
-
249
- global___SandboxExecStdinWriteResponse = SandboxExecStdinWriteResponse
250
-
251
- class SandboxExecStdioReadRequest(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 task ID of the sandbox 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___SandboxExecStdioFileDescriptor.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___SandboxExecStdioFileDescriptor.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___SandboxExecStdioReadRequest = SandboxExecStdioReadRequest
279
-
280
- class SandboxExecStdioReadResponse(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___SandboxExecStdioReadResponse = SandboxExecStdioReadResponse
294
-
295
- class SandboxExecWaitRequest(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 task ID of the sandbox 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___SandboxExecWaitRequest = SandboxExecWaitRequest
313
-
314
- class SandboxExecWaitResponse(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___SandboxExecWaitResponse = SandboxExecWaitResponse
@@ -1,203 +0,0 @@
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 sandbox_router_pb2 as modal__proto_dot_sandbox__router__pb2
6
-
7
-
8
- class SandboxRouterStub(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.SandboxExecPoll = channel.unary_unary(
18
- '/modal.sandbox_router.SandboxRouter/SandboxExecPoll',
19
- request_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecPollRequest.SerializeToString,
20
- response_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecPollResponse.FromString,
21
- )
22
- self.SandboxExecStart = channel.unary_unary(
23
- '/modal.sandbox_router.SandboxRouter/SandboxExecStart',
24
- request_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStartRequest.SerializeToString,
25
- response_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStartResponse.FromString,
26
- )
27
- self.SandboxExecStdinWrite = channel.unary_unary(
28
- '/modal.sandbox_router.SandboxRouter/SandboxExecStdinWrite',
29
- request_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStdinWriteRequest.SerializeToString,
30
- response_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStdinWriteResponse.FromString,
31
- )
32
- self.SandboxExecStdioRead = channel.unary_stream(
33
- '/modal.sandbox_router.SandboxRouter/SandboxExecStdioRead',
34
- request_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStdioReadRequest.SerializeToString,
35
- response_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStdioReadResponse.FromString,
36
- )
37
- self.SandboxExecWait = channel.unary_unary(
38
- '/modal.sandbox_router.SandboxRouter/SandboxExecWait',
39
- request_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecWaitRequest.SerializeToString,
40
- response_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecWaitResponse.FromString,
41
- )
42
-
43
-
44
- class SandboxRouterServicer(object):
45
- """Missing associated documentation comment in .proto file."""
46
-
47
- def SandboxExecPoll(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 SandboxExecStart(self, request, context):
55
- """Execute a command in the sandbox.
56
- """
57
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
58
- context.set_details('Method not implemented!')
59
- raise NotImplementedError('Method not implemented!')
60
-
61
- def SandboxExecStdinWrite(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 SandboxExecStdioRead(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 SandboxExecWait(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_SandboxRouterServicer_to_server(servicer, server):
84
- rpc_method_handlers = {
85
- 'SandboxExecPoll': grpc.unary_unary_rpc_method_handler(
86
- servicer.SandboxExecPoll,
87
- request_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecPollRequest.FromString,
88
- response_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecPollResponse.SerializeToString,
89
- ),
90
- 'SandboxExecStart': grpc.unary_unary_rpc_method_handler(
91
- servicer.SandboxExecStart,
92
- request_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStartRequest.FromString,
93
- response_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStartResponse.SerializeToString,
94
- ),
95
- 'SandboxExecStdinWrite': grpc.unary_unary_rpc_method_handler(
96
- servicer.SandboxExecStdinWrite,
97
- request_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStdinWriteRequest.FromString,
98
- response_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStdinWriteResponse.SerializeToString,
99
- ),
100
- 'SandboxExecStdioRead': grpc.unary_stream_rpc_method_handler(
101
- servicer.SandboxExecStdioRead,
102
- request_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStdioReadRequest.FromString,
103
- response_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecStdioReadResponse.SerializeToString,
104
- ),
105
- 'SandboxExecWait': grpc.unary_unary_rpc_method_handler(
106
- servicer.SandboxExecWait,
107
- request_deserializer=modal__proto_dot_sandbox__router__pb2.SandboxExecWaitRequest.FromString,
108
- response_serializer=modal__proto_dot_sandbox__router__pb2.SandboxExecWaitResponse.SerializeToString,
109
- ),
110
- }
111
- generic_handler = grpc.method_handlers_generic_handler(
112
- 'modal.sandbox_router.SandboxRouter', rpc_method_handlers)
113
- server.add_generic_rpc_handlers((generic_handler,))
114
-
115
-
116
- # This class is part of an EXPERIMENTAL API.
117
- class SandboxRouter(object):
118
- """Missing associated documentation comment in .proto file."""
119
-
120
- @staticmethod
121
- def SandboxExecPoll(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.sandbox_router.SandboxRouter/SandboxExecPoll',
132
- modal__proto_dot_sandbox__router__pb2.SandboxExecPollRequest.SerializeToString,
133
- modal__proto_dot_sandbox__router__pb2.SandboxExecPollResponse.FromString,
134
- options, channel_credentials,
135
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
136
-
137
- @staticmethod
138
- def SandboxExecStart(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.sandbox_router.SandboxRouter/SandboxExecStart',
149
- modal__proto_dot_sandbox__router__pb2.SandboxExecStartRequest.SerializeToString,
150
- modal__proto_dot_sandbox__router__pb2.SandboxExecStartResponse.FromString,
151
- options, channel_credentials,
152
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
153
-
154
- @staticmethod
155
- def SandboxExecStdinWrite(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.sandbox_router.SandboxRouter/SandboxExecStdinWrite',
166
- modal__proto_dot_sandbox__router__pb2.SandboxExecStdinWriteRequest.SerializeToString,
167
- modal__proto_dot_sandbox__router__pb2.SandboxExecStdinWriteResponse.FromString,
168
- options, channel_credentials,
169
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
170
-
171
- @staticmethod
172
- def SandboxExecStdioRead(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.sandbox_router.SandboxRouter/SandboxExecStdioRead',
183
- modal__proto_dot_sandbox__router__pb2.SandboxExecStdioReadRequest.SerializeToString,
184
- modal__proto_dot_sandbox__router__pb2.SandboxExecStdioReadResponse.FromString,
185
- options, channel_credentials,
186
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
187
-
188
- @staticmethod
189
- def SandboxExecWait(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.sandbox_router.SandboxRouter/SandboxExecWait',
200
- modal__proto_dot_sandbox__router__pb2.SandboxExecWaitRequest.SerializeToString,
201
- modal__proto_dot_sandbox__router__pb2.SandboxExecWaitResponse.FromString,
202
- options, channel_credentials,
203
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@@ -1,75 +0,0 @@
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.sandbox_router_pb2
9
-
10
- class SandboxRouterStub:
11
- def __init__(self, channel: grpc.Channel) -> None: ...
12
- SandboxExecPoll: grpc.UnaryUnaryMultiCallable[
13
- modal_proto.sandbox_router_pb2.SandboxExecPollRequest,
14
- modal_proto.sandbox_router_pb2.SandboxExecPollResponse,
15
- ]
16
- """Poll for the exit status of an exec'd command."""
17
- SandboxExecStart: grpc.UnaryUnaryMultiCallable[
18
- modal_proto.sandbox_router_pb2.SandboxExecStartRequest,
19
- modal_proto.sandbox_router_pb2.SandboxExecStartResponse,
20
- ]
21
- """Execute a command in the sandbox."""
22
- SandboxExecStdinWrite: grpc.UnaryUnaryMultiCallable[
23
- modal_proto.sandbox_router_pb2.SandboxExecStdinWriteRequest,
24
- modal_proto.sandbox_router_pb2.SandboxExecStdinWriteResponse,
25
- ]
26
- """Write to the stdin stream of an exec'd command."""
27
- SandboxExecStdioRead: grpc.UnaryStreamMultiCallable[
28
- modal_proto.sandbox_router_pb2.SandboxExecStdioReadRequest,
29
- modal_proto.sandbox_router_pb2.SandboxExecStdioReadResponse,
30
- ]
31
- """Get a stream of output from the stdout or stderr stream of an exec'd command."""
32
- SandboxExecWait: grpc.UnaryUnaryMultiCallable[
33
- modal_proto.sandbox_router_pb2.SandboxExecWaitRequest,
34
- modal_proto.sandbox_router_pb2.SandboxExecWaitResponse,
35
- ]
36
- """Wait for an exec'd command to exit and return the exit code."""
37
-
38
- class SandboxRouterServicer(metaclass=abc.ABCMeta):
39
- @abc.abstractmethod
40
- def SandboxExecPoll(
41
- self,
42
- request: modal_proto.sandbox_router_pb2.SandboxExecPollRequest,
43
- context: grpc.ServicerContext,
44
- ) -> modal_proto.sandbox_router_pb2.SandboxExecPollResponse:
45
- """Poll for the exit status of an exec'd command."""
46
- @abc.abstractmethod
47
- def SandboxExecStart(
48
- self,
49
- request: modal_proto.sandbox_router_pb2.SandboxExecStartRequest,
50
- context: grpc.ServicerContext,
51
- ) -> modal_proto.sandbox_router_pb2.SandboxExecStartResponse:
52
- """Execute a command in the sandbox."""
53
- @abc.abstractmethod
54
- def SandboxExecStdinWrite(
55
- self,
56
- request: modal_proto.sandbox_router_pb2.SandboxExecStdinWriteRequest,
57
- context: grpc.ServicerContext,
58
- ) -> modal_proto.sandbox_router_pb2.SandboxExecStdinWriteResponse:
59
- """Write to the stdin stream of an exec'd command."""
60
- @abc.abstractmethod
61
- def SandboxExecStdioRead(
62
- self,
63
- request: modal_proto.sandbox_router_pb2.SandboxExecStdioReadRequest,
64
- context: grpc.ServicerContext,
65
- ) -> collections.abc.Iterator[modal_proto.sandbox_router_pb2.SandboxExecStdioReadResponse]:
66
- """Get a stream of output from the stdout or stderr stream of an exec'd command."""
67
- @abc.abstractmethod
68
- def SandboxExecWait(
69
- self,
70
- request: modal_proto.sandbox_router_pb2.SandboxExecWaitRequest,
71
- context: grpc.ServicerContext,
72
- ) -> modal_proto.sandbox_router_pb2.SandboxExecWaitResponse:
73
- """Wait for an exec'd command to exit and return the exit code."""
74
-
75
- def add_SandboxRouterServicer_to_server(servicer: SandboxRouterServicer, server: grpc.Server) -> None: ...