modal 1.1.1.dev3__tar.gz → 1.1.1.dev4__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.
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/PKG-INFO +1 -1
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/client.pyi +2 -2
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/sandbox.py +68 -4
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/sandbox.pyi +85 -3
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_version/__init__.py +1 -1
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/LICENSE +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/README.md +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/__main__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_clustered_functions.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_clustered_functions.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_container_entrypoint.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_functions.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_ipython.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_location.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_object.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_output.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_partial_function.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_pty.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_resolver.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_resources.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/asgi.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/execution_context.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/telemetry.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_serialization.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_traceback.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_tunnel.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_tunnel.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_type_manager.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/app_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/async_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/blob_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/deprecation.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/docker_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/function_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/git_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/hash_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/http_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/logger.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/mount_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/name_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/package_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/shell_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_utils/time_utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_vendor/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_vendor/tblib.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/_watcher.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/app.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/app.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/call_graph.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/_download.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/_traceback.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/app.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/cluster.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/config.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/container.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/dict.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/entry_point.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/environment.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/import_refs.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/launch.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/network_file_system.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/profile.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/programs/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/programs/vscode.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/queues.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/run.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/secret.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/token.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/utils.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cli/volume.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/client.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cls.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/cls.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/config.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/container_process.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/container_process.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/dict.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/dict.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/environments.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/environments.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/exception.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/experimental/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/experimental/flash.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/experimental/flash.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/experimental/ipython.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/file_io.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/file_io.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/file_pattern_matcher.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/functions.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/functions.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/gpu.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/image.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/image.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/io_streams.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/io_streams.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/mount.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/mount.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/network_file_system.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/network_file_system.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/object.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/object.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/output.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/parallel_map.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/parallel_map.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/partial_function.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/partial_function.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/proxy.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/proxy.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/py.typed +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/queue.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/queue.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/requirements/2023.12.312.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/requirements/2023.12.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/requirements/2024.04.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/requirements/2024.10.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/requirements/2025.06.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/requirements/PREVIEW.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/requirements/README.md +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/requirements/base-images.json +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/retries.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/runner.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/runner.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/running_app.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/schedule.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/scheduler_placement.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/secret.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/secret.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/serving.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/serving.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/snapshot.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/snapshot.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/stream_type.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/token_flow.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/token_flow.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/volume.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal/volume.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal.egg-info/requires.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal.egg-info/top_level.txt +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_docs/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/__init__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/api.proto +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/api_grpc.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/api_pb2.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/api_pb2.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/modal_options_grpc.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/options.proto +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/options_grpc.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/options_pb2.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/options_pb2.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/options_pb2_grpc.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/options_pb2_grpc.pyi +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_proto/py.typed +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/modal_version/__main__.py +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/pyproject.toml +0 -0
- {modal-1.1.1.dev3 → modal-1.1.1.dev4}/setup.cfg +0 -0
@@ -33,7 +33,7 @@ class _Client:
|
|
33
33
|
server_url: str,
|
34
34
|
client_type: int,
|
35
35
|
credentials: typing.Optional[tuple[str, str]],
|
36
|
-
version: str = "1.1.1.
|
36
|
+
version: str = "1.1.1.dev4",
|
37
37
|
):
|
38
38
|
"""mdmd:hidden
|
39
39
|
The Modal client object is not intended to be instantiated directly by users.
|
@@ -163,7 +163,7 @@ class Client:
|
|
163
163
|
server_url: str,
|
164
164
|
client_type: int,
|
165
165
|
credentials: typing.Optional[tuple[str, str]],
|
166
|
-
version: str = "1.1.1.
|
166
|
+
version: str = "1.1.1.dev4",
|
167
167
|
):
|
168
168
|
"""mdmd:hidden
|
169
169
|
The Modal client object is not intended to be instantiated directly by users.
|
@@ -73,6 +73,20 @@ def _validate_exec_args(entrypoint_args: Sequence[str]) -> None:
|
|
73
73
|
)
|
74
74
|
|
75
75
|
|
76
|
+
class DefaultSandboxNameOverride(str):
|
77
|
+
"""A singleton class that represents the default sandbox name override.
|
78
|
+
|
79
|
+
It is used to indicate that the sandbox name should not be overridden.
|
80
|
+
"""
|
81
|
+
|
82
|
+
def __repr__(self) -> str:
|
83
|
+
# NOTE: this must match the instance var name below in order for type stubs to work 😬
|
84
|
+
return "_DEFAULT_SANDBOX_NAME_OVERRIDE"
|
85
|
+
|
86
|
+
|
87
|
+
_DEFAULT_SANDBOX_NAME_OVERRIDE = DefaultSandboxNameOverride()
|
88
|
+
|
89
|
+
|
76
90
|
class _Sandbox(_Object, type_prefix="sb"):
|
77
91
|
"""A `Sandbox` object lets you interact with a running sandbox. This API is similar to Python's
|
78
92
|
[asyncio.subprocess.Process](https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process).
|
@@ -93,6 +107,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
93
107
|
entrypoint_args: Sequence[str],
|
94
108
|
image: _Image,
|
95
109
|
secrets: Sequence[_Secret],
|
110
|
+
name: Optional[str] = None,
|
96
111
|
timeout: Optional[int] = None,
|
97
112
|
workdir: Optional[str] = None,
|
98
113
|
gpu: GPU_T = None,
|
@@ -216,6 +231,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
216
231
|
proxy_id=(proxy.object_id if proxy else None),
|
217
232
|
enable_snapshot=enable_snapshot,
|
218
233
|
verbose=verbose,
|
234
|
+
name=name,
|
219
235
|
experimental_options=experimental_options,
|
220
236
|
)
|
221
237
|
|
@@ -230,7 +246,9 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
230
246
|
@staticmethod
|
231
247
|
async def create(
|
232
248
|
*entrypoint_args: str,
|
233
|
-
|
249
|
+
# Associate the sandbox with an app. Required unless creating from a container.
|
250
|
+
app: Optional["modal.app._App"] = None,
|
251
|
+
name: Optional[str] = None, # Optionally give the sandbox a name. Unique within an app.
|
234
252
|
image: Optional[_Image] = None, # The image to run as the container for the sandbox.
|
235
253
|
secrets: Sequence[_Secret] = (), # Environment variables to inject into the sandbox.
|
236
254
|
network_file_systems: dict[Union[str, os.PathLike], _NetworkFileSystem] = {},
|
@@ -295,6 +313,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
295
313
|
return await _Sandbox._create(
|
296
314
|
*entrypoint_args,
|
297
315
|
app=app,
|
316
|
+
name=name,
|
298
317
|
image=image,
|
299
318
|
secrets=secrets,
|
300
319
|
network_file_systems=network_file_systems,
|
@@ -323,7 +342,9 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
323
342
|
@staticmethod
|
324
343
|
async def _create(
|
325
344
|
*entrypoint_args: str,
|
326
|
-
|
345
|
+
# Associate the sandbox with an app. Required unless creating from a container.
|
346
|
+
app: Optional["modal.app._App"] = None,
|
347
|
+
name: Optional[str] = None, # Optionally give the sandbox a name. Unique within an app.
|
327
348
|
image: Optional[_Image] = None, # The image to run as the container for the sandbox.
|
328
349
|
secrets: Sequence[_Secret] = (), # Environment variables to inject into the sandbox.
|
329
350
|
mounts: Sequence[_Mount] = (),
|
@@ -376,6 +397,7 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
376
397
|
entrypoint_args,
|
377
398
|
image=image or _default_image,
|
378
399
|
secrets=secrets,
|
400
|
+
name=name,
|
379
401
|
timeout=timeout,
|
380
402
|
workdir=workdir,
|
381
403
|
gpu=gpu,
|
@@ -443,6 +465,27 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
443
465
|
self._stdin = StreamWriter(self.object_id, "sandbox", self._client)
|
444
466
|
self._result = None
|
445
467
|
|
468
|
+
@staticmethod
|
469
|
+
async def from_name(
|
470
|
+
app_name: str,
|
471
|
+
name: str,
|
472
|
+
*,
|
473
|
+
environment_name: Optional[str] = None,
|
474
|
+
client: Optional[_Client] = None,
|
475
|
+
) -> "_Sandbox":
|
476
|
+
"""Get a running Sandbox by name from the given app.
|
477
|
+
|
478
|
+
Raises an error if no running sandbox is found with the given name. A Sandbox's name
|
479
|
+
is the `name` argument passed to `Sandbox.create`.
|
480
|
+
"""
|
481
|
+
if client is None:
|
482
|
+
client = await _Client.from_env()
|
483
|
+
env_name = _get_environment_name(environment_name)
|
484
|
+
|
485
|
+
req = api_pb2.SandboxGetFromNameRequest(sandbox_name=name, app_name=app_name, environment_name=env_name)
|
486
|
+
resp = await retry_transient_errors(client.stub.SandboxGetFromName, req)
|
487
|
+
return _Sandbox._new_hydrated(resp.sandbox_id, client, None)
|
488
|
+
|
446
489
|
@staticmethod
|
447
490
|
async def from_id(sandbox_id: str, client: Optional[_Client] = None) -> "_Sandbox":
|
448
491
|
"""Construct a Sandbox from an id and look up the Sandbox result.
|
@@ -719,10 +762,31 @@ class _Sandbox(_Object, type_prefix="sb"):
|
|
719
762
|
return obj
|
720
763
|
|
721
764
|
@staticmethod
|
722
|
-
async def _experimental_from_snapshot(
|
765
|
+
async def _experimental_from_snapshot(
|
766
|
+
snapshot: _SandboxSnapshot,
|
767
|
+
client: Optional[_Client] = None,
|
768
|
+
*,
|
769
|
+
name: Optional[str] = _DEFAULT_SANDBOX_NAME_OVERRIDE,
|
770
|
+
):
|
723
771
|
client = client or await _Client.from_env()
|
724
772
|
|
725
|
-
|
773
|
+
if name is _DEFAULT_SANDBOX_NAME_OVERRIDE:
|
774
|
+
restore_req = api_pb2.SandboxRestoreRequest(
|
775
|
+
snapshot_id=snapshot.object_id,
|
776
|
+
sandbox_name_override_type=api_pb2.SandboxRestoreRequest.SANDBOX_NAME_OVERRIDE_TYPE_UNSPECIFIED,
|
777
|
+
)
|
778
|
+
elif name is None:
|
779
|
+
restore_req = api_pb2.SandboxRestoreRequest(
|
780
|
+
snapshot_id=snapshot.object_id,
|
781
|
+
sandbox_name_override_type=api_pb2.SandboxRestoreRequest.SANDBOX_NAME_OVERRIDE_TYPE_NONE,
|
782
|
+
)
|
783
|
+
else:
|
784
|
+
restore_req = api_pb2.SandboxRestoreRequest(
|
785
|
+
snapshot_id=snapshot.object_id,
|
786
|
+
sandbox_name_override=name,
|
787
|
+
sandbox_name_override_type=api_pb2.SandboxRestoreRequest.SANDBOX_NAME_OVERRIDE_TYPE_STRING,
|
788
|
+
)
|
789
|
+
|
726
790
|
restore_resp: api_pb2.SandboxRestoreResponse = await retry_transient_errors(
|
727
791
|
client.stub.SandboxRestore, restore_req
|
728
792
|
)
|
@@ -27,6 +27,17 @@ import typing_extensions
|
|
27
27
|
|
28
28
|
def _validate_exec_args(entrypoint_args: collections.abc.Sequence[str]) -> None: ...
|
29
29
|
|
30
|
+
class DefaultSandboxNameOverride(str):
|
31
|
+
"""A singleton class that represents the default sandbox name override.
|
32
|
+
|
33
|
+
It is used to indicate that the sandbox name should not be overridden.
|
34
|
+
"""
|
35
|
+
def __repr__(self) -> str:
|
36
|
+
"""Return repr(self)."""
|
37
|
+
...
|
38
|
+
|
39
|
+
_DEFAULT_SANDBOX_NAME_OVERRIDE: DefaultSandboxNameOverride
|
40
|
+
|
30
41
|
class _Sandbox(modal._object._Object):
|
31
42
|
"""A `Sandbox` object lets you interact with a running sandbox. This API is similar to Python's
|
32
43
|
[asyncio.subprocess.Process](https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process).
|
@@ -47,6 +58,7 @@ class _Sandbox(modal._object._Object):
|
|
47
58
|
entrypoint_args: collections.abc.Sequence[str],
|
48
59
|
image: modal.image._Image,
|
49
60
|
secrets: collections.abc.Sequence[modal.secret._Secret],
|
61
|
+
name: typing.Optional[str] = None,
|
50
62
|
timeout: typing.Optional[int] = None,
|
51
63
|
workdir: typing.Optional[str] = None,
|
52
64
|
gpu: typing.Union[None, str, modal.gpu._GPUConfig] = None,
|
@@ -79,6 +91,7 @@ class _Sandbox(modal._object._Object):
|
|
79
91
|
async def create(
|
80
92
|
*entrypoint_args: str,
|
81
93
|
app: typing.Optional[modal.app._App] = None,
|
94
|
+
name: typing.Optional[str] = None,
|
82
95
|
image: typing.Optional[modal.image._Image] = None,
|
83
96
|
secrets: collections.abc.Sequence[modal.secret._Secret] = (),
|
84
97
|
network_file_systems: dict[typing.Union[str, os.PathLike], modal.network_file_system._NetworkFileSystem] = {},
|
@@ -125,6 +138,7 @@ class _Sandbox(modal._object._Object):
|
|
125
138
|
async def _create(
|
126
139
|
*entrypoint_args: str,
|
127
140
|
app: typing.Optional[modal.app._App] = None,
|
141
|
+
name: typing.Optional[str] = None,
|
128
142
|
image: typing.Optional[modal.image._Image] = None,
|
129
143
|
secrets: collections.abc.Sequence[modal.secret._Secret] = (),
|
130
144
|
mounts: collections.abc.Sequence[modal.mount._Mount] = (),
|
@@ -154,6 +168,21 @@ class _Sandbox(modal._object._Object):
|
|
154
168
|
verbose: bool = False,
|
155
169
|
): ...
|
156
170
|
def _hydrate_metadata(self, handle_metadata: typing.Optional[google.protobuf.message.Message]): ...
|
171
|
+
@staticmethod
|
172
|
+
async def from_name(
|
173
|
+
app_name: str,
|
174
|
+
name: str,
|
175
|
+
*,
|
176
|
+
environment_name: typing.Optional[str] = None,
|
177
|
+
client: typing.Optional[modal.client._Client] = None,
|
178
|
+
) -> _Sandbox:
|
179
|
+
"""Get a running Sandbox by name from the given app.
|
180
|
+
|
181
|
+
Raises an error if no running sandbox is found with the given name. A Sandbox's name
|
182
|
+
is the `name` argument passed to `Sandbox.create`.
|
183
|
+
"""
|
184
|
+
...
|
185
|
+
|
157
186
|
@staticmethod
|
158
187
|
async def from_id(sandbox_id: str, client: typing.Optional[modal.client._Client] = None) -> _Sandbox:
|
159
188
|
"""Construct a Sandbox from an id and look up the Sandbox result.
|
@@ -243,7 +272,10 @@ class _Sandbox(modal._object._Object):
|
|
243
272
|
async def _experimental_snapshot(self) -> modal.snapshot._SandboxSnapshot: ...
|
244
273
|
@staticmethod
|
245
274
|
async def _experimental_from_snapshot(
|
246
|
-
snapshot: modal.snapshot._SandboxSnapshot,
|
275
|
+
snapshot: modal.snapshot._SandboxSnapshot,
|
276
|
+
client: typing.Optional[modal.client._Client] = None,
|
277
|
+
*,
|
278
|
+
name: typing.Optional[str] = _DEFAULT_SANDBOX_NAME_OVERRIDE,
|
247
279
|
): ...
|
248
280
|
@typing.overload
|
249
281
|
async def open(self, path: str, mode: _typeshed.OpenTextMode) -> modal.file_io._FileIO[str]: ...
|
@@ -335,6 +367,7 @@ class Sandbox(modal.object.Object):
|
|
335
367
|
entrypoint_args: collections.abc.Sequence[str],
|
336
368
|
image: modal.image.Image,
|
337
369
|
secrets: collections.abc.Sequence[modal.secret.Secret],
|
370
|
+
name: typing.Optional[str] = None,
|
338
371
|
timeout: typing.Optional[int] = None,
|
339
372
|
workdir: typing.Optional[str] = None,
|
340
373
|
gpu: typing.Union[None, str, modal.gpu._GPUConfig] = None,
|
@@ -368,6 +401,7 @@ class Sandbox(modal.object.Object):
|
|
368
401
|
/,
|
369
402
|
*entrypoint_args: str,
|
370
403
|
app: typing.Optional[modal.app.App] = None,
|
404
|
+
name: typing.Optional[str] = None,
|
371
405
|
image: typing.Optional[modal.image.Image] = None,
|
372
406
|
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
373
407
|
network_file_systems: dict[
|
@@ -417,6 +451,7 @@ class Sandbox(modal.object.Object):
|
|
417
451
|
/,
|
418
452
|
*entrypoint_args: str,
|
419
453
|
app: typing.Optional[modal.app.App] = None,
|
454
|
+
name: typing.Optional[str] = None,
|
420
455
|
image: typing.Optional[modal.image.Image] = None,
|
421
456
|
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
422
457
|
network_file_systems: dict[
|
@@ -469,6 +504,7 @@ class Sandbox(modal.object.Object):
|
|
469
504
|
/,
|
470
505
|
*entrypoint_args: str,
|
471
506
|
app: typing.Optional[modal.app.App] = None,
|
507
|
+
name: typing.Optional[str] = None,
|
472
508
|
image: typing.Optional[modal.image.Image] = None,
|
473
509
|
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
474
510
|
mounts: collections.abc.Sequence[modal.mount.Mount] = (),
|
@@ -504,6 +540,7 @@ class Sandbox(modal.object.Object):
|
|
504
540
|
/,
|
505
541
|
*entrypoint_args: str,
|
506
542
|
app: typing.Optional[modal.app.App] = None,
|
543
|
+
name: typing.Optional[str] = None,
|
507
544
|
image: typing.Optional[modal.image.Image] = None,
|
508
545
|
secrets: collections.abc.Sequence[modal.secret.Secret] = (),
|
509
546
|
mounts: collections.abc.Sequence[modal.mount.Mount] = (),
|
@@ -539,6 +576,41 @@ class Sandbox(modal.object.Object):
|
|
539
576
|
|
540
577
|
def _hydrate_metadata(self, handle_metadata: typing.Optional[google.protobuf.message.Message]): ...
|
541
578
|
|
579
|
+
class __from_name_spec(typing_extensions.Protocol):
|
580
|
+
def __call__(
|
581
|
+
self,
|
582
|
+
/,
|
583
|
+
app_name: str,
|
584
|
+
name: str,
|
585
|
+
*,
|
586
|
+
environment_name: typing.Optional[str] = None,
|
587
|
+
client: typing.Optional[modal.client.Client] = None,
|
588
|
+
) -> Sandbox:
|
589
|
+
"""Get a running Sandbox by name from the given app.
|
590
|
+
|
591
|
+
Raises an error if no running sandbox is found with the given name. A Sandbox's name
|
592
|
+
is the `name` argument passed to `Sandbox.create`.
|
593
|
+
"""
|
594
|
+
...
|
595
|
+
|
596
|
+
async def aio(
|
597
|
+
self,
|
598
|
+
/,
|
599
|
+
app_name: str,
|
600
|
+
name: str,
|
601
|
+
*,
|
602
|
+
environment_name: typing.Optional[str] = None,
|
603
|
+
client: typing.Optional[modal.client.Client] = None,
|
604
|
+
) -> Sandbox:
|
605
|
+
"""Get a running Sandbox by name from the given app.
|
606
|
+
|
607
|
+
Raises an error if no running sandbox is found with the given name. A Sandbox's name
|
608
|
+
is the `name` argument passed to `Sandbox.create`.
|
609
|
+
"""
|
610
|
+
...
|
611
|
+
|
612
|
+
from_name: __from_name_spec
|
613
|
+
|
542
614
|
class __from_id_spec(typing_extensions.Protocol):
|
543
615
|
def __call__(self, /, sandbox_id: str, client: typing.Optional[modal.client.Client] = None) -> Sandbox:
|
544
616
|
"""Construct a Sandbox from an id and look up the Sandbox result.
|
@@ -753,10 +825,20 @@ class Sandbox(modal.object.Object):
|
|
753
825
|
|
754
826
|
class ___experimental_from_snapshot_spec(typing_extensions.Protocol):
|
755
827
|
def __call__(
|
756
|
-
self,
|
828
|
+
self,
|
829
|
+
/,
|
830
|
+
snapshot: modal.snapshot.SandboxSnapshot,
|
831
|
+
client: typing.Optional[modal.client.Client] = None,
|
832
|
+
*,
|
833
|
+
name: typing.Optional[str] = _DEFAULT_SANDBOX_NAME_OVERRIDE,
|
757
834
|
): ...
|
758
835
|
async def aio(
|
759
|
-
self,
|
836
|
+
self,
|
837
|
+
/,
|
838
|
+
snapshot: modal.snapshot.SandboxSnapshot,
|
839
|
+
client: typing.Optional[modal.client.Client] = None,
|
840
|
+
*,
|
841
|
+
name: typing.Optional[str] = _DEFAULT_SANDBOX_NAME_OVERRIDE,
|
760
842
|
): ...
|
761
843
|
|
762
844
|
_experimental_from_snapshot: ___experimental_from_snapshot_spec
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|