modal 1.1.5.dev66__py3-none-any.whl → 1.3.1.dev8__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.

Files changed (143) hide show
  1. modal/__init__.py +4 -4
  2. modal/__main__.py +4 -29
  3. modal/_billing.py +84 -0
  4. modal/_clustered_functions.py +1 -3
  5. modal/_container_entrypoint.py +33 -208
  6. modal/_functions.py +171 -138
  7. modal/_grpc_client.py +191 -0
  8. modal/_ipython.py +16 -6
  9. modal/_load_context.py +106 -0
  10. modal/_object.py +72 -21
  11. modal/_output.py +12 -14
  12. modal/_partial_function.py +31 -4
  13. modal/_resolver.py +44 -57
  14. modal/_runtime/container_io_manager.py +30 -28
  15. modal/_runtime/container_io_manager.pyi +42 -44
  16. modal/_runtime/gpu_memory_snapshot.py +9 -7
  17. modal/_runtime/user_code_event_loop.py +80 -0
  18. modal/_runtime/user_code_imports.py +236 -10
  19. modal/_serialization.py +2 -1
  20. modal/_traceback.py +4 -13
  21. modal/_tunnel.py +16 -11
  22. modal/_tunnel.pyi +25 -3
  23. modal/_utils/async_utils.py +337 -10
  24. modal/_utils/auth_token_manager.py +1 -4
  25. modal/_utils/blob_utils.py +29 -22
  26. modal/_utils/function_utils.py +20 -21
  27. modal/_utils/grpc_testing.py +6 -3
  28. modal/_utils/grpc_utils.py +223 -64
  29. modal/_utils/mount_utils.py +26 -1
  30. modal/_utils/name_utils.py +2 -3
  31. modal/_utils/package_utils.py +0 -1
  32. modal/_utils/rand_pb_testing.py +8 -1
  33. modal/_utils/task_command_router_client.py +524 -0
  34. modal/_vendor/cloudpickle.py +144 -48
  35. modal/app.py +285 -105
  36. modal/app.pyi +216 -53
  37. modal/billing.py +5 -0
  38. modal/builder/2025.06.txt +6 -3
  39. modal/builder/PREVIEW.txt +2 -1
  40. modal/builder/base-images.json +4 -2
  41. modal/cli/_download.py +19 -3
  42. modal/cli/cluster.py +4 -2
  43. modal/cli/config.py +3 -1
  44. modal/cli/container.py +5 -4
  45. modal/cli/dict.py +5 -2
  46. modal/cli/entry_point.py +26 -2
  47. modal/cli/environment.py +2 -16
  48. modal/cli/launch.py +1 -76
  49. modal/cli/network_file_system.py +5 -20
  50. modal/cli/programs/run_jupyter.py +1 -1
  51. modal/cli/programs/vscode.py +1 -1
  52. modal/cli/queues.py +5 -4
  53. modal/cli/run.py +24 -204
  54. modal/cli/secret.py +1 -2
  55. modal/cli/shell.py +375 -0
  56. modal/cli/utils.py +1 -13
  57. modal/cli/volume.py +11 -17
  58. modal/client.py +16 -125
  59. modal/client.pyi +94 -144
  60. modal/cloud_bucket_mount.py +3 -1
  61. modal/cloud_bucket_mount.pyi +4 -0
  62. modal/cls.py +101 -64
  63. modal/cls.pyi +9 -8
  64. modal/config.py +21 -1
  65. modal/container_process.py +288 -12
  66. modal/container_process.pyi +99 -38
  67. modal/dict.py +72 -33
  68. modal/dict.pyi +88 -57
  69. modal/environments.py +16 -8
  70. modal/environments.pyi +6 -2
  71. modal/exception.py +154 -16
  72. modal/experimental/__init__.py +24 -53
  73. modal/experimental/flash.py +161 -74
  74. modal/experimental/flash.pyi +97 -49
  75. modal/file_io.py +50 -92
  76. modal/file_io.pyi +117 -89
  77. modal/functions.pyi +70 -87
  78. modal/image.py +82 -47
  79. modal/image.pyi +51 -30
  80. modal/io_streams.py +500 -149
  81. modal/io_streams.pyi +279 -189
  82. modal/mount.py +60 -46
  83. modal/mount.pyi +41 -17
  84. modal/network_file_system.py +19 -11
  85. modal/network_file_system.pyi +72 -39
  86. modal/object.pyi +114 -22
  87. modal/parallel_map.py +42 -44
  88. modal/parallel_map.pyi +9 -17
  89. modal/partial_function.pyi +4 -2
  90. modal/proxy.py +14 -6
  91. modal/proxy.pyi +10 -2
  92. modal/queue.py +45 -38
  93. modal/queue.pyi +88 -52
  94. modal/runner.py +96 -96
  95. modal/runner.pyi +44 -27
  96. modal/sandbox.py +225 -107
  97. modal/sandbox.pyi +226 -60
  98. modal/secret.py +58 -56
  99. modal/secret.pyi +28 -13
  100. modal/serving.py +7 -11
  101. modal/serving.pyi +7 -8
  102. modal/snapshot.py +29 -15
  103. modal/snapshot.pyi +18 -10
  104. modal/token_flow.py +1 -1
  105. modal/token_flow.pyi +4 -6
  106. modal/volume.py +102 -55
  107. modal/volume.pyi +125 -66
  108. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/METADATA +10 -9
  109. modal-1.3.1.dev8.dist-info/RECORD +189 -0
  110. modal_proto/api.proto +141 -70
  111. modal_proto/api_grpc.py +42 -26
  112. modal_proto/api_pb2.py +1123 -1103
  113. modal_proto/api_pb2.pyi +331 -83
  114. modal_proto/api_pb2_grpc.py +80 -48
  115. modal_proto/api_pb2_grpc.pyi +26 -18
  116. modal_proto/modal_api_grpc.py +175 -174
  117. modal_proto/task_command_router.proto +164 -0
  118. modal_proto/task_command_router_grpc.py +138 -0
  119. modal_proto/task_command_router_pb2.py +180 -0
  120. modal_proto/{sandbox_router_pb2.pyi → task_command_router_pb2.pyi} +148 -57
  121. modal_proto/task_command_router_pb2_grpc.py +272 -0
  122. modal_proto/task_command_router_pb2_grpc.pyi +100 -0
  123. modal_version/__init__.py +1 -1
  124. modal_version/__main__.py +1 -1
  125. modal/cli/programs/launch_instance_ssh.py +0 -94
  126. modal/cli/programs/run_marimo.py +0 -95
  127. modal-1.1.5.dev66.dist-info/RECORD +0 -191
  128. modal_proto/modal_options_grpc.py +0 -3
  129. modal_proto/options.proto +0 -19
  130. modal_proto/options_grpc.py +0 -3
  131. modal_proto/options_pb2.py +0 -35
  132. modal_proto/options_pb2.pyi +0 -20
  133. modal_proto/options_pb2_grpc.py +0 -4
  134. modal_proto/options_pb2_grpc.pyi +0 -7
  135. modal_proto/sandbox_router.proto +0 -125
  136. modal_proto/sandbox_router_grpc.py +0 -89
  137. modal_proto/sandbox_router_pb2.py +0 -128
  138. modal_proto/sandbox_router_pb2_grpc.py +0 -169
  139. modal_proto/sandbox_router_pb2_grpc.pyi +0 -63
  140. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/WHEEL +0 -0
  141. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/entry_points.txt +0 -0
  142. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/licenses/LICENSE +0 -0
  143. {modal-1.1.5.dev66.dist-info → modal-1.3.1.dev8.dist-info}/top_level.txt +0 -0
@@ -19,72 +19,116 @@ else:
19
19
 
20
20
  DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
21
21
 
22
- class _SandboxExecStderrConfig:
22
+ class _TaskExecStderrConfig:
23
23
  ValueType = typing.NewType("ValueType", builtins.int)
24
24
  V: typing_extensions.TypeAlias = ValueType
25
25
 
26
- class _SandboxExecStderrConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SandboxExecStderrConfig.ValueType], builtins.type): # noqa: F821
26
+ class _TaskExecStderrConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStderrConfig.ValueType], builtins.type): # noqa: F821
27
27
  DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
28
- SANDBOX_EXEC_STDERR_CONFIG_DEVNULL: _SandboxExecStderrConfig.ValueType # 0
28
+ TASK_EXEC_STDERR_CONFIG_DEVNULL: _TaskExecStderrConfig.ValueType # 0
29
29
  """The output will be discarded."""
30
- SANDBOX_EXEC_STDERR_CONFIG_PIPE: _SandboxExecStderrConfig.ValueType # 1
30
+ TASK_EXEC_STDERR_CONFIG_PIPE: _TaskExecStderrConfig.ValueType # 1
31
31
  """The output will be streamed to the client."""
32
- SANDBOX_EXEC_STDERR_CONFIG_STDOUT: _SandboxExecStderrConfig.ValueType # 2
32
+ TASK_EXEC_STDERR_CONFIG_STDOUT: _TaskExecStderrConfig.ValueType # 2
33
33
  """A special value that can be used to indicate that the stderr stream should
34
34
  be merged with the stdout stream.
35
35
  """
36
36
 
37
- class SandboxExecStderrConfig(_SandboxExecStderrConfig, metaclass=_SandboxExecStderrConfigEnumTypeWrapper): ...
37
+ class TaskExecStderrConfig(_TaskExecStderrConfig, metaclass=_TaskExecStderrConfigEnumTypeWrapper): ...
38
38
 
39
- SANDBOX_EXEC_STDERR_CONFIG_DEVNULL: SandboxExecStderrConfig.ValueType # 0
39
+ TASK_EXEC_STDERR_CONFIG_DEVNULL: TaskExecStderrConfig.ValueType # 0
40
40
  """The output will be discarded."""
41
- SANDBOX_EXEC_STDERR_CONFIG_PIPE: SandboxExecStderrConfig.ValueType # 1
41
+ TASK_EXEC_STDERR_CONFIG_PIPE: TaskExecStderrConfig.ValueType # 1
42
42
  """The output will be streamed to the client."""
43
- SANDBOX_EXEC_STDERR_CONFIG_STDOUT: SandboxExecStderrConfig.ValueType # 2
43
+ TASK_EXEC_STDERR_CONFIG_STDOUT: TaskExecStderrConfig.ValueType # 2
44
44
  """A special value that can be used to indicate that the stderr stream should
45
45
  be merged with the stdout stream.
46
46
  """
47
- global___SandboxExecStderrConfig = SandboxExecStderrConfig
47
+ global___TaskExecStderrConfig = TaskExecStderrConfig
48
48
 
49
- class _SandboxExecStdioFileDescriptor:
49
+ class _TaskExecStdioFileDescriptor:
50
50
  ValueType = typing.NewType("ValueType", builtins.int)
51
51
  V: typing_extensions.TypeAlias = ValueType
52
52
 
53
- class _SandboxExecStdioFileDescriptorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SandboxExecStdioFileDescriptor.ValueType], builtins.type): # noqa: F821
53
+ class _TaskExecStdioFileDescriptorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStdioFileDescriptor.ValueType], builtins.type): # noqa: F821
54
54
  DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
55
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: _SandboxExecStdioFileDescriptor.ValueType # 0
55
+ TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: _TaskExecStdioFileDescriptor.ValueType # 0
56
56
  """Read from stdout."""
57
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: _SandboxExecStdioFileDescriptor.ValueType # 1
57
+ TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: _TaskExecStdioFileDescriptor.ValueType # 1
58
58
  """Read from stderr."""
59
59
 
60
- class SandboxExecStdioFileDescriptor(_SandboxExecStdioFileDescriptor, metaclass=_SandboxExecStdioFileDescriptorEnumTypeWrapper): ...
60
+ class TaskExecStdioFileDescriptor(_TaskExecStdioFileDescriptor, metaclass=_TaskExecStdioFileDescriptorEnumTypeWrapper): ...
61
61
 
62
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: SandboxExecStdioFileDescriptor.ValueType # 0
62
+ TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDOUT: TaskExecStdioFileDescriptor.ValueType # 0
63
63
  """Read from stdout."""
64
- SANDBOX_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: SandboxExecStdioFileDescriptor.ValueType # 1
64
+ TASK_EXEC_STDIO_FILE_DESCRIPTOR_STDERR: TaskExecStdioFileDescriptor.ValueType # 1
65
65
  """Read from stderr."""
66
- global___SandboxExecStdioFileDescriptor = SandboxExecStdioFileDescriptor
66
+ global___TaskExecStdioFileDescriptor = TaskExecStdioFileDescriptor
67
67
 
68
- class _SandboxExecStdoutConfig:
68
+ class _TaskExecStdoutConfig:
69
69
  ValueType = typing.NewType("ValueType", builtins.int)
70
70
  V: typing_extensions.TypeAlias = ValueType
71
71
 
72
- class _SandboxExecStdoutConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SandboxExecStdoutConfig.ValueType], builtins.type): # noqa: F821
72
+ class _TaskExecStdoutConfigEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TaskExecStdoutConfig.ValueType], builtins.type): # noqa: F821
73
73
  DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
74
- SANDBOX_EXEC_STDOUT_CONFIG_DEVNULL: _SandboxExecStdoutConfig.ValueType # 0
74
+ TASK_EXEC_STDOUT_CONFIG_DEVNULL: _TaskExecStdoutConfig.ValueType # 0
75
75
  """The output will be discarded."""
76
- SANDBOX_EXEC_STDOUT_CONFIG_PIPE: _SandboxExecStdoutConfig.ValueType # 1
76
+ TASK_EXEC_STDOUT_CONFIG_PIPE: _TaskExecStdoutConfig.ValueType # 1
77
77
  """The output will be streamed to the client."""
78
78
 
79
- class SandboxExecStdoutConfig(_SandboxExecStdoutConfig, metaclass=_SandboxExecStdoutConfigEnumTypeWrapper): ...
79
+ class TaskExecStdoutConfig(_TaskExecStdoutConfig, metaclass=_TaskExecStdoutConfigEnumTypeWrapper): ...
80
80
 
81
- SANDBOX_EXEC_STDOUT_CONFIG_DEVNULL: SandboxExecStdoutConfig.ValueType # 0
81
+ TASK_EXEC_STDOUT_CONFIG_DEVNULL: TaskExecStdoutConfig.ValueType # 0
82
82
  """The output will be discarded."""
83
- SANDBOX_EXEC_STDOUT_CONFIG_PIPE: SandboxExecStdoutConfig.ValueType # 1
83
+ TASK_EXEC_STDOUT_CONFIG_PIPE: TaskExecStdoutConfig.ValueType # 1
84
84
  """The output will be streamed to the client."""
85
- global___SandboxExecStdoutConfig = SandboxExecStdoutConfig
85
+ global___TaskExecStdoutConfig = TaskExecStdoutConfig
86
86
 
87
- class SandboxExecStartRequest(google.protobuf.message.Message):
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):
88
132
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
89
133
 
90
134
  TASK_ID_FIELD_NUMBER: builtins.int
@@ -98,21 +142,17 @@ class SandboxExecStartRequest(google.protobuf.message.Message):
98
142
  PTY_INFO_FIELD_NUMBER: builtins.int
99
143
  RUNTIME_DEBUG_FIELD_NUMBER: builtins.int
100
144
  task_id: builtins.str
101
- """The task ID of the sandbox to execute the command in."""
145
+ """The ID of the task to execute the command in."""
102
146
  exec_id: builtins.str
103
147
  """Execution ID. This ID will be used to identify the execution for other
104
148
  requests and ensure exec commands are idempotent.
105
-
106
- TODO(saltzm): Could instead have a separate idempotency key from the exec_id
107
- like present day, and have the server generate the exec_id and return it in
108
- the ExecStartResponse.
109
149
  """
110
150
  @property
111
151
  def command_args(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
112
152
  """Command arguments to execute."""
113
- stdout_config: global___SandboxExecStdoutConfig.ValueType
153
+ stdout_config: global___TaskExecStdoutConfig.ValueType
114
154
  """Configures how the stdout of the command will be handled."""
115
- stderr_config: global___SandboxExecStderrConfig.ValueType
155
+ stderr_config: global___TaskExecStderrConfig.ValueType
116
156
  """Configures how the stderr of the command will be handled."""
117
157
  timeout_secs: builtins.int
118
158
  """Timeout in seconds for the exec'd command to exit. If the command does not
@@ -123,7 +163,7 @@ class SandboxExecStartRequest(google.protobuf.message.Message):
123
163
  """Working directory for the command."""
124
164
  @property
125
165
  def secret_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
126
- """Secret IDs to mount into the sandbox."""
166
+ """Secret IDs to mount into the task."""
127
167
  @property
128
168
  def pty_info(self) -> modal_proto.api_pb2.PTYInfo:
129
169
  """PTY info for the command."""
@@ -137,8 +177,8 @@ class SandboxExecStartRequest(google.protobuf.message.Message):
137
177
  task_id: builtins.str = ...,
138
178
  exec_id: builtins.str = ...,
139
179
  command_args: collections.abc.Iterable[builtins.str] | None = ...,
140
- stdout_config: global___SandboxExecStdoutConfig.ValueType = ...,
141
- stderr_config: global___SandboxExecStderrConfig.ValueType = ...,
180
+ stdout_config: global___TaskExecStdoutConfig.ValueType = ...,
181
+ stderr_config: global___TaskExecStderrConfig.ValueType = ...,
142
182
  timeout_secs: builtins.int | None = ...,
143
183
  workdir: builtins.str | None = ...,
144
184
  secret_ids: collections.abc.Iterable[builtins.str] | None = ...,
@@ -154,18 +194,18 @@ class SandboxExecStartRequest(google.protobuf.message.Message):
154
194
  @typing.overload
155
195
  def WhichOneof(self, oneof_group: typing_extensions.Literal["_workdir", b"_workdir"]) -> typing_extensions.Literal["workdir"] | None: ...
156
196
 
157
- global___SandboxExecStartRequest = SandboxExecStartRequest
197
+ global___TaskExecStartRequest = TaskExecStartRequest
158
198
 
159
- class SandboxExecStartResponse(google.protobuf.message.Message):
199
+ class TaskExecStartResponse(google.protobuf.message.Message):
160
200
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
161
201
 
162
202
  def __init__(
163
203
  self,
164
204
  ) -> None: ...
165
205
 
166
- global___SandboxExecStartResponse = SandboxExecStartResponse
206
+ global___TaskExecStartResponse = TaskExecStartResponse
167
207
 
168
- class SandboxExecStdinWriteRequest(google.protobuf.message.Message):
208
+ class TaskExecStdinWriteRequest(google.protobuf.message.Message):
169
209
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
170
210
 
171
211
  TASK_ID_FIELD_NUMBER: builtins.int
@@ -174,7 +214,7 @@ class SandboxExecStdinWriteRequest(google.protobuf.message.Message):
174
214
  DATA_FIELD_NUMBER: builtins.int
175
215
  EOF_FIELD_NUMBER: builtins.int
176
216
  task_id: builtins.str
177
- """The task ID of the sandbox running the exec'd command."""
217
+ """The ID of the task running the exec'd command."""
178
218
  exec_id: builtins.str
179
219
  """The execution ID of the command to write to."""
180
220
  offset: builtins.int
@@ -197,18 +237,18 @@ class SandboxExecStdinWriteRequest(google.protobuf.message.Message):
197
237
  ) -> None: ...
198
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: ...
199
239
 
200
- global___SandboxExecStdinWriteRequest = SandboxExecStdinWriteRequest
240
+ global___TaskExecStdinWriteRequest = TaskExecStdinWriteRequest
201
241
 
202
- class SandboxExecStdinWriteResponse(google.protobuf.message.Message):
242
+ class TaskExecStdinWriteResponse(google.protobuf.message.Message):
203
243
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
204
244
 
205
245
  def __init__(
206
246
  self,
207
247
  ) -> None: ...
208
248
 
209
- global___SandboxExecStdinWriteResponse = SandboxExecStdinWriteResponse
249
+ global___TaskExecStdinWriteResponse = TaskExecStdinWriteResponse
210
250
 
211
- class SandboxExecStdioReadRequest(google.protobuf.message.Message):
251
+ class TaskExecStdioReadRequest(google.protobuf.message.Message):
212
252
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
213
253
 
214
254
  TASK_ID_FIELD_NUMBER: builtins.int
@@ -216,14 +256,14 @@ class SandboxExecStdioReadRequest(google.protobuf.message.Message):
216
256
  OFFSET_FIELD_NUMBER: builtins.int
217
257
  FILE_DESCRIPTOR_FIELD_NUMBER: builtins.int
218
258
  task_id: builtins.str
219
- """The task ID of the sandbox running the exec'd command."""
259
+ """The ID of the task running the exec'd command."""
220
260
  exec_id: builtins.str
221
261
  """The execution ID of the command to read from."""
222
262
  offset: builtins.int
223
263
  """The offset to start reading from. This is used to resume reading from the
224
264
  last read position if the connection is closed and reopened.
225
265
  """
226
- file_descriptor: global___SandboxExecStdioFileDescriptor.ValueType
266
+ file_descriptor: global___TaskExecStdioFileDescriptor.ValueType
227
267
  """Which file descriptor to read from."""
228
268
  def __init__(
229
269
  self,
@@ -231,13 +271,13 @@ class SandboxExecStdioReadRequest(google.protobuf.message.Message):
231
271
  task_id: builtins.str = ...,
232
272
  exec_id: builtins.str = ...,
233
273
  offset: builtins.int = ...,
234
- file_descriptor: global___SandboxExecStdioFileDescriptor.ValueType = ...,
274
+ file_descriptor: global___TaskExecStdioFileDescriptor.ValueType = ...,
235
275
  ) -> None: ...
236
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: ...
237
277
 
238
- global___SandboxExecStdioReadRequest = SandboxExecStdioReadRequest
278
+ global___TaskExecStdioReadRequest = TaskExecStdioReadRequest
239
279
 
240
- class SandboxExecStdioReadResponse(google.protobuf.message.Message):
280
+ class TaskExecStdioReadResponse(google.protobuf.message.Message):
241
281
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
242
282
 
243
283
  DATA_FIELD_NUMBER: builtins.int
@@ -250,15 +290,15 @@ class SandboxExecStdioReadResponse(google.protobuf.message.Message):
250
290
  ) -> None: ...
251
291
  def ClearField(self, field_name: typing_extensions.Literal["data", b"data"]) -> None: ...
252
292
 
253
- global___SandboxExecStdioReadResponse = SandboxExecStdioReadResponse
293
+ global___TaskExecStdioReadResponse = TaskExecStdioReadResponse
254
294
 
255
- class SandboxExecWaitRequest(google.protobuf.message.Message):
295
+ class TaskExecWaitRequest(google.protobuf.message.Message):
256
296
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
257
297
 
258
298
  TASK_ID_FIELD_NUMBER: builtins.int
259
299
  EXEC_ID_FIELD_NUMBER: builtins.int
260
300
  task_id: builtins.str
261
- """The task ID of the sandbox running the exec'd command."""
301
+ """The ID of the task running the exec'd command."""
262
302
  exec_id: builtins.str
263
303
  """The execution ID of the command to wait on."""
264
304
  def __init__(
@@ -269,9 +309,9 @@ class SandboxExecWaitRequest(google.protobuf.message.Message):
269
309
  ) -> None: ...
270
310
  def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "task_id", b"task_id"]) -> None: ...
271
311
 
272
- global___SandboxExecWaitRequest = SandboxExecWaitRequest
312
+ global___TaskExecWaitRequest = TaskExecWaitRequest
273
313
 
274
- class SandboxExecWaitResponse(google.protobuf.message.Message):
314
+ class TaskExecWaitResponse(google.protobuf.message.Message):
275
315
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
276
316
 
277
317
  CODE_FIELD_NUMBER: builtins.int
@@ -290,4 +330,55 @@ class SandboxExecWaitResponse(google.protobuf.message.Message):
290
330
  def ClearField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> None: ...
291
331
  def WhichOneof(self, oneof_group: typing_extensions.Literal["exit_status", b"exit_status"]) -> typing_extensions.Literal["code", "signal"] | None: ...
292
332
 
293
- global___SandboxExecWaitResponse = SandboxExecWaitResponse
333
+ global___TaskExecWaitResponse = TaskExecWaitResponse
334
+
335
+ class TaskMountDirectoryRequest(google.protobuf.message.Message):
336
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
337
+
338
+ TASK_ID_FIELD_NUMBER: builtins.int
339
+ PATH_FIELD_NUMBER: builtins.int
340
+ IMAGE_ID_FIELD_NUMBER: builtins.int
341
+ task_id: builtins.str
342
+ path: builtins.bytes
343
+ image_id: builtins.str
344
+ def __init__(
345
+ self,
346
+ *,
347
+ task_id: builtins.str = ...,
348
+ path: builtins.bytes = ...,
349
+ image_id: builtins.str = ...,
350
+ ) -> None: ...
351
+ def ClearField(self, field_name: typing_extensions.Literal["image_id", b"image_id", "path", b"path", "task_id", b"task_id"]) -> None: ...
352
+
353
+ global___TaskMountDirectoryRequest = TaskMountDirectoryRequest
354
+
355
+ class TaskSnapshotDirectoryRequest(google.protobuf.message.Message):
356
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
357
+
358
+ TASK_ID_FIELD_NUMBER: builtins.int
359
+ PATH_FIELD_NUMBER: builtins.int
360
+ task_id: builtins.str
361
+ path: builtins.bytes
362
+ def __init__(
363
+ self,
364
+ *,
365
+ task_id: builtins.str = ...,
366
+ path: builtins.bytes = ...,
367
+ ) -> None: ...
368
+ def ClearField(self, field_name: typing_extensions.Literal["path", b"path", "task_id", b"task_id"]) -> None: ...
369
+
370
+ global___TaskSnapshotDirectoryRequest = TaskSnapshotDirectoryRequest
371
+
372
+ class TaskSnapshotDirectoryResponse(google.protobuf.message.Message):
373
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
374
+
375
+ IMAGE_ID_FIELD_NUMBER: builtins.int
376
+ image_id: builtins.str
377
+ def __init__(
378
+ self,
379
+ *,
380
+ image_id: builtins.str = ...,
381
+ ) -> None: ...
382
+ def ClearField(self, field_name: typing_extensions.Literal["image_id", b"image_id"]) -> None: ...
383
+
384
+ global___TaskSnapshotDirectoryResponse = TaskSnapshotDirectoryResponse
@@ -0,0 +1,272 @@
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 google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
6
+ from modal_proto import task_command_router_pb2 as modal__proto_dot_task__command__router__pb2
7
+
8
+
9
+ class TaskCommandRouterStub(object):
10
+ """Missing associated documentation comment in .proto file."""
11
+
12
+ def __init__(self, channel):
13
+ """Constructor.
14
+
15
+ Args:
16
+ channel: A grpc.Channel.
17
+ """
18
+ self.TaskExecPoll = channel.unary_unary(
19
+ '/modal.task_command_router.TaskCommandRouter/TaskExecPoll',
20
+ request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecPollRequest.SerializeToString,
21
+ response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecPollResponse.FromString,
22
+ )
23
+ self.TaskExecStart = channel.unary_unary(
24
+ '/modal.task_command_router.TaskCommandRouter/TaskExecStart',
25
+ request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStartRequest.SerializeToString,
26
+ response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStartResponse.FromString,
27
+ )
28
+ self.TaskExecStdinWrite = channel.unary_unary(
29
+ '/modal.task_command_router.TaskCommandRouter/TaskExecStdinWrite',
30
+ request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteRequest.SerializeToString,
31
+ response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteResponse.FromString,
32
+ )
33
+ self.TaskExecStdioRead = channel.unary_stream(
34
+ '/modal.task_command_router.TaskCommandRouter/TaskExecStdioRead',
35
+ request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStdioReadRequest.SerializeToString,
36
+ response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStdioReadResponse.FromString,
37
+ )
38
+ self.TaskExecWait = channel.unary_unary(
39
+ '/modal.task_command_router.TaskCommandRouter/TaskExecWait',
40
+ request_serializer=modal__proto_dot_task__command__router__pb2.TaskExecWaitRequest.SerializeToString,
41
+ response_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecWaitResponse.FromString,
42
+ )
43
+ self.TaskMountDirectory = channel.unary_unary(
44
+ '/modal.task_command_router.TaskCommandRouter/TaskMountDirectory',
45
+ request_serializer=modal__proto_dot_task__command__router__pb2.TaskMountDirectoryRequest.SerializeToString,
46
+ response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
47
+ )
48
+ self.TaskSnapshotDirectory = channel.unary_unary(
49
+ '/modal.task_command_router.TaskCommandRouter/TaskSnapshotDirectory',
50
+ request_serializer=modal__proto_dot_task__command__router__pb2.TaskSnapshotDirectoryRequest.SerializeToString,
51
+ response_deserializer=modal__proto_dot_task__command__router__pb2.TaskSnapshotDirectoryResponse.FromString,
52
+ )
53
+
54
+
55
+ class TaskCommandRouterServicer(object):
56
+ """Missing associated documentation comment in .proto file."""
57
+
58
+ def TaskExecPoll(self, request, context):
59
+ """Poll for the exit status of an exec'd command.
60
+ """
61
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
62
+ context.set_details('Method not implemented!')
63
+ raise NotImplementedError('Method not implemented!')
64
+
65
+ def TaskExecStart(self, request, context):
66
+ """Execute a command in the task.
67
+ """
68
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
69
+ context.set_details('Method not implemented!')
70
+ raise NotImplementedError('Method not implemented!')
71
+
72
+ def TaskExecStdinWrite(self, request, context):
73
+ """Write to the stdin stream of an exec'd command.
74
+ """
75
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
76
+ context.set_details('Method not implemented!')
77
+ raise NotImplementedError('Method not implemented!')
78
+
79
+ def TaskExecStdioRead(self, request, context):
80
+ """Get a stream of output from the stdout or stderr stream of an exec'd command.
81
+ """
82
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
83
+ context.set_details('Method not implemented!')
84
+ raise NotImplementedError('Method not implemented!')
85
+
86
+ def TaskExecWait(self, request, context):
87
+ """Wait for an exec'd command to exit and return the exit code.
88
+ """
89
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
90
+ context.set_details('Method not implemented!')
91
+ raise NotImplementedError('Method not implemented!')
92
+
93
+ def TaskMountDirectory(self, request, context):
94
+ """Mount an image at a directory in the container.
95
+ """
96
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
97
+ context.set_details('Method not implemented!')
98
+ raise NotImplementedError('Method not implemented!')
99
+
100
+ def TaskSnapshotDirectory(self, request, context):
101
+ """Snapshot a directory with a mounted image, including any local changes, into a new image.
102
+ """
103
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
104
+ context.set_details('Method not implemented!')
105
+ raise NotImplementedError('Method not implemented!')
106
+
107
+
108
+ def add_TaskCommandRouterServicer_to_server(servicer, server):
109
+ rpc_method_handlers = {
110
+ 'TaskExecPoll': grpc.unary_unary_rpc_method_handler(
111
+ servicer.TaskExecPoll,
112
+ request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecPollRequest.FromString,
113
+ response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecPollResponse.SerializeToString,
114
+ ),
115
+ 'TaskExecStart': grpc.unary_unary_rpc_method_handler(
116
+ servicer.TaskExecStart,
117
+ request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStartRequest.FromString,
118
+ response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStartResponse.SerializeToString,
119
+ ),
120
+ 'TaskExecStdinWrite': grpc.unary_unary_rpc_method_handler(
121
+ servicer.TaskExecStdinWrite,
122
+ request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteRequest.FromString,
123
+ response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteResponse.SerializeToString,
124
+ ),
125
+ 'TaskExecStdioRead': grpc.unary_stream_rpc_method_handler(
126
+ servicer.TaskExecStdioRead,
127
+ request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecStdioReadRequest.FromString,
128
+ response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecStdioReadResponse.SerializeToString,
129
+ ),
130
+ 'TaskExecWait': grpc.unary_unary_rpc_method_handler(
131
+ servicer.TaskExecWait,
132
+ request_deserializer=modal__proto_dot_task__command__router__pb2.TaskExecWaitRequest.FromString,
133
+ response_serializer=modal__proto_dot_task__command__router__pb2.TaskExecWaitResponse.SerializeToString,
134
+ ),
135
+ 'TaskMountDirectory': grpc.unary_unary_rpc_method_handler(
136
+ servicer.TaskMountDirectory,
137
+ request_deserializer=modal__proto_dot_task__command__router__pb2.TaskMountDirectoryRequest.FromString,
138
+ response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
139
+ ),
140
+ 'TaskSnapshotDirectory': grpc.unary_unary_rpc_method_handler(
141
+ servicer.TaskSnapshotDirectory,
142
+ request_deserializer=modal__proto_dot_task__command__router__pb2.TaskSnapshotDirectoryRequest.FromString,
143
+ response_serializer=modal__proto_dot_task__command__router__pb2.TaskSnapshotDirectoryResponse.SerializeToString,
144
+ ),
145
+ }
146
+ generic_handler = grpc.method_handlers_generic_handler(
147
+ 'modal.task_command_router.TaskCommandRouter', rpc_method_handlers)
148
+ server.add_generic_rpc_handlers((generic_handler,))
149
+
150
+
151
+ # This class is part of an EXPERIMENTAL API.
152
+ class TaskCommandRouter(object):
153
+ """Missing associated documentation comment in .proto file."""
154
+
155
+ @staticmethod
156
+ def TaskExecPoll(request,
157
+ target,
158
+ options=(),
159
+ channel_credentials=None,
160
+ call_credentials=None,
161
+ insecure=False,
162
+ compression=None,
163
+ wait_for_ready=None,
164
+ timeout=None,
165
+ metadata=None):
166
+ return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskCommandRouter/TaskExecPoll',
167
+ modal__proto_dot_task__command__router__pb2.TaskExecPollRequest.SerializeToString,
168
+ modal__proto_dot_task__command__router__pb2.TaskExecPollResponse.FromString,
169
+ options, channel_credentials,
170
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
171
+
172
+ @staticmethod
173
+ def TaskExecStart(request,
174
+ target,
175
+ options=(),
176
+ channel_credentials=None,
177
+ call_credentials=None,
178
+ insecure=False,
179
+ compression=None,
180
+ wait_for_ready=None,
181
+ timeout=None,
182
+ metadata=None):
183
+ return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskCommandRouter/TaskExecStart',
184
+ modal__proto_dot_task__command__router__pb2.TaskExecStartRequest.SerializeToString,
185
+ modal__proto_dot_task__command__router__pb2.TaskExecStartResponse.FromString,
186
+ options, channel_credentials,
187
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
188
+
189
+ @staticmethod
190
+ def TaskExecStdinWrite(request,
191
+ target,
192
+ options=(),
193
+ channel_credentials=None,
194
+ call_credentials=None,
195
+ insecure=False,
196
+ compression=None,
197
+ wait_for_ready=None,
198
+ timeout=None,
199
+ metadata=None):
200
+ return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskCommandRouter/TaskExecStdinWrite',
201
+ modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteRequest.SerializeToString,
202
+ modal__proto_dot_task__command__router__pb2.TaskExecStdinWriteResponse.FromString,
203
+ options, channel_credentials,
204
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
205
+
206
+ @staticmethod
207
+ def TaskExecStdioRead(request,
208
+ target,
209
+ options=(),
210
+ channel_credentials=None,
211
+ call_credentials=None,
212
+ insecure=False,
213
+ compression=None,
214
+ wait_for_ready=None,
215
+ timeout=None,
216
+ metadata=None):
217
+ return grpc.experimental.unary_stream(request, target, '/modal.task_command_router.TaskCommandRouter/TaskExecStdioRead',
218
+ modal__proto_dot_task__command__router__pb2.TaskExecStdioReadRequest.SerializeToString,
219
+ modal__proto_dot_task__command__router__pb2.TaskExecStdioReadResponse.FromString,
220
+ options, channel_credentials,
221
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
222
+
223
+ @staticmethod
224
+ def TaskExecWait(request,
225
+ target,
226
+ options=(),
227
+ channel_credentials=None,
228
+ call_credentials=None,
229
+ insecure=False,
230
+ compression=None,
231
+ wait_for_ready=None,
232
+ timeout=None,
233
+ metadata=None):
234
+ return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskCommandRouter/TaskExecWait',
235
+ modal__proto_dot_task__command__router__pb2.TaskExecWaitRequest.SerializeToString,
236
+ modal__proto_dot_task__command__router__pb2.TaskExecWaitResponse.FromString,
237
+ options, channel_credentials,
238
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
239
+
240
+ @staticmethod
241
+ def TaskMountDirectory(request,
242
+ target,
243
+ options=(),
244
+ channel_credentials=None,
245
+ call_credentials=None,
246
+ insecure=False,
247
+ compression=None,
248
+ wait_for_ready=None,
249
+ timeout=None,
250
+ metadata=None):
251
+ return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskCommandRouter/TaskMountDirectory',
252
+ modal__proto_dot_task__command__router__pb2.TaskMountDirectoryRequest.SerializeToString,
253
+ google_dot_protobuf_dot_empty__pb2.Empty.FromString,
254
+ options, channel_credentials,
255
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
256
+
257
+ @staticmethod
258
+ def TaskSnapshotDirectory(request,
259
+ target,
260
+ options=(),
261
+ channel_credentials=None,
262
+ call_credentials=None,
263
+ insecure=False,
264
+ compression=None,
265
+ wait_for_ready=None,
266
+ timeout=None,
267
+ metadata=None):
268
+ return grpc.experimental.unary_unary(request, target, '/modal.task_command_router.TaskCommandRouter/TaskSnapshotDirectory',
269
+ modal__proto_dot_task__command__router__pb2.TaskSnapshotDirectoryRequest.SerializeToString,
270
+ modal__proto_dot_task__command__router__pb2.TaskSnapshotDirectoryResponse.FromString,
271
+ options, channel_credentials,
272
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)