modal 1.6.5.dev3__tar.gz → 1.6.5.dev5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/PKG-INFO +1 -1
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_audit_logs/list.py +41 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_serialization.py +3 -7
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_workspace.py +211 -40
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/image.py +17 -35
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/shell.py +12 -2
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/volume.py +0 -2
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/workspace.py +17 -10
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/client.pyi +2 -2
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_sandbox.py +10 -5
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_task_command_router_client.py +4 -1
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/sandbox.pyi +20 -10
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/types.py +70 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/workspace.py +5 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/workspace.pyi +337 -57
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal.egg-info/SOURCES.txt +0 -1
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/api_grpc.py +3 -3
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/api_pb2.py +1486 -1476
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/api_pb2.pyi +42 -4
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/api_pb2_grpc.py +3 -3
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/api_pb2_grpc.pyi +2 -2
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_version/__init__.py +1 -1
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/pyproject.toml +3 -9
- modal-1.6.5.dev3/modal/experimental/ipython.py +0 -84
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/LICENSE +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/README.md +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/__main__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_audit_logs/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_audit_logs/_rpcs.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_audit_logs/count.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_billing.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_cluster.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_cluster.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_container_entrypoint.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_environments.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_function_variants.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_functions.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_grpc_client.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_image.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_ipython.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_load_context.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_location.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_logs.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_logs_manager.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_logs_manager.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_metrics.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_metrics.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_object.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_outbound_policy.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_outbound_policy.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_output/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_output/manager.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_output/pty.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_output/rich.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_output/status.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_partial_function.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_resolver.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_resources.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/asgi.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/execution_context.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/task_lifecycle_manager.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/telemetry.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_server.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_server.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_supports_logs.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_traceback.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_tunnel.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_tunnel.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_type_manager.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/app_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/async_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/blob_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/browser_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/curl_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/deprecation.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/display_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/docker_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/function_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/git_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/hash_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/http_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/idle_countdown.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/logger.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/mount_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/name_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/oauth.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/package_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/proxy_support.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/sandbox_fs_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/shell_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_utils/time_utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_vendor/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_vendor/tblib.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_vendor/version.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/_watcher.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/app.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/app.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/billing.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/billing.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/2023.12.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/2024.04.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/2024.10.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/2025.06.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/2026.10.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/README.md +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/builder/base-images.json +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/call_graph.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/_download.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/_help.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/_logs.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/_stats.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/_suggest.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/_traceback.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/app.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/billing.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/changelog.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/config.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/container.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/curl.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/dashboard.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/dict.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/endpoint.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/entry_point.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/environment.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/function.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/import_refs.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/logo.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/network_file_system.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/profile.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/queues.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/run.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/secret.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/selector.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/server.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/skills.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/token.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cli/utils.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/client.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cls.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cls.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cluster.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/cluster.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/config.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/container_process.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/container_process.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/dict.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/dict.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/environments.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/environments.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/exception.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/experimental/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/experimental/_flash_container_entry.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/experimental/flash.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/experimental/flash.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/experimental/flash_server.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/experimental/flash_server.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/experimental/stream.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/experimental/stream.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/file_pattern_matcher.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/functions.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/functions.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/image.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/image.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/io_streams.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/io_streams.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/mount.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/mount.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/network_file_system.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/network_file_system.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/object.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/object.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/output.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/parallel_map.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/parallel_map.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/partial_function.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/partial_function.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/proxy.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/proxy.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/py.typed +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/queue.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/queue.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/retries.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/runner.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/runner.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/running_app.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_common.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_filesystem.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_impl_persistent.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_impl_v1.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_impl_v2.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_sidecar.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/_snapshot.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/sandbox/sandbox.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/schedule.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/scheduler_placement.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/secret.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/secret.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/server.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/server.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/serving.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/serving.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/skills/modal/SKILL.md +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/stream_type.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/token_flow.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/token_flow.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/volume.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal/volume.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal.egg-info/requires.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal.egg-info/top_level.txt +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/gen_cli_docs_main.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/gen_reference_docs_main.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/mdmd/types.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_docs/reference_intro.md +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/__init__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/py.typed +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/modal_version/__main__.py +0 -0
- {modal-1.6.5.dev3 → modal-1.6.5.dev5}/setup.cfg +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Copyright Modal Labs 2026
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
+
import math
|
|
4
5
|
from collections.abc import AsyncGenerator
|
|
5
6
|
from contextlib import aclosing
|
|
6
7
|
|
|
@@ -50,6 +51,34 @@ async def _fetch_bucket(
|
|
|
50
51
|
return entries
|
|
51
52
|
|
|
52
53
|
|
|
54
|
+
async def fetch_newest_audit_logs(
|
|
55
|
+
q: str,
|
|
56
|
+
oldest_ms: int,
|
|
57
|
+
newest_ms: int,
|
|
58
|
+
count: int,
|
|
59
|
+
*,
|
|
60
|
+
client: _Client | None = None,
|
|
61
|
+
config: api_pb2.AuditLogSettingsGetResponse,
|
|
62
|
+
) -> list[api_pb2.AuditLogEntry]:
|
|
63
|
+
"""Read the newest `count` entries in the range, oldest to newest.
|
|
64
|
+
|
|
65
|
+
A count larger than one page fetches only the newest buckets that cover it, concurrently.
|
|
66
|
+
"""
|
|
67
|
+
if client is None:
|
|
68
|
+
client = await _Client.from_env()
|
|
69
|
+
if count <= config.page_size:
|
|
70
|
+
resp = await _rpcs.list_page(client, q, oldest_ms, newest_ms, count, config)
|
|
71
|
+
return list(reversed(resp.items))
|
|
72
|
+
buckets = await get_bucket_cursors(client, q, oldest_ms, newest_ms, config)
|
|
73
|
+
# Buckets are cut from the newest entry, so all but the oldest hold exactly `bucket_size` entries.
|
|
74
|
+
newest_buckets = buckets[-math.ceil(count / config.bucket_size) :]
|
|
75
|
+
entries: list[api_pb2.AuditLogEntry] = []
|
|
76
|
+
async with aclosing(_stream_buckets(client, q, oldest_ms, newest_ms, config, newest_buckets)) as stream:
|
|
77
|
+
async for entry in stream:
|
|
78
|
+
entries.append(entry)
|
|
79
|
+
return entries[-count:]
|
|
80
|
+
|
|
81
|
+
|
|
53
82
|
async def fetch_audit_logs(
|
|
54
83
|
q: str,
|
|
55
84
|
oldest_ms: int,
|
|
@@ -68,7 +97,19 @@ async def fetch_audit_logs(
|
|
|
68
97
|
if client is None:
|
|
69
98
|
client = await _Client.from_env()
|
|
70
99
|
buckets = await get_bucket_cursors(client, q, oldest_ms, newest_ms, config)
|
|
100
|
+
async with aclosing(_stream_buckets(client, q, oldest_ms, newest_ms, config, buckets)) as stream:
|
|
101
|
+
async for entry in stream:
|
|
102
|
+
yield entry
|
|
103
|
+
|
|
71
104
|
|
|
105
|
+
async def _stream_buckets(
|
|
106
|
+
client: _Client,
|
|
107
|
+
q: str,
|
|
108
|
+
oldest_ms: int,
|
|
109
|
+
newest_ms: int,
|
|
110
|
+
config: api_pb2.AuditLogSettingsGetResponse,
|
|
111
|
+
buckets: list[Bucket],
|
|
112
|
+
) -> AsyncGenerator[api_pb2.AuditLogEntry]:
|
|
72
113
|
async def bucket_stream() -> AsyncGenerator[Bucket]:
|
|
73
114
|
for bucket in buckets:
|
|
74
115
|
yield bucket
|
|
@@ -378,16 +378,12 @@ def serialize_data_format(obj: Any, data_format: int) -> bytes:
|
|
|
378
378
|
raise InvalidError("CBOR support requires the 'cbor2' package to be installed.")
|
|
379
379
|
try:
|
|
380
380
|
return cbor2.dumps(obj)
|
|
381
|
-
except cbor2.CBOREncodeError:
|
|
382
|
-
try:
|
|
383
|
-
typename = f"{type(obj).__module__}.{type(obj).__name__}"
|
|
384
|
-
except Exception:
|
|
385
|
-
typename = str(type(obj))
|
|
381
|
+
except cbor2.CBOREncodeError as exc:
|
|
386
382
|
raise SerializationError(
|
|
387
383
|
# TODO (elias): add documentation link for more information on this
|
|
388
|
-
f"
|
|
384
|
+
f"CBOR payload serialization failed: {exc}. If you need to use a custom data type, "
|
|
389
385
|
"try to serialize it yourself e.g. by using pickle.dumps(my_data)"
|
|
390
|
-
)
|
|
386
|
+
) from exc
|
|
391
387
|
else:
|
|
392
388
|
raise InvalidError(f"Unknown data format {data_format!r}")
|
|
393
389
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# Copyright Modal Labs 2025
|
|
2
2
|
import builtins
|
|
3
3
|
import warnings
|
|
4
|
-
from collections.abc import Mapping
|
|
5
|
-
from
|
|
4
|
+
from collections.abc import AsyncGenerator, Mapping
|
|
5
|
+
from contextlib import aclosing
|
|
6
|
+
from datetime import datetime, timedelta, timezone
|
|
6
7
|
from decimal import Decimal
|
|
7
8
|
from typing import Optional
|
|
8
9
|
|
|
@@ -12,12 +13,16 @@ from modal.exception import DeprecationError, InvalidError, NotFoundError
|
|
|
12
13
|
from modal.types import MemberTokenInfo, ServiceUserInfo
|
|
13
14
|
from modal_proto import api_pb2
|
|
14
15
|
|
|
16
|
+
from ._audit_logs import _rpcs
|
|
17
|
+
from ._audit_logs.count import count_audit_logs
|
|
18
|
+
from ._audit_logs.list import fetch_audit_logs, fetch_newest_audit_logs
|
|
15
19
|
from ._load_context import LoadContext
|
|
16
20
|
from ._object import _Object
|
|
17
21
|
from ._resolver import Resolver
|
|
18
|
-
from ._utils.time_utils import is_utc_month_aligned, parse_billing_cycle, timestamp_to_localized_dt
|
|
22
|
+
from ._utils.time_utils import is_utc_month_aligned, locale_tz, parse_billing_cycle, timestamp_to_localized_dt
|
|
19
23
|
from .client import _Client
|
|
20
24
|
from .types import (
|
|
25
|
+
AuditEvent,
|
|
21
26
|
BillingReportItem,
|
|
22
27
|
ProxyTokenInfo,
|
|
23
28
|
TokenData,
|
|
@@ -26,6 +31,9 @@ from .types import (
|
|
|
26
31
|
WorkspaceSettings,
|
|
27
32
|
)
|
|
28
33
|
|
|
34
|
+
_AUDIT_LOG_DEFAULT_LIMIT = 100
|
|
35
|
+
_AUDIT_LOG_DEFAULT_WINDOW = timedelta(days=7)
|
|
36
|
+
|
|
29
37
|
|
|
30
38
|
def _member_role_from_proto(proto_value: int) -> str:
|
|
31
39
|
match proto_value:
|
|
@@ -87,6 +95,11 @@ class _Workspace(_Object, type_prefixes=("ac",)):
|
|
|
87
95
|
"""Namespace with methods for managing the membership of a Workspace."""
|
|
88
96
|
return _WorkspaceMembersManager(self)
|
|
89
97
|
|
|
98
|
+
@property
|
|
99
|
+
def audit_logs(self) -> "_WorkspaceAuditLogsManager":
|
|
100
|
+
"""Namespace for reading [Workspace audit logs](https://modal.com/docs/guide/audit-logs)."""
|
|
101
|
+
return _WorkspaceAuditLogsManager(self)
|
|
102
|
+
|
|
90
103
|
@staticmethod
|
|
91
104
|
def from_context(*, client: Optional[_Client] = None) -> "_Workspace":
|
|
92
105
|
"""Look up the Workspace associated with the current context.
|
|
@@ -145,6 +158,157 @@ class _Workspace(_Object, type_prefixes=("ac",)):
|
|
|
145
158
|
return _WorkspaceMemberTokenManager(self)
|
|
146
159
|
|
|
147
160
|
|
|
161
|
+
class _WorkspaceAuditLogsManager:
|
|
162
|
+
"""mdmd:namespace"""
|
|
163
|
+
|
|
164
|
+
def __init__(self, workspace: _Workspace):
|
|
165
|
+
"""mdmd:hidden"""
|
|
166
|
+
self._workspace = workspace
|
|
167
|
+
|
|
168
|
+
@staticmethod
|
|
169
|
+
def _range(since: datetime | None, until: datetime | None) -> tuple[int, int]:
|
|
170
|
+
until = until or datetime.now(timezone.utc)
|
|
171
|
+
if until.tzinfo is None:
|
|
172
|
+
until = until.replace(tzinfo=locale_tz())
|
|
173
|
+
until = until.astimezone(timezone.utc)
|
|
174
|
+
if since is None:
|
|
175
|
+
since = until - _AUDIT_LOG_DEFAULT_WINDOW
|
|
176
|
+
elif since.tzinfo is None:
|
|
177
|
+
since = since.replace(tzinfo=locale_tz())
|
|
178
|
+
since = since.astimezone(timezone.utc)
|
|
179
|
+
return int(since.timestamp() * 1000), int(until.timestamp() * 1000)
|
|
180
|
+
|
|
181
|
+
async def fetch(
|
|
182
|
+
self,
|
|
183
|
+
query: str = "",
|
|
184
|
+
*,
|
|
185
|
+
since: datetime | None = None,
|
|
186
|
+
until: datetime | None = None,
|
|
187
|
+
limit: int | None = None,
|
|
188
|
+
) -> AsyncGenerator[AuditEvent, None]:
|
|
189
|
+
"""Fetch the Workspace's audit events, oldest-first.
|
|
190
|
+
|
|
191
|
+
Audit events record the sensitive actions that change a Workspace's state: who did
|
|
192
|
+
what, when, to which resource, and from where. Reading them requires the Enterprise
|
|
193
|
+
plan and either a Workspace Owner or Manager role, or a role that grants audit log
|
|
194
|
+
read access. See [the guide](https://modal.com/docs/guide/audit-logs) for more
|
|
195
|
+
information.
|
|
196
|
+
|
|
197
|
+
With no arguments, return the latest 100 events in the past seven days,
|
|
198
|
+
ordered oldest-first. Workspaces with fewer than 100 events in that window
|
|
199
|
+
return only those events.
|
|
200
|
+
|
|
201
|
+
A `since` or `until` datetime without a timezone is treated as local time. The range
|
|
202
|
+
between them is limited by the server, currently to seven days.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
query: Query selecting which events to return, e.g.
|
|
206
|
+
`action:environment.create -status:failure`. Defaults to an empty string,
|
|
207
|
+
which matches all events.
|
|
208
|
+
See the query guide [here](https://modal.com/docs/guide/audit-logs#filtering).
|
|
209
|
+
since: Inclusive start time. Defaults to seven days before `until`.
|
|
210
|
+
until: Exclusive end time. Defaults to now.
|
|
211
|
+
limit: Return the newest `limit` matching events in the interval; must be
|
|
212
|
+
positive if provided. Defaults to 100 when `since` is omitted, or no
|
|
213
|
+
limit (every event in the interval) when `since` is provided.
|
|
214
|
+
|
|
215
|
+
Examples:
|
|
216
|
+
```python notest
|
|
217
|
+
from datetime import datetime, timezone
|
|
218
|
+
|
|
219
|
+
ws = modal.Workspace.from_context()
|
|
220
|
+
latest_events = list(ws.audit_logs.fetch()) # defaults to latest 100 from past week
|
|
221
|
+
latest_500_events = list(ws.audit_logs.fetch(limit=500)) # latest 500 from past week
|
|
222
|
+
|
|
223
|
+
# latest 100 environment creations from past week, excluding failed attempts
|
|
224
|
+
environment_creation_events = list(ws.audit_logs.fetch("action:environment.create -status:failure"))
|
|
225
|
+
|
|
226
|
+
# latest 100 environment creations or deletions from past week
|
|
227
|
+
environment_change_events = list(ws.audit_logs.fetch("action:(environment.create OR environment.delete)"))
|
|
228
|
+
|
|
229
|
+
# return every event in range
|
|
230
|
+
start = datetime(2026, 10, 1, tzinfo=timezone.utc)
|
|
231
|
+
end = datetime(2026, 10, 8, tzinfo=timezone.utc)
|
|
232
|
+
first_week_of_october_events = list(ws.audit_logs.fetch(since=start, until=end))
|
|
233
|
+
```
|
|
234
|
+
"""
|
|
235
|
+
oldest_ms, newest_ms = self._range(since, until)
|
|
236
|
+
if limit is not None and limit < 1:
|
|
237
|
+
raise InvalidError("limit must be positive.")
|
|
238
|
+
await self._workspace.hydrate()
|
|
239
|
+
client = self._workspace.client
|
|
240
|
+
config = await _rpcs.get_settings(client)
|
|
241
|
+
if since is None or limit is not None:
|
|
242
|
+
entries = await fetch_newest_audit_logs(
|
|
243
|
+
query, oldest_ms, newest_ms, limit or _AUDIT_LOG_DEFAULT_LIMIT, client=client, config=config
|
|
244
|
+
)
|
|
245
|
+
for entry in entries:
|
|
246
|
+
yield AuditEvent._from_proto(entry)
|
|
247
|
+
return
|
|
248
|
+
stream = fetch_audit_logs(
|
|
249
|
+
query,
|
|
250
|
+
oldest_ms,
|
|
251
|
+
newest_ms,
|
|
252
|
+
client=client,
|
|
253
|
+
config=config,
|
|
254
|
+
)
|
|
255
|
+
async with aclosing(stream):
|
|
256
|
+
async for entry in stream:
|
|
257
|
+
yield AuditEvent._from_proto(entry)
|
|
258
|
+
|
|
259
|
+
async def count(
|
|
260
|
+
self,
|
|
261
|
+
query: str = "",
|
|
262
|
+
*,
|
|
263
|
+
since: datetime,
|
|
264
|
+
until: datetime | None = None,
|
|
265
|
+
) -> int:
|
|
266
|
+
"""Count the Workspace's audit events.
|
|
267
|
+
|
|
268
|
+
Audit events record the sensitive actions that change a Workspace's state: who did
|
|
269
|
+
what, when, to which resource, and from where. Reading them requires the Enterprise
|
|
270
|
+
plan and either a Workspace Owner or Manager role, or a role that grants audit log
|
|
271
|
+
read access. See [the guide](https://modal.com/docs/guide/audit-logs) for more
|
|
272
|
+
information.
|
|
273
|
+
|
|
274
|
+
An explicit `since` is required to select the start of the time range.
|
|
275
|
+
|
|
276
|
+
A `since` or `until` datetime without a timezone is treated as local time. The range
|
|
277
|
+
between them is limited by the server, currently to seven days.
|
|
278
|
+
|
|
279
|
+
Args:
|
|
280
|
+
query: Query selecting which events to return, e.g.
|
|
281
|
+
`action:environment.create -status:failure`. Defaults to an empty string,
|
|
282
|
+
which matches all events.
|
|
283
|
+
See the query guide [here](https://modal.com/docs/guide/audit-logs#filtering).
|
|
284
|
+
since: Inclusive start time (required).
|
|
285
|
+
until: Exclusive end time. Defaults to now.
|
|
286
|
+
|
|
287
|
+
Examples:
|
|
288
|
+
```python notest
|
|
289
|
+
from datetime import datetime, timedelta, timezone
|
|
290
|
+
|
|
291
|
+
ws = modal.Workspace.from_context()
|
|
292
|
+
start = datetime.now(timezone.utc) - timedelta(days=7)
|
|
293
|
+
past_week_count = ws.audit_logs.count(since=start)
|
|
294
|
+
|
|
295
|
+
# environments created or deleted in the past week
|
|
296
|
+
environment_change_count = ws.audit_logs.count(
|
|
297
|
+
"action:(environment.create OR environment.delete)", since=start
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
start = datetime(2026, 10, 1, tzinfo=timezone.utc)
|
|
301
|
+
end = datetime(2026, 10, 8, tzinfo=timezone.utc)
|
|
302
|
+
first_week_of_october_count = ws.audit_logs.count(since=start, until=end)
|
|
303
|
+
```
|
|
304
|
+
"""
|
|
305
|
+
oldest_ms, newest_ms = self._range(since, until)
|
|
306
|
+
await self._workspace.hydrate()
|
|
307
|
+
client = self._workspace.client
|
|
308
|
+
config = await _rpcs.get_settings(client)
|
|
309
|
+
return await count_audit_logs(client, query, oldest_ms, newest_ms, config)
|
|
310
|
+
|
|
311
|
+
|
|
148
312
|
class _WorkspaceProxyTokenManager:
|
|
149
313
|
"""mdmd:namespace"""
|
|
150
314
|
|
|
@@ -748,31 +912,6 @@ class _WorkspaceMemberTokenManager:
|
|
|
748
912
|
def __init__(self, workspace: _Workspace):
|
|
749
913
|
self._workspace = workspace
|
|
750
914
|
|
|
751
|
-
async def list(self) -> list[MemberTokenInfo]:
|
|
752
|
-
"""List Member Tokens in the specified Workspace.
|
|
753
|
-
|
|
754
|
-
If you are a Manager or an Owner of this Workspace, this method will return a list of all the
|
|
755
|
-
Member Tokens in the Workspace. Otherwise, this method will only return the Tokens you have
|
|
756
|
-
created.
|
|
757
|
-
|
|
758
|
-
Returns:
|
|
759
|
-
A list of `MemberTokenInfo` dataclasses.
|
|
760
|
-
|
|
761
|
-
Examples:
|
|
762
|
-
|
|
763
|
-
```python notest
|
|
764
|
-
ws = modal.Workspace.from_context()
|
|
765
|
-
for member_token in ws.member_tokens.list():
|
|
766
|
-
print(member_token)
|
|
767
|
-
```
|
|
768
|
-
"""
|
|
769
|
-
if not self._workspace._is_hydrated:
|
|
770
|
-
await self._workspace.hydrate()
|
|
771
|
-
|
|
772
|
-
resp = await self._workspace.client._stub.TokensList(Empty())
|
|
773
|
-
|
|
774
|
-
return [MemberTokenInfo._from_proto(token) for token in resp.tokens]
|
|
775
|
-
|
|
776
915
|
async def disable(self, *token_ids: str) -> None:
|
|
777
916
|
"""Disable member tokens in the specified Workspace.
|
|
778
917
|
|
|
@@ -829,29 +968,61 @@ class _WorkspaceMemberTokenManager:
|
|
|
829
968
|
|
|
830
969
|
await self._workspace.client._stub.TokenEnable(api_pb2.TokenEnableRequest(token_ids=list(set(token_ids))))
|
|
831
970
|
|
|
832
|
-
async def delete(self,
|
|
833
|
-
"""Delete
|
|
971
|
+
async def delete(self, *token_ids: str, allow_missing: bool = False) -> "list[str]":
|
|
972
|
+
"""Delete member tokens in the specified Workspace.
|
|
834
973
|
|
|
835
|
-
If you are a Workspace Manager or Owner, you can use this method to delete any
|
|
836
|
-
Workspace. Otherwise, you can only delete
|
|
974
|
+
If you are a Workspace Manager or Owner, you can use this method to delete any token in the
|
|
975
|
+
Workspace. Otherwise, you can only delete member tokens that you have created.
|
|
837
976
|
|
|
838
977
|
Args:
|
|
839
|
-
|
|
840
|
-
allow_missing: If `True`, do not throw an exception if the
|
|
978
|
+
*token_ids: The ID(s) of the token(s) you would like to delete.
|
|
979
|
+
allow_missing: If `True`, do not throw an exception if some of the tokens do not exist.
|
|
980
|
+
|
|
981
|
+
Returns:
|
|
982
|
+
A list of the tokens that were successfully deleted.
|
|
841
983
|
|
|
842
984
|
Examples:
|
|
843
985
|
|
|
844
986
|
```python notest
|
|
845
987
|
ws = modal.Workspace.from_context()
|
|
846
|
-
ws.member_tokens.delete(
|
|
988
|
+
ws.member_tokens.delete("ak-0123456789abcdefghijkl", "ak-mnopqrstuvwxyz01234567")
|
|
847
989
|
```
|
|
848
990
|
"""
|
|
849
991
|
|
|
850
992
|
if not self._workspace._is_hydrated:
|
|
851
993
|
await self._workspace.hydrate()
|
|
852
994
|
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
995
|
+
resp = await self._workspace.client._stub.TokenDelete(
|
|
996
|
+
req=api_pb2.TokenDeleteRequest(
|
|
997
|
+
token_ids=token_ids,
|
|
998
|
+
allow_missing=allow_missing,
|
|
999
|
+
)
|
|
1000
|
+
)
|
|
1001
|
+
|
|
1002
|
+
return list(resp.deleted_token_ids)
|
|
1003
|
+
|
|
1004
|
+
# .list() must be defined last, as otherwise it masks the builtin `list` type in annotations
|
|
1005
|
+
async def list(self) -> "list[MemberTokenInfo]":
|
|
1006
|
+
"""List Member Tokens in the specified Workspace.
|
|
1007
|
+
|
|
1008
|
+
If you are a Manager or an Owner of this Workspace, this method will return a list of all the
|
|
1009
|
+
Member Tokens in the Workspace. Otherwise, this method will only return the Tokens you have
|
|
1010
|
+
created.
|
|
1011
|
+
|
|
1012
|
+
Returns:
|
|
1013
|
+
A list of `MemberTokenInfo` dataclasses.
|
|
1014
|
+
|
|
1015
|
+
Examples:
|
|
1016
|
+
|
|
1017
|
+
```python notest
|
|
1018
|
+
ws = modal.Workspace.from_context()
|
|
1019
|
+
for member_token in ws.member_tokens.list():
|
|
1020
|
+
print(member_token)
|
|
1021
|
+
```
|
|
1022
|
+
"""
|
|
1023
|
+
if not self._workspace._is_hydrated:
|
|
1024
|
+
await self._workspace.hydrate()
|
|
1025
|
+
|
|
1026
|
+
resp = await self._workspace.client._stub.TokensList(Empty())
|
|
1027
|
+
|
|
1028
|
+
return [MemberTokenInfo._from_proto(token) for token in resp.tokens]
|
|
@@ -371,31 +371,15 @@ async def _iter_tag_pages(
|
|
|
371
371
|
async def _fetch_history_page(
|
|
372
372
|
client: _Client,
|
|
373
373
|
name_tag: str,
|
|
374
|
-
page_token: str,
|
|
375
374
|
) -> api_pb2.ImageTagRevisionsResponse:
|
|
376
375
|
return await client._stub.ImageTagRevisions(
|
|
377
376
|
api_pb2.ImageTagRevisionsRequest(
|
|
378
377
|
tag=name_tag,
|
|
379
378
|
max_objects=IMAGE_NAMES_HISTORY_PAGE_SIZE,
|
|
380
|
-
page_token=page_token,
|
|
381
379
|
)
|
|
382
380
|
)
|
|
383
381
|
|
|
384
382
|
|
|
385
|
-
async def _iter_history_pages(
|
|
386
|
-
client: _Client, name_tag: str, first_page: api_pb2.ImageTagRevisionsResponse
|
|
387
|
-
) -> AsyncIterator[api_pb2.ImageTagRevisionsResponse]:
|
|
388
|
-
response = first_page
|
|
389
|
-
|
|
390
|
-
while True:
|
|
391
|
-
yield response
|
|
392
|
-
|
|
393
|
-
if not response.next_page_token:
|
|
394
|
-
return
|
|
395
|
-
await asyncio.sleep(IMAGE_NAMES_HISTORY_PAGE_DELAY_SECONDS)
|
|
396
|
-
response = await _fetch_history_page(client, name_tag, response.next_page_token)
|
|
397
|
-
|
|
398
|
-
|
|
399
383
|
image_names_cli = ModalGroup(name="names", help="Manage Modal Image names.")
|
|
400
384
|
image_cli.add_command(image_names_cli)
|
|
401
385
|
|
|
@@ -453,34 +437,32 @@ async def history(
|
|
|
453
437
|
)
|
|
454
438
|
client = await _Client.from_env()
|
|
455
439
|
|
|
456
|
-
|
|
457
|
-
if not
|
|
458
|
-
raise click.ClickException(f"No publishing history found for named image {
|
|
440
|
+
response = await _fetch_history_page(client, upgraded_image_name)
|
|
441
|
+
if not response.items:
|
|
442
|
+
raise click.ClickException(f"No publishing history found for named image {response.tag!r}.")
|
|
459
443
|
|
|
460
444
|
if json:
|
|
461
445
|
click.echo("[", nl=False)
|
|
462
446
|
count = 0
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
count += 1
|
|
447
|
+
for item in response.items:
|
|
448
|
+
if count:
|
|
449
|
+
click.echo(",", nl=False)
|
|
450
|
+
click.echo(json_module.dumps(_history_item_json(item)), nl=False)
|
|
451
|
+
count += 1
|
|
469
452
|
click.echo("]")
|
|
470
453
|
return
|
|
471
454
|
|
|
472
455
|
count = 0
|
|
473
456
|
show_title = True
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
count += len(response.items)
|
|
457
|
+
if response.items:
|
|
458
|
+
title = f"History for {response.tag}" if show_title else ""
|
|
459
|
+
display_table(
|
|
460
|
+
["Image ID", "Published at", "Published by"],
|
|
461
|
+
[_history_item_row(item) for item in response.items],
|
|
462
|
+
title=title,
|
|
463
|
+
)
|
|
464
|
+
show_title = False
|
|
465
|
+
count += len(response.items)
|
|
484
466
|
|
|
485
467
|
_print_result_summary(count)
|
|
486
468
|
|
|
@@ -293,8 +293,18 @@ def _start_shell_from_image(
|
|
|
293
293
|
multiple=True,
|
|
294
294
|
help="Name of a modal.Secret to mount inside the shell (if not using REF). Can be used multiple times.",
|
|
295
295
|
)
|
|
296
|
-
@click.option(
|
|
297
|
-
|
|
296
|
+
@click.option(
|
|
297
|
+
"--cpu",
|
|
298
|
+
default=None,
|
|
299
|
+
type=int,
|
|
300
|
+
help="Number of CPU cores to request for the shell (if not using REF). The shell can burst above this request.",
|
|
301
|
+
)
|
|
302
|
+
@click.option(
|
|
303
|
+
"--memory",
|
|
304
|
+
default=None,
|
|
305
|
+
type=int,
|
|
306
|
+
help="Memory to request for the shell, in MiB (if not using REF). The shell can burst above this request.",
|
|
307
|
+
)
|
|
298
308
|
@click.option(
|
|
299
309
|
"--gpu",
|
|
300
310
|
default=None,
|
|
@@ -726,28 +726,35 @@ def member_tokens_list(json: bool):
|
|
|
726
726
|
|
|
727
727
|
|
|
728
728
|
@member_tokens_cli.command("delete", no_args_is_help=True)
|
|
729
|
-
@click.argument("
|
|
730
|
-
@click.option(
|
|
729
|
+
@click.argument("token_ids", nargs=-1)
|
|
730
|
+
@click.option(
|
|
731
|
+
"--allow-missing", is_flag=True, default=False, help="Don't error if any of the specified tokens don't exist."
|
|
732
|
+
)
|
|
731
733
|
@yes_option
|
|
732
|
-
def member_tokens_delete(
|
|
733
|
-
"""Delete
|
|
734
|
+
def member_tokens_delete(token_ids: list[str], *, allow_missing: bool, yes: bool):
|
|
735
|
+
"""Delete member tokens in this Workspace.
|
|
734
736
|
|
|
735
|
-
Note that this action is irreversible. This will immediately invalidate the target
|
|
736
|
-
render
|
|
737
|
+
Note that this action is irreversible. This will immediately invalidate the target tokens and will
|
|
738
|
+
render them unable to authenticate with Modal.
|
|
737
739
|
|
|
738
740
|
```bash
|
|
739
|
-
# Delete the
|
|
741
|
+
# Delete the token with ID `ak-0123456789abcdefghijkl`
|
|
740
742
|
modal workspace member-tokens delete ak-0123456789abcdefghijkl
|
|
743
|
+
|
|
744
|
+
# Delete multiple tokens
|
|
745
|
+
modal workspace member-tokens delete ak-0123456789abcdefghijkl ak-mnopqrstuvwxyz01234567
|
|
741
746
|
```
|
|
742
747
|
"""
|
|
743
748
|
if not yes:
|
|
744
|
-
confirm_or_suggest_yes(f"Are you sure you want to irrevocably delete
|
|
749
|
+
confirm_or_suggest_yes(f"Are you sure you want to irrevocably delete {len(token_ids)} token(s)?")
|
|
745
750
|
|
|
746
751
|
ws = Workspace.from_context()
|
|
747
|
-
ws.member_tokens.delete(
|
|
752
|
+
deleted_token_ids = ws.member_tokens.delete(*token_ids, allow_missing=allow_missing)
|
|
748
753
|
|
|
749
754
|
output_manager = OutputManager.get()
|
|
750
|
-
output_manager.print(
|
|
755
|
+
output_manager.print(
|
|
756
|
+
f"[green]✓[/green] Deleted {len(deleted_token_ids)} {'token' if len(deleted_token_ids) == 1 else 'tokens'}."
|
|
757
|
+
)
|
|
751
758
|
|
|
752
759
|
|
|
753
760
|
@member_tokens_cli.command("disable", no_args_is_help=True)
|
|
@@ -85,7 +85,7 @@ class _Client:
|
|
|
85
85
|
server_url: str,
|
|
86
86
|
client_type: int,
|
|
87
87
|
credentials: typing.Optional[tuple[str, str]],
|
|
88
|
-
version: str = "1.6.5.
|
|
88
|
+
version: str = "1.6.5.dev5",
|
|
89
89
|
*,
|
|
90
90
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
91
91
|
):
|
|
@@ -310,7 +310,7 @@ class Client:
|
|
|
310
310
|
server_url: str,
|
|
311
311
|
client_type: int,
|
|
312
312
|
credentials: typing.Optional[tuple[str, str]],
|
|
313
|
-
version: str = "1.6.5.
|
|
313
|
+
version: str = "1.6.5.dev5",
|
|
314
314
|
*,
|
|
315
315
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
316
316
|
):
|
|
@@ -242,10 +242,12 @@ class _Sandbox(_Object, type_prefixes=("sb",)):
|
|
|
242
242
|
cpu:
|
|
243
243
|
Specify, in fractional CPU cores, how many CPU cores to request. Or, pass (request, limit) to
|
|
244
244
|
additionally specify a hard limit in fractional CPU cores. CPU throttling will prevent a container
|
|
245
|
-
from exceeding its specified limit.
|
|
245
|
+
from exceeding its specified limit. Modal Sandboxes support bursting above the CPU request, so most
|
|
246
|
+
users don't need to specify a request.
|
|
246
247
|
memory:
|
|
247
248
|
Specify, in MiB, a memory request which is the minimum memory required. Or, pass (request, limit) to
|
|
248
|
-
additionally specify a hard limit in MiB.
|
|
249
|
+
additionally specify a hard limit in MiB. Modal Sandboxes support bursting above the memory request,
|
|
250
|
+
so most users don't need to specify a request.
|
|
249
251
|
runtime:
|
|
250
252
|
Runtime under which the Sandbox executes, or None to let Modal pick.
|
|
251
253
|
block_network: Whether to block network access.
|
|
@@ -272,7 +274,9 @@ class _Sandbox(_Object, type_prefixes=("sb",)):
|
|
|
272
274
|
proxy: Reference to a Modal Proxy to use in front of this Sandbox.
|
|
273
275
|
include_oidc_identity_token:
|
|
274
276
|
If True, the sandbox will receive a MODAL_IDENTITY_TOKEN env var for OIDC-based auth.
|
|
275
|
-
readiness_probe:
|
|
277
|
+
readiness_probe:
|
|
278
|
+
Probe used to determine when the Sandbox is ready.
|
|
279
|
+
If not configured, the Sandbox is ready when it starts.
|
|
276
280
|
verbose: Enable verbose logging for sandbox operations.
|
|
277
281
|
experimental_options: Experimental options to pass to the sandbox.
|
|
278
282
|
_experimental_enable_snapshot: Enable memory snapshots.
|
|
@@ -971,9 +975,10 @@ class _Sandbox(_Object, type_prefixes=("sb",)):
|
|
|
971
975
|
await self._impl.wait(raise_on_termination)
|
|
972
976
|
|
|
973
977
|
async def wait_until_ready(self, *, timeout: int = 300) -> None:
|
|
974
|
-
"""Wait
|
|
978
|
+
"""Wait until the Sandbox is ready.
|
|
975
979
|
|
|
976
|
-
|
|
980
|
+
A Sandbox with a readiness probe is ready once the probe passes;
|
|
981
|
+
a Sandbox without one is ready once it starts.
|
|
977
982
|
|
|
978
983
|
Args:
|
|
979
984
|
timeout: Maximum time in seconds to wait for readiness.
|
|
@@ -812,7 +812,10 @@ class TaskCommandRouterClient:
|
|
|
812
812
|
)
|
|
813
813
|
|
|
814
814
|
async def sandbox_wait_until_ready(self, task_id: str, timeout: float) -> sr_pb2.SandboxWaitUntilReadyTcrResponse:
|
|
815
|
-
"""Wait until the
|
|
815
|
+
"""Wait until the Sandbox is ready.
|
|
816
|
+
|
|
817
|
+
A Sandbox with a readiness probe is ready once the probe passes;
|
|
818
|
+
a Sandbox without one is ready once it starts.
|
|
816
819
|
|
|
817
820
|
Args:
|
|
818
821
|
task_id: The task ID hosting the sandbox.
|