modal 1.0.6.dev58__py3-none-any.whl → 1.2.3.dev7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of modal might be problematic. Click here for more details.
- modal/__main__.py +3 -4
- modal/_billing.py +80 -0
- modal/_clustered_functions.py +7 -3
- modal/_clustered_functions.pyi +4 -2
- modal/_container_entrypoint.py +41 -49
- modal/_functions.py +424 -195
- modal/_grpc_client.py +171 -0
- modal/_load_context.py +105 -0
- modal/_object.py +68 -20
- modal/_output.py +58 -45
- modal/_partial_function.py +36 -11
- modal/_pty.py +7 -3
- modal/_resolver.py +21 -35
- modal/_runtime/asgi.py +4 -3
- modal/_runtime/container_io_manager.py +301 -186
- modal/_runtime/container_io_manager.pyi +70 -61
- modal/_runtime/execution_context.py +18 -2
- modal/_runtime/execution_context.pyi +4 -1
- modal/_runtime/gpu_memory_snapshot.py +170 -63
- modal/_runtime/user_code_imports.py +28 -58
- modal/_serialization.py +57 -1
- modal/_utils/async_utils.py +33 -12
- modal/_utils/auth_token_manager.py +2 -5
- modal/_utils/blob_utils.py +110 -53
- modal/_utils/function_utils.py +49 -42
- modal/_utils/grpc_utils.py +80 -50
- modal/_utils/mount_utils.py +26 -1
- modal/_utils/name_utils.py +17 -3
- modal/_utils/task_command_router_client.py +536 -0
- modal/_utils/time_utils.py +34 -6
- modal/app.py +219 -83
- modal/app.pyi +229 -56
- modal/billing.py +5 -0
- modal/{requirements → builder}/2025.06.txt +1 -0
- modal/{requirements → builder}/PREVIEW.txt +1 -0
- modal/cli/_download.py +19 -3
- modal/cli/_traceback.py +3 -2
- modal/cli/app.py +4 -4
- modal/cli/cluster.py +15 -7
- modal/cli/config.py +5 -3
- modal/cli/container.py +7 -6
- modal/cli/dict.py +22 -16
- modal/cli/entry_point.py +12 -5
- modal/cli/environment.py +5 -4
- modal/cli/import_refs.py +3 -3
- modal/cli/launch.py +102 -5
- modal/cli/network_file_system.py +9 -13
- modal/cli/profile.py +3 -2
- modal/cli/programs/launch_instance_ssh.py +94 -0
- modal/cli/programs/run_jupyter.py +1 -1
- modal/cli/programs/run_marimo.py +95 -0
- modal/cli/programs/vscode.py +1 -1
- modal/cli/queues.py +57 -26
- modal/cli/run.py +58 -16
- modal/cli/secret.py +48 -22
- modal/cli/utils.py +3 -4
- modal/cli/volume.py +28 -25
- modal/client.py +13 -116
- modal/client.pyi +9 -91
- modal/cloud_bucket_mount.py +5 -3
- modal/cloud_bucket_mount.pyi +5 -1
- modal/cls.py +130 -102
- modal/cls.pyi +45 -85
- modal/config.py +29 -10
- modal/container_process.py +291 -13
- modal/container_process.pyi +95 -32
- modal/dict.py +282 -63
- modal/dict.pyi +423 -73
- modal/environments.py +15 -27
- modal/environments.pyi +5 -15
- modal/exception.py +8 -0
- modal/experimental/__init__.py +143 -38
- modal/experimental/flash.py +247 -78
- modal/experimental/flash.pyi +137 -9
- modal/file_io.py +14 -28
- modal/file_io.pyi +2 -2
- modal/file_pattern_matcher.py +25 -16
- modal/functions.pyi +134 -61
- modal/image.py +255 -86
- modal/image.pyi +300 -62
- modal/io_streams.py +436 -126
- modal/io_streams.pyi +236 -171
- modal/mount.py +62 -157
- modal/mount.pyi +45 -172
- modal/network_file_system.py +30 -53
- modal/network_file_system.pyi +16 -76
- modal/object.pyi +42 -8
- modal/parallel_map.py +821 -113
- modal/parallel_map.pyi +134 -0
- modal/partial_function.pyi +4 -1
- modal/proxy.py +16 -7
- modal/proxy.pyi +10 -2
- modal/queue.py +263 -61
- modal/queue.pyi +409 -66
- modal/runner.py +112 -92
- modal/runner.pyi +45 -27
- modal/sandbox.py +451 -124
- modal/sandbox.pyi +513 -67
- modal/secret.py +291 -67
- modal/secret.pyi +425 -19
- modal/serving.py +7 -11
- modal/serving.pyi +7 -8
- modal/snapshot.py +11 -8
- modal/token_flow.py +4 -4
- modal/volume.py +344 -98
- modal/volume.pyi +464 -68
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/METADATA +9 -8
- modal-1.2.3.dev7.dist-info/RECORD +195 -0
- modal_docs/mdmd/mdmd.py +11 -1
- modal_proto/api.proto +399 -67
- modal_proto/api_grpc.py +241 -1
- modal_proto/api_pb2.py +1395 -1000
- modal_proto/api_pb2.pyi +1239 -79
- modal_proto/api_pb2_grpc.py +499 -4
- modal_proto/api_pb2_grpc.pyi +162 -14
- modal_proto/modal_api_grpc.py +175 -160
- modal_proto/sandbox_router.proto +145 -0
- modal_proto/sandbox_router_grpc.py +105 -0
- modal_proto/sandbox_router_pb2.py +149 -0
- modal_proto/sandbox_router_pb2.pyi +333 -0
- modal_proto/sandbox_router_pb2_grpc.py +203 -0
- modal_proto/sandbox_router_pb2_grpc.pyi +75 -0
- modal_proto/task_command_router.proto +144 -0
- modal_proto/task_command_router_grpc.py +105 -0
- modal_proto/task_command_router_pb2.py +149 -0
- modal_proto/task_command_router_pb2.pyi +333 -0
- modal_proto/task_command_router_pb2_grpc.py +203 -0
- modal_proto/task_command_router_pb2_grpc.pyi +75 -0
- modal_version/__init__.py +1 -1
- modal-1.0.6.dev58.dist-info/RECORD +0 -183
- modal_proto/modal_options_grpc.py +0 -3
- modal_proto/options.proto +0 -19
- modal_proto/options_grpc.py +0 -3
- modal_proto/options_pb2.py +0 -35
- modal_proto/options_pb2.pyi +0 -20
- modal_proto/options_pb2_grpc.py +0 -4
- modal_proto/options_pb2_grpc.pyi +0 -7
- /modal/{requirements → builder}/2023.12.312.txt +0 -0
- /modal/{requirements → builder}/2023.12.txt +0 -0
- /modal/{requirements → builder}/2024.04.txt +0 -0
- /modal/{requirements → builder}/2024.10.txt +0 -0
- /modal/{requirements → builder}/README.md +0 -0
- /modal/{requirements → builder}/base-images.json +0 -0
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/WHEEL +0 -0
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/entry_points.txt +0 -0
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/licenses/LICENSE +0 -0
- {modal-1.0.6.dev58.dist-info → modal-1.2.3.dev7.dist-info}/top_level.txt +0 -0
modal/runner.pyi
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import modal.
|
|
1
|
+
import modal._load_context
|
|
2
|
+
import modal.app
|
|
2
3
|
import modal.client
|
|
3
|
-
import modal.cls
|
|
4
4
|
import modal.running_app
|
|
5
5
|
import modal_proto.api_pb2
|
|
6
6
|
import multiprocessing.synchronize
|
|
@@ -8,8 +8,6 @@ import synchronicity.combined_types
|
|
|
8
8
|
import typing
|
|
9
9
|
import typing_extensions
|
|
10
10
|
|
|
11
|
-
_App = typing.TypeVar("_App")
|
|
12
|
-
|
|
13
11
|
V = typing.TypeVar("V")
|
|
14
12
|
|
|
15
13
|
async def _heartbeat(client: modal.client._Client, app_id: str) -> None: ...
|
|
@@ -19,19 +17,18 @@ async def _init_local_app_existing(
|
|
|
19
17
|
async def _init_local_app_new(
|
|
20
18
|
client: modal.client._Client,
|
|
21
19
|
description: str,
|
|
20
|
+
tags: dict[str, str],
|
|
22
21
|
app_state: int,
|
|
23
22
|
environment_name: str = "",
|
|
24
23
|
interactive: bool = False,
|
|
25
24
|
) -> modal.running_app.RunningApp: ...
|
|
26
25
|
async def _init_local_app_from_name(
|
|
27
|
-
client: modal.client._Client, name: str, environment_name: str = ""
|
|
26
|
+
client: modal.client._Client, name: str, tags: dict[str, str], environment_name: str = ""
|
|
28
27
|
) -> modal.running_app.RunningApp: ...
|
|
29
28
|
async def _create_all_objects(
|
|
30
|
-
client: modal.client._Client,
|
|
31
29
|
running_app: modal.running_app.RunningApp,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
environment_name: str,
|
|
30
|
+
local_app_state: modal.app._LocalAppState,
|
|
31
|
+
load_context: modal._load_context.LoadContext,
|
|
35
32
|
) -> None:
|
|
36
33
|
"""Create objects that have been defined but not created on the server."""
|
|
37
34
|
...
|
|
@@ -40,10 +37,9 @@ async def _publish_app(
|
|
|
40
37
|
client: modal.client._Client,
|
|
41
38
|
running_app: modal.running_app.RunningApp,
|
|
42
39
|
app_state: int,
|
|
43
|
-
|
|
44
|
-
classes: dict[str, modal.cls._Cls],
|
|
40
|
+
app_local_state: modal.app._LocalAppState,
|
|
45
41
|
name: str = "",
|
|
46
|
-
|
|
42
|
+
deployment_tag: str = "",
|
|
47
43
|
commit_info: typing.Optional[modal_proto.api_pb2.CommitInfo] = None,
|
|
48
44
|
) -> tuple[str, list[modal_proto.api_pb2.Warning]]:
|
|
49
45
|
"""Wrapper for AppPublish RPC."""
|
|
@@ -65,18 +61,18 @@ async def _status_based_disconnect(
|
|
|
65
61
|
...
|
|
66
62
|
|
|
67
63
|
def _run_app(
|
|
68
|
-
app: _App,
|
|
64
|
+
app: modal.app._App,
|
|
69
65
|
*,
|
|
70
66
|
client: typing.Optional[modal.client._Client] = None,
|
|
71
67
|
detach: bool = False,
|
|
72
68
|
environment_name: typing.Optional[str] = None,
|
|
73
69
|
interactive: bool = False,
|
|
74
|
-
) -> typing.AsyncContextManager[_App]:
|
|
70
|
+
) -> typing.AsyncContextManager[modal.app._App]:
|
|
75
71
|
"""mdmd:hidden"""
|
|
76
72
|
...
|
|
77
73
|
|
|
78
74
|
async def _serve_update(
|
|
79
|
-
app: _App, existing_app_id: str, is_ready: multiprocessing.synchronize.Event, environment_name: str
|
|
75
|
+
app: modal.app._App, existing_app_id: str, is_ready: multiprocessing.synchronize.Event, environment_name: str
|
|
80
76
|
) -> None:
|
|
81
77
|
"""mdmd:hidden"""
|
|
82
78
|
...
|
|
@@ -114,7 +110,7 @@ class DeployResult:
|
|
|
114
110
|
...
|
|
115
111
|
|
|
116
112
|
async def _deploy_app(
|
|
117
|
-
app: _App,
|
|
113
|
+
app: modal.app._App,
|
|
118
114
|
name: typing.Optional[str] = None,
|
|
119
115
|
namespace: typing.Any = None,
|
|
120
116
|
client: typing.Optional[modal.client._Client] = None,
|
|
@@ -128,7 +124,7 @@ async def _deploy_app(
|
|
|
128
124
|
...
|
|
129
125
|
|
|
130
126
|
async def _interactive_shell(
|
|
131
|
-
_app: _App, cmds: list[str], environment_name: str = "", pty: bool = True, **kwargs: typing.Any
|
|
127
|
+
_app: modal.app._App, cmds: list[str], environment_name: str = "", pty: bool = True, **kwargs: typing.Any
|
|
132
128
|
) -> None:
|
|
133
129
|
"""Run an interactive shell (like `bash`) within the image for this app.
|
|
134
130
|
|
|
@@ -158,26 +154,26 @@ class __run_app_spec(typing_extensions.Protocol):
|
|
|
158
154
|
def __call__(
|
|
159
155
|
self,
|
|
160
156
|
/,
|
|
161
|
-
app:
|
|
157
|
+
app: modal.app.App,
|
|
162
158
|
*,
|
|
163
159
|
client: typing.Optional[modal.client.Client] = None,
|
|
164
160
|
detach: bool = False,
|
|
165
161
|
environment_name: typing.Optional[str] = None,
|
|
166
162
|
interactive: bool = False,
|
|
167
|
-
) -> synchronicity.combined_types.AsyncAndBlockingContextManager[
|
|
163
|
+
) -> synchronicity.combined_types.AsyncAndBlockingContextManager[modal.app.App]:
|
|
168
164
|
"""mdmd:hidden"""
|
|
169
165
|
...
|
|
170
166
|
|
|
171
167
|
def aio(
|
|
172
168
|
self,
|
|
173
169
|
/,
|
|
174
|
-
app:
|
|
170
|
+
app: modal.app.App,
|
|
175
171
|
*,
|
|
176
172
|
client: typing.Optional[modal.client.Client] = None,
|
|
177
173
|
detach: bool = False,
|
|
178
174
|
environment_name: typing.Optional[str] = None,
|
|
179
175
|
interactive: bool = False,
|
|
180
|
-
) -> typing.AsyncContextManager[
|
|
176
|
+
) -> typing.AsyncContextManager[modal.app.App]:
|
|
181
177
|
"""mdmd:hidden"""
|
|
182
178
|
...
|
|
183
179
|
|
|
@@ -185,13 +181,23 @@ run_app: __run_app_spec
|
|
|
185
181
|
|
|
186
182
|
class __serve_update_spec(typing_extensions.Protocol):
|
|
187
183
|
def __call__(
|
|
188
|
-
self,
|
|
184
|
+
self,
|
|
185
|
+
/,
|
|
186
|
+
app: modal.app.App,
|
|
187
|
+
existing_app_id: str,
|
|
188
|
+
is_ready: multiprocessing.synchronize.Event,
|
|
189
|
+
environment_name: str,
|
|
189
190
|
) -> None:
|
|
190
191
|
"""mdmd:hidden"""
|
|
191
192
|
...
|
|
192
193
|
|
|
193
194
|
async def aio(
|
|
194
|
-
self,
|
|
195
|
+
self,
|
|
196
|
+
/,
|
|
197
|
+
app: modal.app.App,
|
|
198
|
+
existing_app_id: str,
|
|
199
|
+
is_ready: multiprocessing.synchronize.Event,
|
|
200
|
+
environment_name: str,
|
|
195
201
|
) -> None:
|
|
196
202
|
"""mdmd:hidden"""
|
|
197
203
|
...
|
|
@@ -202,7 +208,7 @@ class __deploy_app_spec(typing_extensions.Protocol):
|
|
|
202
208
|
def __call__(
|
|
203
209
|
self,
|
|
204
210
|
/,
|
|
205
|
-
app:
|
|
211
|
+
app: modal.app.App,
|
|
206
212
|
name: typing.Optional[str] = None,
|
|
207
213
|
namespace: typing.Any = None,
|
|
208
214
|
client: typing.Optional[modal.client.Client] = None,
|
|
@@ -218,7 +224,7 @@ class __deploy_app_spec(typing_extensions.Protocol):
|
|
|
218
224
|
async def aio(
|
|
219
225
|
self,
|
|
220
226
|
/,
|
|
221
|
-
app:
|
|
227
|
+
app: modal.app.App,
|
|
222
228
|
name: typing.Optional[str] = None,
|
|
223
229
|
namespace: typing.Any = None,
|
|
224
230
|
client: typing.Optional[modal.client.Client] = None,
|
|
@@ -235,7 +241,13 @@ deploy_app: __deploy_app_spec
|
|
|
235
241
|
|
|
236
242
|
class __interactive_shell_spec(typing_extensions.Protocol):
|
|
237
243
|
def __call__(
|
|
238
|
-
self,
|
|
244
|
+
self,
|
|
245
|
+
/,
|
|
246
|
+
_app: modal.app.App,
|
|
247
|
+
cmds: list[str],
|
|
248
|
+
environment_name: str = "",
|
|
249
|
+
pty: bool = True,
|
|
250
|
+
**kwargs: typing.Any,
|
|
239
251
|
) -> None:
|
|
240
252
|
"""Run an interactive shell (like `bash`) within the image for this app.
|
|
241
253
|
|
|
@@ -262,7 +274,13 @@ class __interactive_shell_spec(typing_extensions.Protocol):
|
|
|
262
274
|
...
|
|
263
275
|
|
|
264
276
|
async def aio(
|
|
265
|
-
self,
|
|
277
|
+
self,
|
|
278
|
+
/,
|
|
279
|
+
_app: modal.app.App,
|
|
280
|
+
cmds: list[str],
|
|
281
|
+
environment_name: str = "",
|
|
282
|
+
pty: bool = True,
|
|
283
|
+
**kwargs: typing.Any,
|
|
266
284
|
) -> None:
|
|
267
285
|
"""Run an interactive shell (like `bash`) within the image for this app.
|
|
268
286
|
|