modal 1.6.5.dev4__tar.gz → 1.6.5.dev6__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.dev4 → modal-1.6.5.dev6}/PKG-INFO +1 -1
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_workspace.py +44 -37
- modal-1.6.5.dev6/modal/cli/_audit_logs.py +163 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_logs.py +4 -2
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/image.py +17 -35
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/shell.py +12 -2
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/workspace.py +88 -10
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/client.pyi +2 -2
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_sandbox.py +4 -2
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/sandbox.pyi +8 -4
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/workspace.pyi +63 -57
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/SOURCES.txt +1 -1
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_grpc.py +19 -3
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_pb2.py +582 -535
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_pb2.pyi +210 -4
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_pb2_grpc.py +36 -3
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/api_pb2_grpc.pyi +12 -2
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/modal_api_grpc.py +1 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_version/__init__.py +1 -1
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/pyproject.toml +3 -9
- modal-1.6.5.dev4/modal/experimental/ipython.py +0 -84
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/LICENSE +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/README.md +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/__main__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_audit_logs/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_audit_logs/_rpcs.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_audit_logs/count.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_audit_logs/list.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_billing.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_cluster.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_cluster.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_container_entrypoint.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_environments.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_function_variants.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_functions.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_grpc_client.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_image.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_ipython.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_load_context.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_location.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_logs.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_logs_manager.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_logs_manager.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_metrics.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_metrics.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_object.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_outbound_policy.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_outbound_policy.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/manager.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/pty.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/rich.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_output/status.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_partial_function.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_resolver.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_resources.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/asgi.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/execution_context.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/task_lifecycle_manager.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/telemetry.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_serialization.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_server.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_server.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_supports_logs.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_traceback.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_tunnel.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_tunnel.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_type_manager.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/app_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/async_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/blob_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/browser_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/curl_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/deprecation.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/display_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/docker_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/function_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/git_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/hash_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/http_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/idle_countdown.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/logger.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/mount_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/name_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/oauth.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/package_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/proxy_support.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/sandbox_fs_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/shell_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_utils/time_utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/tblib.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_vendor/version.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/_watcher.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/app.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/app.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/billing.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/billing.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2023.12.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2024.04.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2024.10.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2025.06.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/2026.10.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/README.md +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/builder/base-images.json +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/call_graph.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_download.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_help.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_stats.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_suggest.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/_traceback.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/app.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/billing.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/changelog.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/config.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/container.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/curl.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/dashboard.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/dict.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/endpoint.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/entry_point.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/environment.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/function.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/import_refs.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/logo.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/network_file_system.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/profile.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/queues.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/run.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/secret.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/selector.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/server.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/skills.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/token.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/utils.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cli/volume.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/client.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cls.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cls.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cluster.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/cluster.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/config.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/container_process.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/container_process.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/dict.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/dict.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/environments.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/environments.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/exception.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/_flash_container_entry.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/flash.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/flash.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/flash_server.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/flash_server.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/stream.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/experimental/stream.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/file_pattern_matcher.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/functions.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/functions.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/image.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/image.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/io_streams.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/io_streams.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/mount.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/mount.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/network_file_system.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/network_file_system.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/object.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/object.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/output.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/parallel_map.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/parallel_map.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/partial_function.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/partial_function.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/proxy.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/proxy.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/py.typed +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/queue.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/queue.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/retries.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/runner.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/runner.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/running_app.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_common.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_filesystem.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_impl_persistent.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_impl_v1.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_impl_v2.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_sidecar.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_snapshot.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/_task_command_router_client.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/sandbox/sandbox.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/schedule.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/scheduler_placement.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/secret.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/secret.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/server.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/server.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/serving.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/serving.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/skills/modal/SKILL.md +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/stream_type.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/token_flow.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/token_flow.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/types.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/volume.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/volume.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal/workspace.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/requires.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal.egg-info/top_level.txt +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/gen_cli_docs_main.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/gen_reference_docs_main.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/mdmd/types.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_docs/reference_intro.md +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/__init__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/py.typed +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/modal_version/__main__.py +0 -0
- {modal-1.6.5.dev4 → modal-1.6.5.dev6}/setup.cfg +0 -0
|
@@ -912,31 +912,6 @@ class _WorkspaceMemberTokenManager:
|
|
|
912
912
|
def __init__(self, workspace: _Workspace):
|
|
913
913
|
self._workspace = workspace
|
|
914
914
|
|
|
915
|
-
async def list(self) -> list[MemberTokenInfo]:
|
|
916
|
-
"""List Member Tokens in the specified Workspace.
|
|
917
|
-
|
|
918
|
-
If you are a Manager or an Owner of this Workspace, this method will return a list of all the
|
|
919
|
-
Member Tokens in the Workspace. Otherwise, this method will only return the Tokens you have
|
|
920
|
-
created.
|
|
921
|
-
|
|
922
|
-
Returns:
|
|
923
|
-
A list of `MemberTokenInfo` dataclasses.
|
|
924
|
-
|
|
925
|
-
Examples:
|
|
926
|
-
|
|
927
|
-
```python notest
|
|
928
|
-
ws = modal.Workspace.from_context()
|
|
929
|
-
for member_token in ws.member_tokens.list():
|
|
930
|
-
print(member_token)
|
|
931
|
-
```
|
|
932
|
-
"""
|
|
933
|
-
if not self._workspace._is_hydrated:
|
|
934
|
-
await self._workspace.hydrate()
|
|
935
|
-
|
|
936
|
-
resp = await self._workspace.client._stub.TokensList(Empty())
|
|
937
|
-
|
|
938
|
-
return [MemberTokenInfo._from_proto(token) for token in resp.tokens]
|
|
939
|
-
|
|
940
915
|
async def disable(self, *token_ids: str) -> None:
|
|
941
916
|
"""Disable member tokens in the specified Workspace.
|
|
942
917
|
|
|
@@ -993,29 +968,61 @@ class _WorkspaceMemberTokenManager:
|
|
|
993
968
|
|
|
994
969
|
await self._workspace.client._stub.TokenEnable(api_pb2.TokenEnableRequest(token_ids=list(set(token_ids))))
|
|
995
970
|
|
|
996
|
-
async def delete(self,
|
|
997
|
-
"""Delete
|
|
971
|
+
async def delete(self, *token_ids: str, allow_missing: bool = False) -> "list[str]":
|
|
972
|
+
"""Delete member tokens in the specified Workspace.
|
|
998
973
|
|
|
999
|
-
If you are a Workspace Manager or Owner, you can use this method to delete any
|
|
1000
|
-
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.
|
|
1001
976
|
|
|
1002
977
|
Args:
|
|
1003
|
-
|
|
1004
|
-
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.
|
|
1005
983
|
|
|
1006
984
|
Examples:
|
|
1007
985
|
|
|
1008
986
|
```python notest
|
|
1009
987
|
ws = modal.Workspace.from_context()
|
|
1010
|
-
ws.member_tokens.delete(
|
|
988
|
+
ws.member_tokens.delete("ak-0123456789abcdefghijkl", "ak-mnopqrstuvwxyz01234567")
|
|
1011
989
|
```
|
|
1012
990
|
"""
|
|
1013
991
|
|
|
1014
992
|
if not self._workspace._is_hydrated:
|
|
1015
993
|
await self._workspace.hydrate()
|
|
1016
994
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
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]
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Copyright Modal Labs 2026
|
|
2
|
+
import contextlib
|
|
3
|
+
import csv
|
|
4
|
+
import io
|
|
5
|
+
import json
|
|
6
|
+
import logging
|
|
7
|
+
from collections.abc import Iterable, Iterator
|
|
8
|
+
from datetime import datetime, timezone
|
|
9
|
+
|
|
10
|
+
import click
|
|
11
|
+
|
|
12
|
+
from modal._utils.logger import logger
|
|
13
|
+
from modal._workspace import _AUDIT_LOG_DEFAULT_WINDOW, _WorkspaceAuditLogsManager
|
|
14
|
+
from modal.types import AuditEvent
|
|
15
|
+
|
|
16
|
+
from ._logs import _parse_fetch_range
|
|
17
|
+
|
|
18
|
+
_CSV_COLUMNS = (
|
|
19
|
+
"id",
|
|
20
|
+
"timestamp",
|
|
21
|
+
"action",
|
|
22
|
+
"status",
|
|
23
|
+
"actor_type",
|
|
24
|
+
"actor_id",
|
|
25
|
+
"actor_name",
|
|
26
|
+
"actor_email",
|
|
27
|
+
"target_type",
|
|
28
|
+
"target_id",
|
|
29
|
+
"workspace_id",
|
|
30
|
+
"environment_id",
|
|
31
|
+
"environment_name",
|
|
32
|
+
"source",
|
|
33
|
+
"ip_address",
|
|
34
|
+
"metadata",
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _timestamp(entry: AuditEvent) -> str:
|
|
39
|
+
return entry.timestamp.astimezone(timezone.utc).isoformat(timespec="milliseconds")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _csv_row(entry: AuditEvent) -> list[str | None]:
|
|
43
|
+
target = entry.targets[0] if entry.targets else None
|
|
44
|
+
return [
|
|
45
|
+
entry.id,
|
|
46
|
+
_timestamp(entry),
|
|
47
|
+
entry.action,
|
|
48
|
+
entry.status,
|
|
49
|
+
entry.actor.type,
|
|
50
|
+
entry.actor.id,
|
|
51
|
+
entry.actor.name,
|
|
52
|
+
entry.actor.email,
|
|
53
|
+
target.type if target else None,
|
|
54
|
+
target.id if target else None,
|
|
55
|
+
entry.context.workspace_id,
|
|
56
|
+
entry.context.environment_id,
|
|
57
|
+
entry.context.environment_name,
|
|
58
|
+
entry.context.source,
|
|
59
|
+
str(entry.context.ip_address) if entry.context.ip_address else None,
|
|
60
|
+
json.dumps(entry.metadata),
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _format_json(entry: AuditEvent) -> str:
|
|
65
|
+
return json.dumps(
|
|
66
|
+
{
|
|
67
|
+
"id": entry.id,
|
|
68
|
+
"timestamp": _timestamp(entry),
|
|
69
|
+
"action": entry.action,
|
|
70
|
+
"status": entry.status,
|
|
71
|
+
"actor": {
|
|
72
|
+
"type": entry.actor.type,
|
|
73
|
+
"id": entry.actor.id,
|
|
74
|
+
"name": entry.actor.name,
|
|
75
|
+
"email": entry.actor.email,
|
|
76
|
+
},
|
|
77
|
+
"targets": [{"type": target.type, "id": target.id} for target in entry.targets],
|
|
78
|
+
"context": {
|
|
79
|
+
"workspace_id": entry.context.workspace_id,
|
|
80
|
+
"environment_id": entry.context.environment_id,
|
|
81
|
+
"environment_name": entry.context.environment_name,
|
|
82
|
+
"source": entry.context.source,
|
|
83
|
+
"ip_address": str(entry.context.ip_address) if entry.context.ip_address else None,
|
|
84
|
+
},
|
|
85
|
+
"metadata": entry.metadata,
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _print_csv_row(row: Iterable[str | None]) -> None:
|
|
91
|
+
buffer = io.StringIO(newline="")
|
|
92
|
+
csv.writer(buffer, lineterminator="\n").writerow(row)
|
|
93
|
+
click.echo(buffer.getvalue(), nl=False)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
async def _print_events(
|
|
97
|
+
manager: _WorkspaceAuditLogsManager,
|
|
98
|
+
*,
|
|
99
|
+
query: str,
|
|
100
|
+
since: datetime | None,
|
|
101
|
+
until: datetime,
|
|
102
|
+
limit: int | None,
|
|
103
|
+
as_csv: bool,
|
|
104
|
+
) -> None:
|
|
105
|
+
if as_csv:
|
|
106
|
+
_print_csv_row(_CSV_COLUMNS)
|
|
107
|
+
stream = manager.fetch(query, since=since, until=until, limit=limit)
|
|
108
|
+
try:
|
|
109
|
+
async for entry in stream:
|
|
110
|
+
if as_csv:
|
|
111
|
+
_print_csv_row(_csv_row(entry))
|
|
112
|
+
else:
|
|
113
|
+
click.echo(_format_json(entry))
|
|
114
|
+
finally:
|
|
115
|
+
await stream.aclose()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class _DropRateLimitWarnings(logging.Filter):
|
|
119
|
+
def filter(self, record: logging.LogRecord) -> bool:
|
|
120
|
+
message = record.getMessage()
|
|
121
|
+
return not ("/AuditLog" in message and "RESOURCE_EXHAUSTED" in message)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@contextlib.contextmanager
|
|
125
|
+
def _quiet_rate_limit_warnings() -> Iterator[None]:
|
|
126
|
+
"""Hides the SDK's per-retry rate limit warnings so they don't interleave with the printed events."""
|
|
127
|
+
log_filter = _DropRateLimitWarnings()
|
|
128
|
+
logger.addFilter(log_filter)
|
|
129
|
+
try:
|
|
130
|
+
yield
|
|
131
|
+
finally:
|
|
132
|
+
logger.removeFilter(log_filter)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
async def run_audit_logs_command(
|
|
136
|
+
manager: _WorkspaceAuditLogsManager,
|
|
137
|
+
*,
|
|
138
|
+
query: str,
|
|
139
|
+
since: str | None,
|
|
140
|
+
until: str | None,
|
|
141
|
+
limit: int | None,
|
|
142
|
+
count_only: bool,
|
|
143
|
+
as_csv: bool,
|
|
144
|
+
) -> None:
|
|
145
|
+
if count_only and as_csv:
|
|
146
|
+
raise click.UsageError("--csv can't be used with --count.")
|
|
147
|
+
if count_only and since is None:
|
|
148
|
+
raise click.UsageError("--since is required with --count.")
|
|
149
|
+
since_dt, until_dt = _parse_fetch_range(since, until, _AUDIT_LOG_DEFAULT_WINDOW)
|
|
150
|
+
|
|
151
|
+
with _quiet_rate_limit_warnings():
|
|
152
|
+
if count_only:
|
|
153
|
+
click.echo(await manager.count(query, since=since_dt, until=until_dt))
|
|
154
|
+
return
|
|
155
|
+
|
|
156
|
+
await _print_events(
|
|
157
|
+
manager,
|
|
158
|
+
query=query,
|
|
159
|
+
since=since_dt if since is not None else None,
|
|
160
|
+
until=until_dt,
|
|
161
|
+
limit=limit,
|
|
162
|
+
as_csv=as_csv,
|
|
163
|
+
)
|
|
@@ -53,7 +53,9 @@ def _validate_logs_args(*, follow: bool, since: str | None, until: str | None, t
|
|
|
53
53
|
raise UsageError(f"--tail value must not exceed {_FETCH_LIMIT}.")
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
def _parse_fetch_range(
|
|
56
|
+
def _parse_fetch_range(
|
|
57
|
+
since: str | None, until: str | None, default_window: timedelta = timedelta(hours=1)
|
|
58
|
+
) -> tuple[datetime, datetime]:
|
|
57
59
|
now = datetime.now(timezone.utc).replace(microsecond=0)
|
|
58
60
|
|
|
59
61
|
def parse_bound(value: str | None, default: datetime, flag: str) -> datetime:
|
|
@@ -70,7 +72,7 @@ def _parse_fetch_range(since: str | None, until: str | None) -> tuple[datetime,
|
|
|
70
72
|
return result
|
|
71
73
|
|
|
72
74
|
until_dt = parse_bound(until, now, "--until")
|
|
73
|
-
since_dt = parse_bound(since, until_dt -
|
|
75
|
+
since_dt = parse_bound(since, until_dt - default_window, "--since")
|
|
74
76
|
if since_dt >= until_dt:
|
|
75
77
|
raise UsageError("--since must be before --until.")
|
|
76
78
|
if since_dt.timestamp() < 0:
|
|
@@ -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,
|
|
@@ -20,6 +20,7 @@ from modal.output import OutputManager
|
|
|
20
20
|
from modal.workspace import Workspace
|
|
21
21
|
from modal_proto import api_pb2
|
|
22
22
|
|
|
23
|
+
from ._audit_logs import run_audit_logs_command
|
|
23
24
|
from ._help import _MAX_HELP_WIDTH, ModalGroup
|
|
24
25
|
|
|
25
26
|
WORKSPACE_HELP_TEXT = """Interact with the current Modal Workspace.
|
|
@@ -55,6 +56,76 @@ def members_list(json: bool = False):
|
|
|
55
56
|
display_table(["Name", "Email", "Role", "User ID", "Joined", "Last active"], rows, json=json)
|
|
56
57
|
|
|
57
58
|
|
|
59
|
+
@workspace_cli.command("audit-logs", short_help="Show Workspace audit logs as JSON (default) or CSV.")
|
|
60
|
+
@click.option(
|
|
61
|
+
"-q",
|
|
62
|
+
"--query",
|
|
63
|
+
default="",
|
|
64
|
+
help="Filter events with the audit log search syntax. See https://modal.com/docs/guide/log-search-syntax",
|
|
65
|
+
)
|
|
66
|
+
@click.option(
|
|
67
|
+
"--since",
|
|
68
|
+
default=None,
|
|
69
|
+
help="Start of time range. Accepts ISO 8601 datetime or relative time, e.g. '1d' (1 day ago), '2h', '30m'.",
|
|
70
|
+
)
|
|
71
|
+
@click.option("--until", default=None, help="End of time range; accepts same argument types as --since.")
|
|
72
|
+
@click.option(
|
|
73
|
+
"-n",
|
|
74
|
+
"--limit",
|
|
75
|
+
type=int,
|
|
76
|
+
default=None,
|
|
77
|
+
help="Show the newest N events in the range.",
|
|
78
|
+
)
|
|
79
|
+
@click.option(
|
|
80
|
+
"--count", "count_only", is_flag=True, default=False, help="Print the number of matching events; requires --since."
|
|
81
|
+
)
|
|
82
|
+
@click.option("--csv", "as_csv", is_flag=True, default=False, help="Output CSV instead of newline-delimited JSON.")
|
|
83
|
+
@synchronizer.create_blocking
|
|
84
|
+
async def audit_logs(
|
|
85
|
+
query: str = "",
|
|
86
|
+
since: str | None = None,
|
|
87
|
+
until: str | None = None,
|
|
88
|
+
limit: int | None = None,
|
|
89
|
+
count_only: bool = False,
|
|
90
|
+
as_csv: bool = False,
|
|
91
|
+
):
|
|
92
|
+
"""Show the audit logs of the current Workspace as newline-delimited JSON (default) or CSV.
|
|
93
|
+
|
|
94
|
+
By default, this command prints the newest 100 events from the last 7 days. With ``--since``, it
|
|
95
|
+
prints every event in the range, oldest first. The range cannot exceed 7 days.
|
|
96
|
+
|
|
97
|
+
Each line contains a full event, including metadata, with a UTC timestamp at millisecond precision.
|
|
98
|
+
|
|
99
|
+
Counting with ``--count`` requires ``--since`` to specify the start of the time range.
|
|
100
|
+
|
|
101
|
+
Examples:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Newest 100 events
|
|
105
|
+
modal workspace audit-logs
|
|
106
|
+
|
|
107
|
+
# Every deploy or stop in the last 2 days
|
|
108
|
+
modal workspace audit-logs -q 'action:(app.deploy OR app.stop)' --since 2d
|
|
109
|
+
|
|
110
|
+
# Every field of each event, one JSON object per line
|
|
111
|
+
modal workspace audit-logs --since 1d
|
|
112
|
+
|
|
113
|
+
# Export every event in the last day as CSV
|
|
114
|
+
modal workspace audit-logs --since 1d --csv > audit.csv
|
|
115
|
+
|
|
116
|
+
# How many secrets were created in the last 7 days
|
|
117
|
+
modal workspace audit-logs -q 'action:secret.create' --since 7d --count
|
|
118
|
+
```
|
|
119
|
+
"""
|
|
120
|
+
if limit is not None and limit < 1:
|
|
121
|
+
raise click.BadParameter("must be at least 1", param_hint="'--limit'")
|
|
122
|
+
ws = _Workspace.from_context()
|
|
123
|
+
await ws.hydrate()
|
|
124
|
+
await run_audit_logs_command(
|
|
125
|
+
ws.audit_logs, query=query, since=since, until=until, limit=limit, count_only=count_only, as_csv=as_csv
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
|
|
58
129
|
PROXY_TOKENS_HELP_TEXT = """Manage the proxy tokens of the current Workspace.
|
|
59
130
|
|
|
60
131
|
Proxy tokens provide authentication to Modal Endpoints, Servers, and Web Functions.
|
|
@@ -726,28 +797,35 @@ def member_tokens_list(json: bool):
|
|
|
726
797
|
|
|
727
798
|
|
|
728
799
|
@member_tokens_cli.command("delete", no_args_is_help=True)
|
|
729
|
-
@click.argument("
|
|
730
|
-
@click.option(
|
|
800
|
+
@click.argument("token_ids", nargs=-1)
|
|
801
|
+
@click.option(
|
|
802
|
+
"--allow-missing", is_flag=True, default=False, help="Don't error if any of the specified tokens don't exist."
|
|
803
|
+
)
|
|
731
804
|
@yes_option
|
|
732
|
-
def member_tokens_delete(
|
|
733
|
-
"""Delete
|
|
805
|
+
def member_tokens_delete(token_ids: list[str], *, allow_missing: bool, yes: bool):
|
|
806
|
+
"""Delete member tokens in this Workspace.
|
|
734
807
|
|
|
735
|
-
Note that this action is irreversible. This will immediately invalidate the target
|
|
736
|
-
render
|
|
808
|
+
Note that this action is irreversible. This will immediately invalidate the target tokens and will
|
|
809
|
+
render them unable to authenticate with Modal.
|
|
737
810
|
|
|
738
811
|
```bash
|
|
739
|
-
# Delete the
|
|
812
|
+
# Delete the token with ID `ak-0123456789abcdefghijkl`
|
|
740
813
|
modal workspace member-tokens delete ak-0123456789abcdefghijkl
|
|
814
|
+
|
|
815
|
+
# Delete multiple tokens
|
|
816
|
+
modal workspace member-tokens delete ak-0123456789abcdefghijkl ak-mnopqrstuvwxyz01234567
|
|
741
817
|
```
|
|
742
818
|
"""
|
|
743
819
|
if not yes:
|
|
744
|
-
confirm_or_suggest_yes(f"Are you sure you want to irrevocably delete
|
|
820
|
+
confirm_or_suggest_yes(f"Are you sure you want to irrevocably delete {len(token_ids)} token(s)?")
|
|
745
821
|
|
|
746
822
|
ws = Workspace.from_context()
|
|
747
|
-
ws.member_tokens.delete(
|
|
823
|
+
deleted_token_ids = ws.member_tokens.delete(*token_ids, allow_missing=allow_missing)
|
|
748
824
|
|
|
749
825
|
output_manager = OutputManager.get()
|
|
750
|
-
output_manager.print(
|
|
826
|
+
output_manager.print(
|
|
827
|
+
f"[green]✓[/green] Deleted {len(deleted_token_ids)} {'token' if len(deleted_token_ids) == 1 else 'tokens'}."
|
|
828
|
+
)
|
|
751
829
|
|
|
752
830
|
|
|
753
831
|
@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.dev6",
|
|
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.dev6",
|
|
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.
|
|
@@ -1391,10 +1391,12 @@ class Sandbox(modal.object.Object):
|
|
|
1391
1391
|
cpu:
|
|
1392
1392
|
Specify, in fractional CPU cores, how many CPU cores to request. Or, pass (request, limit) to
|
|
1393
1393
|
additionally specify a hard limit in fractional CPU cores. CPU throttling will prevent a container
|
|
1394
|
-
from exceeding its specified limit.
|
|
1394
|
+
from exceeding its specified limit. Modal Sandboxes support bursting above the CPU request, so most
|
|
1395
|
+
users don't need to specify a request.
|
|
1395
1396
|
memory:
|
|
1396
1397
|
Specify, in MiB, a memory request which is the minimum memory required. Or, pass (request, limit) to
|
|
1397
|
-
additionally specify a hard limit in MiB.
|
|
1398
|
+
additionally specify a hard limit in MiB. Modal Sandboxes support bursting above the memory request,
|
|
1399
|
+
so most users don't need to specify a request.
|
|
1398
1400
|
runtime:
|
|
1399
1401
|
Runtime under which the Sandbox executes, or None to let Modal pick.
|
|
1400
1402
|
block_network: Whether to block network access.
|
|
@@ -1518,10 +1520,12 @@ class Sandbox(modal.object.Object):
|
|
|
1518
1520
|
cpu:
|
|
1519
1521
|
Specify, in fractional CPU cores, how many CPU cores to request. Or, pass (request, limit) to
|
|
1520
1522
|
additionally specify a hard limit in fractional CPU cores. CPU throttling will prevent a container
|
|
1521
|
-
from exceeding its specified limit.
|
|
1523
|
+
from exceeding its specified limit. Modal Sandboxes support bursting above the CPU request, so most
|
|
1524
|
+
users don't need to specify a request.
|
|
1522
1525
|
memory:
|
|
1523
1526
|
Specify, in MiB, a memory request which is the minimum memory required. Or, pass (request, limit) to
|
|
1524
|
-
additionally specify a hard limit in MiB.
|
|
1527
|
+
additionally specify a hard limit in MiB. Modal Sandboxes support bursting above the memory request,
|
|
1528
|
+
so most users don't need to specify a request.
|
|
1525
1529
|
runtime:
|
|
1526
1530
|
Runtime under which the Sandbox executes, or None to let Modal pick.
|
|
1527
1531
|
block_network: Whether to block network access.
|