modal 1.1.1.dev9__py3-none-any.whl → 1.1.1.dev11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of modal might be problematic. Click here for more details.
- modal/client.pyi +2 -2
- modal/exception.py +4 -0
- modal/functions.pyi +6 -6
- modal/sandbox.py +17 -7
- modal/sandbox.pyi +6 -6
- {modal-1.1.1.dev9.dist-info → modal-1.1.1.dev11.dist-info}/METADATA +1 -1
- {modal-1.1.1.dev9.dist-info → modal-1.1.1.dev11.dist-info}/RECORD +19 -19
- modal_proto/api.proto +40 -1
- modal_proto/api_grpc.py +32 -0
- modal_proto/api_pb2.py +588 -538
- modal_proto/api_pb2.pyi +140 -5
- modal_proto/api_pb2_grpc.py +67 -0
- modal_proto/api_pb2_grpc.pyi +22 -0
- modal_proto/modal_api_grpc.py +2 -0
- modal_version/__init__.py +1 -1
- {modal-1.1.1.dev9.dist-info → modal-1.1.1.dev11.dist-info}/WHEEL +0 -0
- {modal-1.1.1.dev9.dist-info → modal-1.1.1.dev11.dist-info}/entry_points.txt +0 -0
- {modal-1.1.1.dev9.dist-info → modal-1.1.1.dev11.dist-info}/licenses/LICENSE +0 -0
- {modal-1.1.1.dev9.dist-info → modal-1.1.1.dev11.dist-info}/top_level.txt +0 -0
modal/client.pyi
CHANGED
|
@@ -33,7 +33,7 @@ class _Client:
|
|
|
33
33
|
server_url: str,
|
|
34
34
|
client_type: int,
|
|
35
35
|
credentials: typing.Optional[tuple[str, str]],
|
|
36
|
-
version: str = "1.1.1.
|
|
36
|
+
version: str = "1.1.1.dev11",
|
|
37
37
|
):
|
|
38
38
|
"""mdmd:hidden
|
|
39
39
|
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.1.1.
|
|
166
|
+
version: str = "1.1.1.dev11",
|
|
167
167
|
):
|
|
168
168
|
"""mdmd:hidden
|
|
169
169
|
The Modal client object is not intended to be instantiated directly by users.
|
modal/exception.py
CHANGED
modal/functions.pyi
CHANGED
|
@@ -428,7 +428,7 @@ class Function(
|
|
|
428
428
|
|
|
429
429
|
_call_generator: ___call_generator_spec[typing_extensions.Self]
|
|
430
430
|
|
|
431
|
-
class __remote_spec(typing_extensions.Protocol[
|
|
431
|
+
class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
|
432
432
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER:
|
|
433
433
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
|
434
434
|
...
|
|
@@ -437,7 +437,7 @@ class Function(
|
|
|
437
437
|
"""Calls the function remotely, executing it with the given arguments and returning the execution's result."""
|
|
438
438
|
...
|
|
439
439
|
|
|
440
|
-
remote: __remote_spec[modal._functions.
|
|
440
|
+
remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
|
|
441
441
|
|
|
442
442
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
443
443
|
def __call__(self, /, *args, **kwargs) -> typing.Generator[typing.Any, None, None]:
|
|
@@ -464,7 +464,7 @@ class Function(
|
|
|
464
464
|
"""
|
|
465
465
|
...
|
|
466
466
|
|
|
467
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
|
467
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
|
468
468
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
|
469
469
|
"""[Experimental] Calls the function with the given arguments, without waiting for the results.
|
|
470
470
|
|
|
@@ -488,7 +488,7 @@ class Function(
|
|
|
488
488
|
...
|
|
489
489
|
|
|
490
490
|
_experimental_spawn: ___experimental_spawn_spec[
|
|
491
|
-
modal._functions.
|
|
491
|
+
modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
|
|
492
492
|
]
|
|
493
493
|
|
|
494
494
|
class ___spawn_map_inner_spec(typing_extensions.Protocol[P_INNER, SUPERSELF]):
|
|
@@ -497,7 +497,7 @@ class Function(
|
|
|
497
497
|
|
|
498
498
|
_spawn_map_inner: ___spawn_map_inner_spec[modal._functions.P, typing_extensions.Self]
|
|
499
499
|
|
|
500
|
-
class __spawn_spec(typing_extensions.Protocol[
|
|
500
|
+
class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
|
|
501
501
|
def __call__(self, /, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]:
|
|
502
502
|
"""Calls the function with the given arguments, without waiting for the results.
|
|
503
503
|
|
|
@@ -518,7 +518,7 @@ class Function(
|
|
|
518
518
|
"""
|
|
519
519
|
...
|
|
520
520
|
|
|
521
|
-
spawn: __spawn_spec[modal._functions.
|
|
521
|
+
spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
|
|
522
522
|
|
|
523
523
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]:
|
|
524
524
|
"""Return the inner Python object wrapped by this Modal Function."""
|
modal/sandbox.py
CHANGED
|
@@ -27,7 +27,7 @@ from ._utils.mount_utils import validate_network_file_systems, validate_volumes
|
|
|
27
27
|
from .client import _Client
|
|
28
28
|
from .config import config
|
|
29
29
|
from .container_process import _ContainerProcess
|
|
30
|
-
from .exception import ExecutionError, InvalidError, SandboxTerminatedError, SandboxTimeoutError
|
|
30
|
+
from .exception import AlreadyExistsError, ExecutionError, InvalidError, SandboxTerminatedError, SandboxTimeoutError
|
|
31
31
|
from .file_io import FileWatchEvent, FileWatchEventType, _FileIO
|
|
32
32
|
from .gpu import GPU_T
|
|
33
33
|
from .image import _Image
|
|
@@ -236,7 +236,12 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
236
236
|
)
|
|
237
237
|
|
|
238
238
|
create_req = api_pb2.SandboxCreateRequest(app_id=resolver.app_id, definition=definition)
|
|
239
|
-
|
|
239
|
+
try:
|
|
240
|
+
create_resp = await retry_transient_errors(resolver.client.stub.SandboxCreate, create_req)
|
|
241
|
+
except GRPCError as exc:
|
|
242
|
+
if exc.status == Status.ALREADY_EXISTS:
|
|
243
|
+
raise AlreadyExistsError(exc.message)
|
|
244
|
+
raise exc
|
|
240
245
|
|
|
241
246
|
sandbox_id = create_resp.sandbox_id
|
|
242
247
|
self._hydrate(sandbox_id, resolver.client, None)
|
|
@@ -475,8 +480,8 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
475
480
|
) -> "_Sandbox":
|
|
476
481
|
"""Get a running Sandbox by name from the given app.
|
|
477
482
|
|
|
478
|
-
Raises
|
|
479
|
-
is the `name` argument passed to `Sandbox.create`.
|
|
483
|
+
Raises a modal.exception.NotFoundError if no running sandbox is found with the given name.
|
|
484
|
+
A Sandbox's name is the `name` argument passed to `Sandbox.create`.
|
|
480
485
|
"""
|
|
481
486
|
if client is None:
|
|
482
487
|
client = await _Client.from_env()
|
|
@@ -786,10 +791,15 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
|
786
791
|
sandbox_name_override=name,
|
|
787
792
|
sandbox_name_override_type=api_pb2.SandboxRestoreRequest.SANDBOX_NAME_OVERRIDE_TYPE_STRING,
|
|
788
793
|
)
|
|
794
|
+
try:
|
|
795
|
+
restore_resp: api_pb2.SandboxRestoreResponse = await retry_transient_errors(
|
|
796
|
+
client.stub.SandboxRestore, restore_req
|
|
797
|
+
)
|
|
798
|
+
except GRPCError as exc:
|
|
799
|
+
if exc.status == Status.ALREADY_EXISTS:
|
|
800
|
+
raise AlreadyExistsError(exc.message)
|
|
801
|
+
raise exc
|
|
789
802
|
|
|
790
|
-
restore_resp: api_pb2.SandboxRestoreResponse = await retry_transient_errors(
|
|
791
|
-
client.stub.SandboxRestore, restore_req
|
|
792
|
-
)
|
|
793
803
|
sandbox = await _Sandbox.from_id(restore_resp.sandbox_id, client)
|
|
794
804
|
|
|
795
805
|
task_id_req = api_pb2.SandboxGetTaskIdRequest(
|
modal/sandbox.pyi
CHANGED
|
@@ -178,8 +178,8 @@ class _Sandbox(modal._object._Object):
|
|
|
178
178
|
) -> _Sandbox:
|
|
179
179
|
"""Get a running Sandbox by name from the given app.
|
|
180
180
|
|
|
181
|
-
Raises
|
|
182
|
-
is the `name` argument passed to `Sandbox.create`.
|
|
181
|
+
Raises a modal.exception.NotFoundError if no running sandbox is found with the given name.
|
|
182
|
+
A Sandbox's name is the `name` argument passed to `Sandbox.create`.
|
|
183
183
|
"""
|
|
184
184
|
...
|
|
185
185
|
|
|
@@ -588,8 +588,8 @@ class Sandbox(modal.object.Object):
|
|
|
588
588
|
) -> Sandbox:
|
|
589
589
|
"""Get a running Sandbox by name from the given app.
|
|
590
590
|
|
|
591
|
-
Raises
|
|
592
|
-
is the `name` argument passed to `Sandbox.create`.
|
|
591
|
+
Raises a modal.exception.NotFoundError if no running sandbox is found with the given name.
|
|
592
|
+
A Sandbox's name is the `name` argument passed to `Sandbox.create`.
|
|
593
593
|
"""
|
|
594
594
|
...
|
|
595
595
|
|
|
@@ -604,8 +604,8 @@ class Sandbox(modal.object.Object):
|
|
|
604
604
|
) -> Sandbox:
|
|
605
605
|
"""Get a running Sandbox by name from the given app.
|
|
606
606
|
|
|
607
|
-
Raises
|
|
608
|
-
is the `name` argument passed to `Sandbox.create`.
|
|
607
|
+
Raises a modal.exception.NotFoundError if no running sandbox is found with the given name.
|
|
608
|
+
A Sandbox's name is the `name` argument passed to `Sandbox.create`.
|
|
609
609
|
"""
|
|
610
610
|
...
|
|
611
611
|
|
|
@@ -22,7 +22,7 @@ modal/app.py,sha256=BBR2NmGzZbFGfhKAmtzllD0o4TbVDBbOEs0O2ysSdQo,48277
|
|
|
22
22
|
modal/app.pyi,sha256=h6JtBA6a7wobdZAuS3QuXrWCUZqfyKPuGV3XdjCqT3k,43753
|
|
23
23
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
|
24
24
|
modal/client.py,sha256=pBSZ7lv5dezIL9U9H4tpE0Yz6qA1n0NoNbnJ3KCQMMA,18252
|
|
25
|
-
modal/client.pyi,sha256
|
|
25
|
+
modal/client.pyi,sha256=6XCqQQIWp-h6J59QPjDwBOKKVz3-LFlp1yOskRtdNDI,15390
|
|
26
26
|
modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
|
|
27
27
|
modal/cloud_bucket_mount.pyi,sha256=-qSfYAQvIoO_l2wsCCGTG5ZUwQieNKXdAO00yP1-LYU,7394
|
|
28
28
|
modal/cls.py,sha256=7A0xGnugQzm8dOfnKMjLjtqekRlRtQ0jPFRYgq6xdUM,40018
|
|
@@ -34,12 +34,12 @@ modal/dict.py,sha256=wVIkHPFvR8WDoh5c6jT0UstZYmJTpCTM8drkwwjLiAc,14387
|
|
|
34
34
|
modal/dict.pyi,sha256=gs3J7X5yG3J1L6rW0s3_7yRn8qAfY0f4n5-sqaDZY2g,20853
|
|
35
35
|
modal/environments.py,sha256=gHFNLG78bqgizpQ4w_elz27QOqmcgAonFsmLs7NjUJ4,6804
|
|
36
36
|
modal/environments.pyi,sha256=9-KtrzAcUe55cCP4020lSUD7-fWS7OPakAHssq4-bro,4219
|
|
37
|
-
modal/exception.py,sha256=
|
|
37
|
+
modal/exception.py,sha256=o0V93PK8Hcg2YQ2aeOB1Y-qWBw4Gz5ATfyokR8GapuQ,5634
|
|
38
38
|
modal/file_io.py,sha256=BVqAJ0sgPUfN8QsYztWiGB4j56he60TncM02KsylnCw,21449
|
|
39
39
|
modal/file_io.pyi,sha256=cPT_hsplE5iLCXhYOLn1Sp9eDdk7DxdFmicQHanJZyg,15918
|
|
40
40
|
modal/file_pattern_matcher.py,sha256=urAue8es8jxqX94k9EYoZxxhtfgOlsEES8lbFHOorzc,7734
|
|
41
41
|
modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
|
|
42
|
-
modal/functions.pyi,sha256=
|
|
42
|
+
modal/functions.pyi,sha256=0P4f8ew79lf0lWXObYmNFxKoUPbWmoT0CD5IqGNKFhE,34823
|
|
43
43
|
modal/gpu.py,sha256=Fe5ORvVPDIstSq1xjmM6OoNgLYFWvogP9r5BgmD3hYg,6769
|
|
44
44
|
modal/image.py,sha256=0E3Tge4W3JLS-8dzFy1AVlkdccMhYs3TQkv5kQwv3G0,102368
|
|
45
45
|
modal/image.pyi,sha256=s_AQaFoWmjLzffJGmiedFf9K1qQkedVIlsC6vRtlKS8,68161
|
|
@@ -65,8 +65,8 @@ modal/retries.py,sha256=IvNLDM0f_GLUDD5VgEDoN09C88yoxSrCquinAuxT1Sc,5205
|
|
|
65
65
|
modal/runner.py,sha256=ostdzYpQb-20tlD6dIq7bpWTkZkOhjJBNuMNektqnJA,24068
|
|
66
66
|
modal/runner.pyi,sha256=lbwLljm1cC8d6PcNvmYQhkE8501V9fg0bYqqKX6G4r4,8489
|
|
67
67
|
modal/running_app.py,sha256=v61mapYNV1-O-Uaho5EfJlryMLvIT9We0amUOSvSGx8,1188
|
|
68
|
-
modal/sandbox.py,sha256=
|
|
69
|
-
modal/sandbox.pyi,sha256=
|
|
68
|
+
modal/sandbox.py,sha256=_hAoBwParMzooNUo02LRt-nC5RrTGUtOutyO9oI79Kc,40896
|
|
69
|
+
modal/sandbox.pyi,sha256=GPPlsm-DiSUSgrxyA5bqkpuLlrfgmNR7Z7s3W0QLuQ0,41812
|
|
70
70
|
modal/schedule.py,sha256=ng0g0AqNY5GQI9KhkXZQ5Wam5G42glbkqVQsNpBtbDE,3078
|
|
71
71
|
modal/scheduler_placement.py,sha256=BAREdOY5HzHpzSBqt6jDVR6YC_jYfHMVqOzkyqQfngU,1235
|
|
72
72
|
modal/secret.py,sha256=bpgtv0urwaBOmmJpMTZIwVWUraQlpeu4hW8pbJiGcOA,10546
|
|
@@ -151,7 +151,7 @@ modal/requirements/2025.06.txt,sha256=KxDaVTOwatHvboDo4lorlgJ7-n-MfAwbPwxJ0zcJqr
|
|
|
151
151
|
modal/requirements/PREVIEW.txt,sha256=KxDaVTOwatHvboDo4lorlgJ7-n-MfAwbPwxJ0zcJqrs,312
|
|
152
152
|
modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
|
|
153
153
|
modal/requirements/base-images.json,sha256=JYSDAgHTl-WrV_TZW5icY-IJEnbe2eQ4CZ_KN6EOZKU,1304
|
|
154
|
-
modal-1.1.1.
|
|
154
|
+
modal-1.1.1.dev11.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
|
155
155
|
modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
|
|
156
156
|
modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
|
|
157
157
|
modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
|
|
@@ -159,13 +159,13 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
|
|
|
159
159
|
modal_docs/mdmd/mdmd.py,sha256=eW5MzrEl7mSclDo4Uv64sQ1-4IyLggldbgUJdBVLDdI,6449
|
|
160
160
|
modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
|
|
161
161
|
modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
|
|
162
|
-
modal_proto/api.proto,sha256=
|
|
163
|
-
modal_proto/api_grpc.py,sha256=
|
|
164
|
-
modal_proto/api_pb2.py,sha256=
|
|
165
|
-
modal_proto/api_pb2.pyi,sha256=
|
|
166
|
-
modal_proto/api_pb2_grpc.py,sha256=
|
|
167
|
-
modal_proto/api_pb2_grpc.pyi,sha256=
|
|
168
|
-
modal_proto/modal_api_grpc.py,sha256=
|
|
162
|
+
modal_proto/api.proto,sha256=ffh0G4zLQTKLCT4lSTg8z_ndjIIdk_UuqtQCoTF2yO0,101413
|
|
163
|
+
modal_proto/api_grpc.py,sha256=AL8Z1zlvrsqrxXYEv_mKroJArPV7_8eQ2bMvvswDlTQ,123880
|
|
164
|
+
modal_proto/api_pb2.py,sha256=nDzUdLnJZusqy6WUMBxYOHG-R5mnZgyzdt2AVSbDdR8,355572
|
|
165
|
+
modal_proto/api_pb2.pyi,sha256=1KudI7XZlEzOXBXmYIjQLyqpNJ3c3-fJ5U5lX76W3OE,487293
|
|
166
|
+
modal_proto/api_pb2_grpc.py,sha256=QmhsoHLD9BBXVl3ZpIb-0_sZzpQ1Q9OLBU7ONHHojG4,267607
|
|
167
|
+
modal_proto/api_pb2_grpc.pyi,sha256=Wy6NAO-o06jbQHxvZiMAi08QQT8VHUJcSAmlRRL0p1M,62762
|
|
168
|
+
modal_proto/modal_api_grpc.py,sha256=A622btdK6V3CFaZfXK63ocCUlulKYJsgM-rcEPEFv24,18703
|
|
169
169
|
modal_proto/modal_options_grpc.py,sha256=qJ1cuwA54oRqrdTyPTbvfhFZYd9HhJKK5UCwt523r3Y,120
|
|
170
170
|
modal_proto/options.proto,sha256=zp9h5r61ivsp0XwEWwNBsVqNTbRA1VSY_UtN7sEcHtE,549
|
|
171
171
|
modal_proto/options_grpc.py,sha256=M18X3d-8F_cNYSVM3I25dUTO5rZ0rd-vCCfynfh13Nc,125
|
|
@@ -174,10 +174,10 @@ modal_proto/options_pb2.pyi,sha256=l7DBrbLO7q3Ir-XDkWsajm0d0TQqqrfuX54i4BMpdQg,1
|
|
|
174
174
|
modal_proto/options_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
|
175
175
|
modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0yJSI,247
|
|
176
176
|
modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
177
|
-
modal_version/__init__.py,sha256=
|
|
177
|
+
modal_version/__init__.py,sha256=osH-Mr-vP1BcrvR9tP0Qjq2q-_JHabM7fscFI5ZQQTE,121
|
|
178
178
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
|
179
|
-
modal-1.1.1.
|
|
180
|
-
modal-1.1.1.
|
|
181
|
-
modal-1.1.1.
|
|
182
|
-
modal-1.1.1.
|
|
183
|
-
modal-1.1.1.
|
|
179
|
+
modal-1.1.1.dev11.dist-info/METADATA,sha256=kR_ESJByhSqOoTMn7vBfXXgBK_5tcj3x-dDmE8MAidc,2462
|
|
180
|
+
modal-1.1.1.dev11.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
181
|
+
modal-1.1.1.dev11.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
|
182
|
+
modal-1.1.1.dev11.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
|
|
183
|
+
modal-1.1.1.dev11.dist-info/RECORD,,
|
modal_proto/api.proto
CHANGED
|
@@ -611,7 +611,7 @@ message AttemptStartRequest {
|
|
|
611
611
|
|
|
612
612
|
message AttemptStartResponse {
|
|
613
613
|
string attempt_token = 1;
|
|
614
|
-
FunctionRetryPolicy retry_policy = 2;
|
|
614
|
+
FunctionRetryPolicy retry_policy = 2; // TODO(ben-okeefe) TODO(nathan): Not currently used
|
|
615
615
|
}
|
|
616
616
|
|
|
617
617
|
message AuthTokenGetRequest {
|
|
@@ -1651,6 +1651,7 @@ message FunctionGetInputsItem {
|
|
|
1651
1651
|
string function_call_id = 5;
|
|
1652
1652
|
FunctionCallInvocationType function_call_invocation_type = 6;
|
|
1653
1653
|
uint32 retry_count = 7;
|
|
1654
|
+
optional int32 function_map_idx = 8; // intercepted and only used by the worker.
|
|
1654
1655
|
}
|
|
1655
1656
|
|
|
1656
1657
|
message FunctionGetInputsRequest {
|
|
@@ -1843,6 +1844,8 @@ message FunctionPutOutputsItem {
|
|
|
1843
1844
|
double output_created_at = 4;
|
|
1844
1845
|
DataFormat data_format = 7; // for result.data_oneof
|
|
1845
1846
|
uint32 retry_count = 8;
|
|
1847
|
+
string function_call_id = 9; // injected by the worker
|
|
1848
|
+
optional int32 function_map_idx = 10; // injected by the worker
|
|
1846
1849
|
}
|
|
1847
1850
|
|
|
1848
1851
|
message FunctionPutOutputsRequest {
|
|
@@ -2070,6 +2073,38 @@ message InputInfo {
|
|
|
2070
2073
|
bool task_first_input = 7;
|
|
2071
2074
|
}
|
|
2072
2075
|
|
|
2076
|
+
message MapAwaitRequest {
|
|
2077
|
+
string function_call_id = 1;
|
|
2078
|
+
string last_entry_id = 2;
|
|
2079
|
+
double requested_at = 3; // Used for waypoints.
|
|
2080
|
+
float timeout = 4;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
message MapAwaitResponse {
|
|
2084
|
+
repeated FunctionGetOutputsItem outputs = 1;
|
|
2085
|
+
string last_entry_id = 2;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
message MapStartOrContinueItem {
|
|
2089
|
+
FunctionPutInputsItem input = 1;
|
|
2090
|
+
optional string attempt_token = 2; // None if this is a fresh input, otherwise it is the attempt token for a retry.
|
|
2091
|
+
}
|
|
2092
|
+
|
|
2093
|
+
message MapStartOrContinueRequest {
|
|
2094
|
+
string function_id = 1;
|
|
2095
|
+
string parent_input_id = 2;
|
|
2096
|
+
optional string function_call_id = 3; // This is given iff this is a map continue request.
|
|
2097
|
+
repeated MapStartOrContinueItem items = 4;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
message MapStartOrContinueResponse {
|
|
2101
|
+
string function_id = 1;
|
|
2102
|
+
string function_call_id = 2;
|
|
2103
|
+
uint32 max_inputs_outstanding = 3;
|
|
2104
|
+
repeated string attempt_tokens = 4;
|
|
2105
|
+
FunctionRetryPolicy retry_policy = 5; // TODO(ben-okeefe): Not currently used
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2073
2108
|
message MethodDefinition {
|
|
2074
2109
|
string function_name = 1;
|
|
2075
2110
|
Function.FunctionType function_type = 2;
|
|
@@ -3397,6 +3432,10 @@ service ModalClient {
|
|
|
3397
3432
|
rpc ImageGetOrCreate(ImageGetOrCreateRequest) returns (ImageGetOrCreateResponse);
|
|
3398
3433
|
rpc ImageJoinStreaming(ImageJoinStreamingRequest) returns (stream ImageJoinStreamingResponse);
|
|
3399
3434
|
|
|
3435
|
+
// Input Plane Map
|
|
3436
|
+
rpc MapAwait(MapAwaitRequest) returns (MapAwaitResponse);
|
|
3437
|
+
rpc MapStartOrContinue(MapStartOrContinueRequest) returns (MapStartOrContinueResponse);
|
|
3438
|
+
|
|
3400
3439
|
// Mounts
|
|
3401
3440
|
rpc MountGetOrCreate(MountGetOrCreateRequest) returns (MountGetOrCreateResponse);
|
|
3402
3441
|
rpc MountPutFile(MountPutFileRequest) returns (MountPutFileResponse);
|
modal_proto/api_grpc.py
CHANGED
|
@@ -362,6 +362,14 @@ class ModalClientBase(abc.ABC):
|
|
|
362
362
|
async def ImageJoinStreaming(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.ImageJoinStreamingRequest, modal_proto.api_pb2.ImageJoinStreamingResponse]') -> None:
|
|
363
363
|
pass
|
|
364
364
|
|
|
365
|
+
@abc.abstractmethod
|
|
366
|
+
async def MapAwait(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.MapAwaitRequest, modal_proto.api_pb2.MapAwaitResponse]') -> None:
|
|
367
|
+
pass
|
|
368
|
+
|
|
369
|
+
@abc.abstractmethod
|
|
370
|
+
async def MapStartOrContinue(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.MapStartOrContinueRequest, modal_proto.api_pb2.MapStartOrContinueResponse]') -> None:
|
|
371
|
+
pass
|
|
372
|
+
|
|
365
373
|
@abc.abstractmethod
|
|
366
374
|
async def MountGetOrCreate(self, stream: 'grpclib.server.Stream[modal_proto.api_pb2.MountGetOrCreateRequest, modal_proto.api_pb2.MountGetOrCreateResponse]') -> None:
|
|
367
375
|
pass
|
|
@@ -1172,6 +1180,18 @@ class ModalClientBase(abc.ABC):
|
|
|
1172
1180
|
modal_proto.api_pb2.ImageJoinStreamingRequest,
|
|
1173
1181
|
modal_proto.api_pb2.ImageJoinStreamingResponse,
|
|
1174
1182
|
),
|
|
1183
|
+
'/modal.client.ModalClient/MapAwait': grpclib.const.Handler(
|
|
1184
|
+
self.MapAwait,
|
|
1185
|
+
grpclib.const.Cardinality.UNARY_UNARY,
|
|
1186
|
+
modal_proto.api_pb2.MapAwaitRequest,
|
|
1187
|
+
modal_proto.api_pb2.MapAwaitResponse,
|
|
1188
|
+
),
|
|
1189
|
+
'/modal.client.ModalClient/MapStartOrContinue': grpclib.const.Handler(
|
|
1190
|
+
self.MapStartOrContinue,
|
|
1191
|
+
grpclib.const.Cardinality.UNARY_UNARY,
|
|
1192
|
+
modal_proto.api_pb2.MapStartOrContinueRequest,
|
|
1193
|
+
modal_proto.api_pb2.MapStartOrContinueResponse,
|
|
1194
|
+
),
|
|
1175
1195
|
'/modal.client.ModalClient/MountGetOrCreate': grpclib.const.Handler(
|
|
1176
1196
|
self.MountGetOrCreate,
|
|
1177
1197
|
grpclib.const.Cardinality.UNARY_UNARY,
|
|
@@ -2132,6 +2152,18 @@ class ModalClientStub:
|
|
|
2132
2152
|
modal_proto.api_pb2.ImageJoinStreamingRequest,
|
|
2133
2153
|
modal_proto.api_pb2.ImageJoinStreamingResponse,
|
|
2134
2154
|
)
|
|
2155
|
+
self.MapAwait = grpclib.client.UnaryUnaryMethod(
|
|
2156
|
+
channel,
|
|
2157
|
+
'/modal.client.ModalClient/MapAwait',
|
|
2158
|
+
modal_proto.api_pb2.MapAwaitRequest,
|
|
2159
|
+
modal_proto.api_pb2.MapAwaitResponse,
|
|
2160
|
+
)
|
|
2161
|
+
self.MapStartOrContinue = grpclib.client.UnaryUnaryMethod(
|
|
2162
|
+
channel,
|
|
2163
|
+
'/modal.client.ModalClient/MapStartOrContinue',
|
|
2164
|
+
modal_proto.api_pb2.MapStartOrContinueRequest,
|
|
2165
|
+
modal_proto.api_pb2.MapStartOrContinueResponse,
|
|
2166
|
+
)
|
|
2135
2167
|
self.MountGetOrCreate = grpclib.client.UnaryUnaryMethod(
|
|
2136
2168
|
channel,
|
|
2137
2169
|
'/modal.client.ModalClient/MountGetOrCreate',
|