modal 1.3.5.dev0__tar.gz → 1.3.6.dev0__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.3.6.dev0/LICENSE +176 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/PKG-INFO +4 -3
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_functions.py +4 -1
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_output/pty.py +3 -2
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_output/rich.py +18 -12
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_tunnel.py +9 -0
- modal-1.3.6.dev0/modal/_utils/sandbox_fs_utils.py +157 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/app.py +15 -2
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/app.pyi +3 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/app.py +3 -2
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/changelog.py +7 -5
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/container.py +4 -3
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/run.py +9 -3
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/utils.py +18 -6
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/client.pyi +2 -2
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/exception.py +36 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/experimental/flash.py +1 -1
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/file_io.py +252 -165
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/file_io.pyi +39 -33
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/functions.pyi +6 -6
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/runner.py +99 -4
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/runner.pyi +14 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/sandbox.py +31 -5
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/sandbox.pyi +21 -0
- modal-1.3.6.dev0/modal/sandbox_fs.py +311 -0
- modal-1.3.6.dev0/modal/sandbox_fs.pyi +507 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/serving.py +1 -1
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal.egg-info/PKG-INFO +4 -3
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal.egg-info/SOURCES.txt +6 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_docs/gen_cli_docs.py +0 -1
- modal-1.3.6.dev0/modal_docs/gen_cli_docs_main.py +8 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_docs/gen_reference_docs.py +0 -1
- modal-1.3.6.dev0/modal_docs/gen_reference_docs_main.py +8 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_docs/mdmd/mdmd.py +17 -2
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/api_grpc.py +48 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/api_pb2.py +1128 -1057
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/api_pb2.pyi +197 -4
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/api_pb2_grpc.py +99 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/api_pb2_grpc.pyi +30 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/modal_api_grpc.py +3 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_version/__init__.py +1 -1
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/pyproject.toml +1 -2
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/README.md +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/__main__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_billing.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_clustered_functions.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_clustered_functions.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_container_entrypoint.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_grpc_client.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_ipython.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_load_context.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_location.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_object.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_output/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_output/manager.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_output/status.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_partial_function.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_resolver.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_resources.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/asgi.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/execution_context.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/telemetry.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_serialization.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_server.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_traceback.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_tunnel.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_type_manager.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/app_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/async_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/blob_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/browser_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/deprecation.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/docker_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/function_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/git_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/hash_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/http_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/logger.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/mount_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/name_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/package_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/shell_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/task_command_router_client.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_utils/time_utils.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_vendor/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_vendor/tblib.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_vendor/version.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/_watcher.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/billing.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/builder/2023.12.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/builder/2024.04.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/builder/2024.10.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/builder/2025.06.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/builder/README.md +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/builder/base-images.json +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/call_graph.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/_download.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/_traceback.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/billing.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/cluster.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/config.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/dashboard.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/dict.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/entry_point.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/environment.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/import_refs.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/launch.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/network_file_system.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/profile.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/programs/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/programs/vscode.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/queues.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/secret.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/selector.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/shell.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/token.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cli/volume.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/client.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cls.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/cls.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/config.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/container_process.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/container_process.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/dict.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/dict.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/environments.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/environments.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/experimental/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/experimental/flash.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/experimental/ipython.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/file_pattern_matcher.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/functions.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/gpu.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/image.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/image.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/io_streams.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/io_streams.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/mount.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/mount.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/network_file_system.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/network_file_system.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/object.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/object.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/output.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/parallel_map.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/parallel_map.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/partial_function.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/partial_function.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/proxy.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/proxy.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/py.typed +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/queue.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/queue.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/retries.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/running_app.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/schedule.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/scheduler_placement.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/secret.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/secret.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/server.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/server.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/serving.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/snapshot.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/snapshot.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/stream_type.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/token_flow.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/token_flow.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/volume.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal/volume.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal.egg-info/requires.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal.egg-info/top_level.txt +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_docs/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/__init__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/py.typed +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/modal_version/__main__.py +0 -0
- {modal-1.3.5.dev0 → modal-1.3.6.dev0}/setup.cfg +0 -0
modal-1.3.6.dev0/LICENSE
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: modal
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.6.dev0
|
|
4
4
|
Summary: Python client library for Modal
|
|
5
5
|
Author-email: Modal Labs <support@modal.com>
|
|
6
|
-
License: Apache-2.0
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
7
|
Project-URL: Homepage, https://modal.com
|
|
8
8
|
Project-URL: Source, https://github.com/modal-labs/modal-client
|
|
9
9
|
Project-URL: Documentation, https://modal.com/docs
|
|
@@ -11,10 +11,10 @@ Project-URL: Issue Tracker, https://github.com/modal-labs/modal-client/issues
|
|
|
11
11
|
Keywords: modal,client,cloud,serverless,infrastructure
|
|
12
12
|
Classifier: Topic :: System :: Distributed Computing
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
14
|
Classifier: Programming Language :: Python :: 3
|
|
16
15
|
Requires-Python: <3.15,>=3.10
|
|
17
16
|
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
18
|
Requires-Dist: aiohttp
|
|
19
19
|
Requires-Dist: cbor2
|
|
20
20
|
Requires-Dist: certifi
|
|
@@ -30,6 +30,7 @@ Requires-Dist: types-certifi
|
|
|
30
30
|
Requires-Dist: types-toml
|
|
31
31
|
Requires-Dist: watchfiles
|
|
32
32
|
Requires-Dist: typing_extensions~=4.6
|
|
33
|
+
Dynamic: license-file
|
|
33
34
|
|
|
34
35
|
# Modal Python SDK
|
|
35
36
|
|
|
@@ -550,6 +550,7 @@ class FunctionStats:
|
|
|
550
550
|
|
|
551
551
|
backlog: int
|
|
552
552
|
num_total_runners: int
|
|
553
|
+
num_running_inputs: int
|
|
553
554
|
|
|
554
555
|
|
|
555
556
|
def _parse_retries(
|
|
@@ -1917,7 +1918,9 @@ Use the `Function.get_web_url()` method instead.
|
|
|
1917
1918
|
api_pb2.FunctionGetCurrentStatsRequest(function_id=self.object_id),
|
|
1918
1919
|
retry=Retry(total_timeout=10.0),
|
|
1919
1920
|
)
|
|
1920
|
-
return FunctionStats(
|
|
1921
|
+
return FunctionStats(
|
|
1922
|
+
backlog=resp.backlog, num_total_runners=resp.num_total_tasks, num_running_inputs=resp.num_running_inputs
|
|
1923
|
+
)
|
|
1921
1924
|
|
|
1922
1925
|
@live_method
|
|
1923
1926
|
async def _get_schema(self) -> api_pb2.FunctionSchema:
|
|
@@ -70,6 +70,7 @@ async def get_app_logs_loop(
|
|
|
70
70
|
app_id: Optional[str] = None,
|
|
71
71
|
task_id: Optional[str] = None,
|
|
72
72
|
sandbox_id: Optional[str] = None,
|
|
73
|
+
follow: bool = True,
|
|
73
74
|
):
|
|
74
75
|
last_log_batch_entry_id = ""
|
|
75
76
|
|
|
@@ -124,7 +125,7 @@ async def get_app_logs_loop(
|
|
|
124
125
|
app_id=app_id or "",
|
|
125
126
|
task_id=task_id or "",
|
|
126
127
|
sandbox_id=sandbox_id or "",
|
|
127
|
-
timeout=55,
|
|
128
|
+
timeout=55 if follow else 0,
|
|
128
129
|
last_entry_id=last_log_batch_entry_id,
|
|
129
130
|
)
|
|
130
131
|
log_batch: api_pb2.TaskLogsBatch
|
|
@@ -192,7 +193,7 @@ async def get_app_logs_loop(
|
|
|
192
193
|
continue
|
|
193
194
|
raise
|
|
194
195
|
|
|
195
|
-
if last_log_batch_entry_id is None:
|
|
196
|
+
if last_log_batch_entry_id is None or not follow:
|
|
196
197
|
break
|
|
197
198
|
|
|
198
199
|
await stop_pty_shell()
|
|
@@ -14,6 +14,7 @@ import platform
|
|
|
14
14
|
import re
|
|
15
15
|
from collections.abc import Generator
|
|
16
16
|
from datetime import timedelta
|
|
17
|
+
from pathlib import Path
|
|
17
18
|
from typing import Any, Callable
|
|
18
19
|
|
|
19
20
|
from rich.console import Console, Group, RenderableType
|
|
@@ -321,7 +322,11 @@ class RichOutputManager(OutputManager):
|
|
|
321
322
|
default Python warning display.
|
|
322
323
|
"""
|
|
323
324
|
# For non-Modal warnings, fall back to the default display
|
|
324
|
-
|
|
325
|
+
import modal
|
|
326
|
+
|
|
327
|
+
is_modal_warning = issubclass(category, (DeprecationError, PendingDeprecationError, ServerWarning))
|
|
328
|
+
filename_in_modal = modal.__path__ and Path(filename).is_relative_to(modal.__path__[0])
|
|
329
|
+
if not is_modal_warning and not filename_in_modal:
|
|
325
330
|
base_showwarning(warning, category, filename, lineno, file=None, line=None)
|
|
326
331
|
return
|
|
327
332
|
|
|
@@ -334,20 +339,21 @@ class RichOutputManager(OutputManager):
|
|
|
334
339
|
date = ""
|
|
335
340
|
message = content
|
|
336
341
|
|
|
337
|
-
# Try to add source context
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
342
|
+
# Try to add source context for non-Modal file sources
|
|
343
|
+
if not filename_in_modal:
|
|
344
|
+
try:
|
|
345
|
+
with open(filename, encoding="utf-8", errors="replace") as code_file:
|
|
346
|
+
source = code_file.readlines()[lineno - 1].strip()
|
|
347
|
+
message = f"{message}\n\nSource: {filename}:{lineno}\n {source}"
|
|
348
|
+
except OSError:
|
|
349
|
+
# e.g., when filename is "<unknown>"; raises FileNotFoundError on posix but OSError on windows
|
|
350
|
+
pass
|
|
345
351
|
|
|
346
352
|
# Build title
|
|
347
|
-
if issubclass(category,
|
|
348
|
-
title = "Modal Warning"
|
|
349
|
-
else:
|
|
353
|
+
if issubclass(category, (DeprecationError, PendingDeprecationError)):
|
|
350
354
|
title = "Modal Deprecation Warning"
|
|
355
|
+
else:
|
|
356
|
+
title = "Modal Warning"
|
|
351
357
|
if date:
|
|
352
358
|
title += f" ({date})"
|
|
353
359
|
|
|
@@ -10,6 +10,7 @@ from synchronicity.async_wrap import asynccontextmanager
|
|
|
10
10
|
from modal_proto import api_pb2
|
|
11
11
|
|
|
12
12
|
from ._utils.async_utils import synchronize_api
|
|
13
|
+
from ._utils.deprecation import deprecation_warning
|
|
13
14
|
from .client import _Client
|
|
14
15
|
from .exception import AlreadyExistsError, InvalidError, RemoteError, ServiceError
|
|
15
16
|
|
|
@@ -29,6 +30,14 @@ class Tunnel:
|
|
|
29
30
|
@property
|
|
30
31
|
def url(self) -> str:
|
|
31
32
|
"""Get the public HTTPS URL of the forwarded port."""
|
|
33
|
+
if self.unencrypted_host:
|
|
34
|
+
deprecation_warning(
|
|
35
|
+
(2026, 3, 5),
|
|
36
|
+
"`.url` on unencrypted tunnels will be deprecated in a future release. "
|
|
37
|
+
"For HTTPS, use an encrypted tunnel instead: with `forward()`, call "
|
|
38
|
+
"`forward(port)` without `unencrypted=True`; with sandboxes, declare the port "
|
|
39
|
+
"in `encrypted_ports` instead of `unencrypted_ports`.",
|
|
40
|
+
)
|
|
32
41
|
value = f"https://{self.host}"
|
|
33
42
|
if self.port != 443:
|
|
34
43
|
value += f":{self.port}"
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Copyright Modal Labs 2026
|
|
2
|
+
import json
|
|
3
|
+
import re
|
|
4
|
+
from contextlib import contextmanager
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from pathlib import PurePosixPath
|
|
7
|
+
from typing import NoReturn, Optional, Union
|
|
8
|
+
|
|
9
|
+
from ..config import logger
|
|
10
|
+
from ..exception import (
|
|
11
|
+
ConnectionError,
|
|
12
|
+
Error as ModalError,
|
|
13
|
+
InvalidError,
|
|
14
|
+
NotFoundError,
|
|
15
|
+
SandboxFilesystemError,
|
|
16
|
+
SandboxFilesystemFileTooLargeError,
|
|
17
|
+
SandboxFilesystemIsADirectoryError,
|
|
18
|
+
SandboxFilesystemNotADirectoryError,
|
|
19
|
+
SandboxFilesystemNotFoundError,
|
|
20
|
+
SandboxFilesystemPermissionError,
|
|
21
|
+
ServiceError,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
_EXEC_SANDBOX_UNAVAILABLE_ERROR_TYPES = (NotFoundError, ServiceError, ConnectionError)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass
|
|
28
|
+
class ErrorPayload:
|
|
29
|
+
error_kind: str
|
|
30
|
+
message: str
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _stderr_to_text(stderr: Union[str, bytes]) -> str:
|
|
34
|
+
stderr_bytes = stderr if isinstance(stderr, bytes) else stderr.encode("utf-8")
|
|
35
|
+
return stderr_bytes.decode("utf-8", errors="replace").strip()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def try_parse_error_payload(stderr: Union[str, bytes]) -> Optional[ErrorPayload]:
|
|
39
|
+
stderr_text = _stderr_to_text(stderr)
|
|
40
|
+
if not stderr_text:
|
|
41
|
+
return None
|
|
42
|
+
try:
|
|
43
|
+
payload = json.loads(stderr_text)
|
|
44
|
+
except json.JSONDecodeError:
|
|
45
|
+
return None
|
|
46
|
+
if not isinstance(payload, dict):
|
|
47
|
+
return None
|
|
48
|
+
error_kind = payload.get("error_kind")
|
|
49
|
+
message = payload.get("message")
|
|
50
|
+
if not isinstance(error_kind, str):
|
|
51
|
+
return None
|
|
52
|
+
if not isinstance(message, str) or not message.strip():
|
|
53
|
+
return None
|
|
54
|
+
return ErrorPayload(error_kind=error_kind, message=message)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def raise_read_file_error(returncode: int, stderr: Union[str, bytes], remote_path: str) -> NoReturn:
|
|
58
|
+
if payload := try_parse_error_payload(stderr):
|
|
59
|
+
if payload.error_kind == "NotFound":
|
|
60
|
+
raise SandboxFilesystemNotFoundError(f"{payload.message}: {remote_path}")
|
|
61
|
+
if payload.error_kind == "IsDirectory":
|
|
62
|
+
raise SandboxFilesystemIsADirectoryError(f"{payload.message}: {remote_path}")
|
|
63
|
+
if payload.error_kind == "PermissionDenied":
|
|
64
|
+
raise SandboxFilesystemPermissionError(f"{payload.message}: {remote_path}")
|
|
65
|
+
if payload.error_kind == "FileTooLarge":
|
|
66
|
+
raise SandboxFilesystemFileTooLargeError(f"{payload.message}: {remote_path}")
|
|
67
|
+
raise SandboxFilesystemError(payload.message)
|
|
68
|
+
|
|
69
|
+
if stderr_text := _stderr_to_text(stderr):
|
|
70
|
+
logger.debug(f"Unstructured modal-sandbox-fs-tools stderr: {stderr_text}")
|
|
71
|
+
raise SandboxFilesystemError(f"Operation on '{remote_path}' failed with exit code {returncode}")
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _extract_support_error_code(exc: Exception) -> Optional[str]:
|
|
75
|
+
if match := re.search(r"Error code:\s*([A-Z0-9]{8})", str(exc)):
|
|
76
|
+
return match.group(1)
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _translate_exec_sandbox_unavailable_error(operation: str, path: str, exc: Exception) -> Exception:
|
|
81
|
+
logger.debug(
|
|
82
|
+
f"Sandbox filesystem control-plane error for operation={operation}, path={path}: {type(exc).__name__}: {exc}"
|
|
83
|
+
)
|
|
84
|
+
return NotFoundError("The Sandbox is unavailable. This Sandbox may have already shut down.")
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def translate_exec_unexpected_error(operation: str, path: str, exc: Exception) -> Exception:
|
|
88
|
+
"""Translate an unexpected exec-level error into a generic user-facing error.
|
|
89
|
+
|
|
90
|
+
This is less than ideal — it discards the original exception and returns a
|
|
91
|
+
generic message — but it's necessary to avoid surfacing "call to exec()
|
|
92
|
+
failed"-style messages to users who shouldn't be aware that the filesystem
|
|
93
|
+
API is implemented in terms of Sandbox.exec().
|
|
94
|
+
"""
|
|
95
|
+
error_code = _extract_support_error_code(exc)
|
|
96
|
+
logger.debug(
|
|
97
|
+
f"Unexpected sandbox filesystem exec error for operation={operation}, path={path}: {type(exc).__name__}: {exc}"
|
|
98
|
+
)
|
|
99
|
+
support_suffix = (
|
|
100
|
+
f"please contact support@modal.com (Error code: {error_code})"
|
|
101
|
+
if error_code
|
|
102
|
+
else "please contact support@modal.com"
|
|
103
|
+
)
|
|
104
|
+
return SandboxFilesystemError(f"An unexpected error occurred, {support_suffix}")
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def raise_write_file_error(returncode: int, stderr: Union[str, bytes], remote_path: str) -> NoReturn:
|
|
108
|
+
if payload := try_parse_error_payload(stderr):
|
|
109
|
+
if payload.error_kind == "NotDirectory" or payload.error_kind == "AlreadyExists":
|
|
110
|
+
raise SandboxFilesystemNotADirectoryError(f"{payload.message}: {remote_path}")
|
|
111
|
+
if payload.error_kind == "IsDirectory":
|
|
112
|
+
raise SandboxFilesystemIsADirectoryError(f"{payload.message}: {remote_path}")
|
|
113
|
+
if payload.error_kind == "PermissionDenied":
|
|
114
|
+
raise SandboxFilesystemPermissionError(f"{payload.message}: {remote_path}")
|
|
115
|
+
raise SandboxFilesystemError(payload.message)
|
|
116
|
+
|
|
117
|
+
if stderr_text := _stderr_to_text(stderr):
|
|
118
|
+
logger.debug(f"Unstructured modal-sandbox-fs-tools stderr: {stderr_text}")
|
|
119
|
+
raise SandboxFilesystemError(f"Operation on '{remote_path}' failed with exit code {returncode}")
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def make_write_file_command(remote_path: str) -> str:
|
|
123
|
+
"""Build the JSON command string for a WriteFile operation.
|
|
124
|
+
|
|
125
|
+
The returned JSON must match the `Command` enum in the modal-sandbox-fs-tools
|
|
126
|
+
Rust crate (crates/modal-sandbox-fs-tools/src/lib.rs). Treat changes to
|
|
127
|
+
this schema like protobuf changes: fields must not be removed or renamed,
|
|
128
|
+
only added with backwards-compatible defaults.
|
|
129
|
+
"""
|
|
130
|
+
return json.dumps({"WriteFile": {"path": remote_path}})
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def make_read_file_command(remote_path: str) -> str:
|
|
134
|
+
"""Build the JSON command string for a ReadFile operation.
|
|
135
|
+
|
|
136
|
+
The returned JSON must match the `Command` enum in the modal-sandbox-fs-tools
|
|
137
|
+
Rust crate (crates/modal-sandbox-fs-tools/src/lib.rs). Treat changes to
|
|
138
|
+
this schema like protobuf changes: fields must not be removed or renamed,
|
|
139
|
+
only added with backwards-compatible defaults.
|
|
140
|
+
"""
|
|
141
|
+
return json.dumps({"ReadFile": {"path": remote_path}})
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def validate_absolute_remote_path(remote_path: str, operation: str) -> None:
|
|
145
|
+
if not PurePosixPath(remote_path).is_absolute():
|
|
146
|
+
raise InvalidError(f"Sandbox.filesystem.{operation}() currently only supports absolute remote_path values")
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
@contextmanager
|
|
150
|
+
def translate_exec_errors(operation: str, remote_path: str):
|
|
151
|
+
"""Translate exec-level exceptions into user-facing errors."""
|
|
152
|
+
try:
|
|
153
|
+
yield
|
|
154
|
+
except _EXEC_SANDBOX_UNAVAILABLE_ERROR_TYPES as exc:
|
|
155
|
+
raise _translate_exec_sandbox_unavailable_error(operation, remote_path, exc) from None
|
|
156
|
+
except ModalError as exc:
|
|
157
|
+
raise translate_exec_unexpected_error(operation, remote_path, exc) from None
|
|
@@ -439,6 +439,13 @@ class _App:
|
|
|
439
439
|
environment_name: Optional[str] = None, # Environment to deploy the App in
|
|
440
440
|
tag: str = "", # Optional metadata that is specific to this deployment
|
|
441
441
|
client: Optional[_Client] = None, # Alternate client to use for communication with the server
|
|
442
|
+
# Deployment strategy:
|
|
443
|
+
# - 'rolling' (default): Traffic shifts to the new deployment by starting
|
|
444
|
+
# new containers gradually. Old containers will continue to process inputs while new
|
|
445
|
+
# containers start up.
|
|
446
|
+
# - 'restart': As part of the deployment, all running containers are terminated. New inputs
|
|
447
|
+
# will start new containers.
|
|
448
|
+
strategy: str = "rolling",
|
|
442
449
|
) -> typing_extensions.Self:
|
|
443
450
|
"""Deploy the App so that it is available persistently.
|
|
444
451
|
|
|
@@ -482,7 +489,10 @@ class _App:
|
|
|
482
489
|
```
|
|
483
490
|
|
|
484
491
|
"""
|
|
485
|
-
from .runner import
|
|
492
|
+
from .runner import ( # Defer import of runner.py, which imports a lot from Rich
|
|
493
|
+
_deploy_app,
|
|
494
|
+
_validate_deployment_strategy,
|
|
495
|
+
)
|
|
486
496
|
|
|
487
497
|
if name is None and self._name is None:
|
|
488
498
|
raise InvalidError(
|
|
@@ -493,7 +503,10 @@ class _App:
|
|
|
493
503
|
"or\n"
|
|
494
504
|
'app = modal.App("some-name")'
|
|
495
505
|
)
|
|
496
|
-
|
|
506
|
+
strategy = _validate_deployment_strategy(strategy)
|
|
507
|
+
result = await _deploy_app(
|
|
508
|
+
self, name=name, environment_name=environment_name, tag=tag, client=client, deployment_strategy=strategy
|
|
509
|
+
)
|
|
497
510
|
self._app_id = result.app_id
|
|
498
511
|
return self
|
|
499
512
|
|
|
@@ -310,6 +310,7 @@ class _App:
|
|
|
310
310
|
environment_name: typing.Optional[str] = None,
|
|
311
311
|
tag: str = "",
|
|
312
312
|
client: typing.Optional[modal.client._Client] = None,
|
|
313
|
+
strategy: str = "rolling",
|
|
313
314
|
) -> typing_extensions.Self:
|
|
314
315
|
"""Deploy the App so that it is available persistently.
|
|
315
316
|
|
|
@@ -986,6 +987,7 @@ class App:
|
|
|
986
987
|
environment_name: typing.Optional[str] = None,
|
|
987
988
|
tag: str = "",
|
|
988
989
|
client: typing.Optional[modal.client.Client] = None,
|
|
990
|
+
strategy: str = "rolling",
|
|
989
991
|
) -> SUPERSELF:
|
|
990
992
|
"""Deploy the App so that it is available persistently.
|
|
991
993
|
|
|
@@ -1038,6 +1040,7 @@ class App:
|
|
|
1038
1040
|
environment_name: typing.Optional[str] = None,
|
|
1039
1041
|
tag: str = "",
|
|
1040
1042
|
client: typing.Optional[modal.client.Client] = None,
|
|
1043
|
+
strategy: str = "rolling",
|
|
1041
1044
|
) -> SUPERSELF:
|
|
1042
1045
|
"""Deploy the App so that it is available persistently.
|
|
1043
1046
|
|
|
@@ -84,9 +84,10 @@ async def list_(env: Optional[str] = ENV_OPTION, json: bool = False):
|
|
|
84
84
|
@app_cli.command("logs", no_args_is_help=True)
|
|
85
85
|
def logs(
|
|
86
86
|
app_identifier: str = APP_IDENTIFIER,
|
|
87
|
+
follow: bool = typer.Option(False, "-f", "--follow", help="Stream log output until App stops"),
|
|
88
|
+
timestamps: bool = typer.Option(False, "--timestamps", help="Show timestamps for each log line"),
|
|
87
89
|
*,
|
|
88
90
|
env: Optional[str] = ENV_OPTION,
|
|
89
|
-
timestamps: bool = typer.Option(False, "--timestamps", help="Show timestamps for each log line"),
|
|
90
91
|
):
|
|
91
92
|
"""Show App logs, streaming while active.
|
|
92
93
|
|
|
@@ -106,7 +107,7 @@ def logs(
|
|
|
106
107
|
|
|
107
108
|
"""
|
|
108
109
|
app_id = get_app_id(app_identifier, env)
|
|
109
|
-
stream_app_logs(app_id, show_timestamps=timestamps)
|
|
110
|
+
stream_app_logs(app_id, show_timestamps=timestamps, follow=follow)
|
|
110
111
|
|
|
111
112
|
|
|
112
113
|
@app_cli.command("rollback", no_args_is_help=True, context_settings={"ignore_unknown_options": True})
|
|
@@ -118,15 +118,17 @@ def changelog(
|
|
|
118
118
|
|
|
119
119
|
Examples:
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
```bash
|
|
122
|
+
modal changelog --since 1.2.0 # Show updates added after a specific version
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
modal changelog --since 2026-01-01 # Show updates added after a specific date
|
|
124
125
|
|
|
125
|
-
|
|
126
|
+
modal changelog --newer # Show updates released after the currently installed version
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
modal changelog --last 3 # Show updates included in the 3 most recent releases
|
|
128
129
|
|
|
129
|
-
|
|
130
|
+
modal changelog --for 1.3.1 # Show the changelog for a specific release
|
|
131
|
+
```
|
|
130
132
|
|
|
131
133
|
Note: when using `--since` or `--last`, only changes up to the currently installed version are shown.
|
|
132
134
|
|
|
@@ -23,13 +23,13 @@ container_cli = typer.Typer(name="container", help="Manage and connect to runnin
|
|
|
23
23
|
|
|
24
24
|
@container_cli.command("list")
|
|
25
25
|
@synchronizer.create_blocking
|
|
26
|
-
async def list_(env: Optional[str] = ENV_OPTION, json: bool = False):
|
|
26
|
+
async def list_(env: Optional[str] = ENV_OPTION, json: bool = False, app_id: str = ""):
|
|
27
27
|
"""List all containers that are currently running."""
|
|
28
28
|
env = ensure_env(env)
|
|
29
29
|
client = await _Client.from_env()
|
|
30
30
|
environment_name = _get_environment_name(env)
|
|
31
31
|
res: api_pb2.TaskListResponse = await client.stub.TaskList(
|
|
32
|
-
api_pb2.TaskListRequest(environment_name=environment_name)
|
|
32
|
+
api_pb2.TaskListRequest(environment_name=environment_name, app_id=app_id)
|
|
33
33
|
)
|
|
34
34
|
|
|
35
35
|
column_names: list[Union[Column, str]] = [
|
|
@@ -56,6 +56,7 @@ async def list_(env: Optional[str] = ENV_OPTION, json: bool = False):
|
|
|
56
56
|
@container_cli.command("logs")
|
|
57
57
|
def logs(
|
|
58
58
|
container_id: str = typer.Argument(help="Container ID"),
|
|
59
|
+
follow: bool = typer.Option(False, "-f", "--follow", help="Stream log output until Container stops"),
|
|
59
60
|
timestamps: bool = typer.Option(False, "--timestamps", help="Show timestamps for each log line"),
|
|
60
61
|
):
|
|
61
62
|
"""Show logs for a specific container, streaming while active."""
|
|
@@ -66,7 +67,7 @@ def logs(
|
|
|
66
67
|
task_id = container_id
|
|
67
68
|
else:
|
|
68
69
|
raise InvalidError(f"Invalid container ID: {container_id}")
|
|
69
|
-
stream_app_logs(task_id=task_id, sandbox_id=sandbox_id, show_timestamps=timestamps)
|
|
70
|
+
stream_app_logs(task_id=task_id, sandbox_id=sandbox_id, show_timestamps=timestamps, follow=follow)
|
|
70
71
|
|
|
71
72
|
|
|
72
73
|
@container_cli.command("exec")
|
|
@@ -21,7 +21,7 @@ from ..environments import ensure_env
|
|
|
21
21
|
from ..exception import ExecutionError, InvalidError, _CliUserExecutionError
|
|
22
22
|
from ..functions import Function
|
|
23
23
|
from ..output import OutputManager
|
|
24
|
-
from ..runner import deploy_app, run_app
|
|
24
|
+
from ..runner import DEPLOYMENT_STRATEGY_TYPE, deploy_app, run_app
|
|
25
25
|
from ..serving import serve_app
|
|
26
26
|
from .import_refs import (
|
|
27
27
|
CLICommand,
|
|
@@ -504,6 +504,7 @@ def deploy(
|
|
|
504
504
|
False, "-m", help="Interpret argument as a Python module path instead of a file/script path"
|
|
505
505
|
),
|
|
506
506
|
timestamps: bool = typer.Option(False, "--timestamps", help="Show timestamps for each log line."),
|
|
507
|
+
strategy: DEPLOYMENT_STRATEGY_TYPE = typer.Option("rolling", help="Deployment strategy"),
|
|
507
508
|
):
|
|
508
509
|
"""Deploy a Modal application.
|
|
509
510
|
|
|
@@ -530,10 +531,15 @@ def deploy(
|
|
|
530
531
|
"modal deploy ... --name=some-name"
|
|
531
532
|
)
|
|
532
533
|
|
|
533
|
-
res = deploy_app(app, name=name, environment_name=env or "", tag=tag)
|
|
534
|
+
res = deploy_app(app, name=name, environment_name=env or "", tag=tag, deployment_strategy=strategy)
|
|
534
535
|
|
|
535
536
|
if stream_logs:
|
|
536
|
-
stream_app_logs(
|
|
537
|
+
stream_app_logs(
|
|
538
|
+
app_id=res.app_id,
|
|
539
|
+
app_logs_url=res.app_logs_url,
|
|
540
|
+
show_timestamps=timestamps,
|
|
541
|
+
follow=True,
|
|
542
|
+
)
|
|
537
543
|
|
|
538
544
|
|
|
539
545
|
def serve(
|