modal 1.6.5.dev12__tar.gz → 1.7.0.dev1__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.6.5.dev12 → modal-1.7.0.dev1}/PKG-INFO +4 -4
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/README.md +1 -1
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/__init__.py +2 -14
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_environments.py +8 -2
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_image.py +7 -32
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_server.pyi +1 -1
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/app.pyi +3 -3
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/container.py +1 -1
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/client.pyi +2 -2
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/image.pyi +0 -1
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/object.pyi +6 -18
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/partial_function.pyi +1 -2
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/runner.py +2 -2
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_common.py +23 -6
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_impl_persistent.py +28 -7
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_impl_v1.py +42 -9
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_impl_v2.py +42 -9
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_sandbox.py +48 -42
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/sandbox.pyi +12 -5
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/server.pyi +1 -1
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/volume.pyi +6 -6
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal.egg-info/PKG-INFO +4 -4
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal.egg-info/requires.txt +1 -1
- modal-1.7.0.dev1/modal_proto/api_pb2.py +1875 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/api_pb2.pyi +20 -1
- modal-1.7.0.dev1/modal_proto/task_command_router_pb2.py +138 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_version/__init__.py +1 -1
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/pyproject.toml +2 -3
- modal-1.6.5.dev12/modal_proto/api_pb2.py +0 -8594
- modal-1.6.5.dev12/modal_proto/task_command_router_pb2.py +0 -552
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/LICENSE +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/__main__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_audit_logs/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_audit_logs/_rpcs.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_audit_logs/count.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_audit_logs/list.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_billing.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_cluster.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_cluster.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_container_entrypoint.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_experimental_outbound_policy.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_experimental_outbound_policy.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_function_variants.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_functions.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_grpc_client.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_ipython.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_load_context.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_location.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_logs.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_logs_manager.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_logs_manager.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_metrics.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_metrics.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_object.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_outbound_policy.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_outbound_policy.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_output/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_output/manager.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_output/pty.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_output/rich.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_output/status.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_partial_function.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_resolver.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_resources.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/asgi.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/execution_context.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/task_lifecycle_manager.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/telemetry.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_serialization.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_server.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_supports_logs.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_traceback.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_tunnel.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_tunnel.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_type_manager.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/app_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/async_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/blob_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/browser_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/curl_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/deprecation.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/display_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/docker_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/function_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/git_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/hash_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/http_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/idle_countdown.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/logger.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/mount_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/name_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/oauth.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/package_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/proxy_support.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/sandbox_fs_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/shell_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_utils/time_utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_vendor/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_vendor/tblib.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_vendor/version.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_watcher.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/_workspace.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/app.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/billing.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/billing.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/2023.12.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/2024.04.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/2024.10.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/2025.06.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/2026.10.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/README.md +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/builder/base-images.json +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/call_graph.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/_audit_logs.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/_download.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/_help.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/_logs.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/_stats.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/_suggest.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/_traceback.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/app.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/billing.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/changelog.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/config.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/curl.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/dashboard.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/dict.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/endpoint.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/entry_point.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/environment.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/function.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/image.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/import_refs.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/logo.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/network_file_system.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/profile.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/queues.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/run.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/secret.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/selector.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/server.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/shell.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/skills.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/token.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/utils.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/volume.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cli/workspace.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/client.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cls.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cls.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cluster.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/cluster.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/config.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/container_process.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/container_process.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/dict.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/dict.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/environments.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/environments.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/exception.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/experimental/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/experimental/_flash_container_entry.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/experimental/flash_server.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/experimental/flash_server.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/experimental/stream.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/experimental/stream.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/file_pattern_matcher.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/functions.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/functions.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/image.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/io_streams.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/io_streams.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/mount.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/mount.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/network_file_system.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/network_file_system.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/object.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/output.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/parallel_map.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/parallel_map.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/partial_function.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/proxy.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/proxy.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/py.typed +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/queue.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/queue.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/retries.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/runner.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/running_app.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_filesystem.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_sidecar.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_snapshot.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/_task_command_router_client.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/sandbox/sandbox.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/schedule.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/scheduler_placement.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/secret.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/secret.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/server.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/serving.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/serving.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/skills/modal/SKILL.md +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/stream_type.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/token_flow.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/token_flow.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/types.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/volume.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/workspace.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal/workspace.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal.egg-info/top_level.txt +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/gen_cli_docs_main.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/gen_reference_docs_main.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/mdmd/types.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_docs/reference_intro.md +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/__init__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/api_grpc.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/py.typed +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/modal_version/__main__.py +0 -0
- {modal-1.6.5.dev12 → modal-1.7.0.dev1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: modal
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0.dev1
|
|
4
4
|
Summary: Python client library for Modal
|
|
5
5
|
Author-email: Modal Labs <support@modal.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -12,7 +12,7 @@ Keywords: modal,client,cloud,serverless,infrastructure
|
|
|
12
12
|
Classifier: Topic :: System :: Distributed Computing
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Requires-Python: <3.16,>=3.
|
|
15
|
+
Requires-Python: <3.16,>=3.11
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: aiohttp
|
|
@@ -21,7 +21,7 @@ Requires-Dist: certifi
|
|
|
21
21
|
Requires-Dist: click~=8.1
|
|
22
22
|
Requires-Dist: grpclib<0.4.10,>=0.4.7; python_version < "3.14"
|
|
23
23
|
Requires-Dist: grpclib<0.4.10,>=0.4.9; python_version >= "3.14"
|
|
24
|
-
Requires-Dist: protobuf!=4.24.0,<8.0,>=3
|
|
24
|
+
Requires-Dist: protobuf!=4.24.0,<8.0,>=4.21.3
|
|
25
25
|
Requires-Dist: rich>=12.0.0
|
|
26
26
|
Requires-Dist: synchronicity~=0.12.7
|
|
27
27
|
Requires-Dist: toml
|
|
@@ -55,7 +55,7 @@ a [user guide](https://modal.com/docs/guide), and the detailed
|
|
|
55
55
|
|
|
56
56
|
## Installation
|
|
57
57
|
|
|
58
|
-
**This library requires Python 3.
|
|
58
|
+
**This library requires Python 3.11 – 3.15.**
|
|
59
59
|
|
|
60
60
|
Install the package with `uv` or `pip`:
|
|
61
61
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
# Copyright Modal Labs 2022
|
|
2
|
-
import os
|
|
3
2
|
import sys
|
|
4
3
|
|
|
5
|
-
if sys.version_info[:2] < (3,
|
|
6
|
-
raise RuntimeError("This version of Modal requires at least Python 3.
|
|
4
|
+
if sys.version_info[:2] < (3, 11):
|
|
5
|
+
raise RuntimeError("This version of Modal requires at least Python 3.11")
|
|
7
6
|
if sys.version_info[:2] >= (3, 16):
|
|
8
7
|
raise RuntimeError("This version of Modal does not support Python 3.16+")
|
|
9
8
|
|
|
@@ -61,17 +60,6 @@ except Exception:
|
|
|
61
60
|
print()
|
|
62
61
|
raise
|
|
63
62
|
|
|
64
|
-
if sys.version_info[:2] == (3, 10) and os.environ.get("MODAL_IS_REMOTE") != "1":
|
|
65
|
-
from ._utils.deprecation import deprecation_warning
|
|
66
|
-
|
|
67
|
-
deprecation_warning(
|
|
68
|
-
(2026, 11, 4),
|
|
69
|
-
"Python 3.10 is EOL and Modal will not support it in version 1.7.0. "
|
|
70
|
-
"Please upgrade your local Python to 3.11 or later.",
|
|
71
|
-
show_source=False,
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
|
|
75
63
|
__all__ = [
|
|
76
64
|
"__version__",
|
|
77
65
|
"App",
|
|
@@ -57,10 +57,16 @@ class _EnvironmentManager:
|
|
|
57
57
|
check_environment_name(name, allow_periods=False)
|
|
58
58
|
|
|
59
59
|
client = await _Client.from_env() if client is None else client
|
|
60
|
-
|
|
60
|
+
options = dict(experimental_options or {})
|
|
61
|
+
is_public = options.pop("is_public", False)
|
|
62
|
+
request = api_pb2.EnvironmentCreateRequest(
|
|
63
|
+
name=name,
|
|
64
|
+
is_managed=restricted,
|
|
65
|
+
experimental_options={k: str(v) for k, v in options.items()},
|
|
66
|
+
)
|
|
61
67
|
if default_role:
|
|
62
68
|
request.default_member_role_str = default_role
|
|
63
|
-
if
|
|
69
|
+
if is_public:
|
|
64
70
|
request.environment_type = api_pb2.ENVIRONMENT_TYPE_PUBLIC
|
|
65
71
|
await client._stub.EnvironmentCreate(request)
|
|
66
72
|
|
|
@@ -37,7 +37,6 @@ from ._serialization import get_preferred_payload_format, serialize
|
|
|
37
37
|
from ._supports_logs import _ImageLogQueryData
|
|
38
38
|
from ._utils.async_utils import TaskContext, deprecate_aio_usage, synchronizer
|
|
39
39
|
from ._utils.blob_utils import MAX_OBJECT_SIZE_BYTES
|
|
40
|
-
from ._utils.deprecation import deprecation_warning
|
|
41
40
|
from ._utils.docker_utils import (
|
|
42
41
|
extract_copy_command_patterns,
|
|
43
42
|
find_dockerignore_file,
|
|
@@ -82,29 +81,13 @@ LATEST_IMAGE_BUILDER_VERSION: ImageBuilderVersion = "2026.10"
|
|
|
82
81
|
SUPPORTED_PYTHON_SERIES: dict[ImageBuilderVersion, list[str]] = {
|
|
83
82
|
"PREVIEW": ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
|
|
84
83
|
"2026.10": ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
|
|
85
|
-
"2025.06": ["3.
|
|
86
|
-
"2024.10": ["3.
|
|
87
|
-
"2024.04": ["3.
|
|
88
|
-
"2023.12": ["3.
|
|
84
|
+
"2025.06": ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"],
|
|
85
|
+
"2024.10": ["3.11", "3.12", "3.13"],
|
|
86
|
+
"2024.04": ["3.11", "3.12"],
|
|
87
|
+
"2023.12": ["3.11", "3.12"],
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
|
|
92
|
-
def _uses_python_310(metadata: api_pb2.ImageMetadata | None) -> bool:
|
|
93
|
-
return metadata is not None and bool(re.match(r"Python 3\.10\.", metadata.python_version_info))
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
def _warn_if_python_310(image_id: str, metadata: api_pb2.ImageMetadata | None) -> None:
|
|
97
|
-
if _uses_python_310(metadata):
|
|
98
|
-
deprecation_warning(
|
|
99
|
-
(2026, 11, 4),
|
|
100
|
-
f"Image {image_id} uses Python 3.10, which is EOL. Modal 1.7.0 and later will not run or deploy apps "
|
|
101
|
-
"that use Images with Python 3.10; apps already deployed with older clients keep working. "
|
|
102
|
-
"Please update the Image to use Python 3.11 or later "
|
|
103
|
-
"(e.g. via `python_version=` or `add_python=`).",
|
|
104
|
-
show_source=False,
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
|
|
108
91
|
LOCAL_REQUIREMENTS_DIR = Path(__file__).parent / "builder"
|
|
109
92
|
CONTAINER_REQUIREMENTS_PATH = "/modal_requirements.txt"
|
|
110
93
|
|
|
@@ -532,8 +515,8 @@ class DockerfileSpec:
|
|
|
532
515
|
context_files: dict[str, str] = field(default_factory=dict)
|
|
533
516
|
|
|
534
517
|
|
|
535
|
-
def _standalone_python_arch(platform: str | None
|
|
536
|
-
return "aarch64" if platform == "linux/arm64"
|
|
518
|
+
def _standalone_python_arch(platform: str | None) -> str:
|
|
519
|
+
return "aarch64" if platform == "linux/arm64" else "x86_64"
|
|
537
520
|
|
|
538
521
|
|
|
539
522
|
async def _image_await_build_result(image_id: str, client: _Client) -> api_pb2.ImageJoinStreamingResponse:
|
|
@@ -712,7 +695,6 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
712
695
|
# For internal use only.
|
|
713
696
|
_namespace: "api_pb2.DeploymentNamespace.ValueType" = api_pb2.DEPLOYMENT_NAMESPACE_WORKSPACE,
|
|
714
697
|
_do_assert_no_mount_layers: bool = True,
|
|
715
|
-
_arch: "api_pb2.Arch.ValueType" = api_pb2.ARCH_UNSPECIFIED,
|
|
716
698
|
_platform: str | None = None,
|
|
717
699
|
):
|
|
718
700
|
if base_images is None:
|
|
@@ -837,7 +819,6 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
837
819
|
build_function=_build_function,
|
|
838
820
|
build_args=build_args,
|
|
839
821
|
volume_mounts=volume_mounts,
|
|
840
|
-
arch=_arch,
|
|
841
822
|
platform=_platform or "",
|
|
842
823
|
)
|
|
843
824
|
|
|
@@ -903,8 +884,6 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
903
884
|
raise ImageBuildError("Unknown status %s!" % result.status, image_id)
|
|
904
885
|
|
|
905
886
|
self._hydrate(image_id, load_context.client, metadata)
|
|
906
|
-
if not any(_uses_python_310(base._metadata) for base in base_images.values()):
|
|
907
|
-
_warn_if_python_310(image_id, metadata)
|
|
908
887
|
local_mounts: set[_Mount] = set()
|
|
909
888
|
for base in base_images.values():
|
|
910
889
|
local_mounts |= base._serve_mounts
|
|
@@ -1126,7 +1105,6 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
1126
1105
|
async def _load(self: _Image, resolver: Resolver, load_context: LoadContext, existing_object_id: str | None):
|
|
1127
1106
|
resp = await load_context.client._stub.ImageFromId(api_pb2.ImageFromIdRequest(image_id=image_id))
|
|
1128
1107
|
self._hydrate(resp.image_id, load_context.client, resp.metadata)
|
|
1129
|
-
_warn_if_python_310(resp.image_id, resp.metadata)
|
|
1130
1108
|
|
|
1131
1109
|
rep = f"Image.from_id({image_id!r})"
|
|
1132
1110
|
|
|
@@ -2381,12 +2359,10 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2381
2359
|
```
|
|
2382
2360
|
"""
|
|
2383
2361
|
|
|
2384
|
-
arch = kwargs.get("_arch", api_pb2.ARCH_UNSPECIFIED)
|
|
2385
|
-
|
|
2386
2362
|
def context_mount_function(builder_version: ImageBuilderVersion) -> _Mount | None:
|
|
2387
2363
|
return (
|
|
2388
2364
|
_Mount.from_name(
|
|
2389
|
-
python_standalone_mount_name(add_python, builder_version, _standalone_python_arch(platform
|
|
2365
|
+
python_standalone_mount_name(add_python, builder_version, _standalone_python_arch(platform)),
|
|
2390
2366
|
namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
|
|
2391
2367
|
)
|
|
2392
2368
|
if add_python
|
|
@@ -2418,7 +2394,6 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2418
2394
|
dockerfile_function=lambda version: DockerfileSpec(commands=[f"FROM {tag}"], context_files={}),
|
|
2419
2395
|
image_registry_config=kwargs.get("image_registry_config"),
|
|
2420
2396
|
force_build=force_build,
|
|
2421
|
-
_arch=arch,
|
|
2422
2397
|
_platform=platform,
|
|
2423
2398
|
)
|
|
2424
2399
|
|
|
@@ -185,7 +185,7 @@ class _Server:
|
|
|
185
185
|
@classmethod
|
|
186
186
|
def _new_from_function(
|
|
187
187
|
cls, object_id: str, client: modal.client._Client, metadata: modal_proto.api_pb2.FunctionHandleMetadata
|
|
188
|
-
) ->
|
|
188
|
+
) -> typing.Self:
|
|
189
189
|
"""mdmd:hidden
|
|
190
190
|
|
|
191
191
|
Callers which already have handle metadata for a Server service function can use this method to
|
|
@@ -438,7 +438,7 @@ class _App:
|
|
|
438
438
|
tag: str = "",
|
|
439
439
|
client: typing.Optional[modal.client._Client] = None,
|
|
440
440
|
strategy: str = "rolling",
|
|
441
|
-
) ->
|
|
441
|
+
) -> typing.Self:
|
|
442
442
|
"""Deploy the App so that it is available persistently.
|
|
443
443
|
|
|
444
444
|
Deployed Apps will be available for lookup or web-based invocations until they are stopped.
|
|
@@ -901,7 +901,7 @@ class _App:
|
|
|
901
901
|
"""
|
|
902
902
|
...
|
|
903
903
|
|
|
904
|
-
def include(self, /, other_app: _App, inherit_tags: bool = True) ->
|
|
904
|
+
def include(self, /, other_app: _App, inherit_tags: bool = True) -> typing.Self:
|
|
905
905
|
"""Include another App's objects in this one.
|
|
906
906
|
|
|
907
907
|
Useful for splitting up Modal Apps across different self-contained files.
|
|
@@ -2118,7 +2118,7 @@ class App:
|
|
|
2118
2118
|
"""
|
|
2119
2119
|
...
|
|
2120
2120
|
|
|
2121
|
-
def include(self, /, other_app: App, inherit_tags: bool = True) ->
|
|
2121
|
+
def include(self, /, other_app: App, inherit_tags: bool = True) -> typing.Self:
|
|
2122
2122
|
"""Include another App's objects in this one.
|
|
2123
2123
|
|
|
2124
2124
|
Useful for splitting up Modal Apps across different self-contained files.
|
|
@@ -209,7 +209,7 @@ async def logs(
|
|
|
209
209
|
if is_v2_sandbox:
|
|
210
210
|
assert sandbox_id is not None
|
|
211
211
|
sandbox = await _Sandbox.from_id(sandbox_id, client)
|
|
212
|
-
app_id = sandbox.
|
|
212
|
+
app_id = await sandbox._get_app_id()
|
|
213
213
|
try:
|
|
214
214
|
task_id = await asyncio.wait_for(
|
|
215
215
|
sandbox._get_task_id(raise_if_task_complete=True),
|
|
@@ -78,7 +78,7 @@ class _Client:
|
|
|
78
78
|
server_url: str,
|
|
79
79
|
client_type: int,
|
|
80
80
|
credentials: typing.Optional[tuple[str, str]],
|
|
81
|
-
version: str = "1.
|
|
81
|
+
version: str = "1.7.0.dev1",
|
|
82
82
|
*,
|
|
83
83
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
84
84
|
):
|
|
@@ -295,7 +295,7 @@ class Client:
|
|
|
295
295
|
server_url: str,
|
|
296
296
|
client_type: int,
|
|
297
297
|
credentials: typing.Optional[tuple[str, str]],
|
|
298
|
-
version: str = "1.
|
|
298
|
+
version: str = "1.7.0.dev1",
|
|
299
299
|
*,
|
|
300
300
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
301
301
|
):
|
|
@@ -86,7 +86,6 @@ class Image(modal.object.Object):
|
|
|
86
86
|
validated_volumes: typing.Optional[collections.abc.Sequence[tuple[str, modal.volume.Volume]]] = None,
|
|
87
87
|
_namespace: int = 1,
|
|
88
88
|
_do_assert_no_mount_layers: bool = True,
|
|
89
|
-
_arch: int = 0,
|
|
90
89
|
_platform: typing.Optional[str] = None,
|
|
91
90
|
): ...
|
|
92
91
|
def _copy_mount(self, mount: modal.mount.Mount, remote_path: typing.Union[str, pathlib.Path] = ".") -> Image:
|
|
@@ -13,13 +13,13 @@ class Object:
|
|
|
13
13
|
_prefix_to_type: typing.ClassVar[dict[str, type[Object]]]
|
|
14
14
|
_load: typing.Optional[
|
|
15
15
|
collections.abc.Callable[
|
|
16
|
-
[
|
|
16
|
+
[typing.Self, modal._resolver.Resolver, modal._load_context.LoadContext, typing.Optional[str]],
|
|
17
17
|
collections.abc.Awaitable[None],
|
|
18
18
|
]
|
|
19
19
|
]
|
|
20
20
|
_preload: typing.Optional[
|
|
21
21
|
collections.abc.Callable[
|
|
22
|
-
[
|
|
22
|
+
[typing.Self, modal._resolver.Resolver, modal._load_context.LoadContext, typing.Optional[str]],
|
|
23
23
|
collections.abc.Awaitable[None],
|
|
24
24
|
]
|
|
25
25
|
]
|
|
@@ -52,24 +52,12 @@ class Object:
|
|
|
52
52
|
rep: str,
|
|
53
53
|
load: typing.Optional[
|
|
54
54
|
collections.abc.Callable[
|
|
55
|
-
[
|
|
56
|
-
typing_extensions.Self,
|
|
57
|
-
modal._resolver.Resolver,
|
|
58
|
-
modal._load_context.LoadContext,
|
|
59
|
-
typing.Optional[str],
|
|
60
|
-
],
|
|
61
|
-
None,
|
|
55
|
+
[typing.Self, modal._resolver.Resolver, modal._load_context.LoadContext, typing.Optional[str]], None
|
|
62
56
|
]
|
|
63
57
|
] = None,
|
|
64
58
|
preload: typing.Optional[
|
|
65
59
|
collections.abc.Callable[
|
|
66
|
-
[
|
|
67
|
-
typing_extensions.Self,
|
|
68
|
-
modal._resolver.Resolver,
|
|
69
|
-
modal._load_context.LoadContext,
|
|
70
|
-
typing.Optional[str],
|
|
71
|
-
],
|
|
72
|
-
None,
|
|
60
|
+
[typing.Self, modal._resolver.Resolver, modal._load_context.LoadContext, typing.Optional[str]], None
|
|
73
61
|
]
|
|
74
62
|
] = None,
|
|
75
63
|
hydrate_lazily: bool = False,
|
|
@@ -152,8 +140,8 @@ class Object:
|
|
|
152
140
|
handle_metadata: typing.Optional[google.protobuf.message.Message],
|
|
153
141
|
skip_reload: bool = False,
|
|
154
142
|
rep: typing.Optional[str] = None,
|
|
155
|
-
) ->
|
|
156
|
-
def _hydrate_from_other(self, other:
|
|
143
|
+
) -> typing.Self: ...
|
|
144
|
+
def _hydrate_from_other(self, other: typing.Self): ...
|
|
157
145
|
def __repr__(self): ...
|
|
158
146
|
@property
|
|
159
147
|
def _class_name(self): ...
|
|
@@ -2,7 +2,6 @@ import collections.abc
|
|
|
2
2
|
import modal._partial_function
|
|
3
3
|
import modal.functions
|
|
4
4
|
import typing
|
|
5
|
-
import typing_extensions
|
|
6
5
|
|
|
7
6
|
class PartialFunction(
|
|
8
7
|
typing.Generic[
|
|
@@ -31,7 +30,7 @@ class PartialFunction(
|
|
|
31
30
|
self,
|
|
32
31
|
flags: modal._partial_function._PartialFunctionFlags,
|
|
33
32
|
params: modal._partial_function._PartialFunctionParams,
|
|
34
|
-
) ->
|
|
33
|
+
) -> typing.Self:
|
|
35
34
|
"""Implement decorator composition by combining the flags and params."""
|
|
36
35
|
...
|
|
37
36
|
|
|
@@ -765,8 +765,8 @@ async def _interactive_shell(
|
|
|
765
765
|
raise InvalidError(f"`{option}` is not supported for V2 sandboxes")
|
|
766
766
|
create_args = SandboxCreateArgs(args=("sleep", "100000"), secrets=secrets, **kwargs)
|
|
767
767
|
impl_cls = SandboxImplV2 if v2 else impl_class_for_create_args(create_args)
|
|
768
|
-
impl
|
|
769
|
-
sandbox = _Sandbox._from_impl(impl
|
|
768
|
+
impl = await impl_cls.create(create_args, app=_app, client=None)
|
|
769
|
+
sandbox = _Sandbox._from_impl(impl)
|
|
770
770
|
|
|
771
771
|
# Re-enable quiet mode before starting the interactive session
|
|
772
772
|
output_mgr.set_quiet_mode(True)
|
|
@@ -13,6 +13,7 @@ from collections.abc import AsyncIterator, Awaitable, Callable, Collection, Iter
|
|
|
13
13
|
from pathlib import PurePosixPath
|
|
14
14
|
from typing import TYPE_CHECKING, Any, Literal, Protocol
|
|
15
15
|
|
|
16
|
+
from google.protobuf.message import Message
|
|
16
17
|
from grpclib import Status
|
|
17
18
|
|
|
18
19
|
from modal_proto import api_pb2, task_command_router_pb2 as sr_pb2
|
|
@@ -687,17 +688,31 @@ class SandboxImpl(Protocol):
|
|
|
687
688
|
sandbox_id: str
|
|
688
689
|
# The Sandbox's final result once known; `None` while it is running.
|
|
689
690
|
result: api_pb2.GenericResult | None
|
|
691
|
+
app_id: str
|
|
690
692
|
|
|
691
|
-
def
|
|
693
|
+
async def get_app_id(self) -> str: ...
|
|
694
|
+
|
|
695
|
+
def _get_object_metadata(self) -> Message | None: ...
|
|
696
|
+
|
|
697
|
+
@classmethod
|
|
698
|
+
def _from_object_metadata(cls, client: _Client, sandbox_id: str, metadata: Message | None) -> "SandboxImpl": ...
|
|
699
|
+
|
|
700
|
+
def __init__(
|
|
701
|
+
self,
|
|
702
|
+
client: _Client,
|
|
703
|
+
sandbox_id: str,
|
|
704
|
+
*,
|
|
705
|
+
result: api_pb2.GenericResult | None = None,
|
|
706
|
+
app_id: str = "",
|
|
707
|
+
) -> None: ...
|
|
692
708
|
|
|
693
709
|
@classmethod
|
|
694
710
|
async def create(
|
|
695
711
|
cls, create_args: SandboxCreateArgs, *, app: "modal.app._App | None", client: _Client | None
|
|
696
|
-
) -> "
|
|
712
|
+
) -> "SandboxImpl":
|
|
697
713
|
"""Create the Sandbox described by `create_args`.
|
|
698
714
|
|
|
699
|
-
Returns the implementation backing the new Sandbox, holding its initial state
|
|
700
|
-
metadata the backend returned; `_Sandbox._from_impl` turns them into a handle.
|
|
715
|
+
Returns the implementation backing the new Sandbox, holding its initial state.
|
|
701
716
|
"""
|
|
702
717
|
...
|
|
703
718
|
|
|
@@ -711,7 +726,9 @@ class SandboxImpl(Protocol):
|
|
|
711
726
|
) -> api_pb2.SandboxGetFromNameResponse: ...
|
|
712
727
|
|
|
713
728
|
@classmethod
|
|
714
|
-
async def lookup_by_id(cls, client: _Client, sandbox_id: str) ->
|
|
729
|
+
async def lookup_by_id(cls, client: _Client, sandbox_id: str) -> "SandboxImpl":
|
|
730
|
+
"""Look up the Sandbox with the given ID, returning an implementation holding its handle metadata."""
|
|
731
|
+
...
|
|
715
732
|
|
|
716
733
|
@classmethod
|
|
717
734
|
async def list_page(cls, client: _Client, req: api_pb2.SandboxListRequest) -> api_pb2.SandboxListResponse: ...
|
|
@@ -724,7 +741,7 @@ class SandboxImpl(Protocol):
|
|
|
724
741
|
*,
|
|
725
742
|
override_type: "api_pb2.SandboxRestoreRequest.SandboxNameOverrideType.ValueType",
|
|
726
743
|
name_override: str | None,
|
|
727
|
-
) -> "
|
|
744
|
+
) -> "SandboxImpl": ...
|
|
728
745
|
|
|
729
746
|
def make_stdio(self, check_open: Callable[[], None]) -> tuple[StreamReader[str], StreamReader[str], StreamWriter]:
|
|
730
747
|
"""Create the stdout, stderr and stdin streams of the Sandbox entrypoint."""
|
|
@@ -14,6 +14,7 @@ from collections.abc import Awaitable, Callable, Collection, Sequence
|
|
|
14
14
|
from pathlib import PurePosixPath
|
|
15
15
|
from typing import TYPE_CHECKING, Any, Literal, TypeVar
|
|
16
16
|
|
|
17
|
+
from google.protobuf.message import Message
|
|
17
18
|
from grpclib import GRPCError, Status
|
|
18
19
|
|
|
19
20
|
from modal_proto import api_pb2, task_command_router_pb2 as sr_pb2
|
|
@@ -84,12 +85,14 @@ class SandboxImplPersistent:
|
|
|
84
85
|
sandbox_id: str,
|
|
85
86
|
*,
|
|
86
87
|
result: api_pb2.GenericResult | None = None,
|
|
88
|
+
app_id: str = "",
|
|
87
89
|
persistent_sandbox_id: str = "",
|
|
88
90
|
session: SandboxImplV2 | None = None,
|
|
89
91
|
) -> None:
|
|
90
92
|
self.client = client
|
|
91
93
|
self.sandbox_id = sandbox_id
|
|
92
94
|
self.result = result
|
|
95
|
+
self.app_id = app_id
|
|
93
96
|
self._persistent_sandbox_id = persistent_sandbox_id
|
|
94
97
|
self._session = session if session is not None else SandboxImplV2(client, sandbox_id)
|
|
95
98
|
self._replace_lock: asyncio.Lock | None = None
|
|
@@ -103,10 +106,30 @@ class SandboxImplPersistent:
|
|
|
103
106
|
def _client(self) -> _Client:
|
|
104
107
|
return self.client
|
|
105
108
|
|
|
109
|
+
async def get_app_id(self) -> str:
|
|
110
|
+
return self.app_id
|
|
111
|
+
|
|
112
|
+
def _get_object_metadata(self) -> api_pb2.SandboxHandleMetadata:
|
|
113
|
+
metadata = api_pb2.SandboxHandleMetadata(app_id=self.app_id)
|
|
114
|
+
if self.result is not None:
|
|
115
|
+
metadata.result.CopyFrom(self.result)
|
|
116
|
+
return metadata
|
|
117
|
+
|
|
118
|
+
@classmethod
|
|
119
|
+
def _from_object_metadata(
|
|
120
|
+
cls, client: _Client, sandbox_id: str, metadata: Message | None
|
|
121
|
+
) -> "SandboxImplPersistent":
|
|
122
|
+
if metadata is None:
|
|
123
|
+
return cls(client, sandbox_id)
|
|
124
|
+
assert isinstance(metadata, api_pb2.SandboxHandleMetadata)
|
|
125
|
+
return cls(
|
|
126
|
+
client, sandbox_id, app_id=metadata.app_id, result=metadata.result if metadata.HasField("result") else None
|
|
127
|
+
)
|
|
128
|
+
|
|
106
129
|
@classmethod
|
|
107
130
|
async def create(
|
|
108
131
|
cls, create_args: SandboxCreateArgs, *, app: "modal.app._App | None", client: _Client | None
|
|
109
|
-
) -> "
|
|
132
|
+
) -> "SandboxImpl":
|
|
110
133
|
if create_args.timeout is not None or create_args.idle_timeout is not None:
|
|
111
134
|
raise InvalidError("Persistent Sandboxes require `timeout=None` and don't support `idle_timeout`.")
|
|
112
135
|
create_args = dataclasses.replace(
|
|
@@ -138,8 +161,8 @@ class SandboxImplPersistent:
|
|
|
138
161
|
)
|
|
139
162
|
resp = await client._stub.PersistentSandboxCreate(req, metadata=await auth_metadata(client))
|
|
140
163
|
app_id = load_context.app_id or ""
|
|
141
|
-
impl = cls(client, resp.sandbox_id, persistent_sandbox_id=resp.persistent_sandbox_id)
|
|
142
|
-
return impl
|
|
164
|
+
impl = cls(client, resp.sandbox_id, persistent_sandbox_id=resp.persistent_sandbox_id, app_id=app_id)
|
|
165
|
+
return impl
|
|
143
166
|
|
|
144
167
|
# Persistent Sandboxes are only created through `create`, and can't be looked up yet.
|
|
145
168
|
|
|
@@ -148,7 +171,7 @@ class SandboxImplPersistent:
|
|
|
148
171
|
raise NotImplementedError
|
|
149
172
|
|
|
150
173
|
@classmethod
|
|
151
|
-
async def lookup_by_id(cls, *args: Any, **kwargs: Any) ->
|
|
174
|
+
async def lookup_by_id(cls, *args: Any, **kwargs: Any) -> "SandboxImpl":
|
|
152
175
|
raise NotImplementedError
|
|
153
176
|
|
|
154
177
|
@classmethod
|
|
@@ -156,9 +179,7 @@ class SandboxImplPersistent:
|
|
|
156
179
|
raise NotImplementedError
|
|
157
180
|
|
|
158
181
|
@classmethod
|
|
159
|
-
async def restore_from_memory_snapshot(
|
|
160
|
-
cls, *args: Any, **kwargs: Any
|
|
161
|
-
) -> "tuple[SandboxImpl, api_pb2.SandboxHandleMetadata]":
|
|
182
|
+
async def restore_from_memory_snapshot(cls, *args: Any, **kwargs: Any) -> "SandboxImpl":
|
|
162
183
|
raise NotImplementedError
|
|
163
184
|
|
|
164
185
|
def clone(self) -> "SandboxImplPersistent":
|
|
@@ -9,6 +9,8 @@ from collections.abc import Callable, Collection, Sequence
|
|
|
9
9
|
from pathlib import PurePosixPath
|
|
10
10
|
from typing import TYPE_CHECKING, Literal
|
|
11
11
|
|
|
12
|
+
from google.protobuf.message import Message
|
|
13
|
+
|
|
12
14
|
from modal_proto import api_pb2, task_command_router_pb2 as sr_pb2
|
|
13
15
|
|
|
14
16
|
from .._experimental_outbound_policy import _OutboundPolicy as _ExperimentalOutboundPolicy
|
|
@@ -115,26 +117,51 @@ class SandboxImplV1:
|
|
|
115
117
|
sandbox_id: str,
|
|
116
118
|
*,
|
|
117
119
|
result: api_pb2.GenericResult | None = None,
|
|
120
|
+
app_id: str = "",
|
|
118
121
|
task_id: str | None = None,
|
|
119
122
|
) -> None:
|
|
120
123
|
self.client = client
|
|
121
124
|
self.sandbox_id = sandbox_id
|
|
122
125
|
self.result = result
|
|
126
|
+
self.app_id = app_id
|
|
123
127
|
self._task_id = task_id
|
|
124
128
|
self._command_router = LazyCommandRouterClient(self._open_command_router_client)
|
|
125
129
|
self._tunnels = None
|
|
126
130
|
|
|
131
|
+
def _get_object_metadata(self) -> api_pb2.SandboxHandleMetadata:
|
|
132
|
+
metadata = api_pb2.SandboxHandleMetadata(app_id=self.app_id)
|
|
133
|
+
if self.result is not None:
|
|
134
|
+
metadata.result.CopyFrom(self.result)
|
|
135
|
+
return metadata
|
|
136
|
+
|
|
137
|
+
@classmethod
|
|
138
|
+
def _from_object_metadata(cls, client: _Client, sandbox_id: str, metadata: Message | None) -> "SandboxImplV1":
|
|
139
|
+
if metadata is None:
|
|
140
|
+
return cls(client, sandbox_id)
|
|
141
|
+
assert isinstance(metadata, api_pb2.SandboxHandleMetadata), f"{type(metadata)} is not SandboxHandleMetadata"
|
|
142
|
+
return cls(
|
|
143
|
+
client, sandbox_id, app_id=metadata.app_id, result=metadata.result if metadata.HasField("result") else None
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
def _hydrate_metadata(self, metadata: api_pb2.SandboxHandleMetadata) -> None:
|
|
147
|
+
self.app_id = metadata.app_id or self.app_id
|
|
148
|
+
if metadata.HasField("result"):
|
|
149
|
+
self.result = metadata.result
|
|
150
|
+
|
|
151
|
+
async def get_app_id(self) -> str:
|
|
152
|
+
return self.app_id
|
|
153
|
+
|
|
127
154
|
@property
|
|
128
155
|
def _client(self) -> _Client:
|
|
129
156
|
return self.client
|
|
130
157
|
|
|
131
158
|
def clone(self) -> "SandboxImplV1":
|
|
132
|
-
return type(self)(self.client, self.sandbox_id, result=self.result)
|
|
159
|
+
return type(self)(self.client, self.sandbox_id, result=self.result, app_id=self.app_id)
|
|
133
160
|
|
|
134
161
|
@classmethod
|
|
135
162
|
async def create(
|
|
136
163
|
cls, create_args: SandboxCreateArgs, *, app: "modal.app._App | None", client: _Client | None
|
|
137
|
-
) -> "
|
|
164
|
+
) -> "SandboxImpl":
|
|
138
165
|
if create_args.i6pn:
|
|
139
166
|
raise InvalidError("i6pn is not supported by V1 Sandboxes")
|
|
140
167
|
# V1 references every Secret by id, including ephemeral ones and the `env` dict.
|
|
@@ -177,7 +204,8 @@ class SandboxImplV1:
|
|
|
177
204
|
if logger.isEnabledFor(logging.DEBUG):
|
|
178
205
|
total_elapsed = time.monotonic() - load_start
|
|
179
206
|
logger.debug(_format_sandbox_create_timing_log(sandbox_id, total_elapsed, rpc_elapsed, dep_timings))
|
|
180
|
-
|
|
207
|
+
impl.app_id = create_resp.metadata.app_id
|
|
208
|
+
return impl
|
|
181
209
|
|
|
182
210
|
@classmethod
|
|
183
211
|
async def lookup_by_name(
|
|
@@ -186,8 +214,11 @@ class SandboxImplV1:
|
|
|
186
214
|
return await client._stub.SandboxGetFromName(req)
|
|
187
215
|
|
|
188
216
|
@classmethod
|
|
189
|
-
async def lookup_by_id(cls, client: _Client, sandbox_id: str) ->
|
|
190
|
-
|
|
217
|
+
async def lookup_by_id(cls, client: _Client, sandbox_id: str) -> "SandboxImpl":
|
|
218
|
+
resp = await client._stub.SandboxWait(api_pb2.SandboxWaitRequest(sandbox_id=sandbox_id, timeout=0))
|
|
219
|
+
impl = cls(client, sandbox_id)
|
|
220
|
+
impl._hydrate_metadata(resp.metadata)
|
|
221
|
+
return impl
|
|
191
222
|
|
|
192
223
|
@classmethod
|
|
193
224
|
async def list_page(cls, client: _Client, req: api_pb2.SandboxListRequest) -> api_pb2.SandboxListResponse:
|
|
@@ -201,7 +232,7 @@ class SandboxImplV1:
|
|
|
201
232
|
*,
|
|
202
233
|
override_type: "api_pb2.SandboxRestoreRequest.SandboxNameOverrideType.ValueType",
|
|
203
234
|
name_override: str | None,
|
|
204
|
-
) -> "
|
|
235
|
+
) -> "SandboxImpl":
|
|
205
236
|
restore_req = api_pb2.SandboxRestoreRequest(
|
|
206
237
|
snapshot_id=snapshot.object_id,
|
|
207
238
|
sandbox_name_override_type=override_type,
|
|
@@ -214,8 +245,10 @@ class SandboxImplV1:
|
|
|
214
245
|
restore_req.worker_id = worker_id
|
|
215
246
|
restore_resp: api_pb2.SandboxRestoreResponse = await client._stub.SandboxRestore(restore_req)
|
|
216
247
|
|
|
217
|
-
|
|
218
|
-
|
|
248
|
+
impl = await cls.lookup_by_id(client, restore_resp.sandbox_id)
|
|
249
|
+
# Metadata preserves empty results, but restore only caches final results.
|
|
250
|
+
if impl.result is not None and not impl.result.status:
|
|
251
|
+
impl.result = None
|
|
219
252
|
|
|
220
253
|
task_id_req = api_pb2.SandboxGetTaskIdRequest(
|
|
221
254
|
sandbox_id=restore_resp.sandbox_id, wait_until_ready=True, timeout=55.0
|
|
@@ -226,7 +259,7 @@ class SandboxImplV1:
|
|
|
226
259
|
api_pb2.GenericResult.GENERIC_STATUS_SUCCESS,
|
|
227
260
|
]:
|
|
228
261
|
raise ExecutionError(resp.task_result.exception)
|
|
229
|
-
return impl
|
|
262
|
+
return impl
|
|
230
263
|
|
|
231
264
|
def make_stdio(self, check_open: Callable[[], None]) -> tuple[StreamReader[str], StreamReader[str], StreamWriter]:
|
|
232
265
|
sandbox_id = self.sandbox_id
|