modal 0.66.14__py3-none-any.whl → 0.66.39__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modal/__init__.py +1 -1
- modal/_container_entrypoint.py +27 -358
- modal/_runtime/__init__.py +1 -0
- modal/{_asgi.py → _runtime/asgi.py} +8 -7
- modal/{_container_io_manager.py → _runtime/container_io_manager.py} +18 -27
- modal/{execution_context.py → _runtime/execution_context.py} +2 -1
- modal/{_telemetry.py → _runtime/telemetry.py} +1 -1
- modal/_runtime/user_code_imports.py +361 -0
- modal/_serialization.py +1 -1
- modal/_utils/function_utils.py +28 -8
- modal/app.py +13 -46
- modal/cli/import_refs.py +4 -38
- modal/client.pyi +2 -2
- modal/dict.py +0 -6
- modal/dict.pyi +0 -4
- modal/experimental.py +1 -4
- modal/functions.py +11 -10
- modal/functions.pyi +8 -8
- modal/gpu.py +8 -6
- modal/image.py +93 -6
- modal/image.pyi +20 -2
- modal/io_streams.py +32 -12
- modal/io_streams.pyi +8 -4
- modal/mount.py +3 -2
- modal/network_file_system.py +0 -28
- modal/network_file_system.pyi +0 -14
- modal/parallel_map.py +1 -1
- modal/partial_function.py +11 -1
- modal/queue.py +0 -6
- modal/queue.pyi +0 -4
- modal/runner.py +1 -1
- modal/sandbox.py +1 -1
- modal/secret.py +1 -1
- modal/volume.py +0 -22
- modal/volume.pyi +0 -9
- {modal-0.66.14.dist-info → modal-0.66.39.dist-info}/METADATA +1 -2
- {modal-0.66.14.dist-info → modal-0.66.39.dist-info}/RECORD +49 -49
- modal_proto/api.proto +2 -21
- modal_proto/api_grpc.py +0 -16
- modal_proto/api_pb2.py +702 -726
- modal_proto/api_pb2.pyi +6 -60
- modal_proto/api_pb2_grpc.py +0 -33
- modal_proto/api_pb2_grpc.pyi +0 -10
- modal_proto/modal_api_grpc.py +0 -1
- modal_version/_version_generated.py +1 -1
- modal/_container_io_manager.pyi +0 -414
- modal/execution_context.pyi +0 -22
- {modal-0.66.14.dist-info → modal-0.66.39.dist-info}/LICENSE +0 -0
- {modal-0.66.14.dist-info → modal-0.66.39.dist-info}/WHEEL +0 -0
- {modal-0.66.14.dist-info → modal-0.66.39.dist-info}/entry_points.txt +0 -0
- {modal-0.66.14.dist-info → modal-0.66.39.dist-info}/top_level.txt +0 -0
modal_proto/api_pb2.pyi
CHANGED
@@ -375,23 +375,6 @@ GPU_TYPE_H100: GPUType.ValueType # 10
|
|
375
375
|
GPU_TYPE_L40S: GPUType.ValueType # 11
|
376
376
|
global___GPUType = GPUType
|
377
377
|
|
378
|
-
class _InstrumentationType:
|
379
|
-
ValueType = typing.NewType("ValueType", builtins.int)
|
380
|
-
V: typing_extensions.TypeAlias = ValueType
|
381
|
-
|
382
|
-
class _InstrumentationTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_InstrumentationType.ValueType], builtins.type): # noqa: F821
|
383
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
384
|
-
INSTRUMENTATION_TYPE_UNSPECIFIED: _InstrumentationType.ValueType # 0
|
385
|
-
INSTRUMENTATION_TYPE_METRICS: _InstrumentationType.ValueType # 1
|
386
|
-
INSTRUMENTATION_TYPE_TRACE: _InstrumentationType.ValueType # 2
|
387
|
-
|
388
|
-
class InstrumentationType(_InstrumentationType, metaclass=_InstrumentationTypeEnumTypeWrapper): ...
|
389
|
-
|
390
|
-
INSTRUMENTATION_TYPE_UNSPECIFIED: InstrumentationType.ValueType # 0
|
391
|
-
INSTRUMENTATION_TYPE_METRICS: InstrumentationType.ValueType # 1
|
392
|
-
INSTRUMENTATION_TYPE_TRACE: InstrumentationType.ValueType # 2
|
393
|
-
global___InstrumentationType = InstrumentationType
|
394
|
-
|
395
378
|
class _ObjectCreationType:
|
396
379
|
ValueType = typing.NewType("ValueType", builtins.int)
|
397
380
|
V: typing_extensions.TypeAlias = ValueType
|
@@ -650,24 +633,6 @@ TASK_STATE_PREEMPTED: TaskState.ValueType # 10
|
|
650
633
|
TASK_STATE_LOADING_CHECKPOINT_IMAGE: TaskState.ValueType # 11
|
651
634
|
global___TaskState = TaskState
|
652
635
|
|
653
|
-
class _TelemetryEncodingType:
|
654
|
-
ValueType = typing.NewType("ValueType", builtins.int)
|
655
|
-
V: typing_extensions.TypeAlias = ValueType
|
656
|
-
|
657
|
-
class _TelemetryEncodingTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TelemetryEncodingType.ValueType], builtins.type): # noqa: F821
|
658
|
-
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
659
|
-
TELEMETRY_ENCODING_TYPE_UNSPECIFIED: _TelemetryEncodingType.ValueType # 0
|
660
|
-
TELEMETRY_ENCODING_TYPE_PROTOBUF: _TelemetryEncodingType.ValueType # 1
|
661
|
-
TELEMETRY_ENCODING_TYPE_JSON: _TelemetryEncodingType.ValueType # 2
|
662
|
-
|
663
|
-
class TelemetryEncodingType(_TelemetryEncodingType, metaclass=_TelemetryEncodingTypeEnumTypeWrapper):
|
664
|
-
"""Encoding type used for user telemetry data."""
|
665
|
-
|
666
|
-
TELEMETRY_ENCODING_TYPE_UNSPECIFIED: TelemetryEncodingType.ValueType # 0
|
667
|
-
TELEMETRY_ENCODING_TYPE_PROTOBUF: TelemetryEncodingType.ValueType # 1
|
668
|
-
TELEMETRY_ENCODING_TYPE_JSON: TelemetryEncodingType.ValueType # 2
|
669
|
-
global___TelemetryEncodingType = TelemetryEncodingType
|
670
|
-
|
671
636
|
class _VolumeFsVersion:
|
672
637
|
ValueType = typing.NewType("ValueType", builtins.int)
|
673
638
|
V: typing_extensions.TypeAlias = ValueType
|
@@ -1312,7 +1277,6 @@ class AppSetObjectsRequest(google.protobuf.message.Message):
|
|
1312
1277
|
CLIENT_ID_FIELD_NUMBER: builtins.int
|
1313
1278
|
UNINDEXED_OBJECT_IDS_FIELD_NUMBER: builtins.int
|
1314
1279
|
NEW_APP_STATE_FIELD_NUMBER: builtins.int
|
1315
|
-
SINGLE_OBJECT_ID_FIELD_NUMBER: builtins.int
|
1316
1280
|
app_id: builtins.str
|
1317
1281
|
@property
|
1318
1282
|
def indexed_object_ids(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: ...
|
@@ -1321,7 +1285,6 @@ class AppSetObjectsRequest(google.protobuf.message.Message):
|
|
1321
1285
|
def unindexed_object_ids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
|
1322
1286
|
new_app_state: global___AppState.ValueType
|
1323
1287
|
"""promotes an app from initializing to this new state"""
|
1324
|
-
single_object_id: builtins.str
|
1325
1288
|
def __init__(
|
1326
1289
|
self,
|
1327
1290
|
*,
|
@@ -1330,9 +1293,8 @@ class AppSetObjectsRequest(google.protobuf.message.Message):
|
|
1330
1293
|
client_id: builtins.str = ...,
|
1331
1294
|
unindexed_object_ids: collections.abc.Iterable[builtins.str] | None = ...,
|
1332
1295
|
new_app_state: global___AppState.ValueType = ...,
|
1333
|
-
single_object_id: builtins.str = ...,
|
1334
1296
|
) -> None: ...
|
1335
|
-
def ClearField(self, field_name: typing_extensions.Literal["app_id", b"app_id", "client_id", b"client_id", "indexed_object_ids", b"indexed_object_ids", "new_app_state", b"new_app_state", "
|
1297
|
+
def ClearField(self, field_name: typing_extensions.Literal["app_id", b"app_id", "client_id", b"client_id", "indexed_object_ids", b"indexed_object_ids", "new_app_state", b"new_app_state", "unindexed_object_ids", b"unindexed_object_ids"]) -> None: ...
|
1336
1298
|
|
1337
1299
|
global___AppSetObjectsRequest = AppSetObjectsRequest
|
1338
1300
|
|
@@ -4999,26 +4961,6 @@ class FunctionPutOutputsRequest(google.protobuf.message.Message):
|
|
4999
4961
|
|
5000
4962
|
global___FunctionPutOutputsRequest = FunctionPutOutputsRequest
|
5001
4963
|
|
5002
|
-
class FunctionPutUserTelemetryRequest(google.protobuf.message.Message):
|
5003
|
-
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
5004
|
-
|
5005
|
-
DATA_FIELD_NUMBER: builtins.int
|
5006
|
-
ENCODING_TYPE_FIELD_NUMBER: builtins.int
|
5007
|
-
INSTRUMENTATION_TYPE_FIELD_NUMBER: builtins.int
|
5008
|
-
data: builtins.bytes
|
5009
|
-
encoding_type: global___TelemetryEncodingType.ValueType
|
5010
|
-
instrumentation_type: global___InstrumentationType.ValueType
|
5011
|
-
def __init__(
|
5012
|
-
self,
|
5013
|
-
*,
|
5014
|
-
data: builtins.bytes = ...,
|
5015
|
-
encoding_type: global___TelemetryEncodingType.ValueType = ...,
|
5016
|
-
instrumentation_type: global___InstrumentationType.ValueType = ...,
|
5017
|
-
) -> None: ...
|
5018
|
-
def ClearField(self, field_name: typing_extensions.Literal["data", b"data", "encoding_type", b"encoding_type", "instrumentation_type", b"instrumentation_type"]) -> None: ...
|
5019
|
-
|
5020
|
-
global___FunctionPutUserTelemetryRequest = FunctionPutUserTelemetryRequest
|
5021
|
-
|
5022
4964
|
class FunctionRetryInputsItem(google.protobuf.message.Message):
|
5023
4965
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
5024
4966
|
|
@@ -5605,6 +5547,7 @@ class MethodDefinition(google.protobuf.message.Message):
|
|
5605
5547
|
WEBHOOK_CONFIG_FIELD_NUMBER: builtins.int
|
5606
5548
|
WEB_URL_FIELD_NUMBER: builtins.int
|
5607
5549
|
WEB_URL_INFO_FIELD_NUMBER: builtins.int
|
5550
|
+
CUSTOM_DOMAIN_INFO_FIELD_NUMBER: builtins.int
|
5608
5551
|
function_name: builtins.str
|
5609
5552
|
function_type: global___Function.FunctionType.ValueType
|
5610
5553
|
@property
|
@@ -5612,6 +5555,8 @@ class MethodDefinition(google.protobuf.message.Message):
|
|
5612
5555
|
web_url: builtins.str
|
5613
5556
|
@property
|
5614
5557
|
def web_url_info(self) -> global___WebUrlInfo: ...
|
5558
|
+
@property
|
5559
|
+
def custom_domain_info(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CustomDomainInfo]: ...
|
5615
5560
|
def __init__(
|
5616
5561
|
self,
|
5617
5562
|
*,
|
@@ -5620,9 +5565,10 @@ class MethodDefinition(google.protobuf.message.Message):
|
|
5620
5565
|
webhook_config: global___WebhookConfig | None = ...,
|
5621
5566
|
web_url: builtins.str = ...,
|
5622
5567
|
web_url_info: global___WebUrlInfo | None = ...,
|
5568
|
+
custom_domain_info: collections.abc.Iterable[global___CustomDomainInfo] | None = ...,
|
5623
5569
|
) -> None: ...
|
5624
5570
|
def HasField(self, field_name: typing_extensions.Literal["web_url_info", b"web_url_info", "webhook_config", b"webhook_config"]) -> builtins.bool: ...
|
5625
|
-
def ClearField(self, field_name: typing_extensions.Literal["function_name", b"function_name", "function_type", b"function_type", "web_url", b"web_url", "web_url_info", b"web_url_info", "webhook_config", b"webhook_config"]) -> None: ...
|
5571
|
+
def ClearField(self, field_name: typing_extensions.Literal["custom_domain_info", b"custom_domain_info", "function_name", b"function_name", "function_type", b"function_type", "web_url", b"web_url", "web_url_info", b"web_url_info", "webhook_config", b"webhook_config"]) -> None: ...
|
5626
5572
|
|
5627
5573
|
global___MethodDefinition = MethodDefinition
|
5628
5574
|
|
modal_proto/api_pb2_grpc.py
CHANGED
@@ -350,11 +350,6 @@ class ModalClientStub(object):
|
|
350
350
|
request_serializer=modal__proto_dot_api__pb2.FunctionPutOutputsRequest.SerializeToString,
|
351
351
|
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
|
352
352
|
)
|
353
|
-
self.FunctionPutUserTelemetry = channel.unary_unary(
|
354
|
-
'/modal.client.ModalClient/FunctionPutUserTelemetry',
|
355
|
-
request_serializer=modal__proto_dot_api__pb2.FunctionPutUserTelemetryRequest.SerializeToString,
|
356
|
-
response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
|
357
|
-
)
|
358
353
|
self.FunctionRetryInputs = channel.unary_unary(
|
359
354
|
'/modal.client.ModalClient/FunctionRetryInputs',
|
360
355
|
request_serializer=modal__proto_dot_api__pb2.FunctionRetryInputsRequest.SerializeToString,
|
@@ -1084,12 +1079,6 @@ class ModalClientServicer(object):
|
|
1084
1079
|
context.set_details('Method not implemented!')
|
1085
1080
|
raise NotImplementedError('Method not implemented!')
|
1086
1081
|
|
1087
|
-
def FunctionPutUserTelemetry(self, request, context):
|
1088
|
-
"""Missing associated documentation comment in .proto file."""
|
1089
|
-
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
1090
|
-
context.set_details('Method not implemented!')
|
1091
|
-
raise NotImplementedError('Method not implemented!')
|
1092
|
-
|
1093
1082
|
def FunctionRetryInputs(self, request, context):
|
1094
1083
|
"""Missing associated documentation comment in .proto file."""
|
1095
1084
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
@@ -1813,11 +1802,6 @@ def add_ModalClientServicer_to_server(servicer, server):
|
|
1813
1802
|
request_deserializer=modal__proto_dot_api__pb2.FunctionPutOutputsRequest.FromString,
|
1814
1803
|
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
|
1815
1804
|
),
|
1816
|
-
'FunctionPutUserTelemetry': grpc.unary_unary_rpc_method_handler(
|
1817
|
-
servicer.FunctionPutUserTelemetry,
|
1818
|
-
request_deserializer=modal__proto_dot_api__pb2.FunctionPutUserTelemetryRequest.FromString,
|
1819
|
-
response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
|
1820
|
-
),
|
1821
1805
|
'FunctionRetryInputs': grpc.unary_unary_rpc_method_handler(
|
1822
1806
|
servicer.FunctionRetryInputs,
|
1823
1807
|
request_deserializer=modal__proto_dot_api__pb2.FunctionRetryInputsRequest.FromString,
|
@@ -3277,23 +3261,6 @@ class ModalClient(object):
|
|
3277
3261
|
options, channel_credentials,
|
3278
3262
|
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
3279
3263
|
|
3280
|
-
@staticmethod
|
3281
|
-
def FunctionPutUserTelemetry(request,
|
3282
|
-
target,
|
3283
|
-
options=(),
|
3284
|
-
channel_credentials=None,
|
3285
|
-
call_credentials=None,
|
3286
|
-
insecure=False,
|
3287
|
-
compression=None,
|
3288
|
-
wait_for_ready=None,
|
3289
|
-
timeout=None,
|
3290
|
-
metadata=None):
|
3291
|
-
return grpc.experimental.unary_unary(request, target, '/modal.client.ModalClient/FunctionPutUserTelemetry',
|
3292
|
-
modal__proto_dot_api__pb2.FunctionPutUserTelemetryRequest.SerializeToString,
|
3293
|
-
google_dot_protobuf_dot_empty__pb2.Empty.FromString,
|
3294
|
-
options, channel_credentials,
|
3295
|
-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
3296
|
-
|
3297
3264
|
@staticmethod
|
3298
3265
|
def FunctionRetryInputs(request,
|
3299
3266
|
target,
|
modal_proto/api_pb2_grpc.pyi
CHANGED
@@ -290,10 +290,6 @@ class ModalClientStub:
|
|
290
290
|
google.protobuf.empty_pb2.Empty,
|
291
291
|
]
|
292
292
|
"""For containers to return result"""
|
293
|
-
FunctionPutUserTelemetry: grpc.UnaryUnaryMultiCallable[
|
294
|
-
modal_proto.api_pb2.FunctionPutUserTelemetryRequest,
|
295
|
-
google.protobuf.empty_pb2.Empty,
|
296
|
-
]
|
297
293
|
FunctionRetryInputs: grpc.UnaryUnaryMultiCallable[
|
298
294
|
modal_proto.api_pb2.FunctionRetryInputsRequest,
|
299
295
|
modal_proto.api_pb2.FunctionRetryInputsResponse,
|
@@ -972,12 +968,6 @@ class ModalClientServicer(metaclass=abc.ABCMeta):
|
|
972
968
|
) -> google.protobuf.empty_pb2.Empty:
|
973
969
|
"""For containers to return result"""
|
974
970
|
@abc.abstractmethod
|
975
|
-
def FunctionPutUserTelemetry(
|
976
|
-
self,
|
977
|
-
request: modal_proto.api_pb2.FunctionPutUserTelemetryRequest,
|
978
|
-
context: grpc.ServicerContext,
|
979
|
-
) -> google.protobuf.empty_pb2.Empty: ...
|
980
|
-
@abc.abstractmethod
|
981
971
|
def FunctionRetryInputs(
|
982
972
|
self,
|
983
973
|
request: modal_proto.api_pb2.FunctionRetryInputsRequest,
|
modal_proto/modal_api_grpc.py
CHANGED
@@ -79,7 +79,6 @@ class ModalClientModal:
|
|
79
79
|
self.FunctionPrecreate = modal.client.UnaryUnaryWrapper(grpclib_stub.FunctionPrecreate, client)
|
80
80
|
self.FunctionPutInputs = modal.client.UnaryUnaryWrapper(grpclib_stub.FunctionPutInputs, client)
|
81
81
|
self.FunctionPutOutputs = modal.client.UnaryUnaryWrapper(grpclib_stub.FunctionPutOutputs, client)
|
82
|
-
self.FunctionPutUserTelemetry = modal.client.UnaryUnaryWrapper(grpclib_stub.FunctionPutUserTelemetry, client)
|
83
82
|
self.FunctionRetryInputs = modal.client.UnaryUnaryWrapper(grpclib_stub.FunctionRetryInputs, client)
|
84
83
|
self.FunctionStartPtyShell = modal.client.UnaryUnaryWrapper(grpclib_stub.FunctionStartPtyShell, client)
|
85
84
|
self.FunctionUpdateSchedulingParams = modal.client.UnaryUnaryWrapper(grpclib_stub.FunctionUpdateSchedulingParams, client)
|
modal/_container_io_manager.pyi
DELETED
@@ -1,414 +0,0 @@
|
|
1
|
-
import asyncio
|
2
|
-
import asyncio.locks
|
3
|
-
import asyncio.queues
|
4
|
-
import modal._asgi
|
5
|
-
import modal.client
|
6
|
-
import modal.running_app
|
7
|
-
import modal_proto.api_pb2
|
8
|
-
import synchronicity.combined_types
|
9
|
-
import typing
|
10
|
-
import typing_extensions
|
11
|
-
|
12
|
-
class UserException(Exception): ...
|
13
|
-
class Sentinel: ...
|
14
|
-
|
15
|
-
class FinalizedFunction:
|
16
|
-
callable: typing.Callable[..., typing.Any]
|
17
|
-
is_async: bool
|
18
|
-
is_generator: bool
|
19
|
-
data_format: int
|
20
|
-
lifespan_manager: typing.Optional[modal._asgi.LifespanManager]
|
21
|
-
|
22
|
-
def __init__(
|
23
|
-
self,
|
24
|
-
callable: typing.Callable[..., typing.Any],
|
25
|
-
is_async: bool,
|
26
|
-
is_generator: bool,
|
27
|
-
data_format: int,
|
28
|
-
lifespan_manager: typing.Optional[modal._asgi.LifespanManager] = None,
|
29
|
-
) -> None: ...
|
30
|
-
def __repr__(self): ...
|
31
|
-
def __eq__(self, other): ...
|
32
|
-
|
33
|
-
class IOContext:
|
34
|
-
input_ids: typing.List[str]
|
35
|
-
function_call_ids: typing.List[str]
|
36
|
-
finalized_function: FinalizedFunction
|
37
|
-
_cancel_issued: bool
|
38
|
-
_cancel_callback: typing.Optional[typing.Callable[[], None]]
|
39
|
-
|
40
|
-
def __init__(
|
41
|
-
self,
|
42
|
-
input_ids: typing.List[str],
|
43
|
-
function_call_ids: typing.List[str],
|
44
|
-
finalized_function: FinalizedFunction,
|
45
|
-
function_inputs: typing.List[modal_proto.api_pb2.FunctionInput],
|
46
|
-
is_batched: bool,
|
47
|
-
client: modal.client._Client,
|
48
|
-
): ...
|
49
|
-
@classmethod
|
50
|
-
async def create(
|
51
|
-
cls,
|
52
|
-
client: modal.client._Client,
|
53
|
-
finalized_functions: typing.Dict[str, FinalizedFunction],
|
54
|
-
inputs: typing.List[typing.Tuple[str, str, modal_proto.api_pb2.FunctionInput]],
|
55
|
-
is_batched: bool,
|
56
|
-
) -> IOContext: ...
|
57
|
-
def set_cancel_callback(self, cb: typing.Callable[[], None]): ...
|
58
|
-
def cancel(self): ...
|
59
|
-
def _args_and_kwargs(
|
60
|
-
self,
|
61
|
-
) -> typing.Tuple[typing.Tuple[typing.Any, ...], typing.Dict[str, typing.List[typing.Any]]]: ...
|
62
|
-
def call_finalized_function(self) -> typing.Any: ...
|
63
|
-
def validate_output_data(self, data: typing.Any) -> typing.List[typing.Any]: ...
|
64
|
-
|
65
|
-
class InputSlots:
|
66
|
-
active: int
|
67
|
-
value: int
|
68
|
-
waiter: typing.Optional[asyncio.Future]
|
69
|
-
closed: bool
|
70
|
-
|
71
|
-
def __init__(self, value: int) -> None: ...
|
72
|
-
async def acquire(self) -> None: ...
|
73
|
-
def _wake_waiter(self) -> None: ...
|
74
|
-
def release(self) -> None: ...
|
75
|
-
def set_value(self, value: int) -> None: ...
|
76
|
-
async def close(self) -> None: ...
|
77
|
-
|
78
|
-
class _ContainerIOManager:
|
79
|
-
task_id: str
|
80
|
-
function_id: str
|
81
|
-
app_id: str
|
82
|
-
function_def: modal_proto.api_pb2.Function
|
83
|
-
checkpoint_id: typing.Optional[str]
|
84
|
-
calls_completed: int
|
85
|
-
total_user_time: float
|
86
|
-
current_input_id: typing.Optional[str]
|
87
|
-
current_inputs: typing.Dict[str, IOContext]
|
88
|
-
current_input_started_at: typing.Optional[float]
|
89
|
-
_target_concurrency: int
|
90
|
-
_max_concurrency: int
|
91
|
-
_concurrency_loop: typing.Optional[asyncio.Task]
|
92
|
-
_input_slots: InputSlots
|
93
|
-
_environment_name: str
|
94
|
-
_heartbeat_loop: typing.Optional[asyncio.Task]
|
95
|
-
_heartbeat_condition: typing.Optional[asyncio.locks.Condition]
|
96
|
-
_waiting_for_memory_snapshot: bool
|
97
|
-
_is_interactivity_enabled: bool
|
98
|
-
_fetching_inputs: bool
|
99
|
-
_client: modal.client._Client
|
100
|
-
_GENERATOR_STOP_SENTINEL: typing.ClassVar[Sentinel]
|
101
|
-
_singleton: typing.ClassVar[typing.Optional[_ContainerIOManager]]
|
102
|
-
|
103
|
-
def _init(self, container_args: modal_proto.api_pb2.ContainerArguments, client: modal.client._Client): ...
|
104
|
-
@property
|
105
|
-
def heartbeat_condition(self) -> asyncio.locks.Condition: ...
|
106
|
-
@staticmethod
|
107
|
-
def __new__(
|
108
|
-
cls, container_args: modal_proto.api_pb2.ContainerArguments, client: modal.client._Client
|
109
|
-
) -> _ContainerIOManager: ...
|
110
|
-
@classmethod
|
111
|
-
def _reset_singleton(cls): ...
|
112
|
-
async def _run_heartbeat_loop(self): ...
|
113
|
-
async def _heartbeat_handle_cancellations(self) -> bool: ...
|
114
|
-
def heartbeats(self, wait_for_mem_snap: bool) -> typing.AsyncContextManager[None]: ...
|
115
|
-
def stop_heartbeat(self): ...
|
116
|
-
def dynamic_concurrency_manager(self) -> typing.AsyncContextManager[None]: ...
|
117
|
-
async def _dynamic_concurrency_loop(self): ...
|
118
|
-
async def get_app_objects(self) -> modal.running_app.RunningApp: ...
|
119
|
-
async def get_serialized_function(
|
120
|
-
self,
|
121
|
-
) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Callable[..., typing.Any]]]: ...
|
122
|
-
def serialize(self, obj: typing.Any) -> bytes: ...
|
123
|
-
def deserialize(self, data: bytes) -> typing.Any: ...
|
124
|
-
def serialize_data_format(self, obj: typing.Any, data_format: int) -> bytes: ...
|
125
|
-
async def format_blob_data(self, data: bytes) -> typing.Dict[str, typing.Any]: ...
|
126
|
-
def get_data_in(self, function_call_id: str) -> typing.AsyncIterator[typing.Any]: ...
|
127
|
-
async def put_data_out(
|
128
|
-
self, function_call_id: str, start_index: int, data_format: int, messages_bytes: typing.List[typing.Any]
|
129
|
-
) -> None: ...
|
130
|
-
async def generator_output_task(
|
131
|
-
self, function_call_id: str, data_format: int, message_rx: asyncio.queues.Queue
|
132
|
-
) -> None: ...
|
133
|
-
async def _queue_create(self, size: int) -> asyncio.queues.Queue: ...
|
134
|
-
async def _queue_put(self, queue: asyncio.queues.Queue, value: typing.Any) -> None: ...
|
135
|
-
def get_average_call_time(self) -> float: ...
|
136
|
-
def get_max_inputs_to_fetch(self): ...
|
137
|
-
def _generate_inputs(
|
138
|
-
self, batch_max_size: int, batch_wait_ms: int
|
139
|
-
) -> typing.AsyncIterator[typing.List[typing.Tuple[str, str, modal_proto.api_pb2.FunctionInput]]]: ...
|
140
|
-
def run_inputs_outputs(
|
141
|
-
self, finalized_functions: typing.Dict[str, FinalizedFunction], batch_max_size: int = 0, batch_wait_ms: int = 0
|
142
|
-
) -> typing.AsyncIterator[IOContext]: ...
|
143
|
-
async def _push_outputs(
|
144
|
-
self,
|
145
|
-
io_context: IOContext,
|
146
|
-
started_at: float,
|
147
|
-
data_format: int,
|
148
|
-
results: typing.List[modal_proto.api_pb2.GenericResult],
|
149
|
-
) -> None: ...
|
150
|
-
def serialize_exception(self, exc: BaseException) -> bytes: ...
|
151
|
-
def serialize_traceback(
|
152
|
-
self, exc: BaseException
|
153
|
-
) -> typing.Tuple[typing.Optional[bytes], typing.Optional[bytes]]: ...
|
154
|
-
def handle_user_exception(self) -> typing.AsyncContextManager[None]: ...
|
155
|
-
def handle_input_exception(self, io_context: IOContext, started_at: float) -> typing.AsyncContextManager[None]: ...
|
156
|
-
def exit_context(self, started_at, input_ids: typing.List[str]): ...
|
157
|
-
async def push_outputs(
|
158
|
-
self, io_context: IOContext, started_at: float, data: typing.Any, data_format: int
|
159
|
-
) -> None: ...
|
160
|
-
async def memory_restore(self) -> None: ...
|
161
|
-
async def memory_snapshot(self) -> None: ...
|
162
|
-
async def volume_commit(self, volume_ids: typing.List[str]) -> None: ...
|
163
|
-
async def interact(self, from_breakpoint: bool = False): ...
|
164
|
-
@property
|
165
|
-
def target_concurrency(self) -> int: ...
|
166
|
-
@property
|
167
|
-
def max_concurrency(self) -> int: ...
|
168
|
-
@classmethod
|
169
|
-
def get_input_concurrency(cls) -> int: ...
|
170
|
-
@classmethod
|
171
|
-
def set_input_concurrency(cls, concurrency: int): ...
|
172
|
-
@classmethod
|
173
|
-
def stop_fetching_inputs(cls): ...
|
174
|
-
|
175
|
-
class ContainerIOManager:
|
176
|
-
task_id: str
|
177
|
-
function_id: str
|
178
|
-
app_id: str
|
179
|
-
function_def: modal_proto.api_pb2.Function
|
180
|
-
checkpoint_id: typing.Optional[str]
|
181
|
-
calls_completed: int
|
182
|
-
total_user_time: float
|
183
|
-
current_input_id: typing.Optional[str]
|
184
|
-
current_inputs: typing.Dict[str, IOContext]
|
185
|
-
current_input_started_at: typing.Optional[float]
|
186
|
-
_target_concurrency: int
|
187
|
-
_max_concurrency: int
|
188
|
-
_concurrency_loop: typing.Optional[asyncio.Task]
|
189
|
-
_input_slots: InputSlots
|
190
|
-
_environment_name: str
|
191
|
-
_heartbeat_loop: typing.Optional[asyncio.Task]
|
192
|
-
_heartbeat_condition: typing.Optional[asyncio.locks.Condition]
|
193
|
-
_waiting_for_memory_snapshot: bool
|
194
|
-
_is_interactivity_enabled: bool
|
195
|
-
_fetching_inputs: bool
|
196
|
-
_client: modal.client.Client
|
197
|
-
_GENERATOR_STOP_SENTINEL: typing.ClassVar[Sentinel]
|
198
|
-
_singleton: typing.ClassVar[typing.Optional[ContainerIOManager]]
|
199
|
-
|
200
|
-
def __init__(self, /, *args, **kwargs): ...
|
201
|
-
def _init(self, container_args: modal_proto.api_pb2.ContainerArguments, client: modal.client.Client): ...
|
202
|
-
@property
|
203
|
-
def heartbeat_condition(self) -> asyncio.locks.Condition: ...
|
204
|
-
@classmethod
|
205
|
-
def _reset_singleton(cls): ...
|
206
|
-
|
207
|
-
class ___run_heartbeat_loop_spec(typing_extensions.Protocol):
|
208
|
-
def __call__(self): ...
|
209
|
-
async def aio(self): ...
|
210
|
-
|
211
|
-
_run_heartbeat_loop: ___run_heartbeat_loop_spec
|
212
|
-
|
213
|
-
class ___heartbeat_handle_cancellations_spec(typing_extensions.Protocol):
|
214
|
-
def __call__(self) -> bool: ...
|
215
|
-
async def aio(self) -> bool: ...
|
216
|
-
|
217
|
-
_heartbeat_handle_cancellations: ___heartbeat_handle_cancellations_spec
|
218
|
-
|
219
|
-
class __heartbeats_spec(typing_extensions.Protocol):
|
220
|
-
def __call__(
|
221
|
-
self, wait_for_mem_snap: bool
|
222
|
-
) -> synchronicity.combined_types.AsyncAndBlockingContextManager[None]: ...
|
223
|
-
def aio(self, wait_for_mem_snap: bool) -> typing.AsyncContextManager[None]: ...
|
224
|
-
|
225
|
-
heartbeats: __heartbeats_spec
|
226
|
-
|
227
|
-
def stop_heartbeat(self): ...
|
228
|
-
|
229
|
-
class __dynamic_concurrency_manager_spec(typing_extensions.Protocol):
|
230
|
-
def __call__(self) -> synchronicity.combined_types.AsyncAndBlockingContextManager[None]: ...
|
231
|
-
def aio(self) -> typing.AsyncContextManager[None]: ...
|
232
|
-
|
233
|
-
dynamic_concurrency_manager: __dynamic_concurrency_manager_spec
|
234
|
-
|
235
|
-
class ___dynamic_concurrency_loop_spec(typing_extensions.Protocol):
|
236
|
-
def __call__(self): ...
|
237
|
-
async def aio(self): ...
|
238
|
-
|
239
|
-
_dynamic_concurrency_loop: ___dynamic_concurrency_loop_spec
|
240
|
-
|
241
|
-
class __get_app_objects_spec(typing_extensions.Protocol):
|
242
|
-
def __call__(self) -> modal.running_app.RunningApp: ...
|
243
|
-
async def aio(self) -> modal.running_app.RunningApp: ...
|
244
|
-
|
245
|
-
get_app_objects: __get_app_objects_spec
|
246
|
-
|
247
|
-
class __get_serialized_function_spec(typing_extensions.Protocol):
|
248
|
-
def __call__(
|
249
|
-
self,
|
250
|
-
) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Callable[..., typing.Any]]]: ...
|
251
|
-
async def aio(
|
252
|
-
self,
|
253
|
-
) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Callable[..., typing.Any]]]: ...
|
254
|
-
|
255
|
-
get_serialized_function: __get_serialized_function_spec
|
256
|
-
|
257
|
-
def serialize(self, obj: typing.Any) -> bytes: ...
|
258
|
-
def deserialize(self, data: bytes) -> typing.Any: ...
|
259
|
-
def serialize_data_format(self, obj: typing.Any, data_format: int) -> bytes: ...
|
260
|
-
|
261
|
-
class __format_blob_data_spec(typing_extensions.Protocol):
|
262
|
-
def __call__(self, data: bytes) -> typing.Dict[str, typing.Any]: ...
|
263
|
-
async def aio(self, data: bytes) -> typing.Dict[str, typing.Any]: ...
|
264
|
-
|
265
|
-
format_blob_data: __format_blob_data_spec
|
266
|
-
|
267
|
-
class __get_data_in_spec(typing_extensions.Protocol):
|
268
|
-
def __call__(self, function_call_id: str) -> typing.Iterator[typing.Any]: ...
|
269
|
-
def aio(self, function_call_id: str) -> typing.AsyncIterator[typing.Any]: ...
|
270
|
-
|
271
|
-
get_data_in: __get_data_in_spec
|
272
|
-
|
273
|
-
class __put_data_out_spec(typing_extensions.Protocol):
|
274
|
-
def __call__(
|
275
|
-
self, function_call_id: str, start_index: int, data_format: int, messages_bytes: typing.List[typing.Any]
|
276
|
-
) -> None: ...
|
277
|
-
async def aio(
|
278
|
-
self, function_call_id: str, start_index: int, data_format: int, messages_bytes: typing.List[typing.Any]
|
279
|
-
) -> None: ...
|
280
|
-
|
281
|
-
put_data_out: __put_data_out_spec
|
282
|
-
|
283
|
-
class __generator_output_task_spec(typing_extensions.Protocol):
|
284
|
-
def __call__(self, function_call_id: str, data_format: int, message_rx: asyncio.queues.Queue) -> None: ...
|
285
|
-
async def aio(self, function_call_id: str, data_format: int, message_rx: asyncio.queues.Queue) -> None: ...
|
286
|
-
|
287
|
-
generator_output_task: __generator_output_task_spec
|
288
|
-
|
289
|
-
class ___queue_create_spec(typing_extensions.Protocol):
|
290
|
-
def __call__(self, size: int) -> asyncio.queues.Queue: ...
|
291
|
-
async def aio(self, size: int) -> asyncio.queues.Queue: ...
|
292
|
-
|
293
|
-
_queue_create: ___queue_create_spec
|
294
|
-
|
295
|
-
class ___queue_put_spec(typing_extensions.Protocol):
|
296
|
-
def __call__(self, queue: asyncio.queues.Queue, value: typing.Any) -> None: ...
|
297
|
-
async def aio(self, queue: asyncio.queues.Queue, value: typing.Any) -> None: ...
|
298
|
-
|
299
|
-
_queue_put: ___queue_put_spec
|
300
|
-
|
301
|
-
def get_average_call_time(self) -> float: ...
|
302
|
-
def get_max_inputs_to_fetch(self): ...
|
303
|
-
|
304
|
-
class ___generate_inputs_spec(typing_extensions.Protocol):
|
305
|
-
def __call__(
|
306
|
-
self, batch_max_size: int, batch_wait_ms: int
|
307
|
-
) -> typing.Iterator[typing.List[typing.Tuple[str, str, modal_proto.api_pb2.FunctionInput]]]: ...
|
308
|
-
def aio(
|
309
|
-
self, batch_max_size: int, batch_wait_ms: int
|
310
|
-
) -> typing.AsyncIterator[typing.List[typing.Tuple[str, str, modal_proto.api_pb2.FunctionInput]]]: ...
|
311
|
-
|
312
|
-
_generate_inputs: ___generate_inputs_spec
|
313
|
-
|
314
|
-
class __run_inputs_outputs_spec(typing_extensions.Protocol):
|
315
|
-
def __call__(
|
316
|
-
self,
|
317
|
-
finalized_functions: typing.Dict[str, FinalizedFunction],
|
318
|
-
batch_max_size: int = 0,
|
319
|
-
batch_wait_ms: int = 0,
|
320
|
-
) -> typing.Iterator[IOContext]: ...
|
321
|
-
def aio(
|
322
|
-
self,
|
323
|
-
finalized_functions: typing.Dict[str, FinalizedFunction],
|
324
|
-
batch_max_size: int = 0,
|
325
|
-
batch_wait_ms: int = 0,
|
326
|
-
) -> typing.AsyncIterator[IOContext]: ...
|
327
|
-
|
328
|
-
run_inputs_outputs: __run_inputs_outputs_spec
|
329
|
-
|
330
|
-
class ___push_outputs_spec(typing_extensions.Protocol):
|
331
|
-
def __call__(
|
332
|
-
self,
|
333
|
-
io_context: IOContext,
|
334
|
-
started_at: float,
|
335
|
-
data_format: int,
|
336
|
-
results: typing.List[modal_proto.api_pb2.GenericResult],
|
337
|
-
) -> None: ...
|
338
|
-
async def aio(
|
339
|
-
self,
|
340
|
-
io_context: IOContext,
|
341
|
-
started_at: float,
|
342
|
-
data_format: int,
|
343
|
-
results: typing.List[modal_proto.api_pb2.GenericResult],
|
344
|
-
) -> None: ...
|
345
|
-
|
346
|
-
_push_outputs: ___push_outputs_spec
|
347
|
-
|
348
|
-
def serialize_exception(self, exc: BaseException) -> bytes: ...
|
349
|
-
def serialize_traceback(
|
350
|
-
self, exc: BaseException
|
351
|
-
) -> typing.Tuple[typing.Optional[bytes], typing.Optional[bytes]]: ...
|
352
|
-
|
353
|
-
class __handle_user_exception_spec(typing_extensions.Protocol):
|
354
|
-
def __call__(self) -> synchronicity.combined_types.AsyncAndBlockingContextManager[None]: ...
|
355
|
-
def aio(self) -> typing.AsyncContextManager[None]: ...
|
356
|
-
|
357
|
-
handle_user_exception: __handle_user_exception_spec
|
358
|
-
|
359
|
-
class __handle_input_exception_spec(typing_extensions.Protocol):
|
360
|
-
def __call__(
|
361
|
-
self, io_context: IOContext, started_at: float
|
362
|
-
) -> synchronicity.combined_types.AsyncAndBlockingContextManager[None]: ...
|
363
|
-
def aio(self, io_context: IOContext, started_at: float) -> typing.AsyncContextManager[None]: ...
|
364
|
-
|
365
|
-
handle_input_exception: __handle_input_exception_spec
|
366
|
-
|
367
|
-
def exit_context(self, started_at, input_ids: typing.List[str]): ...
|
368
|
-
|
369
|
-
class __push_outputs_spec(typing_extensions.Protocol):
|
370
|
-
def __call__(self, io_context: IOContext, started_at: float, data: typing.Any, data_format: int) -> None: ...
|
371
|
-
async def aio(self, io_context: IOContext, started_at: float, data: typing.Any, data_format: int) -> None: ...
|
372
|
-
|
373
|
-
push_outputs: __push_outputs_spec
|
374
|
-
|
375
|
-
class __memory_restore_spec(typing_extensions.Protocol):
|
376
|
-
def __call__(self) -> None: ...
|
377
|
-
async def aio(self) -> None: ...
|
378
|
-
|
379
|
-
memory_restore: __memory_restore_spec
|
380
|
-
|
381
|
-
class __memory_snapshot_spec(typing_extensions.Protocol):
|
382
|
-
def __call__(self) -> None: ...
|
383
|
-
async def aio(self) -> None: ...
|
384
|
-
|
385
|
-
memory_snapshot: __memory_snapshot_spec
|
386
|
-
|
387
|
-
class __volume_commit_spec(typing_extensions.Protocol):
|
388
|
-
def __call__(self, volume_ids: typing.List[str]) -> None: ...
|
389
|
-
async def aio(self, volume_ids: typing.List[str]) -> None: ...
|
390
|
-
|
391
|
-
volume_commit: __volume_commit_spec
|
392
|
-
|
393
|
-
class __interact_spec(typing_extensions.Protocol):
|
394
|
-
def __call__(self, from_breakpoint: bool = False): ...
|
395
|
-
async def aio(self, from_breakpoint: bool = False): ...
|
396
|
-
|
397
|
-
interact: __interact_spec
|
398
|
-
|
399
|
-
@property
|
400
|
-
def target_concurrency(self) -> int: ...
|
401
|
-
@property
|
402
|
-
def max_concurrency(self) -> int: ...
|
403
|
-
@classmethod
|
404
|
-
def get_input_concurrency(cls) -> int: ...
|
405
|
-
@classmethod
|
406
|
-
def set_input_concurrency(cls, concurrency: int): ...
|
407
|
-
@classmethod
|
408
|
-
def stop_fetching_inputs(cls): ...
|
409
|
-
|
410
|
-
def check_fastapi_pydantic_compatibility(exc: ImportError) -> None: ...
|
411
|
-
|
412
|
-
MAX_OUTPUT_BATCH_SIZE: int
|
413
|
-
|
414
|
-
RTT_S: float
|
modal/execution_context.pyi
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
import contextvars
|
2
|
-
import typing
|
3
|
-
import typing_extensions
|
4
|
-
|
5
|
-
def is_local() -> bool: ...
|
6
|
-
async def _interact() -> None: ...
|
7
|
-
|
8
|
-
class __interact_spec(typing_extensions.Protocol):
|
9
|
-
def __call__(self) -> None: ...
|
10
|
-
async def aio(self) -> None: ...
|
11
|
-
|
12
|
-
interact: __interact_spec
|
13
|
-
|
14
|
-
def current_input_id() -> typing.Optional[str]: ...
|
15
|
-
def current_function_call_id() -> typing.Optional[str]: ...
|
16
|
-
def _set_current_context_ids(
|
17
|
-
input_ids: typing.List[str], function_call_ids: typing.List[str]
|
18
|
-
) -> typing.Callable[[], None]: ...
|
19
|
-
|
20
|
-
_current_input_id: contextvars.ContextVar
|
21
|
-
|
22
|
-
_current_function_call_id: contextvars.ContextVar
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|