modal 1.1.5.dev83__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 (139) 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 +146 -121
  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 +26 -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/package_utils.py +0 -1
  31. modal/_utils/rand_pb_testing.py +8 -1
  32. modal/_utils/task_command_router_client.py +524 -0
  33. modal/_vendor/cloudpickle.py +144 -48
  34. modal/app.py +215 -96
  35. modal/app.pyi +78 -37
  36. modal/billing.py +5 -0
  37. modal/builder/2025.06.txt +6 -3
  38. modal/builder/PREVIEW.txt +2 -1
  39. modal/builder/base-images.json +4 -2
  40. modal/cli/_download.py +19 -3
  41. modal/cli/cluster.py +4 -2
  42. modal/cli/config.py +3 -1
  43. modal/cli/container.py +5 -4
  44. modal/cli/dict.py +5 -2
  45. modal/cli/entry_point.py +26 -2
  46. modal/cli/environment.py +2 -16
  47. modal/cli/launch.py +1 -76
  48. modal/cli/network_file_system.py +5 -20
  49. modal/cli/queues.py +5 -4
  50. modal/cli/run.py +24 -204
  51. modal/cli/secret.py +1 -2
  52. modal/cli/shell.py +375 -0
  53. modal/cli/utils.py +1 -13
  54. modal/cli/volume.py +11 -17
  55. modal/client.py +16 -125
  56. modal/client.pyi +94 -144
  57. modal/cloud_bucket_mount.py +3 -1
  58. modal/cloud_bucket_mount.pyi +4 -0
  59. modal/cls.py +101 -64
  60. modal/cls.pyi +9 -8
  61. modal/config.py +21 -1
  62. modal/container_process.py +288 -12
  63. modal/container_process.pyi +99 -38
  64. modal/dict.py +72 -33
  65. modal/dict.pyi +88 -57
  66. modal/environments.py +16 -8
  67. modal/environments.pyi +6 -2
  68. modal/exception.py +154 -16
  69. modal/experimental/__init__.py +23 -5
  70. modal/experimental/flash.py +161 -74
  71. modal/experimental/flash.pyi +97 -49
  72. modal/file_io.py +50 -92
  73. modal/file_io.pyi +117 -89
  74. modal/functions.pyi +70 -87
  75. modal/image.py +73 -47
  76. modal/image.pyi +33 -30
  77. modal/io_streams.py +500 -149
  78. modal/io_streams.pyi +279 -189
  79. modal/mount.py +60 -45
  80. modal/mount.pyi +41 -17
  81. modal/network_file_system.py +19 -11
  82. modal/network_file_system.pyi +72 -39
  83. modal/object.pyi +114 -22
  84. modal/parallel_map.py +42 -44
  85. modal/parallel_map.pyi +9 -17
  86. modal/partial_function.pyi +4 -2
  87. modal/proxy.py +14 -6
  88. modal/proxy.pyi +10 -2
  89. modal/queue.py +45 -38
  90. modal/queue.pyi +88 -52
  91. modal/runner.py +96 -96
  92. modal/runner.pyi +44 -27
  93. modal/sandbox.py +225 -108
  94. modal/sandbox.pyi +226 -63
  95. modal/secret.py +58 -56
  96. modal/secret.pyi +28 -13
  97. modal/serving.py +7 -11
  98. modal/serving.pyi +7 -8
  99. modal/snapshot.py +29 -15
  100. modal/snapshot.pyi +18 -10
  101. modal/token_flow.py +1 -1
  102. modal/token_flow.pyi +4 -6
  103. modal/volume.py +102 -55
  104. modal/volume.pyi +125 -66
  105. {modal-1.1.5.dev83.dist-info → modal-1.3.1.dev8.dist-info}/METADATA +10 -9
  106. modal-1.3.1.dev8.dist-info/RECORD +189 -0
  107. modal_proto/api.proto +86 -30
  108. modal_proto/api_grpc.py +10 -25
  109. modal_proto/api_pb2.py +1080 -1047
  110. modal_proto/api_pb2.pyi +253 -79
  111. modal_proto/api_pb2_grpc.py +14 -48
  112. modal_proto/api_pb2_grpc.pyi +6 -18
  113. modal_proto/modal_api_grpc.py +175 -176
  114. modal_proto/{sandbox_router.proto → task_command_router.proto} +62 -45
  115. modal_proto/task_command_router_grpc.py +138 -0
  116. modal_proto/task_command_router_pb2.py +180 -0
  117. modal_proto/{sandbox_router_pb2.pyi → task_command_router_pb2.pyi} +110 -63
  118. modal_proto/task_command_router_pb2_grpc.py +272 -0
  119. modal_proto/task_command_router_pb2_grpc.pyi +100 -0
  120. modal_version/__init__.py +1 -1
  121. modal_version/__main__.py +1 -1
  122. modal/cli/programs/launch_instance_ssh.py +0 -94
  123. modal/cli/programs/run_marimo.py +0 -95
  124. modal-1.1.5.dev83.dist-info/RECORD +0 -191
  125. modal_proto/modal_options_grpc.py +0 -3
  126. modal_proto/options.proto +0 -19
  127. modal_proto/options_grpc.py +0 -3
  128. modal_proto/options_pb2.py +0 -35
  129. modal_proto/options_pb2.pyi +0 -20
  130. modal_proto/options_pb2_grpc.py +0 -4
  131. modal_proto/options_pb2_grpc.pyi +0 -7
  132. modal_proto/sandbox_router_grpc.py +0 -105
  133. modal_proto/sandbox_router_pb2.py +0 -148
  134. modal_proto/sandbox_router_pb2_grpc.py +0 -203
  135. modal_proto/sandbox_router_pb2_grpc.pyi +0 -75
  136. {modal-1.1.5.dev83.dist-info → modal-1.3.1.dev8.dist-info}/WHEEL +0 -0
  137. {modal-1.1.5.dev83.dist-info → modal-1.3.1.dev8.dist-info}/entry_points.txt +0 -0
  138. {modal-1.1.5.dev83.dist-info → modal-1.3.1.dev8.dist-info}/licenses/LICENSE +0 -0
  139. {modal-1.1.5.dev83.dist-info → modal-1.3.1.dev8.dist-info}/top_level.txt +0 -0
@@ -19,78 +19,78 @@ 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 SandboxExecPollRequest(google.protobuf.message.Message):
87
+ class TaskExecPollRequest(google.protobuf.message.Message):
88
88
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
89
89
 
90
90
  TASK_ID_FIELD_NUMBER: builtins.int
91
91
  EXEC_ID_FIELD_NUMBER: builtins.int
92
92
  task_id: builtins.str
93
- """The task ID of the sandbox running the exec'd command."""
93
+ """The ID of the task running the exec'd command."""
94
94
  exec_id: builtins.str
95
95
  """The execution ID of the command to wait on."""
96
96
  def __init__(
@@ -101,10 +101,10 @@ class SandboxExecPollRequest(google.protobuf.message.Message):
101
101
  ) -> None: ...
102
102
  def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "task_id", b"task_id"]) -> None: ...
103
103
 
104
- global___SandboxExecPollRequest = SandboxExecPollRequest
104
+ global___TaskExecPollRequest = TaskExecPollRequest
105
105
 
106
- class SandboxExecPollResponse(google.protobuf.message.Message):
107
- """The response to a SandboxExecPollRequest. If the exec'd command has not
106
+ class TaskExecPollResponse(google.protobuf.message.Message):
107
+ """The response to a TaskExecPollRequest. If the exec'd command has not
108
108
  completed, exit_status will be unset.
109
109
  """
110
110
 
@@ -126,9 +126,9 @@ class SandboxExecPollResponse(google.protobuf.message.Message):
126
126
  def ClearField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> None: ...
127
127
  def WhichOneof(self, oneof_group: typing_extensions.Literal["exit_status", b"exit_status"]) -> typing_extensions.Literal["code", "signal"] | None: ...
128
128
 
129
- global___SandboxExecPollResponse = SandboxExecPollResponse
129
+ global___TaskExecPollResponse = TaskExecPollResponse
130
130
 
131
- class SandboxExecStartRequest(google.protobuf.message.Message):
131
+ class TaskExecStartRequest(google.protobuf.message.Message):
132
132
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
133
133
 
134
134
  TASK_ID_FIELD_NUMBER: builtins.int
@@ -142,21 +142,17 @@ class SandboxExecStartRequest(google.protobuf.message.Message):
142
142
  PTY_INFO_FIELD_NUMBER: builtins.int
143
143
  RUNTIME_DEBUG_FIELD_NUMBER: builtins.int
144
144
  task_id: builtins.str
145
- """The task ID of the sandbox to execute the command in."""
145
+ """The ID of the task to execute the command in."""
146
146
  exec_id: builtins.str
147
147
  """Execution ID. This ID will be used to identify the execution for other
148
148
  requests and ensure exec commands are idempotent.
149
-
150
- TODO(saltzm): Could instead have a separate idempotency key from the exec_id
151
- like present day, and have the server generate the exec_id and return it in
152
- the ExecStartResponse.
153
149
  """
154
150
  @property
155
151
  def command_args(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
156
152
  """Command arguments to execute."""
157
- stdout_config: global___SandboxExecStdoutConfig.ValueType
153
+ stdout_config: global___TaskExecStdoutConfig.ValueType
158
154
  """Configures how the stdout of the command will be handled."""
159
- stderr_config: global___SandboxExecStderrConfig.ValueType
155
+ stderr_config: global___TaskExecStderrConfig.ValueType
160
156
  """Configures how the stderr of the command will be handled."""
161
157
  timeout_secs: builtins.int
162
158
  """Timeout in seconds for the exec'd command to exit. If the command does not
@@ -167,7 +163,7 @@ class SandboxExecStartRequest(google.protobuf.message.Message):
167
163
  """Working directory for the command."""
168
164
  @property
169
165
  def secret_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
170
- """Secret IDs to mount into the sandbox."""
166
+ """Secret IDs to mount into the task."""
171
167
  @property
172
168
  def pty_info(self) -> modal_proto.api_pb2.PTYInfo:
173
169
  """PTY info for the command."""
@@ -181,8 +177,8 @@ class SandboxExecStartRequest(google.protobuf.message.Message):
181
177
  task_id: builtins.str = ...,
182
178
  exec_id: builtins.str = ...,
183
179
  command_args: collections.abc.Iterable[builtins.str] | None = ...,
184
- stdout_config: global___SandboxExecStdoutConfig.ValueType = ...,
185
- stderr_config: global___SandboxExecStderrConfig.ValueType = ...,
180
+ stdout_config: global___TaskExecStdoutConfig.ValueType = ...,
181
+ stderr_config: global___TaskExecStderrConfig.ValueType = ...,
186
182
  timeout_secs: builtins.int | None = ...,
187
183
  workdir: builtins.str | None = ...,
188
184
  secret_ids: collections.abc.Iterable[builtins.str] | None = ...,
@@ -198,18 +194,18 @@ class SandboxExecStartRequest(google.protobuf.message.Message):
198
194
  @typing.overload
199
195
  def WhichOneof(self, oneof_group: typing_extensions.Literal["_workdir", b"_workdir"]) -> typing_extensions.Literal["workdir"] | None: ...
200
196
 
201
- global___SandboxExecStartRequest = SandboxExecStartRequest
197
+ global___TaskExecStartRequest = TaskExecStartRequest
202
198
 
203
- class SandboxExecStartResponse(google.protobuf.message.Message):
199
+ class TaskExecStartResponse(google.protobuf.message.Message):
204
200
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
205
201
 
206
202
  def __init__(
207
203
  self,
208
204
  ) -> None: ...
209
205
 
210
- global___SandboxExecStartResponse = SandboxExecStartResponse
206
+ global___TaskExecStartResponse = TaskExecStartResponse
211
207
 
212
- class SandboxExecStdinWriteRequest(google.protobuf.message.Message):
208
+ class TaskExecStdinWriteRequest(google.protobuf.message.Message):
213
209
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
214
210
 
215
211
  TASK_ID_FIELD_NUMBER: builtins.int
@@ -218,7 +214,7 @@ class SandboxExecStdinWriteRequest(google.protobuf.message.Message):
218
214
  DATA_FIELD_NUMBER: builtins.int
219
215
  EOF_FIELD_NUMBER: builtins.int
220
216
  task_id: builtins.str
221
- """The task ID of the sandbox running the exec'd command."""
217
+ """The ID of the task running the exec'd command."""
222
218
  exec_id: builtins.str
223
219
  """The execution ID of the command to write to."""
224
220
  offset: builtins.int
@@ -241,18 +237,18 @@ class SandboxExecStdinWriteRequest(google.protobuf.message.Message):
241
237
  ) -> None: ...
242
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: ...
243
239
 
244
- global___SandboxExecStdinWriteRequest = SandboxExecStdinWriteRequest
240
+ global___TaskExecStdinWriteRequest = TaskExecStdinWriteRequest
245
241
 
246
- class SandboxExecStdinWriteResponse(google.protobuf.message.Message):
242
+ class TaskExecStdinWriteResponse(google.protobuf.message.Message):
247
243
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
248
244
 
249
245
  def __init__(
250
246
  self,
251
247
  ) -> None: ...
252
248
 
253
- global___SandboxExecStdinWriteResponse = SandboxExecStdinWriteResponse
249
+ global___TaskExecStdinWriteResponse = TaskExecStdinWriteResponse
254
250
 
255
- class SandboxExecStdioReadRequest(google.protobuf.message.Message):
251
+ class TaskExecStdioReadRequest(google.protobuf.message.Message):
256
252
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
257
253
 
258
254
  TASK_ID_FIELD_NUMBER: builtins.int
@@ -260,14 +256,14 @@ class SandboxExecStdioReadRequest(google.protobuf.message.Message):
260
256
  OFFSET_FIELD_NUMBER: builtins.int
261
257
  FILE_DESCRIPTOR_FIELD_NUMBER: builtins.int
262
258
  task_id: builtins.str
263
- """The task ID of the sandbox running the exec'd command."""
259
+ """The ID of the task running the exec'd command."""
264
260
  exec_id: builtins.str
265
261
  """The execution ID of the command to read from."""
266
262
  offset: builtins.int
267
263
  """The offset to start reading from. This is used to resume reading from the
268
264
  last read position if the connection is closed and reopened.
269
265
  """
270
- file_descriptor: global___SandboxExecStdioFileDescriptor.ValueType
266
+ file_descriptor: global___TaskExecStdioFileDescriptor.ValueType
271
267
  """Which file descriptor to read from."""
272
268
  def __init__(
273
269
  self,
@@ -275,13 +271,13 @@ class SandboxExecStdioReadRequest(google.protobuf.message.Message):
275
271
  task_id: builtins.str = ...,
276
272
  exec_id: builtins.str = ...,
277
273
  offset: builtins.int = ...,
278
- file_descriptor: global___SandboxExecStdioFileDescriptor.ValueType = ...,
274
+ file_descriptor: global___TaskExecStdioFileDescriptor.ValueType = ...,
279
275
  ) -> None: ...
280
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: ...
281
277
 
282
- global___SandboxExecStdioReadRequest = SandboxExecStdioReadRequest
278
+ global___TaskExecStdioReadRequest = TaskExecStdioReadRequest
283
279
 
284
- class SandboxExecStdioReadResponse(google.protobuf.message.Message):
280
+ class TaskExecStdioReadResponse(google.protobuf.message.Message):
285
281
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
286
282
 
287
283
  DATA_FIELD_NUMBER: builtins.int
@@ -294,15 +290,15 @@ class SandboxExecStdioReadResponse(google.protobuf.message.Message):
294
290
  ) -> None: ...
295
291
  def ClearField(self, field_name: typing_extensions.Literal["data", b"data"]) -> None: ...
296
292
 
297
- global___SandboxExecStdioReadResponse = SandboxExecStdioReadResponse
293
+ global___TaskExecStdioReadResponse = TaskExecStdioReadResponse
298
294
 
299
- class SandboxExecWaitRequest(google.protobuf.message.Message):
295
+ class TaskExecWaitRequest(google.protobuf.message.Message):
300
296
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
301
297
 
302
298
  TASK_ID_FIELD_NUMBER: builtins.int
303
299
  EXEC_ID_FIELD_NUMBER: builtins.int
304
300
  task_id: builtins.str
305
- """The task ID of the sandbox running the exec'd command."""
301
+ """The ID of the task running the exec'd command."""
306
302
  exec_id: builtins.str
307
303
  """The execution ID of the command to wait on."""
308
304
  def __init__(
@@ -313,9 +309,9 @@ class SandboxExecWaitRequest(google.protobuf.message.Message):
313
309
  ) -> None: ...
314
310
  def ClearField(self, field_name: typing_extensions.Literal["exec_id", b"exec_id", "task_id", b"task_id"]) -> None: ...
315
311
 
316
- global___SandboxExecWaitRequest = SandboxExecWaitRequest
312
+ global___TaskExecWaitRequest = TaskExecWaitRequest
317
313
 
318
- class SandboxExecWaitResponse(google.protobuf.message.Message):
314
+ class TaskExecWaitResponse(google.protobuf.message.Message):
319
315
  DESCRIPTOR: google.protobuf.descriptor.Descriptor
320
316
 
321
317
  CODE_FIELD_NUMBER: builtins.int
@@ -334,4 +330,55 @@ class SandboxExecWaitResponse(google.protobuf.message.Message):
334
330
  def ClearField(self, field_name: typing_extensions.Literal["code", b"code", "exit_status", b"exit_status", "signal", b"signal"]) -> None: ...
335
331
  def WhichOneof(self, oneof_group: typing_extensions.Literal["exit_status", b"exit_status"]) -> typing_extensions.Literal["code", "signal"] | None: ...
336
332
 
337
- 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)