modal 1.6.4.dev16__tar.gz → 1.6.4.dev17__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.4.dev16 → modal-1.6.4.dev17}/PKG-INFO +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/__main__.py +2 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_cluster.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_environments.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_functions.py +2 -2
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_image.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_object.py +17 -11
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_output/manager.py +4 -3
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_output/rich.py +18 -5
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/task_lifecycle_manager.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/async_utils.py +23 -5
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/auth_token_manager.py +17 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/http_utils.py +9 -3
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_workspace.py +57 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/app.py +27 -8
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/app.pyi +63 -18
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/_help.py +14 -17
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/_suggest.py +16 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/app.py +2 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/image.py +46 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/import_refs.py +7 -4
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/run.py +57 -38
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/shell.py +2 -16
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/utils.py +4 -7
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/workspace.py +96 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/client.py +74 -27
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/client.pyi +45 -14
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cls.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/config.py +14 -3
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/dict.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/functions.pyi +6 -6
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/mount.py +2 -2
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/network_file_system.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/object.pyi +3 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/proxy.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/queue.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_impl_persistent.py +11 -2
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_sandbox.py +65 -3
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_snapshot.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/sandbox.pyi +107 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/secret.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/types.py +33 -4
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/volume.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/workspace.pyi +104 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/api_grpc.py +48 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/api_pb2.py +1294 -1220
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/api_pb2.pyi +165 -10
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/api_pb2_grpc.py +99 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/api_pb2_grpc.pyi +30 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/modal_api_grpc.py +3 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_version/__init__.py +1 -1
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/LICENSE +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/README.md +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_audit_logs/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_audit_logs/_rpcs.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_audit_logs/count.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_audit_logs/list.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_billing.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_cluster.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_container_entrypoint.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_function_variants.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_grpc_client.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_ipython.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_load_context.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_location.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_logs.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_logs_manager.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_logs_manager.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_metrics.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_metrics.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_outbound_policy.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_outbound_policy.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_output/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_output/pty.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_output/status.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_partial_function.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_resolver.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_resources.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/asgi.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/execution_context.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/telemetry.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_serialization.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_server.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_server.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_supports_logs.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_traceback.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_tunnel.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_tunnel.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_type_manager.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/app_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/blob_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/browser_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/curl_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/deprecation.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/display_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/docker_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/function_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/git_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/hash_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/idle_countdown.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/logger.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/mount_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/name_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/oauth.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/package_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/proxy_support.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/sandbox_fs_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/shell_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_utils/time_utils.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_vendor/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_vendor/tblib.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_vendor/version.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/_watcher.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/billing.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/billing.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/2023.12.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/2024.04.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/2024.10.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/2025.06.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/2026.10.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/README.md +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/builder/base-images.json +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/call_graph.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/_download.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/_logs.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/_stats.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/_traceback.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/billing.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/changelog.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/config.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/container.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/curl.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/dashboard.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/dict.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/endpoint.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/entry_point.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/environment.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/function.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/logo.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/network_file_system.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/profile.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/queues.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/secret.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/selector.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/server.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/skills.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/token.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cli/volume.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cls.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cluster.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/cluster.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/container_process.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/container_process.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/dict.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/environments.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/environments.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/exception.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/_flash_container_entry.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/flash.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/flash.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/flash_server.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/flash_server.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/ipython.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/stream.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/experimental/stream.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/file_pattern_matcher.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/functions.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/image.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/image.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/io_streams.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/io_streams.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/mount.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/network_file_system.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/object.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/output.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/parallel_map.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/parallel_map.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/partial_function.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/partial_function.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/proxy.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/py.typed +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/queue.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/retries.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/runner.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/runner.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/running_app.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_common.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_filesystem.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_impl_v1.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_impl_v2.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_sidecar.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/_task_command_router_client.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/sandbox/sandbox.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/schedule.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/scheduler_placement.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/secret.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/server.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/server.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/serving.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/serving.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/skills/modal/SKILL.md +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/stream_type.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/token_flow.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/token_flow.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/volume.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal/workspace.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal.egg-info/requires.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal.egg-info/top_level.txt +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/gen_cli_docs_main.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/gen_reference_docs_main.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/mdmd/types.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_docs/reference_intro.md +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/__init__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/py.typed +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/modal_version/__main__.py +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/pyproject.toml +0 -0
- {modal-1.6.4.dev16 → modal-1.6.4.dev17}/setup.cfg +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import sys
|
|
3
3
|
|
|
4
4
|
from ._traceback import reduce_traceback_to_user_code
|
|
5
|
+
from .cli._suggest import get_hint
|
|
5
6
|
from .cli._traceback import highlight_modal_warnings, setup_rich_traceback
|
|
6
7
|
from .cli.entry_point import entrypoint_cli
|
|
7
8
|
from .cli.import_refs import _CliUserExecutionError
|
|
@@ -41,7 +42,7 @@ def main():
|
|
|
41
42
|
if notes := getattr(exc, "__notes__", []):
|
|
42
43
|
content = f"{content}\n\nNote: {' '.join(notes)}"
|
|
43
44
|
|
|
44
|
-
OutputManager.get().print_error(content)
|
|
45
|
+
OutputManager.get().print_error(content, hint=get_hint(exc))
|
|
45
46
|
sys.exit(1)
|
|
46
47
|
|
|
47
48
|
|
|
@@ -40,7 +40,7 @@ def get_current_cluster_context() -> ClusterContext:
|
|
|
40
40
|
return current_cluster_context
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
class _Cluster(_Object,
|
|
43
|
+
class _Cluster(_Object, type_prefixes=("cu",)):
|
|
44
44
|
"""A group of containers scheduled together for a clustered Function or Server.
|
|
45
45
|
|
|
46
46
|
Use `Cluster.from_context()` inside a cluster, or `Cluster.from_id()` to
|
|
@@ -620,7 +620,7 @@ OriginalReturnType = typing.TypeVar(
|
|
|
620
620
|
T = typing.TypeVar("T", covariant=True)
|
|
621
621
|
|
|
622
622
|
|
|
623
|
-
class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object,
|
|
623
|
+
class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type_prefixes=("fu",)):
|
|
624
624
|
"""Functions are the basic units of serverless execution on Modal.
|
|
625
625
|
|
|
626
626
|
Generally, you will not construct a `Function` directly. Instead, use the
|
|
@@ -2371,7 +2371,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
2371
2371
|
experimental_spawn_map = MethodWithAio(_experimental_spawn_map_sync, _experimental_spawn_map_async, synchronizer)
|
|
2372
2372
|
|
|
2373
2373
|
|
|
2374
|
-
class _FunctionCall(typing.Generic[ReturnType], _Object,
|
|
2374
|
+
class _FunctionCall(typing.Generic[ReturnType], _Object, type_prefixes=("fc",)):
|
|
2375
2375
|
"""A reference to an executed function call.
|
|
2376
2376
|
|
|
2377
2377
|
Constructed using `.spawn(...)` on a Modal function with the same
|
|
@@ -587,7 +587,7 @@ class _FailedBuildAttempt:
|
|
|
587
587
|
client: _Client
|
|
588
588
|
|
|
589
589
|
|
|
590
|
-
class _Image(_Object,
|
|
590
|
+
class _Image(_Object, type_prefixes=("im",)):
|
|
591
591
|
"""Base class for container images to run functions in.
|
|
592
592
|
|
|
593
593
|
Do not construct this class directly; instead use one of its static factory methods,
|
|
@@ -82,7 +82,8 @@ def live_method_contextmanager(
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
class _Object:
|
|
85
|
-
|
|
85
|
+
# Prefixes of the object IDs that hydrate this type, e.g. `("sb",)` for `sb-...` IDs.
|
|
86
|
+
_type_prefixes: ClassVar[tuple[str, ...]] = ()
|
|
86
87
|
_prefix_to_type: ClassVar[dict[str, type["_Object"]]] = {}
|
|
87
88
|
|
|
88
89
|
# For constructors
|
|
@@ -114,11 +115,16 @@ class _Object:
|
|
|
114
115
|
self.__is_hydrated = value
|
|
115
116
|
|
|
116
117
|
@classmethod
|
|
117
|
-
def __init_subclass__(cls,
|
|
118
|
+
def __init_subclass__(cls, type_prefixes: Sequence[str] = ()):
|
|
118
119
|
super().__init_subclass__()
|
|
119
|
-
if
|
|
120
|
-
cls.
|
|
121
|
-
|
|
120
|
+
if type_prefixes:
|
|
121
|
+
cls._type_prefixes = tuple(type_prefixes)
|
|
122
|
+
for prefix in cls._type_prefixes:
|
|
123
|
+
cls._prefix_to_type[prefix] = cls
|
|
124
|
+
|
|
125
|
+
@classmethod
|
|
126
|
+
def _has_type_prefix(cls, object_id: str) -> bool:
|
|
127
|
+
return any(object_id.startswith(prefix + "-") for prefix in cls._type_prefixes)
|
|
122
128
|
|
|
123
129
|
def __init__(self, *args, **kwargs):
|
|
124
130
|
"""mdmd:hidden"""
|
|
@@ -174,11 +180,11 @@ class _Object:
|
|
|
174
180
|
self._client = other._client
|
|
175
181
|
|
|
176
182
|
def _hydrate(self, object_id: str, client: _Client, metadata: Message | None):
|
|
177
|
-
assert isinstance(object_id, str) and self.
|
|
178
|
-
if not
|
|
183
|
+
assert isinstance(object_id, str) and self._type_prefixes
|
|
184
|
+
if not self._has_type_prefix(object_id):
|
|
179
185
|
raise ExecutionError(
|
|
180
186
|
f"Can not hydrate {type(self)}: "
|
|
181
|
-
f" it has type
|
|
187
|
+
f" it has type prefixes {self._type_prefixes}"
|
|
182
188
|
f" but the object_id starts with {object_id[:3]}. "
|
|
183
189
|
"This usually means the object name was previously used for a different type. "
|
|
184
190
|
"Rename the object/app or stop the previous deployment and redeploy."
|
|
@@ -270,11 +276,11 @@ class _Object:
|
|
|
270
276
|
rep: str | None = None,
|
|
271
277
|
) -> Self:
|
|
272
278
|
obj_cls: type[Self]
|
|
273
|
-
if cls.
|
|
279
|
+
if cls._type_prefixes:
|
|
274
280
|
# This is called directly on a subclass, e.g. Secret.from_id
|
|
275
281
|
# validate the id matching the expected id type of the Object subclass
|
|
276
|
-
if not
|
|
277
|
-
raise InvalidError(f"Object {object_id} does not start with {cls.
|
|
282
|
+
if not cls._has_type_prefix(object_id):
|
|
283
|
+
raise InvalidError(f"Object {object_id} does not start with any of {cls._type_prefixes}")
|
|
278
284
|
|
|
279
285
|
obj_cls = cls
|
|
280
286
|
else:
|
|
@@ -207,7 +207,7 @@ class OutputManager(ABC):
|
|
|
207
207
|
...
|
|
208
208
|
|
|
209
209
|
@abstractmethod
|
|
210
|
-
def print_error(self, error_text: str) -> None:
|
|
210
|
+
def print_error(self, error_text: str, hint: str = "") -> None:
|
|
211
211
|
"""Print an error message to stderr, ignoring quiet/disabled mode.
|
|
212
212
|
|
|
213
213
|
This method always prints the error message regardless of quiet mode
|
|
@@ -216,6 +216,7 @@ class OutputManager(ABC):
|
|
|
216
216
|
|
|
217
217
|
Args:
|
|
218
218
|
error_text: The error message text to display.
|
|
219
|
+
hint: An optional suggestion (e.g. "Did you mean ...?") shown after the message.
|
|
219
220
|
"""
|
|
220
221
|
...
|
|
221
222
|
|
|
@@ -490,9 +491,9 @@ class DisabledOutputManager(OutputManager):
|
|
|
490
491
|
) -> None:
|
|
491
492
|
pass
|
|
492
493
|
|
|
493
|
-
def print_error(self, error_text: str) -> None:
|
|
494
|
+
def print_error(self, error_text: str, hint: str = "") -> None:
|
|
494
495
|
# Print error to stderr without any formatting (Rich is not available)
|
|
495
|
-
sys.stderr.write(error_text
|
|
496
|
+
sys.stderr.write(f"{error_text}\n{hint}\n" if hint else f"{error_text}\n")
|
|
496
497
|
|
|
497
498
|
def show_warning(
|
|
498
499
|
self,
|
|
@@ -227,6 +227,19 @@ _ANSI_RESET = "\033[0m"
|
|
|
227
227
|
QUEUEING_STRAGGLER_GRACE_SECS = 30.0
|
|
228
228
|
|
|
229
229
|
|
|
230
|
+
def format_error_message(error_text: str, hint: str = "") -> Text:
|
|
231
|
+
"""Build the styled text for a CLI error message.
|
|
232
|
+
|
|
233
|
+
The message and hint are taken literally (no markup is interpreted). The message gets an
|
|
234
|
+
"Error:" prefix, and the hint, if any, follows on the next line in a dim style.
|
|
235
|
+
"""
|
|
236
|
+
message = Text.assemble(("Error:", "bold red"), " ", error_text)
|
|
237
|
+
if hint:
|
|
238
|
+
message.append("\n")
|
|
239
|
+
message.append(hint, style="dim")
|
|
240
|
+
return message
|
|
241
|
+
|
|
242
|
+
|
|
230
243
|
class RichOutputManager(OutputManager):
|
|
231
244
|
"""Rich-based implementation of OutputManager.
|
|
232
245
|
|
|
@@ -347,13 +360,13 @@ class RichOutputManager(OutputManager):
|
|
|
347
360
|
else:
|
|
348
361
|
self._console.print(renderable, highlight=highlight, style=style, sep=sep, end=end)
|
|
349
362
|
|
|
350
|
-
def print_error(self, error_text: str) -> None:
|
|
351
|
-
"""Print an error message
|
|
363
|
+
def print_error(self, error_text: str, hint: str = "") -> None:
|
|
364
|
+
"""Print an error message, and an optional suggestion hint, to stderr, ignoring quiet mode.
|
|
352
365
|
|
|
353
|
-
|
|
366
|
+
The message is printed as-is after a styled "Error:" prefix, without hard line wrapping,
|
|
367
|
+
so that a single-line message stays on one line regardless of terminal width.
|
|
354
368
|
"""
|
|
355
|
-
|
|
356
|
-
self._stderr_console.print(panel, highlight=False)
|
|
369
|
+
self._stderr_console.print(format_error_message(error_text, hint), highlight=False, soft_wrap=True)
|
|
357
370
|
|
|
358
371
|
def print_json(self, data: str) -> None:
|
|
359
372
|
"""Print JSON data with formatting."""
|
|
@@ -230,7 +230,7 @@ class _TaskLifecycleManager:
|
|
|
230
230
|
api_pb2.ContainerCheckpointRequest(checkpoint_id=self.checkpoint_id)
|
|
231
231
|
)
|
|
232
232
|
|
|
233
|
-
await self._client.
|
|
233
|
+
await self._client._prep_for_snapshot()
|
|
234
234
|
|
|
235
235
|
logger.debug("Memory snapshot request sent. Connection closed.")
|
|
236
236
|
await self.memory_restore()
|
|
@@ -864,19 +864,37 @@ class AsyncOrSyncIterable:
|
|
|
864
864
|
await self._async_iterable.aclose()
|
|
865
865
|
|
|
866
866
|
|
|
867
|
-
_shutdown_tasks =
|
|
867
|
+
_shutdown_tasks: set[asyncio.Task] = set()
|
|
868
868
|
|
|
869
869
|
|
|
870
|
-
def on_shutdown(
|
|
870
|
+
def on_shutdown(cleanup: Callable[[], Awaitable[Any]]) -> Callable[[], None]:
|
|
871
871
|
# hook into event loop shutdown when all active tasks get cancelled
|
|
872
|
+
active = True
|
|
873
|
+
|
|
872
874
|
async def wrapper():
|
|
875
|
+
nonlocal active
|
|
873
876
|
try:
|
|
874
877
|
await asyncio.sleep(1e10) # never awake except for exceptions
|
|
875
878
|
finally:
|
|
876
|
-
|
|
877
|
-
|
|
879
|
+
if active:
|
|
880
|
+
active = False
|
|
881
|
+
await cleanup()
|
|
882
|
+
|
|
883
|
+
task = asyncio.create_task(wrapper())
|
|
884
|
+
_shutdown_tasks.add(task)
|
|
885
|
+
task.add_done_callback(_shutdown_tasks.discard)
|
|
886
|
+
|
|
887
|
+
def unregister():
|
|
888
|
+
nonlocal active
|
|
889
|
+
if not active:
|
|
890
|
+
return
|
|
891
|
+
active = False
|
|
892
|
+
_shutdown_tasks.discard(task)
|
|
893
|
+
loop = task.get_loop()
|
|
894
|
+
if not loop.is_closed() and not task.done() and task is not asyncio.current_task(loop=loop):
|
|
895
|
+
task.cancel()
|
|
878
896
|
|
|
879
|
-
|
|
897
|
+
return unregister
|
|
880
898
|
|
|
881
899
|
|
|
882
900
|
def asyncify(f: Callable[P, T]) -> Callable[P, typing.Coroutine[None, None, T]]:
|
|
@@ -54,6 +54,17 @@ class _AuthTokenManager:
|
|
|
54
54
|
self._backoff = self.FAILURE_BACKOFF_BASE
|
|
55
55
|
self._refresh_task: asyncio.Task | None = None
|
|
56
56
|
|
|
57
|
+
async def reset(self) -> None:
|
|
58
|
+
if self._refresh_task is not None:
|
|
59
|
+
self._refresh_task.cancel()
|
|
60
|
+
await asyncio.gather(self._refresh_task, return_exceptions=True)
|
|
61
|
+
self._refresh_task = None
|
|
62
|
+
self._token = ""
|
|
63
|
+
self._expiry = 0.0
|
|
64
|
+
self._refresh_at = 0.0
|
|
65
|
+
self._retry_after = 0.0
|
|
66
|
+
self._backoff = self.FAILURE_BACKOFF_BASE
|
|
67
|
+
|
|
57
68
|
async def get_token(self) -> str:
|
|
58
69
|
"""
|
|
59
70
|
When called, the AuthTokenManager can be in one of three states:
|
|
@@ -80,6 +91,12 @@ class _AuthTokenManager:
|
|
|
80
91
|
|
|
81
92
|
return self._token
|
|
82
93
|
|
|
94
|
+
async def close(self) -> None:
|
|
95
|
+
task, self._refresh_task = self._refresh_task, None
|
|
96
|
+
if task is not None:
|
|
97
|
+
task.cancel()
|
|
98
|
+
await asyncio.gather(task, return_exceptions=True)
|
|
99
|
+
|
|
83
100
|
async def _try_refresh_token(self):
|
|
84
101
|
try:
|
|
85
102
|
await self._refresh_token()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Copyright Modal Labs 2022
|
|
2
2
|
import contextlib
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
3
|
+
from typing import TYPE_CHECKING, ClassVar
|
|
4
4
|
|
|
5
5
|
# Note: importing aiohttp seems to take about 100ms, and it's not really necessarily,
|
|
6
6
|
# unless we need to work with blobs. So that's why we import it lazily instead.
|
|
@@ -54,20 +54,26 @@ def _http_client_with_tls(timeout: float | None) -> "ClientSession":
|
|
|
54
54
|
class ClientSessionRegistry:
|
|
55
55
|
_client_session: "ClientSession"
|
|
56
56
|
_client_session_active: bool = False
|
|
57
|
+
_shutdown_unregister: "ClassVar[staticmethod[[], None] | None]" = None
|
|
57
58
|
|
|
58
59
|
@staticmethod
|
|
59
60
|
def get_session():
|
|
60
61
|
if not ClientSessionRegistry._client_session_active:
|
|
61
62
|
ClientSessionRegistry._client_session = _http_client_with_tls(timeout=None)
|
|
62
63
|
ClientSessionRegistry._client_session_active = True
|
|
63
|
-
on_shutdown(ClientSessionRegistry.close_session
|
|
64
|
+
ClientSessionRegistry._shutdown_unregister = staticmethod(on_shutdown(ClientSessionRegistry.close_session))
|
|
64
65
|
return ClientSessionRegistry._client_session
|
|
65
66
|
|
|
66
67
|
@staticmethod
|
|
67
68
|
async def close_session():
|
|
69
|
+
if ClientSessionRegistry._shutdown_unregister is not None:
|
|
70
|
+
ClientSessionRegistry._shutdown_unregister()
|
|
71
|
+
ClientSessionRegistry._shutdown_unregister = None
|
|
68
72
|
if ClientSessionRegistry._client_session_active:
|
|
69
|
-
|
|
73
|
+
session = ClientSessionRegistry._client_session
|
|
74
|
+
del ClientSessionRegistry._client_session
|
|
70
75
|
ClientSessionRegistry._client_session_active = False
|
|
76
|
+
await session.close()
|
|
71
77
|
|
|
72
78
|
|
|
73
79
|
@contextlib.asynccontextmanager
|
|
@@ -71,7 +71,7 @@ class _WorkspaceMembersManager:
|
|
|
71
71
|
]
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
class _Workspace(_Object,
|
|
74
|
+
class _Workspace(_Object, type_prefixes=("ac",)):
|
|
75
75
|
_name: Optional[str] = None
|
|
76
76
|
|
|
77
77
|
def __init__(self):
|
|
@@ -773,6 +773,62 @@ class _WorkspaceMemberTokenManager:
|
|
|
773
773
|
|
|
774
774
|
return [MemberTokenInfo._from_proto(token) for token in resp.tokens]
|
|
775
775
|
|
|
776
|
+
async def disable(self, *token_ids: str) -> None:
|
|
777
|
+
"""Disable member tokens in the specified Workspace.
|
|
778
|
+
|
|
779
|
+
If you are a Workspace Manager or Owner, you can use this method to disable any token in the
|
|
780
|
+
Workspace. Otherwise, you can only disable tokens that you have created. Disabled tokens cannot
|
|
781
|
+
be used to authenticate with Modal, but can be re-enabled at any point.
|
|
782
|
+
|
|
783
|
+
Args:
|
|
784
|
+
*token_ids: The ID(s) of any tokens you want to disable.
|
|
785
|
+
|
|
786
|
+
Examples:
|
|
787
|
+
|
|
788
|
+
```python notest
|
|
789
|
+
ws = modal.Workspace.from_context()
|
|
790
|
+
ws.member_tokens.disable("ak-0123456789abcdefghijkl", "ak-mnopqrstuvwxyz01234567")
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
See Also:
|
|
794
|
+
- [`Workspace.member_tokens.enable()`](https://modal.com/docs/sdk/py/latest/Workspace#member_tokensenable):
|
|
795
|
+
A function that re-enables a disabled token, so that it may be used again.
|
|
796
|
+
- [`modal workspace member-tokens disable`](https://modal.com/docs/cli/latest/workspace#modal-workspace-member-tokens-disable)
|
|
797
|
+
Command-line equivalent to this function.
|
|
798
|
+
|
|
799
|
+
"""
|
|
800
|
+
if not self._workspace._is_hydrated:
|
|
801
|
+
await self._workspace.hydrate()
|
|
802
|
+
|
|
803
|
+
await self._workspace.client._stub.TokenDisable(api_pb2.TokenDisableRequest(token_ids=list(set(token_ids))))
|
|
804
|
+
|
|
805
|
+
async def enable(self, *token_ids: str) -> None:
|
|
806
|
+
"""Re-enable member tokens that have been disabled in the specified Workspace.
|
|
807
|
+
|
|
808
|
+
If you are a Workspace Manager or Owner, you can use this method to enable any token in the
|
|
809
|
+
Workspace. Otherwise, you can only enable tokens that you have created.
|
|
810
|
+
|
|
811
|
+
Args:
|
|
812
|
+
*token_ids: The ID(s) of any tokens you want to enable.
|
|
813
|
+
|
|
814
|
+
Examples:
|
|
815
|
+
|
|
816
|
+
```python notest
|
|
817
|
+
ws = modal.Workspace.from_context()
|
|
818
|
+
ws.member_tokens.enable("ak-0123456789abcdefghijkl", "ak-mnopqrstuvwxyz01234567")
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
See Also:
|
|
822
|
+
- [`Workspace.member_tokens.disable()`](https://modal.com/docs/sdk/py/latest/Workspace#member_tokensdisable).
|
|
823
|
+
A function that disables a token, so that it may not be used to authenticate with Modal.
|
|
824
|
+
- [`modal workspace member-tokens enable`](https://modal.com/docs/cli/latest/workspace#modal-workspace-member-tokens-enable)
|
|
825
|
+
Command-line equivalent to this function.
|
|
826
|
+
"""
|
|
827
|
+
if not self._workspace._is_hydrated:
|
|
828
|
+
await self._workspace.hydrate()
|
|
829
|
+
|
|
830
|
+
await self._workspace.client._stub.TokenEnable(api_pb2.TokenEnableRequest(token_ids=list(set(token_ids))))
|
|
831
|
+
|
|
776
832
|
async def delete(self, token_id: str, *, allow_missing: bool = False) -> None:
|
|
777
833
|
"""Delete a Member Token in the specified Workspace.
|
|
778
834
|
|
|
@@ -43,7 +43,7 @@ from ._utils.function_utils import (
|
|
|
43
43
|
validate_target_concurrency,
|
|
44
44
|
)
|
|
45
45
|
from ._utils.mount_utils import validate_volumes
|
|
46
|
-
from ._utils.name_utils import check_object_name, check_tag_dict
|
|
46
|
+
from ._utils.name_utils import check_object_name, check_tag_dict, is_app_id
|
|
47
47
|
from .client import _Client
|
|
48
48
|
from .cloud_bucket_mount import _CloudBucketMount
|
|
49
49
|
from .cls import _Cls, parameter
|
|
@@ -168,9 +168,9 @@ class _AppSandboxesManager:
|
|
|
168
168
|
Yields:
|
|
169
169
|
`SandboxGroupStats` objects, one per combination of tag values, with the following fields:
|
|
170
170
|
- `tags`: the value of each name in `group_by_tags` for the group's Sandboxes, `None` where not present.
|
|
171
|
-
- `cost`: total cost in USD
|
|
172
|
-
- `cost_by_resource`: cost in USD by billed resource: `CPU`, `Memory`, and GPU
|
|
173
|
-
`H100`. The resource names are subject to change as Modal's billing model evolves.
|
|
171
|
+
- `cost`: total cost in USD as a `decimal.Decimal`, the sum of `cost_by_resource`.
|
|
172
|
+
- `cost_by_resource`: cost in USD as `decimal.Decimal`s, by billed resource: `CPU`, `Memory`, and GPU
|
|
173
|
+
types such as `H100`. The resource names are subject to change as Modal's billing model evolves.
|
|
174
174
|
|
|
175
175
|
Raises:
|
|
176
176
|
InvalidError: If the time range is invalid or there are more than 10,000 groups.
|
|
@@ -421,28 +421,47 @@ class _App:
|
|
|
421
421
|
environment_name: str | None = None,
|
|
422
422
|
create_if_missing: bool = False,
|
|
423
423
|
) -> "_App":
|
|
424
|
-
"""Look up an App
|
|
424
|
+
"""Look up an App by name or App ID, creating a new App if necessary.
|
|
425
425
|
|
|
426
426
|
Note that Apps created through this method will be in a deployed state,
|
|
427
427
|
but they will not have any associated Functions or Classes. This method
|
|
428
428
|
is mainly useful for creating an App to associate with a Sandbox.
|
|
429
429
|
|
|
430
|
+
Passing an App ID (`ap-...`) instead of a name looks up that specific App,
|
|
431
|
+
which also works for ephemeral Apps started with `app.run()` and for stopped
|
|
432
|
+
Apps. A lookup by ID ignores `environment_name` and cannot be combined with
|
|
433
|
+
`create_if_missing`.
|
|
434
|
+
|
|
430
435
|
Args:
|
|
431
|
-
name: App name to resolve or create.
|
|
436
|
+
name: App name to resolve or create, or the ID of an existing App.
|
|
432
437
|
client: Modal client to use; defaults to `Client.from_env()` when omitted.
|
|
433
438
|
environment_name: Optional environment name; defaults to the configured environment.
|
|
439
|
+
Ignored when `name` is an App ID.
|
|
434
440
|
create_if_missing: If True, create the app when it does not already exist.
|
|
441
|
+
Not supported when looking up an App by ID.
|
|
435
442
|
|
|
436
443
|
Returns:
|
|
437
|
-
An `App` handle tied to the
|
|
444
|
+
An `App` handle tied to the App record.
|
|
438
445
|
|
|
439
446
|
Examples:
|
|
440
447
|
```python
|
|
441
448
|
app = modal.App.lookup("my-app", create_if_missing=True)
|
|
442
449
|
modal.Sandbox.create("echo", "hi", app=app)
|
|
443
450
|
```
|
|
451
|
+
|
|
452
|
+
Look up an ephemeral App by its ID and read its most recent logs:
|
|
453
|
+
|
|
454
|
+
```python notest
|
|
455
|
+
app = modal.App.lookup("ap-Xk7fT2qLm9RzVb4NwYc8Hd")
|
|
456
|
+
for entry in app.logs.tail(20):
|
|
457
|
+
print(entry.message, end="")
|
|
458
|
+
```
|
|
444
459
|
"""
|
|
445
|
-
|
|
460
|
+
if is_app_id(name):
|
|
461
|
+
if create_if_missing:
|
|
462
|
+
raise InvalidError("`create_if_missing=True` is not supported when looking up an App by ID.")
|
|
463
|
+
else:
|
|
464
|
+
check_object_name(name, "App")
|
|
446
465
|
|
|
447
466
|
if client is None:
|
|
448
467
|
client = await _Client.from_env()
|
|
@@ -147,9 +147,9 @@ class _AppSandboxesManager:
|
|
|
147
147
|
Yields:
|
|
148
148
|
`SandboxGroupStats` objects, one per combination of tag values, with the following fields:
|
|
149
149
|
- `tags`: the value of each name in `group_by_tags` for the group's Sandboxes, `None` where not present.
|
|
150
|
-
- `cost`: total cost in USD
|
|
151
|
-
- `cost_by_resource`: cost in USD by billed resource: `CPU`, `Memory`, and GPU
|
|
152
|
-
`H100`. The resource names are subject to change as Modal's billing model evolves.
|
|
150
|
+
- `cost`: total cost in USD as a `decimal.Decimal`, the sum of `cost_by_resource`.
|
|
151
|
+
- `cost_by_resource`: cost in USD as `decimal.Decimal`s, by billed resource: `CPU`, `Memory`, and GPU
|
|
152
|
+
types such as `H100`. The resource names are subject to change as Modal's billing model evolves.
|
|
153
153
|
|
|
154
154
|
Raises:
|
|
155
155
|
InvalidError: If the time range is invalid or there are more than 10,000 groups.
|
|
@@ -310,26 +310,41 @@ class _App:
|
|
|
310
310
|
environment_name: typing.Optional[str] = None,
|
|
311
311
|
create_if_missing: bool = False,
|
|
312
312
|
) -> _App:
|
|
313
|
-
"""Look up an App
|
|
313
|
+
"""Look up an App by name or App ID, creating a new App if necessary.
|
|
314
314
|
|
|
315
315
|
Note that Apps created through this method will be in a deployed state,
|
|
316
316
|
but they will not have any associated Functions or Classes. This method
|
|
317
317
|
is mainly useful for creating an App to associate with a Sandbox.
|
|
318
318
|
|
|
319
|
+
Passing an App ID (`ap-...`) instead of a name looks up that specific App,
|
|
320
|
+
which also works for ephemeral Apps started with `app.run()` and for stopped
|
|
321
|
+
Apps. A lookup by ID ignores `environment_name` and cannot be combined with
|
|
322
|
+
`create_if_missing`.
|
|
323
|
+
|
|
319
324
|
Args:
|
|
320
|
-
name: App name to resolve or create.
|
|
325
|
+
name: App name to resolve or create, or the ID of an existing App.
|
|
321
326
|
client: Modal client to use; defaults to `Client.from_env()` when omitted.
|
|
322
327
|
environment_name: Optional environment name; defaults to the configured environment.
|
|
328
|
+
Ignored when `name` is an App ID.
|
|
323
329
|
create_if_missing: If True, create the app when it does not already exist.
|
|
330
|
+
Not supported when looking up an App by ID.
|
|
324
331
|
|
|
325
332
|
Returns:
|
|
326
|
-
An `App` handle tied to the
|
|
333
|
+
An `App` handle tied to the App record.
|
|
327
334
|
|
|
328
335
|
Examples:
|
|
329
336
|
```python
|
|
330
337
|
app = modal.App.lookup("my-app", create_if_missing=True)
|
|
331
338
|
modal.Sandbox.create("echo", "hi", app=app)
|
|
332
339
|
```
|
|
340
|
+
|
|
341
|
+
Look up an ephemeral App by its ID and read its most recent logs:
|
|
342
|
+
|
|
343
|
+
```python notest
|
|
344
|
+
app = modal.App.lookup("ap-Xk7fT2qLm9RzVb4NwYc8Hd")
|
|
345
|
+
for entry in app.logs.tail(20):
|
|
346
|
+
print(entry.message, end="")
|
|
347
|
+
```
|
|
333
348
|
"""
|
|
334
349
|
...
|
|
335
350
|
|
|
@@ -1088,9 +1103,9 @@ class AppSandboxesManager:
|
|
|
1088
1103
|
Yields:
|
|
1089
1104
|
`SandboxGroupStats` objects, one per combination of tag values, with the following fields:
|
|
1090
1105
|
- `tags`: the value of each name in `group_by_tags` for the group's Sandboxes, `None` where not present.
|
|
1091
|
-
- `cost`: total cost in USD
|
|
1092
|
-
- `cost_by_resource`: cost in USD by billed resource: `CPU`, `Memory`, and GPU
|
|
1093
|
-
`H100`. The resource names are subject to change as Modal's billing model evolves.
|
|
1106
|
+
- `cost`: total cost in USD as a `decimal.Decimal`, the sum of `cost_by_resource`.
|
|
1107
|
+
- `cost_by_resource`: cost in USD as `decimal.Decimal`s, by billed resource: `CPU`, `Memory`, and GPU
|
|
1108
|
+
types such as `H100`. The resource names are subject to change as Modal's billing model evolves.
|
|
1094
1109
|
|
|
1095
1110
|
Raises:
|
|
1096
1111
|
InvalidError: If the time range is invalid or there are more than 10,000 groups.
|
|
@@ -1131,9 +1146,9 @@ class AppSandboxesManager:
|
|
|
1131
1146
|
Yields:
|
|
1132
1147
|
`SandboxGroupStats` objects, one per combination of tag values, with the following fields:
|
|
1133
1148
|
- `tags`: the value of each name in `group_by_tags` for the group's Sandboxes, `None` where not present.
|
|
1134
|
-
- `cost`: total cost in USD
|
|
1135
|
-
- `cost_by_resource`: cost in USD by billed resource: `CPU`, `Memory`, and GPU
|
|
1136
|
-
`H100`. The resource names are subject to change as Modal's billing model evolves.
|
|
1149
|
+
- `cost`: total cost in USD as a `decimal.Decimal`, the sum of `cost_by_resource`.
|
|
1150
|
+
- `cost_by_resource`: cost in USD as `decimal.Decimal`s, by billed resource: `CPU`, `Memory`, and GPU
|
|
1151
|
+
types such as `H100`. The resource names are subject to change as Modal's billing model evolves.
|
|
1137
1152
|
|
|
1138
1153
|
Raises:
|
|
1139
1154
|
InvalidError: If the time range is invalid or there are more than 10,000 groups.
|
|
@@ -1297,26 +1312,41 @@ class App:
|
|
|
1297
1312
|
environment_name: typing.Optional[str] = None,
|
|
1298
1313
|
create_if_missing: bool = False,
|
|
1299
1314
|
) -> App:
|
|
1300
|
-
"""Look up an App
|
|
1315
|
+
"""Look up an App by name or App ID, creating a new App if necessary.
|
|
1301
1316
|
|
|
1302
1317
|
Note that Apps created through this method will be in a deployed state,
|
|
1303
1318
|
but they will not have any associated Functions or Classes. This method
|
|
1304
1319
|
is mainly useful for creating an App to associate with a Sandbox.
|
|
1305
1320
|
|
|
1321
|
+
Passing an App ID (`ap-...`) instead of a name looks up that specific App,
|
|
1322
|
+
which also works for ephemeral Apps started with `app.run()` and for stopped
|
|
1323
|
+
Apps. A lookup by ID ignores `environment_name` and cannot be combined with
|
|
1324
|
+
`create_if_missing`.
|
|
1325
|
+
|
|
1306
1326
|
Args:
|
|
1307
|
-
name: App name to resolve or create.
|
|
1327
|
+
name: App name to resolve or create, or the ID of an existing App.
|
|
1308
1328
|
client: Modal client to use; defaults to `Client.from_env()` when omitted.
|
|
1309
1329
|
environment_name: Optional environment name; defaults to the configured environment.
|
|
1330
|
+
Ignored when `name` is an App ID.
|
|
1310
1331
|
create_if_missing: If True, create the app when it does not already exist.
|
|
1332
|
+
Not supported when looking up an App by ID.
|
|
1311
1333
|
|
|
1312
1334
|
Returns:
|
|
1313
|
-
An `App` handle tied to the
|
|
1335
|
+
An `App` handle tied to the App record.
|
|
1314
1336
|
|
|
1315
1337
|
Examples:
|
|
1316
1338
|
```python
|
|
1317
1339
|
app = modal.App.lookup("my-app", create_if_missing=True)
|
|
1318
1340
|
modal.Sandbox.create("echo", "hi", app=app)
|
|
1319
1341
|
```
|
|
1342
|
+
|
|
1343
|
+
Look up an ephemeral App by its ID and read its most recent logs:
|
|
1344
|
+
|
|
1345
|
+
```python notest
|
|
1346
|
+
app = modal.App.lookup("ap-Xk7fT2qLm9RzVb4NwYc8Hd")
|
|
1347
|
+
for entry in app.logs.tail(20):
|
|
1348
|
+
print(entry.message, end="")
|
|
1349
|
+
```
|
|
1320
1350
|
"""
|
|
1321
1351
|
...
|
|
1322
1352
|
|
|
@@ -1329,26 +1359,41 @@ class App:
|
|
|
1329
1359
|
environment_name: typing.Optional[str] = None,
|
|
1330
1360
|
create_if_missing: bool = False,
|
|
1331
1361
|
) -> App:
|
|
1332
|
-
"""Look up an App
|
|
1362
|
+
"""Look up an App by name or App ID, creating a new App if necessary.
|
|
1333
1363
|
|
|
1334
1364
|
Note that Apps created through this method will be in a deployed state,
|
|
1335
1365
|
but they will not have any associated Functions or Classes. This method
|
|
1336
1366
|
is mainly useful for creating an App to associate with a Sandbox.
|
|
1337
1367
|
|
|
1368
|
+
Passing an App ID (`ap-...`) instead of a name looks up that specific App,
|
|
1369
|
+
which also works for ephemeral Apps started with `app.run()` and for stopped
|
|
1370
|
+
Apps. A lookup by ID ignores `environment_name` and cannot be combined with
|
|
1371
|
+
`create_if_missing`.
|
|
1372
|
+
|
|
1338
1373
|
Args:
|
|
1339
|
-
name: App name to resolve or create.
|
|
1374
|
+
name: App name to resolve or create, or the ID of an existing App.
|
|
1340
1375
|
client: Modal client to use; defaults to `Client.from_env()` when omitted.
|
|
1341
1376
|
environment_name: Optional environment name; defaults to the configured environment.
|
|
1377
|
+
Ignored when `name` is an App ID.
|
|
1342
1378
|
create_if_missing: If True, create the app when it does not already exist.
|
|
1379
|
+
Not supported when looking up an App by ID.
|
|
1343
1380
|
|
|
1344
1381
|
Returns:
|
|
1345
|
-
An `App` handle tied to the
|
|
1382
|
+
An `App` handle tied to the App record.
|
|
1346
1383
|
|
|
1347
1384
|
Examples:
|
|
1348
1385
|
```python
|
|
1349
1386
|
app = modal.App.lookup("my-app", create_if_missing=True)
|
|
1350
1387
|
modal.Sandbox.create("echo", "hi", app=app)
|
|
1351
1388
|
```
|
|
1389
|
+
|
|
1390
|
+
Look up an ephemeral App by its ID and read its most recent logs:
|
|
1391
|
+
|
|
1392
|
+
```python notest
|
|
1393
|
+
app = modal.App.lookup("ap-Xk7fT2qLm9RzVb4NwYc8Hd")
|
|
1394
|
+
for entry in app.logs.tail(20):
|
|
1395
|
+
print(entry.message, end="")
|
|
1396
|
+
```
|
|
1352
1397
|
"""
|
|
1353
1398
|
...
|
|
1354
1399
|
|