modal 1.0.6.dev54__tar.gz → 1.0.6.dev56__tar.gz
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-1.0.6.dev54 → modal-1.0.6.dev56}/PKG-INFO +1 -1
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_functions.py +1 -1
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_partial_function.py +6 -1
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/container_io_manager.py +5 -1
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/function_utils.py +6 -3
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/app.py +15 -1
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/client.pyi +2 -2
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/functions.pyi +6 -6
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_version/__init__.py +1 -1
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/LICENSE +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/README.md +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/__main__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_clustered_functions.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_clustered_functions.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_container_entrypoint.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_ipython.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_location.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_object.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_output.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_pty.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_resolver.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_resources.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/asgi.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/execution_context.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/telemetry.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_serialization.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_traceback.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_tunnel.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_tunnel.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_type_manager.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/app_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/async_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/blob_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/deprecation.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/docker_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/git_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/hash_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/http_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/logger.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/mount_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/name_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/package_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/shell_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_utils/time_utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_vendor/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_vendor/tblib.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/_watcher.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/app.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/call_graph.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/_download.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/_traceback.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/app.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/cluster.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/config.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/container.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/dict.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/entry_point.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/environment.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/import_refs.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/launch.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/network_file_system.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/profile.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/programs/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/programs/vscode.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/queues.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/run.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/secret.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/token.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/utils.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cli/volume.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/client.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cls.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/cls.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/config.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/container_process.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/container_process.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/dict.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/dict.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/environments.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/environments.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/exception.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/experimental/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/experimental/flash.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/experimental/flash.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/experimental/ipython.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/file_io.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/file_io.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/file_pattern_matcher.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/functions.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/gpu.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/image.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/image.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/io_streams.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/io_streams.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/mount.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/mount.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/network_file_system.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/network_file_system.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/object.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/object.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/output.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/parallel_map.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/parallel_map.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/partial_function.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/partial_function.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/proxy.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/proxy.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/py.typed +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/queue.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/queue.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/requirements/2023.12.312.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/requirements/2023.12.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/requirements/2024.04.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/requirements/2024.10.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/requirements/2025.06.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/requirements/PREVIEW.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/requirements/README.md +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/requirements/base-images.json +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/retries.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/runner.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/runner.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/running_app.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/sandbox.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/sandbox.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/schedule.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/scheduler_placement.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/secret.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/secret.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/serving.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/serving.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/snapshot.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/snapshot.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/stream_type.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/token_flow.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/token_flow.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/volume.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal/volume.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal.egg-info/requires.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal.egg-info/top_level.txt +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_docs/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/__init__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/api.proto +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/api_grpc.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/api_pb2.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/api_pb2.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/modal_options_grpc.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/options.proto +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/options_grpc.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/options_pb2.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/options_pb2.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/options_pb2_grpc.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/options_pb2_grpc.pyi +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_proto/py.typed +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/modal_version/__main__.py +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/pyproject.toml +0 -0
- {modal-1.0.6.dev54 → modal-1.0.6.dev56}/setup.cfg +0 -0
|
@@ -334,7 +334,7 @@ class _Invocation:
|
|
|
334
334
|
items_total: Union[int, None] = None
|
|
335
335
|
async with aclosing(
|
|
336
336
|
async_merge(
|
|
337
|
-
_stream_function_call_data(self.client, self.function_call_id, variant="data_out"),
|
|
337
|
+
_stream_function_call_data(self.client, None, self.function_call_id, variant="data_out"),
|
|
338
338
|
callable_to_agen(self.run_function),
|
|
339
339
|
)
|
|
340
340
|
) as streamer:
|
|
@@ -836,7 +836,12 @@ def _concurrent(
|
|
|
836
836
|
|
|
837
837
|
|
|
838
838
|
# NOTE: clustered is currently exposed through modal.experimental, not the top-level namespace
|
|
839
|
-
def _clustered(
|
|
839
|
+
def _clustered(
|
|
840
|
+
size: int, broadcast: bool = True, rdma: bool = False
|
|
841
|
+
) -> Callable[
|
|
842
|
+
[Union[Callable[P, ReturnType], _PartialFunction[P, ReturnType, ReturnType]]],
|
|
843
|
+
_PartialFunction[P, ReturnType, ReturnType],
|
|
844
|
+
]:
|
|
840
845
|
"""Provision clusters of colocated and networked containers for the Function.
|
|
841
846
|
|
|
842
847
|
Parameters:
|
|
@@ -486,7 +486,11 @@ class _ContainerIOManager:
|
|
|
486
486
|
|
|
487
487
|
async def get_data_in(self, function_call_id: str) -> AsyncIterator[Any]:
|
|
488
488
|
"""Read from the `data_in` stream of a function call."""
|
|
489
|
-
|
|
489
|
+
stub = self._client.stub
|
|
490
|
+
if self.input_plane_server_url:
|
|
491
|
+
stub = await self._client.get_stub(self.input_plane_server_url)
|
|
492
|
+
|
|
493
|
+
async for data in _stream_function_call_data(self._client, stub, function_call_id, "data_in"):
|
|
490
494
|
yield data
|
|
491
495
|
|
|
492
496
|
async def put_data_out(
|
|
@@ -386,9 +386,12 @@ def callable_has_non_self_non_default_params(f: Callable[..., Any]) -> bool:
|
|
|
386
386
|
|
|
387
387
|
|
|
388
388
|
async def _stream_function_call_data(
|
|
389
|
-
client, function_call_id: str, variant: Literal["data_in", "data_out"]
|
|
389
|
+
client, stub, function_call_id: str, variant: Literal["data_in", "data_out"]
|
|
390
390
|
) -> AsyncGenerator[Any, None]:
|
|
391
391
|
"""Read from the `data_in` or `data_out` stream of a function call."""
|
|
392
|
+
if stub is None:
|
|
393
|
+
stub = client.stub
|
|
394
|
+
|
|
392
395
|
last_index = 0
|
|
393
396
|
|
|
394
397
|
# TODO(gongy): generalize this logic as util for unary streams
|
|
@@ -396,9 +399,9 @@ async def _stream_function_call_data(
|
|
|
396
399
|
delay_ms = 1
|
|
397
400
|
|
|
398
401
|
if variant == "data_in":
|
|
399
|
-
stub_fn =
|
|
402
|
+
stub_fn = stub.FunctionCallGetDataIn
|
|
400
403
|
elif variant == "data_out":
|
|
401
|
-
stub_fn =
|
|
404
|
+
stub_fn = stub.FunctionCallGetDataOut
|
|
402
405
|
else:
|
|
403
406
|
raise ValueError(f"Invalid variant {variant}")
|
|
404
407
|
|
|
@@ -930,13 +930,24 @@ class _App:
|
|
|
930
930
|
else:
|
|
931
931
|
max_concurrent_inputs = allow_concurrent_inputs
|
|
932
932
|
target_concurrent_inputs = None
|
|
933
|
+
|
|
934
|
+
if wrapped_cls.flags & _PartialFunctionFlags.CLUSTERED:
|
|
935
|
+
cluster_size = wrapped_cls.params.cluster_size
|
|
936
|
+
else:
|
|
937
|
+
cluster_size = None
|
|
933
938
|
else:
|
|
934
939
|
user_cls = wrapped_cls
|
|
935
940
|
max_concurrent_inputs = allow_concurrent_inputs
|
|
936
941
|
target_concurrent_inputs = None
|
|
942
|
+
cluster_size = None
|
|
937
943
|
if not inspect.isclass(user_cls):
|
|
938
944
|
raise TypeError("The @app.cls decorator must be used on a class.")
|
|
939
945
|
|
|
946
|
+
interface_methods = _find_partial_methods_for_user_cls(user_cls, _PartialFunctionFlags.interface_flags())
|
|
947
|
+
if cluster_size:
|
|
948
|
+
if len(interface_methods) > 1:
|
|
949
|
+
raise InvalidError(f"Modal class {user_cls.__name__} cannot have multiple methods when clustered.")
|
|
950
|
+
|
|
940
951
|
batch_functions = _find_partial_methods_for_user_cls(user_cls, _PartialFunctionFlags.BATCHED)
|
|
941
952
|
if batch_functions:
|
|
942
953
|
if len(batch_functions) > 1:
|
|
@@ -966,6 +977,8 @@ class _App:
|
|
|
966
977
|
|
|
967
978
|
info = FunctionInfo(None, serialized=serialized, user_cls=user_cls)
|
|
968
979
|
|
|
980
|
+
i6pn_enabled = i6pn or cluster_size is not None
|
|
981
|
+
|
|
969
982
|
cls_func = _Function.from_local(
|
|
970
983
|
info,
|
|
971
984
|
app=self,
|
|
@@ -994,7 +1007,8 @@ class _App:
|
|
|
994
1007
|
restrict_modal_access=restrict_modal_access,
|
|
995
1008
|
max_inputs=max_inputs,
|
|
996
1009
|
scheduler_placement=scheduler_placement,
|
|
997
|
-
i6pn_enabled=
|
|
1010
|
+
i6pn_enabled=i6pn_enabled,
|
|
1011
|
+
cluster_size=cluster_size,
|
|
998
1012
|
include_source=include_source if include_source is not None else self._include_source_default,
|
|
999
1013
|
experimental_options={k: str(v) for k, v in (experimental_options or {}).items()},
|
|
1000
1014
|
_experimental_proxy_ip=_experimental_proxy_ip,
|
|
@@ -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.0.6.
|
|
36
|
+
version: str = "1.0.6.dev56",
|
|
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.0.6.
|
|
166
|
+
version: str = "1.0.6.dev56",
|
|
167
167
|
):
|
|
168
168
|
"""mdmd:hidden
|
|
169
169
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -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[P_INNER, ReturnType_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.P, modal._functions.ReturnType, 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[P_INNER, ReturnType_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.P, modal._functions.ReturnType, 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[P_INNER, ReturnType_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.P, modal._functions.ReturnType, 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."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|