modal 1.1.5.dev25__tar.gz → 1.1.5.dev27__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.1.5.dev25 → modal-1.1.5.dev27}/PKG-INFO +1 -1
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_functions.py +29 -2
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/client.pyi +2 -2
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/image.py +62 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/image.pyi +163 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/api.proto +11 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/api_pb2.py +643 -642
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/api_pb2.pyi +48 -5
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_version/__init__.py +1 -1
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/LICENSE +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/README.md +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/__main__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_clustered_functions.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_clustered_functions.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_container_entrypoint.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_ipython.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_location.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_object.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_output.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_partial_function.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_pty.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_resolver.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_resources.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/asgi.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/execution_context.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/telemetry.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_serialization.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_traceback.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_tunnel.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_tunnel.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_type_manager.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/app_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/async_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/blob_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/deprecation.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/docker_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/function_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/git_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/hash_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/http_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/logger.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/mount_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/name_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/package_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/shell_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_utils/time_utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_vendor/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_vendor/tblib.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/_watcher.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/app.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/app.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/builder/2023.12.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/builder/2024.04.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/builder/2024.10.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/builder/2025.06.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/builder/README.md +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/builder/base-images.json +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/call_graph.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/_download.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/_traceback.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/app.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/cluster.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/config.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/container.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/dict.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/entry_point.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/environment.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/import_refs.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/launch.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/network_file_system.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/profile.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/programs/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/programs/launch_instance_ssh.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/programs/run_marimo.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/programs/vscode.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/queues.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/run.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/secret.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/token.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/utils.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cli/volume.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/client.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cls.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/cls.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/config.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/container_process.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/container_process.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/dict.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/dict.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/environments.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/environments.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/exception.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/experimental/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/experimental/flash.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/experimental/flash.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/experimental/ipython.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/file_io.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/file_io.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/file_pattern_matcher.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/functions.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/functions.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/gpu.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/io_streams.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/io_streams.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/mount.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/mount.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/network_file_system.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/network_file_system.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/object.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/object.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/output.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/parallel_map.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/parallel_map.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/partial_function.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/partial_function.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/proxy.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/proxy.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/py.typed +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/queue.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/queue.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/retries.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/runner.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/runner.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/running_app.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/sandbox.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/sandbox.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/schedule.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/scheduler_placement.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/secret.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/secret.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/serving.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/serving.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/snapshot.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/snapshot.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/stream_type.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/token_flow.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/token_flow.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/volume.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal/volume.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal.egg-info/requires.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal.egg-info/top_level.txt +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_docs/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/__init__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/api_grpc.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/modal_options_grpc.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/options.proto +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/options_grpc.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/options_pb2.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/options_pb2.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/options_pb2_grpc.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/options_pb2_grpc.pyi +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_proto/py.typed +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/modal_version/__main__.py +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/pyproject.toml +0 -0
- {modal-1.1.5.dev25 → modal-1.1.5.dev27}/setup.cfg +0 -0
|
@@ -831,17 +831,23 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
831
831
|
for method_name, partial_function in interface_methods.items():
|
|
832
832
|
function_type = get_function_type(partial_function.params.is_generator)
|
|
833
833
|
function_name = f"{info.user_cls.__name__}.{method_name}"
|
|
834
|
+
is_web_endpoint = partial_function._is_web_endpoint()
|
|
834
835
|
method_schema = get_callable_schema(
|
|
835
836
|
partial_function._get_raw_f(),
|
|
836
|
-
is_web_endpoint=
|
|
837
|
+
is_web_endpoint=is_web_endpoint,
|
|
837
838
|
ignore_first_argument=True,
|
|
838
839
|
)
|
|
839
|
-
|
|
840
840
|
method_definition = api_pb2.MethodDefinition(
|
|
841
841
|
webhook_config=partial_function.params.webhook_config,
|
|
842
842
|
function_type=function_type,
|
|
843
843
|
function_name=function_name,
|
|
844
844
|
function_schema=method_schema,
|
|
845
|
+
supported_input_formats=[api_pb2.DATA_FORMAT_ASGI]
|
|
846
|
+
if is_web_endpoint
|
|
847
|
+
else [api_pb2.DATA_FORMAT_PICKLE],
|
|
848
|
+
supported_output_formats=[api_pb2.DATA_FORMAT_ASGI]
|
|
849
|
+
if is_web_endpoint
|
|
850
|
+
else [api_pb2.DATA_FORMAT_PICKLE],
|
|
845
851
|
)
|
|
846
852
|
method_definitions[method_name] = method_definition
|
|
847
853
|
|
|
@@ -865,6 +871,18 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
865
871
|
|
|
866
872
|
return deps
|
|
867
873
|
|
|
874
|
+
if info.is_service_class():
|
|
875
|
+
# classes don't have data formats themselves - methods do
|
|
876
|
+
supported_input_formats = []
|
|
877
|
+
supported_output_formats = []
|
|
878
|
+
elif webhook_config is not None:
|
|
879
|
+
supported_input_formats = [api_pb2.DATA_FORMAT_ASGI]
|
|
880
|
+
supported_output_formats = [api_pb2.DATA_FORMAT_ASGI]
|
|
881
|
+
else:
|
|
882
|
+
# TODO: add CBOR support
|
|
883
|
+
supported_input_formats = [api_pb2.DATA_FORMAT_PICKLE]
|
|
884
|
+
supported_output_formats = [api_pb2.DATA_FORMAT_PICKLE]
|
|
885
|
+
|
|
868
886
|
async def _preload(self: _Function, resolver: Resolver, existing_object_id: Optional[str]):
|
|
869
887
|
assert resolver.client and resolver.client.stub
|
|
870
888
|
|
|
@@ -877,6 +895,8 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
877
895
|
function_schema=get_callable_schema(info.raw_f, is_web_endpoint=bool(webhook_config))
|
|
878
896
|
if info.raw_f
|
|
879
897
|
else None,
|
|
898
|
+
supported_input_formats=supported_input_formats,
|
|
899
|
+
supported_output_formats=supported_output_formats,
|
|
880
900
|
)
|
|
881
901
|
if method_definitions:
|
|
882
902
|
for method_name, method_definition in method_definitions.items():
|
|
@@ -955,6 +975,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
955
975
|
function_schema = (
|
|
956
976
|
get_callable_schema(info.raw_f, is_web_endpoint=bool(webhook_config)) if info.raw_f else None
|
|
957
977
|
)
|
|
978
|
+
|
|
958
979
|
# Create function remotely
|
|
959
980
|
function_definition = api_pb2.Function(
|
|
960
981
|
module_name=info.module_name or "",
|
|
@@ -1016,6 +1037,8 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
1016
1037
|
task_idle_timeout_secs=scaledown_window or 0,
|
|
1017
1038
|
# ---
|
|
1018
1039
|
function_schema=function_schema,
|
|
1040
|
+
supported_input_formats=supported_input_formats,
|
|
1041
|
+
supported_output_formats=supported_output_formats,
|
|
1019
1042
|
)
|
|
1020
1043
|
|
|
1021
1044
|
if isinstance(gpu, list):
|
|
@@ -1051,6 +1074,8 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
1051
1074
|
runtime_perf_record=function_definition.runtime_perf_record,
|
|
1052
1075
|
function_schema=function_schema,
|
|
1053
1076
|
untrusted=function_definition.untrusted,
|
|
1077
|
+
supported_input_formats=supported_input_formats,
|
|
1078
|
+
supported_output_formats=supported_output_formats,
|
|
1054
1079
|
)
|
|
1055
1080
|
|
|
1056
1081
|
ranked_functions = []
|
|
@@ -1529,6 +1554,8 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
1529
1554
|
input_plane_region=self._input_plane_region,
|
|
1530
1555
|
max_object_size_bytes=self._max_object_size_bytes,
|
|
1531
1556
|
_experimental_flash_urls=self._experimental_flash_urls,
|
|
1557
|
+
supported_input_formats=self._metadata.supported_input_formats if self._metadata else [],
|
|
1558
|
+
supported_output_formats=self._metadata.supported_output_formats if self._metadata else [],
|
|
1532
1559
|
)
|
|
1533
1560
|
|
|
1534
1561
|
def _check_no_web_url(self, fn_name: str):
|
|
@@ -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.5.
|
|
36
|
+
version: str = "1.1.5.dev27",
|
|
37
37
|
):
|
|
38
38
|
"""mdmd:hidden
|
|
39
39
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -164,7 +164,7 @@ class Client:
|
|
|
164
164
|
server_url: str,
|
|
165
165
|
client_type: int,
|
|
166
166
|
credentials: typing.Optional[tuple[str, str]],
|
|
167
|
-
version: str = "1.1.5.
|
|
167
|
+
version: str = "1.1.5.dev27",
|
|
168
168
|
):
|
|
169
169
|
"""mdmd:hidden
|
|
170
170
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -868,6 +868,68 @@ class _Image(_Object, type_prefix="im"):
|
|
|
868
868
|
|
|
869
869
|
return obj
|
|
870
870
|
|
|
871
|
+
async def build(self, app: "modal.app._App") -> "_Image":
|
|
872
|
+
"""Eagerly build an image.
|
|
873
|
+
|
|
874
|
+
If your image was previously built, then this method will not rebuild your image
|
|
875
|
+
and your cached image is returned.
|
|
876
|
+
|
|
877
|
+
**Examples**
|
|
878
|
+
|
|
879
|
+
```python
|
|
880
|
+
image = modal.Image.debian_slim().uv_pip_install("scipy", "numpy")
|
|
881
|
+
|
|
882
|
+
app = modal.App("build-image")
|
|
883
|
+
with modal.enable_output(), app.run():
|
|
884
|
+
image.build(app)
|
|
885
|
+
|
|
886
|
+
# Save the image id
|
|
887
|
+
my_image_id = image.object_id
|
|
888
|
+
|
|
889
|
+
# Reference the image with the id or uses it another context.
|
|
890
|
+
built_image = modal.Image.from_id(my_image_id)
|
|
891
|
+
```
|
|
892
|
+
|
|
893
|
+
Alternatively, you can pre-build a image and use it in a sandbox.
|
|
894
|
+
|
|
895
|
+
```python notest
|
|
896
|
+
app = modal.App.lookup("sandbox-example")
|
|
897
|
+
|
|
898
|
+
with modal.enable_output():
|
|
899
|
+
image = modal.Image.debian_slim().uv_pip_install("scipy")
|
|
900
|
+
image.build(app)
|
|
901
|
+
|
|
902
|
+
sb = modal.Sandbox.create("python", "-c", "import scipy; print(scipy)", app=app, image=image)
|
|
903
|
+
print(sb.stdout.read())
|
|
904
|
+
sb.terminate()
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
**Note**
|
|
908
|
+
|
|
909
|
+
For defining Modal functions, images are built automatically when deploying or running an App.
|
|
910
|
+
You do not need to built the image explicitly:
|
|
911
|
+
|
|
912
|
+
```python notest
|
|
913
|
+
app = modal.App()
|
|
914
|
+
image = modal.Image.debian_slim()
|
|
915
|
+
|
|
916
|
+
# No need to explicitly build the image for defining a function.
|
|
917
|
+
@app.function(image=image)
|
|
918
|
+
def f():
|
|
919
|
+
...
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
"""
|
|
923
|
+
if app.app_id is None:
|
|
924
|
+
raise InvalidError("App has not been initialized yet. Use the content manager `app.run()` or `App.lookup`")
|
|
925
|
+
|
|
926
|
+
app_id = app.app_id
|
|
927
|
+
app_client = app._client or await _Client.from_env()
|
|
928
|
+
|
|
929
|
+
resolver = Resolver(app_client, app_id=app_id)
|
|
930
|
+
await resolver.load(self)
|
|
931
|
+
return self
|
|
932
|
+
|
|
871
933
|
def pip_install(
|
|
872
934
|
self,
|
|
873
935
|
*packages: Union[str, list[str]], # A list of Python packages, eg. ["numpy", "matplotlib>=3.5.0"]
|
|
@@ -2,6 +2,7 @@ import collections.abc
|
|
|
2
2
|
import google.protobuf.message
|
|
3
3
|
import modal._functions
|
|
4
4
|
import modal._object
|
|
5
|
+
import modal.app
|
|
5
6
|
import modal.client
|
|
6
7
|
import modal.cloud_bucket_mount
|
|
7
8
|
import modal.functions
|
|
@@ -318,6 +319,59 @@ class _Image(modal._object._Object):
|
|
|
318
319
|
"""
|
|
319
320
|
...
|
|
320
321
|
|
|
322
|
+
async def build(self, app: modal.app._App) -> _Image:
|
|
323
|
+
"""Eagerly build an image.
|
|
324
|
+
|
|
325
|
+
If your image was previously built, then this method will not rebuild your image
|
|
326
|
+
and your cached image is returned.
|
|
327
|
+
|
|
328
|
+
**Examples**
|
|
329
|
+
|
|
330
|
+
```python
|
|
331
|
+
image = modal.Image.debian_slim().uv_pip_install("scipy", "numpy")
|
|
332
|
+
|
|
333
|
+
app = modal.App("build-image")
|
|
334
|
+
with modal.enable_output(), app.run():
|
|
335
|
+
image.build(app)
|
|
336
|
+
|
|
337
|
+
# Save the image id
|
|
338
|
+
my_image_id = image.object_id
|
|
339
|
+
|
|
340
|
+
# Reference the image with the id or uses it another context.
|
|
341
|
+
built_image = modal.Image.from_id(my_image_id)
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Alternatively, you can pre-build a image and use it in a sandbox.
|
|
345
|
+
|
|
346
|
+
```python notest
|
|
347
|
+
app = modal.App.lookup("sandbox-example")
|
|
348
|
+
|
|
349
|
+
with modal.enable_output():
|
|
350
|
+
image = modal.Image.debian_slim().uv_pip_install("scipy")
|
|
351
|
+
image.build(app)
|
|
352
|
+
|
|
353
|
+
sb = modal.Sandbox.create("python", "-c", "import scipy; print(scipy)", app=app, image=image)
|
|
354
|
+
print(sb.stdout.read())
|
|
355
|
+
sb.terminate()
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**Note**
|
|
359
|
+
|
|
360
|
+
For defining Modal functions, images are built automatically when deploying or running an App.
|
|
361
|
+
You do not need to built the image explicitly:
|
|
362
|
+
|
|
363
|
+
```python notest
|
|
364
|
+
app = modal.App()
|
|
365
|
+
image = modal.Image.debian_slim()
|
|
366
|
+
|
|
367
|
+
# No need to explicitly build the image for defining a function.
|
|
368
|
+
@app.function(image=image)
|
|
369
|
+
def f():
|
|
370
|
+
...
|
|
371
|
+
```
|
|
372
|
+
"""
|
|
373
|
+
...
|
|
374
|
+
|
|
321
375
|
def pip_install(
|
|
322
376
|
self,
|
|
323
377
|
*packages: typing.Union[str, list[str]],
|
|
@@ -1182,6 +1236,115 @@ class Image(modal.object.Object):
|
|
|
1182
1236
|
|
|
1183
1237
|
from_id: __from_id_spec
|
|
1184
1238
|
|
|
1239
|
+
class __build_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
1240
|
+
def __call__(self, /, app: modal.app.App) -> Image:
|
|
1241
|
+
"""Eagerly build an image.
|
|
1242
|
+
|
|
1243
|
+
If your image was previously built, then this method will not rebuild your image
|
|
1244
|
+
and your cached image is returned.
|
|
1245
|
+
|
|
1246
|
+
**Examples**
|
|
1247
|
+
|
|
1248
|
+
```python
|
|
1249
|
+
image = modal.Image.debian_slim().uv_pip_install("scipy", "numpy")
|
|
1250
|
+
|
|
1251
|
+
app = modal.App("build-image")
|
|
1252
|
+
with modal.enable_output(), app.run():
|
|
1253
|
+
image.build(app)
|
|
1254
|
+
|
|
1255
|
+
# Save the image id
|
|
1256
|
+
my_image_id = image.object_id
|
|
1257
|
+
|
|
1258
|
+
# Reference the image with the id or uses it another context.
|
|
1259
|
+
built_image = modal.Image.from_id(my_image_id)
|
|
1260
|
+
```
|
|
1261
|
+
|
|
1262
|
+
Alternatively, you can pre-build a image and use it in a sandbox.
|
|
1263
|
+
|
|
1264
|
+
```python notest
|
|
1265
|
+
app = modal.App.lookup("sandbox-example")
|
|
1266
|
+
|
|
1267
|
+
with modal.enable_output():
|
|
1268
|
+
image = modal.Image.debian_slim().uv_pip_install("scipy")
|
|
1269
|
+
image.build(app)
|
|
1270
|
+
|
|
1271
|
+
sb = modal.Sandbox.create("python", "-c", "import scipy; print(scipy)", app=app, image=image)
|
|
1272
|
+
print(sb.stdout.read())
|
|
1273
|
+
sb.terminate()
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
**Note**
|
|
1277
|
+
|
|
1278
|
+
For defining Modal functions, images are built automatically when deploying or running an App.
|
|
1279
|
+
You do not need to built the image explicitly:
|
|
1280
|
+
|
|
1281
|
+
```python notest
|
|
1282
|
+
app = modal.App()
|
|
1283
|
+
image = modal.Image.debian_slim()
|
|
1284
|
+
|
|
1285
|
+
# No need to explicitly build the image for defining a function.
|
|
1286
|
+
@app.function(image=image)
|
|
1287
|
+
def f():
|
|
1288
|
+
...
|
|
1289
|
+
```
|
|
1290
|
+
"""
|
|
1291
|
+
...
|
|
1292
|
+
|
|
1293
|
+
async def aio(self, /, app: modal.app.App) -> Image:
|
|
1294
|
+
"""Eagerly build an image.
|
|
1295
|
+
|
|
1296
|
+
If your image was previously built, then this method will not rebuild your image
|
|
1297
|
+
and your cached image is returned.
|
|
1298
|
+
|
|
1299
|
+
**Examples**
|
|
1300
|
+
|
|
1301
|
+
```python
|
|
1302
|
+
image = modal.Image.debian_slim().uv_pip_install("scipy", "numpy")
|
|
1303
|
+
|
|
1304
|
+
app = modal.App("build-image")
|
|
1305
|
+
with modal.enable_output(), app.run():
|
|
1306
|
+
image.build(app)
|
|
1307
|
+
|
|
1308
|
+
# Save the image id
|
|
1309
|
+
my_image_id = image.object_id
|
|
1310
|
+
|
|
1311
|
+
# Reference the image with the id or uses it another context.
|
|
1312
|
+
built_image = modal.Image.from_id(my_image_id)
|
|
1313
|
+
```
|
|
1314
|
+
|
|
1315
|
+
Alternatively, you can pre-build a image and use it in a sandbox.
|
|
1316
|
+
|
|
1317
|
+
```python notest
|
|
1318
|
+
app = modal.App.lookup("sandbox-example")
|
|
1319
|
+
|
|
1320
|
+
with modal.enable_output():
|
|
1321
|
+
image = modal.Image.debian_slim().uv_pip_install("scipy")
|
|
1322
|
+
image.build(app)
|
|
1323
|
+
|
|
1324
|
+
sb = modal.Sandbox.create("python", "-c", "import scipy; print(scipy)", app=app, image=image)
|
|
1325
|
+
print(sb.stdout.read())
|
|
1326
|
+
sb.terminate()
|
|
1327
|
+
```
|
|
1328
|
+
|
|
1329
|
+
**Note**
|
|
1330
|
+
|
|
1331
|
+
For defining Modal functions, images are built automatically when deploying or running an App.
|
|
1332
|
+
You do not need to built the image explicitly:
|
|
1333
|
+
|
|
1334
|
+
```python notest
|
|
1335
|
+
app = modal.App()
|
|
1336
|
+
image = modal.Image.debian_slim()
|
|
1337
|
+
|
|
1338
|
+
# No need to explicitly build the image for defining a function.
|
|
1339
|
+
@app.function(image=image)
|
|
1340
|
+
def f():
|
|
1341
|
+
...
|
|
1342
|
+
```
|
|
1343
|
+
"""
|
|
1344
|
+
...
|
|
1345
|
+
|
|
1346
|
+
build: __build_spec[typing_extensions.Self]
|
|
1347
|
+
|
|
1185
1348
|
def pip_install(
|
|
1186
1349
|
self,
|
|
1187
1350
|
*packages: typing.Union[str, list[str]],
|
|
@@ -111,6 +111,7 @@ enum DataFormat {
|
|
|
111
111
|
DATA_FORMAT_PICKLE = 1; // Cloudpickle
|
|
112
112
|
DATA_FORMAT_ASGI = 2; // "Asgi" protobuf message
|
|
113
113
|
DATA_FORMAT_GENERATOR_DONE = 3; // "GeneratorDone" protobuf message
|
|
114
|
+
DATA_FORMAT_CBOR = 4;
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
enum DeploymentNamespace {
|
|
@@ -1504,6 +1505,8 @@ message Function {
|
|
|
1504
1505
|
bool enable_gpu_snapshot = 85; // GPU memory snapshotting (alpha)
|
|
1505
1506
|
|
|
1506
1507
|
uint32 startup_timeout_secs = 86;
|
|
1508
|
+
repeated DataFormat supported_input_formats = 87; // can be used as inputs
|
|
1509
|
+
repeated DataFormat supported_output_formats = 88;
|
|
1507
1510
|
}
|
|
1508
1511
|
|
|
1509
1512
|
message FunctionAsyncInvokeRequest {
|
|
@@ -1679,6 +1682,8 @@ message FunctionData {
|
|
|
1679
1682
|
string flash_service_label = 35;
|
|
1680
1683
|
|
|
1681
1684
|
uint32 startup_timeout_secs = 36;
|
|
1685
|
+
repeated DataFormat supported_input_formats = 37;
|
|
1686
|
+
repeated DataFormat supported_output_formats = 38;
|
|
1682
1687
|
}
|
|
1683
1688
|
|
|
1684
1689
|
message FunctionExtended {
|
|
@@ -1828,6 +1833,8 @@ message FunctionHandleMetadata {
|
|
|
1828
1833
|
// Use optional to ensure unset values default to None instead of 0
|
|
1829
1834
|
optional uint64 max_object_size_bytes = 48;
|
|
1830
1835
|
repeated string _experimental_flash_urls = 49; // (Optional) urls for flash services
|
|
1836
|
+
repeated DataFormat supported_input_formats = 50;
|
|
1837
|
+
repeated DataFormat supported_output_formats = 51;
|
|
1831
1838
|
}
|
|
1832
1839
|
|
|
1833
1840
|
message FunctionInput {
|
|
@@ -1892,6 +1899,8 @@ message FunctionPrecreateRequest {
|
|
|
1892
1899
|
// Mapping of method names to method definitions, only non-empty for class service functions
|
|
1893
1900
|
map<string, MethodDefinition> method_definitions = 8;
|
|
1894
1901
|
FunctionSchema function_schema = 9;
|
|
1902
|
+
repeated DataFormat supported_input_formats = 10;
|
|
1903
|
+
repeated DataFormat supported_output_formats = 11;
|
|
1895
1904
|
}
|
|
1896
1905
|
|
|
1897
1906
|
message FunctionPrecreateResponse {
|
|
@@ -2230,6 +2239,8 @@ message MethodDefinition {
|
|
|
2230
2239
|
WebUrlInfo web_url_info = 5;
|
|
2231
2240
|
repeated CustomDomainInfo custom_domain_info = 6;
|
|
2232
2241
|
FunctionSchema function_schema = 7;
|
|
2242
|
+
repeated DataFormat supported_input_formats = 8;
|
|
2243
|
+
repeated DataFormat supported_output_formats = 9;
|
|
2233
2244
|
}
|
|
2234
2245
|
|
|
2235
2246
|
message MountFile {
|