modal 1.6.5.dev10__tar.gz → 1.6.5.dev12__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.dev10 → modal-1.6.5.dev12}/PKG-INFO +1 -1
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_image.py +30 -7
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_partial_function.py +2 -1
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/user_code_imports.py +1 -2
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/image.py +22 -2
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/shell.py +21 -2
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/client.pyi +2 -2
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/experimental/__init__.py +0 -9
- modal-1.6.5.dev12/modal/experimental/_flash_container_entry.py +36 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/experimental/flash_server.py +0 -3
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/experimental/flash_server.pyi +0 -7
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/image.pyi +17 -4
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/partial_function.pyi +2 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal.egg-info/SOURCES.txt +0 -2
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/api_pb2.py +902 -894
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/api_pb2.pyi +31 -1
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_version/__init__.py +1 -1
- modal-1.6.5.dev10/modal/experimental/_flash_container_entry.py +0 -67
- modal-1.6.5.dev10/modal/experimental/flash.py +0 -327
- modal-1.6.5.dev10/modal/experimental/flash.pyi +0 -205
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/LICENSE +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/README.md +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/__main__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_audit_logs/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_audit_logs/_rpcs.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_audit_logs/count.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_audit_logs/list.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_billing.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_cluster.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_cluster.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_container_entrypoint.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_environments.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_experimental_outbound_policy.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_experimental_outbound_policy.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_function_variants.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_functions.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_grpc_client.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_ipython.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_load_context.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_location.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_logs.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_logs_manager.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_logs_manager.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_metrics.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_metrics.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_object.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_outbound_policy.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_outbound_policy.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_output/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_output/manager.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_output/pty.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_output/rich.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_output/status.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_resolver.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_resources.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/asgi.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/execution_context.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/task_lifecycle_manager.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/telemetry.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_serialization.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_server.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_server.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_supports_logs.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_traceback.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_tunnel.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_tunnel.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_type_manager.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/app_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/async_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/blob_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/browser_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/curl_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/deprecation.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/display_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/docker_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/function_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/git_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/hash_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/http_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/idle_countdown.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/logger.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/mount_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/name_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/oauth.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/package_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/proxy_support.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/sandbox_fs_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/shell_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_utils/time_utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_vendor/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_vendor/tblib.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_vendor/version.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_watcher.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/_workspace.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/app.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/app.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/billing.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/billing.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/2023.12.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/2024.04.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/2024.10.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/2025.06.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/2026.10.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/README.md +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/builder/base-images.json +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/call_graph.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/_audit_logs.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/_download.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/_help.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/_logs.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/_stats.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/_suggest.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/_traceback.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/app.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/billing.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/changelog.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/config.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/container.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/curl.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/dashboard.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/dict.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/endpoint.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/entry_point.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/environment.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/function.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/import_refs.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/logo.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/network_file_system.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/profile.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/queues.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/run.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/secret.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/selector.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/server.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/skills.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/token.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/utils.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/volume.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cli/workspace.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/client.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cls.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cls.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cluster.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/cluster.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/config.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/container_process.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/container_process.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/dict.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/dict.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/environments.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/environments.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/exception.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/experimental/stream.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/experimental/stream.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/file_pattern_matcher.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/functions.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/functions.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/image.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/io_streams.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/io_streams.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/mount.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/mount.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/network_file_system.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/network_file_system.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/object.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/object.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/output.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/parallel_map.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/parallel_map.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/partial_function.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/proxy.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/proxy.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/py.typed +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/queue.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/queue.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/retries.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/runner.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/runner.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/running_app.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_common.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_filesystem.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_impl_persistent.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_impl_v1.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_impl_v2.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_sandbox.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_sidecar.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_snapshot.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/_task_command_router_client.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/sandbox.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/sandbox/sandbox.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/schedule.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/scheduler_placement.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/secret.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/secret.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/server.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/server.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/serving.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/serving.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/skills/modal/SKILL.md +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/stream_type.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/token_flow.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/token_flow.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/types.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/volume.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/volume.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/workspace.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal/workspace.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal.egg-info/requires.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal.egg-info/top_level.txt +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/gen_cli_docs_main.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/gen_reference_docs_main.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/mdmd/types.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_docs/reference_intro.md +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/__init__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/api_grpc.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/py.typed +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/modal_version/__main__.py +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/pyproject.toml +0 -0
- {modal-1.6.5.dev10 → modal-1.6.5.dev12}/setup.cfg +0 -0
|
@@ -532,6 +532,10 @@ class DockerfileSpec:
|
|
|
532
532
|
context_files: dict[str, str] = field(default_factory=dict)
|
|
533
533
|
|
|
534
534
|
|
|
535
|
+
def _standalone_python_arch(platform: str | None, arch: "api_pb2.Arch.ValueType" = api_pb2.ARCH_UNSPECIFIED) -> str:
|
|
536
|
+
return "aarch64" if platform == "linux/arm64" or arch == api_pb2.ARCH_AARCH64 else "x86_64"
|
|
537
|
+
|
|
538
|
+
|
|
535
539
|
async def _image_await_build_result(image_id: str, client: _Client) -> api_pb2.ImageJoinStreamingResponse:
|
|
536
540
|
last_entry_id: str = ""
|
|
537
541
|
result_response: api_pb2.ImageJoinStreamingResponse | None = None
|
|
@@ -709,6 +713,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
709
713
|
_namespace: "api_pb2.DeploymentNamespace.ValueType" = api_pb2.DEPLOYMENT_NAMESPACE_WORKSPACE,
|
|
710
714
|
_do_assert_no_mount_layers: bool = True,
|
|
711
715
|
_arch: "api_pb2.Arch.ValueType" = api_pb2.ARCH_UNSPECIFIED,
|
|
716
|
+
_platform: str | None = None,
|
|
712
717
|
):
|
|
713
718
|
if base_images is None:
|
|
714
719
|
base_images = {}
|
|
@@ -833,6 +838,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
833
838
|
build_args=build_args,
|
|
834
839
|
volume_mounts=volume_mounts,
|
|
835
840
|
arch=_arch,
|
|
841
|
+
platform=_platform or "",
|
|
836
842
|
)
|
|
837
843
|
|
|
838
844
|
req = api_pb2.ImageGetOrCreateRequest(
|
|
@@ -2170,12 +2176,15 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2170
2176
|
def micromamba(
|
|
2171
2177
|
python_version: str | None = None,
|
|
2172
2178
|
force_build: bool = False,
|
|
2179
|
+
*,
|
|
2180
|
+
platform: str | None = None,
|
|
2173
2181
|
) -> "_Image":
|
|
2174
2182
|
"""A Micromamba base image. Micromamba allows for fast building of small Conda-based containers.
|
|
2175
2183
|
|
|
2176
2184
|
Args:
|
|
2177
2185
|
python_version: Python series or full version to install in the base conda environment.
|
|
2178
2186
|
force_build: If True, skip cached image builds.
|
|
2187
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
|
|
2179
2188
|
|
|
2180
2189
|
Returns:
|
|
2181
2190
|
A Micromamba-based `Image`.
|
|
@@ -2205,6 +2214,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2205
2214
|
dockerfile_function=build_dockerfile,
|
|
2206
2215
|
force_build=force_build,
|
|
2207
2216
|
_namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
|
|
2217
|
+
_platform=platform,
|
|
2208
2218
|
)
|
|
2209
2219
|
|
|
2210
2220
|
@_requires_image_instance
|
|
@@ -2319,11 +2329,12 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2319
2329
|
setup_dockerfile_commands: list[str] = [],
|
|
2320
2330
|
force_build: bool = False,
|
|
2321
2331
|
add_python: str | None = None,
|
|
2332
|
+
platform: str | None = None,
|
|
2322
2333
|
**kwargs,
|
|
2323
2334
|
) -> "_Image":
|
|
2324
2335
|
"""Build a Modal Image from a public or private image registry, such as Docker Hub.
|
|
2325
2336
|
|
|
2326
|
-
The image must
|
|
2337
|
+
The registry image must have a variant for `platform`, if set.
|
|
2327
2338
|
|
|
2328
2339
|
If your image does not come with Python installed, you can use the `add_python` parameter
|
|
2329
2340
|
to specify a version of Python to add to the image. Otherwise, the image is expected to
|
|
@@ -2351,6 +2362,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2351
2362
|
setup_dockerfile_commands: Extra Dockerfile lines run after ``FROM`` during base setup.
|
|
2352
2363
|
force_build: If True, skip cached image builds.
|
|
2353
2364
|
add_python: Optional standalone Python series to inject when the base image lacks Python.
|
|
2365
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`.
|
|
2354
2366
|
**kwargs: Additional arguments forwarded to the internal image constructor (e.g. registry config).
|
|
2355
2367
|
|
|
2356
2368
|
Returns:
|
|
@@ -2361,6 +2373,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2361
2373
|
modal.Image.from_registry("python:3.11-slim-bookworm")
|
|
2362
2374
|
modal.Image.from_registry("ubuntu:22.04", add_python="3.11")
|
|
2363
2375
|
modal.Image.from_registry("nvcr.io/nvidia/pytorch:22.12-py3")
|
|
2376
|
+
modal.Image.from_registry("python:3.12-slim", platform="linux/arm64")
|
|
2364
2377
|
modal.Image.from_registry(
|
|
2365
2378
|
"ghcr.io/my-org/my-image:latest",
|
|
2366
2379
|
secret=modal.Secret.from_name("my-registry-secret"),
|
|
@@ -2373,9 +2386,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2373
2386
|
def context_mount_function(builder_version: ImageBuilderVersion) -> _Mount | None:
|
|
2374
2387
|
return (
|
|
2375
2388
|
_Mount.from_name(
|
|
2376
|
-
python_standalone_mount_name(
|
|
2377
|
-
add_python, builder_version, "aarch64" if arch == api_pb2.ARCH_AARCH64 else "x86_64"
|
|
2378
|
-
),
|
|
2389
|
+
python_standalone_mount_name(add_python, builder_version, _standalone_python_arch(platform, arch)),
|
|
2379
2390
|
namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
|
|
2380
2391
|
)
|
|
2381
2392
|
if add_python
|
|
@@ -2396,6 +2407,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2396
2407
|
dockerfile_function=build_dockerfile,
|
|
2397
2408
|
context_mount_function=context_mount_function,
|
|
2398
2409
|
force_build=force_build,
|
|
2410
|
+
_platform=platform,
|
|
2399
2411
|
**kwargs,
|
|
2400
2412
|
)
|
|
2401
2413
|
if not add_python:
|
|
@@ -2407,6 +2419,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2407
2419
|
image_registry_config=kwargs.get("image_registry_config"),
|
|
2408
2420
|
force_build=force_build,
|
|
2409
2421
|
_arch=arch,
|
|
2422
|
+
_platform=platform,
|
|
2410
2423
|
)
|
|
2411
2424
|
|
|
2412
2425
|
def build_python_dockerfile(version: ImageBuilderVersion) -> DockerfileSpec:
|
|
@@ -2579,6 +2592,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2579
2592
|
env: dict[str, str | None] | None = None,
|
|
2580
2593
|
gpu: str | None = None,
|
|
2581
2594
|
add_python: str | None = None,
|
|
2595
|
+
platform: str | None = None,
|
|
2582
2596
|
) -> "_Image":
|
|
2583
2597
|
"""Build a Modal image from a local Dockerfile.
|
|
2584
2598
|
|
|
@@ -2599,6 +2613,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2599
2613
|
env: Environment variables set in the build container.
|
|
2600
2614
|
gpu: GPU type to attach to the build container.
|
|
2601
2615
|
add_python: Standalone Python version to add when the Dockerfile does not install Python.
|
|
2616
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`.
|
|
2602
2617
|
|
|
2603
2618
|
Returns:
|
|
2604
2619
|
An `Image` built from the Dockerfile plus Modal runtime dependencies.
|
|
@@ -2680,12 +2695,13 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2680
2695
|
build_args=build_args,
|
|
2681
2696
|
image_registry_config=image_registry_config,
|
|
2682
2697
|
force_build=force_build,
|
|
2698
|
+
_platform=platform if base_images is None else None,
|
|
2683
2699
|
)
|
|
2684
2700
|
|
|
2685
2701
|
def add_python_mount(builder_version: ImageBuilderVersion) -> _Mount | None:
|
|
2686
2702
|
return (
|
|
2687
2703
|
_Mount.from_name(
|
|
2688
|
-
python_standalone_mount_name(add_python, builder_version),
|
|
2704
|
+
python_standalone_mount_name(add_python, builder_version, _standalone_python_arch(platform)),
|
|
2689
2705
|
namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
|
|
2690
2706
|
)
|
|
2691
2707
|
if add_python
|
|
@@ -2735,6 +2751,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2735
2751
|
dockerfile_function=lambda version: DockerfileSpec(commands=from_lines, context_files={}),
|
|
2736
2752
|
image_registry_config=registry_config,
|
|
2737
2753
|
force_build=force_build,
|
|
2754
|
+
_platform=platform,
|
|
2738
2755
|
)
|
|
2739
2756
|
rest = dockerfile_lines[from_index + 1 :]
|
|
2740
2757
|
rest_is_empty = all(not line.strip() or line.strip().startswith("#") for line in rest)
|
|
@@ -2757,7 +2774,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2757
2774
|
return obj
|
|
2758
2775
|
|
|
2759
2776
|
@staticmethod
|
|
2760
|
-
def from_scratch(force_build: bool = False) -> "_Image":
|
|
2777
|
+
def from_scratch(force_build: bool = False, *, platform: str | None = None) -> "_Image":
|
|
2761
2778
|
"""Create an empty Image, equivalent to `FROM scratch` in Docker.
|
|
2762
2779
|
|
|
2763
2780
|
The resulting Image has no operating system, shell, or package manager. It is
|
|
@@ -2770,6 +2787,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2770
2787
|
|
|
2771
2788
|
Args:
|
|
2772
2789
|
force_build: If True, skip cached image builds.
|
|
2790
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
|
|
2773
2791
|
|
|
2774
2792
|
Returns:
|
|
2775
2793
|
An empty `Image` suitable for minimal filesystem mounts.
|
|
@@ -2787,17 +2805,21 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2787
2805
|
dockerfile_function=build_dockerfile,
|
|
2788
2806
|
force_build=force_build,
|
|
2789
2807
|
_namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
|
|
2808
|
+
_platform=platform,
|
|
2790
2809
|
)
|
|
2791
2810
|
image._is_empty = True
|
|
2792
2811
|
return image
|
|
2793
2812
|
|
|
2794
2813
|
@staticmethod
|
|
2795
|
-
def debian_slim(
|
|
2814
|
+
def debian_slim(
|
|
2815
|
+
python_version: str | None = None, force_build: bool = False, *, platform: str | None = None
|
|
2816
|
+
) -> "_Image":
|
|
2796
2817
|
"""Default image, based on the official `python` Docker images.
|
|
2797
2818
|
|
|
2798
2819
|
Args:
|
|
2799
2820
|
python_version: Python series or full version to use from the Debian slim images.
|
|
2800
2821
|
force_build: If True, skip cached image builds.
|
|
2822
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
|
|
2801
2823
|
|
|
2802
2824
|
Returns:
|
|
2803
2825
|
The standard Debian slim Python `Image` used as Modal's default base.
|
|
@@ -2855,6 +2877,7 @@ class _Image(_Object, type_prefixes=("im",)):
|
|
|
2855
2877
|
dockerfile_function=build_dockerfile,
|
|
2856
2878
|
force_build=force_build,
|
|
2857
2879
|
_namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
|
|
2880
|
+
_platform=platform,
|
|
2858
2881
|
)
|
|
2859
2882
|
|
|
2860
2883
|
@_requires_image_instance
|
|
@@ -910,8 +910,9 @@ def _localized(
|
|
|
910
910
|
max_distance="long",
|
|
911
911
|
)
|
|
912
912
|
```
|
|
913
|
+
|
|
914
|
+
See the [localized placement guide](https://modal.com/docs/guide/localized) for more information.
|
|
913
915
|
"""
|
|
914
|
-
# TODO(clairec): Add the localized placement guide link once available.
|
|
915
916
|
localized = {
|
|
916
917
|
"target_location": target_location,
|
|
917
918
|
"preferred_distance": preferred_distance,
|
|
@@ -367,7 +367,7 @@ class _LifecycleManager:
|
|
|
367
367
|
task_lifecycle_manager: "modal._runtime.task_lifecycle_manager.TaskLifecycleManager",
|
|
368
368
|
):
|
|
369
369
|
# Identify the "enter" methods to run after resuming from a snapshot.
|
|
370
|
-
flash_entry = _FlashContainerEntry(self.function_def.http_config
|
|
370
|
+
flash_entry = _FlashContainerEntry(self.function_def.http_config)
|
|
371
371
|
if not self.function_def.is_auto_snapshot:
|
|
372
372
|
post_snapshot_methods = _find_callables_for_obj(
|
|
373
373
|
self.user_cls_instance, _PartialFunctionFlags.ENTER_POST_SNAPSHOT
|
|
@@ -378,7 +378,6 @@ class _LifecycleManager:
|
|
|
378
378
|
yield
|
|
379
379
|
finally:
|
|
380
380
|
if not self.function_def.is_auto_snapshot:
|
|
381
|
-
flash_entry.stop()
|
|
382
381
|
exit_methods = _find_callables_for_obj(self.user_cls_instance, _PartialFunctionFlags.EXIT)
|
|
383
382
|
call_lifecycle_functions(event_loop, task_lifecycle_manager, list(exit_methods.values()))
|
|
384
383
|
flash_entry.close()
|
|
@@ -122,6 +122,13 @@ def _check_registry_host(image_ref: str) -> None:
|
|
|
122
122
|
),
|
|
123
123
|
)
|
|
124
124
|
@click.option("--force-build", is_flag=True, help="Rebuild every layer of the Image, ignoring cached builds.")
|
|
125
|
+
@click.option(
|
|
126
|
+
"--platform",
|
|
127
|
+
"image_platform",
|
|
128
|
+
default=None,
|
|
129
|
+
metavar="OS/ARCH",
|
|
130
|
+
help="Platform of the Image, e.g. `linux/arm64`.",
|
|
131
|
+
)
|
|
125
132
|
@env_option
|
|
126
133
|
@synchronizer.create_blocking
|
|
127
134
|
async def build(
|
|
@@ -131,6 +138,7 @@ async def build(
|
|
|
131
138
|
registry_secret_name: Optional[str],
|
|
132
139
|
registry_secret_vars: Optional[str],
|
|
133
140
|
force_build: bool,
|
|
141
|
+
image_platform: Optional[str],
|
|
134
142
|
env: Optional[str],
|
|
135
143
|
) -> None:
|
|
136
144
|
"""Build an Image from a Dockerfile and publish it as NAME.
|
|
@@ -145,6 +153,7 @@ async def build(
|
|
|
145
153
|
|
|
146
154
|
```
|
|
147
155
|
modal image build -t my-image .
|
|
156
|
+
modal image build -t my-image --platform linux/arm64 .
|
|
148
157
|
modal image build --name my-image:v2 -f docker/Dockerfile .
|
|
149
158
|
modal image build -t my-env/my-image .
|
|
150
159
|
modal image build -t my-image --registry-secret my-registry-creds .
|
|
@@ -170,7 +179,9 @@ async def build(
|
|
|
170
179
|
_infer_registry_auth_type(keys)
|
|
171
180
|
except InvalidError as exc:
|
|
172
181
|
raise click.UsageError(str(exc)) from exc
|
|
173
|
-
image = _Image.from_dockerfile(
|
|
182
|
+
image = _Image.from_dockerfile(
|
|
183
|
+
dockerfile, context_dir=context_dir, registry_secret=secret, force_build=force_build, platform=image_platform
|
|
184
|
+
)
|
|
174
185
|
app = _App("modal-image-build")
|
|
175
186
|
# Only show the Image build output, which includes its logs
|
|
176
187
|
async with _run_app(app, environment_name=env, stream_output=False):
|
|
@@ -213,6 +224,13 @@ async def build(
|
|
|
213
224
|
is_flag=True,
|
|
214
225
|
help="Pull the image from the registry again, replacing a cached Image.",
|
|
215
226
|
)
|
|
227
|
+
@click.option(
|
|
228
|
+
"--platform",
|
|
229
|
+
"image_platform",
|
|
230
|
+
default=None,
|
|
231
|
+
metavar="OS/ARCH",
|
|
232
|
+
help="Platform of the Image, e.g. `linux/arm64`.",
|
|
233
|
+
)
|
|
216
234
|
@env_option
|
|
217
235
|
@synchronizer.create_blocking
|
|
218
236
|
async def pull(
|
|
@@ -222,6 +240,7 @@ async def pull(
|
|
|
222
240
|
registry_secret_name: Optional[str] = None,
|
|
223
241
|
registry_secret_vars: Optional[str] = None,
|
|
224
242
|
force_build: bool = False,
|
|
243
|
+
image_platform: Optional[str] = None,
|
|
225
244
|
env: Optional[str] = None,
|
|
226
245
|
) -> None:
|
|
227
246
|
"""Pull an Image from a container registry into Modal.
|
|
@@ -236,6 +255,7 @@ async def pull(
|
|
|
236
255
|
|
|
237
256
|
```bash
|
|
238
257
|
modal image pull docker.io/node:20
|
|
258
|
+
modal image pull docker.io/node:20 --platform linux/arm64
|
|
239
259
|
modal image pull nvcr.io/nvidia/pytorch:25.01-py3 --name pytorch:25
|
|
240
260
|
modal image pull docker.io/node:20 --name prod/node:20
|
|
241
261
|
```
|
|
@@ -270,7 +290,7 @@ async def pull(
|
|
|
270
290
|
_infer_registry_auth_type(keys)
|
|
271
291
|
except InvalidError as exc:
|
|
272
292
|
raise click.UsageError(str(exc)) from exc
|
|
273
|
-
image = _Image.from_registry(image_ref, secret, force_build=force_build)
|
|
293
|
+
image = _Image.from_registry(image_ref, secret, force_build=force_build, platform=image_platform)
|
|
274
294
|
|
|
275
295
|
app = _App("modal-image-pull")
|
|
276
296
|
async with _run_app(app, environment_name=env, stream_output=False):
|
|
@@ -276,6 +276,13 @@ def _start_shell_from_image(
|
|
|
276
276
|
@click.option("-e", "--env", default=None, help=ENV_OPTION_HELP)
|
|
277
277
|
@click.option("--image", default=None, help="Container image tag for inside the shell (if not using REF).")
|
|
278
278
|
@click.option("--add-python", default=None, help="Add Python to the image (if not using REF).")
|
|
279
|
+
@click.option(
|
|
280
|
+
"--platform",
|
|
281
|
+
"image_platform",
|
|
282
|
+
default=None,
|
|
283
|
+
metavar="OS/ARCH",
|
|
284
|
+
help="Platform of the image, e.g. `linux/arm64` (if not using REF).",
|
|
285
|
+
)
|
|
279
286
|
@click.option(
|
|
280
287
|
"--volume",
|
|
281
288
|
multiple=True,
|
|
@@ -357,6 +364,7 @@ def shell(
|
|
|
357
364
|
env: str | None = None,
|
|
358
365
|
image: str | None = None,
|
|
359
366
|
add_python: str | None = None,
|
|
367
|
+
image_platform: str | None = None,
|
|
360
368
|
volume: tuple[str, ...] = (),
|
|
361
369
|
add_local: tuple[str, ...] = (),
|
|
362
370
|
secret: tuple[str, ...] = (),
|
|
@@ -407,6 +415,12 @@ def shell(
|
|
|
407
415
|
modal shell hello_world.py -c 'uv pip list' > env.txt
|
|
408
416
|
```
|
|
409
417
|
|
|
418
|
+
Start a shell inside an arm64 image:
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
modal shell --platform linux/arm64
|
|
422
|
+
```
|
|
423
|
+
|
|
410
424
|
Start a shell inside a virtual machine:
|
|
411
425
|
|
|
412
426
|
```
|
|
@@ -472,7 +486,7 @@ def shell(
|
|
|
472
486
|
if ref is not None and _is_valid_modal_id(ref, "im-"):
|
|
473
487
|
ctx = click.get_current_context()
|
|
474
488
|
if passed_forbidden := _passed_forbidden_args(
|
|
475
|
-
shell.params, ctx, locals(), allowed=lambda p: p not in {"add_python", "image"}
|
|
489
|
+
shell.params, ctx, locals(), allowed=lambda p: p not in {"add_python", "image", "image_platform"}
|
|
476
490
|
):
|
|
477
491
|
raise ClickException(
|
|
478
492
|
f"Cannot specify {', '.join(passed_forbidden)} argument(s) "
|
|
@@ -480,7 +494,12 @@ def shell(
|
|
|
480
494
|
)
|
|
481
495
|
modal_image = Image.from_id(ref)
|
|
482
496
|
else:
|
|
483
|
-
|
|
497
|
+
if image:
|
|
498
|
+
modal_image = Image.from_registry(image, add_python=add_python, platform=image_platform)
|
|
499
|
+
elif image_platform:
|
|
500
|
+
modal_image = Image.debian_slim(platform=image_platform)
|
|
501
|
+
else:
|
|
502
|
+
modal_image = None
|
|
484
503
|
|
|
485
504
|
_start_shell_from_image(
|
|
486
505
|
app,
|
|
@@ -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.6.5.
|
|
81
|
+
version: str = "1.6.5.dev12",
|
|
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.6.5.
|
|
298
|
+
version: str = "1.6.5.dev12",
|
|
299
299
|
*,
|
|
300
300
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
301
301
|
):
|
|
@@ -27,15 +27,6 @@ from ..cls import _Cls
|
|
|
27
27
|
from ..exception import InvalidError as InvalidError
|
|
28
28
|
from ..partial_function import clustered as _public_clustered, localized as localized
|
|
29
29
|
from ..secret import _Secret as _Secret
|
|
30
|
-
from .flash import ( # noqa: F401
|
|
31
|
-
flash_forward,
|
|
32
|
-
flash_get_containers,
|
|
33
|
-
http_server,
|
|
34
|
-
)
|
|
35
|
-
from .flash_server import ( # noqa: F401
|
|
36
|
-
ServerManager,
|
|
37
|
-
server_forward,
|
|
38
|
-
)
|
|
39
30
|
from .stream import (
|
|
40
31
|
AppendResult as AppendResult,
|
|
41
32
|
Entry as Entry,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Copyright Modal Labs 2025
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
from modal_proto import api_pb2
|
|
5
|
+
|
|
6
|
+
from .._runtime.task_lifecycle_manager import UserException
|
|
7
|
+
from ..config import logger
|
|
8
|
+
from .flash_server import ServerManager, server_forward
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class _FlashContainerEntry:
|
|
12
|
+
"""
|
|
13
|
+
A class that manages the lifecycle of Flash manager for Flash containers.
|
|
14
|
+
|
|
15
|
+
It is intentional that stop() runs before exit handlers and close(): new requests stop arriving
|
|
16
|
+
before exit handlers run, and in-flight requests keep working until the exit grace period has
|
|
17
|
+
elapsed. For server containers both calls are no-ops.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
flash_manager: ServerManager | None
|
|
21
|
+
|
|
22
|
+
def __init__(self, http_config: api_pb2.HTTPConfig):
|
|
23
|
+
self.http_config: api_pb2.HTTPConfig = http_config
|
|
24
|
+
self.flash_manager = None
|
|
25
|
+
|
|
26
|
+
def enter(self):
|
|
27
|
+
if self.http_config != api_pb2.HTTPConfig():
|
|
28
|
+
try:
|
|
29
|
+
self.flash_manager = server_forward()
|
|
30
|
+
except Exception as e:
|
|
31
|
+
logger.warning(f"[Modal Server] Startup failed: {e}")
|
|
32
|
+
raise UserException()
|
|
33
|
+
|
|
34
|
+
def close(self):
|
|
35
|
+
if self.flash_manager:
|
|
36
|
+
self.flash_manager.close()
|
|
@@ -20,9 +20,6 @@ class _ServerManager:
|
|
|
20
20
|
await self.client._stub.ContainerServerLifecycleReady(api_pb2.ContainerServerLifecycleReadyRequest())
|
|
21
21
|
logger.warning(f"[Modal Server] Ready for task {self.task_id}.")
|
|
22
22
|
|
|
23
|
-
async def stop(self):
|
|
24
|
-
pass
|
|
25
|
-
|
|
26
23
|
async def close(self):
|
|
27
24
|
logger.warning(f"[Modal Server] Drained for task {self.task_id}.")
|
|
28
25
|
|
|
@@ -7,7 +7,6 @@ class _ServerManager:
|
|
|
7
7
|
...
|
|
8
8
|
|
|
9
9
|
async def _start(self): ...
|
|
10
|
-
async def stop(self): ...
|
|
11
10
|
async def close(self): ...
|
|
12
11
|
|
|
13
12
|
class ServerManager:
|
|
@@ -19,12 +18,6 @@ class ServerManager:
|
|
|
19
18
|
|
|
20
19
|
_start: ___start_spec
|
|
21
20
|
|
|
22
|
-
class __stop_spec(typing_extensions.Protocol):
|
|
23
|
-
def __call__(self, /): ...
|
|
24
|
-
async def aio(self, /): ...
|
|
25
|
-
|
|
26
|
-
stop: __stop_spec
|
|
27
|
-
|
|
28
21
|
class __close_spec(typing_extensions.Protocol):
|
|
29
22
|
def __call__(self, /): ...
|
|
30
23
|
async def aio(self, /): ...
|
|
@@ -87,6 +87,7 @@ class Image(modal.object.Object):
|
|
|
87
87
|
_namespace: int = 1,
|
|
88
88
|
_do_assert_no_mount_layers: bool = True,
|
|
89
89
|
_arch: int = 0,
|
|
90
|
+
_platform: typing.Optional[str] = None,
|
|
90
91
|
): ...
|
|
91
92
|
def _copy_mount(self, mount: modal.mount.Mount, remote_path: typing.Union[str, pathlib.Path] = ".") -> Image:
|
|
92
93
|
"""mdmd:hidden
|
|
@@ -835,12 +836,15 @@ class Image(modal.object.Object):
|
|
|
835
836
|
...
|
|
836
837
|
|
|
837
838
|
@staticmethod
|
|
838
|
-
def micromamba(
|
|
839
|
+
def micromamba(
|
|
840
|
+
python_version: typing.Optional[str] = None, force_build: bool = False, *, platform: typing.Optional[str] = None
|
|
841
|
+
) -> Image:
|
|
839
842
|
"""A Micromamba base image. Micromamba allows for fast building of small Conda-based containers.
|
|
840
843
|
|
|
841
844
|
Args:
|
|
842
845
|
python_version: Python series or full version to install in the base conda environment.
|
|
843
846
|
force_build: If True, skip cached image builds.
|
|
847
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
|
|
844
848
|
|
|
845
849
|
Returns:
|
|
846
850
|
A Micromamba-based `Image`.
|
|
@@ -888,11 +892,12 @@ class Image(modal.object.Object):
|
|
|
888
892
|
setup_dockerfile_commands: list[str] = [],
|
|
889
893
|
force_build: bool = False,
|
|
890
894
|
add_python: typing.Optional[str] = None,
|
|
895
|
+
platform: typing.Optional[str] = None,
|
|
891
896
|
**kwargs,
|
|
892
897
|
) -> Image:
|
|
893
898
|
"""Build a Modal Image from a public or private image registry, such as Docker Hub.
|
|
894
899
|
|
|
895
|
-
The image must
|
|
900
|
+
The registry image must have a variant for `platform`, if set.
|
|
896
901
|
|
|
897
902
|
If your image does not come with Python installed, you can use the `add_python` parameter
|
|
898
903
|
to specify a version of Python to add to the image. Otherwise, the image is expected to
|
|
@@ -920,6 +925,7 @@ class Image(modal.object.Object):
|
|
|
920
925
|
setup_dockerfile_commands: Extra Dockerfile lines run after ``FROM`` during base setup.
|
|
921
926
|
force_build: If True, skip cached image builds.
|
|
922
927
|
add_python: Optional standalone Python series to inject when the base image lacks Python.
|
|
928
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`.
|
|
923
929
|
**kwargs: Additional arguments forwarded to the internal image constructor (e.g. registry config).
|
|
924
930
|
|
|
925
931
|
Returns:
|
|
@@ -930,6 +936,7 @@ class Image(modal.object.Object):
|
|
|
930
936
|
modal.Image.from_registry("python:3.11-slim-bookworm")
|
|
931
937
|
modal.Image.from_registry("ubuntu:22.04", add_python="3.11")
|
|
932
938
|
modal.Image.from_registry("nvcr.io/nvidia/pytorch:22.12-py3")
|
|
939
|
+
modal.Image.from_registry("python:3.12-slim", platform="linux/arm64")
|
|
933
940
|
modal.Image.from_registry(
|
|
934
941
|
"ghcr.io/my-org/my-image:latest",
|
|
935
942
|
secret=modal.Secret.from_name("my-registry-secret"),
|
|
@@ -1063,6 +1070,7 @@ class Image(modal.object.Object):
|
|
|
1063
1070
|
env: typing.Optional[dict[str, typing.Optional[str]]] = None,
|
|
1064
1071
|
gpu: typing.Optional[str] = None,
|
|
1065
1072
|
add_python: typing.Optional[str] = None,
|
|
1073
|
+
platform: typing.Optional[str] = None,
|
|
1066
1074
|
) -> Image:
|
|
1067
1075
|
"""Build a Modal image from a local Dockerfile.
|
|
1068
1076
|
|
|
@@ -1083,6 +1091,7 @@ class Image(modal.object.Object):
|
|
|
1083
1091
|
env: Environment variables set in the build container.
|
|
1084
1092
|
gpu: GPU type to attach to the build container.
|
|
1085
1093
|
add_python: Standalone Python version to add when the Dockerfile does not install Python.
|
|
1094
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`.
|
|
1086
1095
|
|
|
1087
1096
|
Returns:
|
|
1088
1097
|
An `Image` built from the Dockerfile plus Modal runtime dependencies.
|
|
@@ -1139,7 +1148,7 @@ class Image(modal.object.Object):
|
|
|
1139
1148
|
...
|
|
1140
1149
|
|
|
1141
1150
|
@staticmethod
|
|
1142
|
-
def from_scratch(force_build: bool = False) -> Image:
|
|
1151
|
+
def from_scratch(force_build: bool = False, *, platform: typing.Optional[str] = None) -> Image:
|
|
1143
1152
|
"""Create an empty Image, equivalent to `FROM scratch` in Docker.
|
|
1144
1153
|
|
|
1145
1154
|
The resulting Image has no operating system, shell, or package manager. It is
|
|
@@ -1152,6 +1161,7 @@ class Image(modal.object.Object):
|
|
|
1152
1161
|
|
|
1153
1162
|
Args:
|
|
1154
1163
|
force_build: If True, skip cached image builds.
|
|
1164
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
|
|
1155
1165
|
|
|
1156
1166
|
Returns:
|
|
1157
1167
|
An empty `Image` suitable for minimal filesystem mounts.
|
|
@@ -1164,12 +1174,15 @@ class Image(modal.object.Object):
|
|
|
1164
1174
|
...
|
|
1165
1175
|
|
|
1166
1176
|
@staticmethod
|
|
1167
|
-
def debian_slim(
|
|
1177
|
+
def debian_slim(
|
|
1178
|
+
python_version: typing.Optional[str] = None, force_build: bool = False, *, platform: typing.Optional[str] = None
|
|
1179
|
+
) -> Image:
|
|
1168
1180
|
"""Default image, based on the official `python` Docker images.
|
|
1169
1181
|
|
|
1170
1182
|
Args:
|
|
1171
1183
|
python_version: Python series or full version to use from the Debian slim images.
|
|
1172
1184
|
force_build: If True, skip cached image builds.
|
|
1185
|
+
platform: Platform of the Image as `"linux/<arch>"`, e.g. `"linux/arm64"`. Defaults to `"linux/amd64"`.
|
|
1173
1186
|
|
|
1174
1187
|
Returns:
|
|
1175
1188
|
The standard Debian slim Python `Image` used as Modal's default base.
|
|
@@ -211,8 +211,6 @@ modal/cli/volume.py
|
|
|
211
211
|
modal/cli/workspace.py
|
|
212
212
|
modal/experimental/__init__.py
|
|
213
213
|
modal/experimental/_flash_container_entry.py
|
|
214
|
-
modal/experimental/flash.py
|
|
215
|
-
modal/experimental/flash.pyi
|
|
216
214
|
modal/experimental/flash_server.py
|
|
217
215
|
modal/experimental/flash_server.pyi
|
|
218
216
|
modal/experimental/stream.py
|