modal 1.6.5.dev6__tar.gz → 1.6.5.dev7__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.dev6 → modal-1.6.5.dev7}/PKG-INFO +1 -1
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_functions.py +6 -1
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_server.py +2 -2
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/config.py +0 -2
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/profile.py +2 -3
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/token.py +0 -1
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/workspace.py +1 -1
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/client.py +9 -27
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/client.pyi +11 -44
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cls.py +31 -4
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cls.pyi +8 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/config.py +7 -8
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/mount.py +9 -4
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/mount.pyi +3 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/token_flow.py +0 -1
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_version/__init__.py +1 -1
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/LICENSE +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/README.md +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/__main__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_audit_logs/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_audit_logs/_rpcs.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_audit_logs/count.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_audit_logs/list.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_billing.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_cluster.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_cluster.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_container_entrypoint.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_environments.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_function_variants.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_grpc_client.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_image.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_ipython.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_load_context.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_location.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_logs.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_logs_manager.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_logs_manager.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_metrics.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_metrics.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_object.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_outbound_policy.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_outbound_policy.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_output/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_output/manager.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_output/pty.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_output/rich.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_output/status.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_partial_function.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_resolver.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_resources.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/asgi.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/execution_context.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/task_lifecycle_manager.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/telemetry.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_serialization.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_server.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_supports_logs.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_traceback.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_tunnel.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_tunnel.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_type_manager.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/app_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/async_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/blob_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/browser_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/curl_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/deprecation.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/display_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/docker_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/function_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/git_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/hash_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/http_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/idle_countdown.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/logger.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/mount_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/name_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/oauth.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/package_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/proxy_support.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/sandbox_fs_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/shell_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_utils/time_utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_vendor/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_vendor/tblib.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_vendor/version.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_watcher.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/_workspace.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/app.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/app.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/billing.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/billing.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/2023.12.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/2024.04.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/2024.10.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/2025.06.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/2026.10.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/README.md +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/builder/base-images.json +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/call_graph.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/_audit_logs.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/_download.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/_help.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/_logs.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/_stats.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/_suggest.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/_traceback.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/app.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/billing.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/changelog.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/container.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/curl.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/dashboard.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/dict.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/endpoint.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/entry_point.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/environment.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/function.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/image.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/import_refs.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/logo.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/network_file_system.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/queues.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/run.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/secret.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/selector.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/server.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/shell.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/skills.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/utils.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cli/volume.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cluster.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/cluster.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/container_process.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/container_process.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/dict.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/dict.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/environments.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/environments.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/exception.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/experimental/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/experimental/_flash_container_entry.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/experimental/flash.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/experimental/flash.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/experimental/flash_server.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/experimental/flash_server.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/experimental/stream.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/experimental/stream.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/file_pattern_matcher.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/functions.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/functions.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/image.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/image.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/io_streams.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/io_streams.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/network_file_system.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/network_file_system.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/object.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/object.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/output.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/parallel_map.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/parallel_map.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/partial_function.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/partial_function.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/proxy.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/proxy.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/py.typed +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/queue.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/queue.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/retries.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/runner.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/runner.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/running_app.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_common.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_filesystem.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_impl_persistent.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_impl_v1.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_impl_v2.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_sandbox.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_sidecar.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_snapshot.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/_task_command_router_client.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/sandbox.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/sandbox/sandbox.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/schedule.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/scheduler_placement.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/secret.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/secret.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/server.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/server.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/serving.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/serving.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/skills/modal/SKILL.md +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/stream_type.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/token_flow.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/types.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/volume.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/volume.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/workspace.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal/workspace.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal.egg-info/requires.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal.egg-info/top_level.txt +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/gen_cli_docs_main.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/gen_reference_docs_main.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/mdmd/types.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_docs/reference_intro.md +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/__init__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/api_grpc.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/api_pb2.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/api_pb2.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/py.typed +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/modal_version/__main__.py +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/pyproject.toml +0 -0
- {modal-1.6.5.dev6 → modal-1.6.5.dev7}/setup.cfg +0 -0
|
@@ -965,6 +965,8 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
965
965
|
is_web_endpoint, is_generator, restrict_output
|
|
966
966
|
)
|
|
967
967
|
|
|
968
|
+
class_parameter_info = info.class_parameter_info()
|
|
969
|
+
|
|
968
970
|
async def _preload(
|
|
969
971
|
self: _Function, resolver: Resolver, load_context: LoadContext, existing_object_id: str | None
|
|
970
972
|
):
|
|
@@ -1103,7 +1105,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
1103
1105
|
cloud_bucket_mounts=cloud_bucket_mounts_to_proto(cloud_bucket_mounts)[0],
|
|
1104
1106
|
scheduler_placement=scheduler_placement,
|
|
1105
1107
|
is_class=info.is_service_class(),
|
|
1106
|
-
class_parameter_info=
|
|
1108
|
+
class_parameter_info=class_parameter_info,
|
|
1107
1109
|
i6pn_enabled=i6pn_enabled,
|
|
1108
1110
|
schedule=schedule.proto_message if schedule is not None else None,
|
|
1109
1111
|
snapshot_debug=config.get("snapshot_debug"),
|
|
@@ -1234,6 +1236,9 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
1234
1236
|
obj._is_method = False
|
|
1235
1237
|
obj._spec = function_spec # needed for modal shell
|
|
1236
1238
|
obj._webhook_config = webhook_config # only set locally
|
|
1239
|
+
# Set locally so Cls instances created before the App is running bind their
|
|
1240
|
+
# parameters the same way as instances created afterwards
|
|
1241
|
+
obj._class_parameter_info = class_parameter_info
|
|
1237
1242
|
|
|
1238
1243
|
# Used to check whether we should rebuild a modal.Image which uses `run_function`.
|
|
1239
1244
|
gpus: list[str] = gpu if isinstance(gpu, list) else [gpu] if gpu else []
|
|
@@ -28,7 +28,7 @@ from ._utils.deprecation import deprecation_warning
|
|
|
28
28
|
from ._utils.function_utils import normalize_fractional_target_concurrency, validate_target_concurrency
|
|
29
29
|
from ._utils.http_utils import ClientSessionRegistry
|
|
30
30
|
from .client import _Client
|
|
31
|
-
from .cls import
|
|
31
|
+
from .cls import _get_parameters
|
|
32
32
|
from .config import logger
|
|
33
33
|
from .exception import ExecutionError, InvalidError, ServiceError
|
|
34
34
|
from .types import ServerAutoscalerSettings, ServerContainerInfo, ServerInfo, ServerSessionCredentials, ServerStats
|
|
@@ -402,7 +402,7 @@ class _Server:
|
|
|
402
402
|
raise TypeError("The @app.server() decorator must be used on a class.")
|
|
403
403
|
|
|
404
404
|
# Check for modal.parameter() - not allowed on server classes
|
|
405
|
-
params =
|
|
405
|
+
params = _get_parameters(user_cls)
|
|
406
406
|
if params:
|
|
407
407
|
raise InvalidError(
|
|
408
408
|
f"Server class {user_cls.__name__} cannot use modal.parameter(). "
|
|
@@ -31,8 +31,6 @@ def show(redact: bool, include_internal: bool, json: bool):
|
|
|
31
31
|
config_dict["token_secret"] = "***"
|
|
32
32
|
if redact and config_dict.get("oauth_refresh_token"):
|
|
33
33
|
config_dict["oauth_refresh_token"] = "***"
|
|
34
|
-
if redact and config_dict.get("oauth_client_secret"):
|
|
35
|
-
config_dict["oauth_client_secret"] = "***"
|
|
36
34
|
if redact and config_dict.get("oauth_jwt_key"):
|
|
37
35
|
config_dict["oauth_jwt_key"] = "***"
|
|
38
36
|
|
|
@@ -39,7 +39,7 @@ async def list_(json: bool = False):
|
|
|
39
39
|
token_secret=config.get("token_secret", profile=profile, use_env=False),
|
|
40
40
|
oauth_refresh_token=config.get("oauth_refresh_token", profile=profile, use_env=False),
|
|
41
41
|
oauth_client_id=config.get("oauth_client_id", profile=profile, use_env=False),
|
|
42
|
-
|
|
42
|
+
oauth_jwt_key=config.get("oauth_jwt_key", profile=profile, use_env=False),
|
|
43
43
|
)
|
|
44
44
|
for profile in profiles
|
|
45
45
|
]
|
|
@@ -51,7 +51,6 @@ async def list_(json: bool = False):
|
|
|
51
51
|
"MODAL_TOKEN_SECRET",
|
|
52
52
|
"MODAL_OAUTH_REFRESH_TOKEN",
|
|
53
53
|
"MODAL_OAUTH_CLIENT_ID",
|
|
54
|
-
"MODAL_OAUTH_CLIENT_SECRET",
|
|
55
54
|
"MODAL_OAUTH_JWT_KEY",
|
|
56
55
|
)
|
|
57
56
|
if any(env_var in os.environ for env_var in credential_env_vars):
|
|
@@ -62,7 +61,7 @@ async def list_(json: bool = False):
|
|
|
62
61
|
token_secret=config.get("token_secret", profile=config_module._profile),
|
|
63
62
|
oauth_refresh_token=config.get("oauth_refresh_token", profile=config_module._profile),
|
|
64
63
|
oauth_client_id=config.get("oauth_client_id", profile=config_module._profile),
|
|
65
|
-
|
|
64
|
+
oauth_jwt_key=config.get("oauth_jwt_key", profile=config_module._profile),
|
|
66
65
|
)
|
|
67
66
|
env_based_workspace = env_based_resp.username
|
|
68
67
|
except AuthError:
|
|
@@ -61,7 +61,7 @@ def members_list(json: bool = False):
|
|
|
61
61
|
"-q",
|
|
62
62
|
"--query",
|
|
63
63
|
default="",
|
|
64
|
-
help="Filter events with the audit log search syntax. See https://modal.com/docs/guide/
|
|
64
|
+
help="Filter events with the audit log search syntax. See https://modal.com/docs/guide/audit-logs#filtering",
|
|
65
65
|
)
|
|
66
66
|
@click.option(
|
|
67
67
|
"--since",
|
|
@@ -35,8 +35,7 @@ HEARTBEAT_TIMEOUT: float = HEARTBEAT_INTERVAL + 0.1
|
|
|
35
35
|
class _OAuthCredentials:
|
|
36
36
|
refresh_token: str = field(repr=False)
|
|
37
37
|
client_id: str
|
|
38
|
-
|
|
39
|
-
jwt_key: str | None = field(default=None, repr=False)
|
|
38
|
+
jwt_key: str = field(repr=False)
|
|
40
39
|
|
|
41
40
|
|
|
42
41
|
def _get_metadata(
|
|
@@ -78,8 +77,6 @@ def _get_metadata(
|
|
|
78
77
|
"x-modal-oauth-client-id": oauth_credentials.client_id,
|
|
79
78
|
}
|
|
80
79
|
)
|
|
81
|
-
if oauth_credentials.client_secret:
|
|
82
|
-
metadata["x-modal-oauth-client-secret"] = oauth_credentials.client_secret
|
|
83
80
|
if agent_env := _agent_environment():
|
|
84
81
|
metadata["x-modal-agent-harness"] = urllib.parse.quote(agent_env)
|
|
85
82
|
|
|
@@ -223,7 +220,7 @@ class _Client:
|
|
|
223
220
|
self._cancellation_context_event_loop = asyncio.get_running_loop()
|
|
224
221
|
await self._cancellation_context.__aenter__()
|
|
225
222
|
metadata_provider = None
|
|
226
|
-
if self._oauth_credentials
|
|
223
|
+
if self._oauth_credentials:
|
|
227
224
|
from ._utils.oauth import OAuthAssertionProvider
|
|
228
225
|
|
|
229
226
|
metadata_provider = OAuthAssertionProvider(
|
|
@@ -345,7 +342,6 @@ class _Client:
|
|
|
345
342
|
token_secret = c["token_secret"]
|
|
346
343
|
oauth_refresh_token = c.get("oauth_refresh_token")
|
|
347
344
|
oauth_client_id = c.get("oauth_client_id")
|
|
348
|
-
oauth_client_secret = c.get("oauth_client_secret")
|
|
349
345
|
oauth_jwt_key = c.get("oauth_jwt_key")
|
|
350
346
|
if _is_remote():
|
|
351
347
|
ignored_credential_settings = [
|
|
@@ -355,7 +351,6 @@ class _Client:
|
|
|
355
351
|
("MODAL_TOKEN_SECRET", token_secret),
|
|
356
352
|
("MODAL_OAUTH_REFRESH_TOKEN", oauth_refresh_token),
|
|
357
353
|
("MODAL_OAUTH_CLIENT_ID", oauth_client_id),
|
|
358
|
-
("MODAL_OAUTH_CLIENT_SECRET", oauth_client_secret),
|
|
359
354
|
("MODAL_OAUTH_JWT_KEY", oauth_jwt_key),
|
|
360
355
|
)
|
|
361
356
|
if value
|
|
@@ -370,25 +365,17 @@ class _Client:
|
|
|
370
365
|
oauth_credentials = None
|
|
371
366
|
else:
|
|
372
367
|
has_token_config = bool(token_id or token_secret)
|
|
373
|
-
has_oauth_config = bool(oauth_refresh_token or oauth_client_id or
|
|
368
|
+
has_oauth_config = bool(oauth_refresh_token or oauth_client_id or oauth_jwt_key)
|
|
374
369
|
if has_token_config and has_oauth_config:
|
|
375
370
|
raise InvalidError("Modal token credentials and OAuth credentials cannot both be configured.")
|
|
376
371
|
if has_oauth_config:
|
|
377
|
-
if
|
|
378
|
-
|
|
379
|
-
or not oauth_client_id
|
|
380
|
-
or bool(oauth_client_secret) == bool(oauth_jwt_key)
|
|
381
|
-
):
|
|
382
|
-
raise InvalidError(
|
|
383
|
-
"OAuth refresh token, client ID, and exactly one of client secret or JWT key "
|
|
384
|
-
"must be configured."
|
|
385
|
-
)
|
|
372
|
+
if not oauth_refresh_token or not oauth_client_id or not oauth_jwt_key:
|
|
373
|
+
raise InvalidError("OAuth refresh token, client ID, and JWT key must be configured.")
|
|
386
374
|
client_type = api_pb2.CLIENT_TYPE_CLIENT
|
|
387
375
|
credentials = None
|
|
388
376
|
oauth_credentials = _OAuthCredentials(
|
|
389
377
|
refresh_token=oauth_refresh_token,
|
|
390
378
|
client_id=oauth_client_id,
|
|
391
|
-
client_secret=oauth_client_secret,
|
|
392
379
|
jwt_key=oauth_jwt_key,
|
|
393
380
|
)
|
|
394
381
|
elif token_id and token_secret:
|
|
@@ -458,8 +445,7 @@ class _Client:
|
|
|
458
445
|
refresh_token: str,
|
|
459
446
|
*,
|
|
460
447
|
oauth_client_id: str,
|
|
461
|
-
|
|
462
|
-
oauth_jwt_key: str | None = None,
|
|
448
|
+
oauth_jwt_key: str,
|
|
463
449
|
) -> "_Client":
|
|
464
450
|
"""
|
|
465
451
|
Constructor based on OAuth credentials; useful for managing Modal on behalf of third-party users.
|
|
@@ -467,7 +453,6 @@ class _Client:
|
|
|
467
453
|
Args:
|
|
468
454
|
refresh_token: OAuth refresh token returned by Modal's token endpoint.
|
|
469
455
|
oauth_client_id: Modal-issued OAuth client ID, with an `oc-` prefix.
|
|
470
|
-
oauth_client_secret: Modal-issued OAuth client secret, with an `ov-` prefix.
|
|
471
456
|
oauth_jwt_key: Unencrypted RSA private key encoded as PEM, with literal or escaped newlines.
|
|
472
457
|
Requires `modal[oauth]`.
|
|
473
458
|
|
|
@@ -479,24 +464,21 @@ class _Client:
|
|
|
479
464
|
client = modal.Client.from_oauth_credentials(
|
|
480
465
|
refresh_token,
|
|
481
466
|
oauth_client_id=oauth_client_id,
|
|
482
|
-
|
|
467
|
+
oauth_jwt_key=oauth_jwt_key,
|
|
483
468
|
)
|
|
484
469
|
|
|
485
470
|
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
486
471
|
```
|
|
487
472
|
"""
|
|
488
473
|
_check_config()
|
|
489
|
-
if not refresh_token or not oauth_client_id or
|
|
490
|
-
raise AuthError(
|
|
491
|
-
"OAuth refresh token, client ID, and exactly one of client secret or JWT key must be provided."
|
|
492
|
-
)
|
|
474
|
+
if not refresh_token or not oauth_client_id or not oauth_jwt_key:
|
|
475
|
+
raise AuthError("OAuth refresh token, client ID, and JWT key must be provided.")
|
|
493
476
|
|
|
494
477
|
server_url = config["server_url"]
|
|
495
478
|
client_type = api_pb2.CLIENT_TYPE_CLIENT
|
|
496
479
|
oauth_credentials = _OAuthCredentials(
|
|
497
480
|
refresh_token=refresh_token,
|
|
498
481
|
client_id=oauth_client_id,
|
|
499
|
-
client_secret=oauth_client_secret,
|
|
500
482
|
jwt_key=oauth_jwt_key,
|
|
501
483
|
)
|
|
502
484
|
client = _Client(
|
|
@@ -11,20 +11,13 @@ import typing
|
|
|
11
11
|
import typing_extensions
|
|
12
12
|
|
|
13
13
|
class _OAuthCredentials:
|
|
14
|
-
"""_OAuthCredentials(refresh_token: str, client_id: str,
|
|
14
|
+
"""_OAuthCredentials(refresh_token: str, client_id: str, jwt_key: str)"""
|
|
15
15
|
|
|
16
16
|
refresh_token: str
|
|
17
17
|
client_id: str
|
|
18
|
-
|
|
19
|
-
jwt_key: typing.Optional[str]
|
|
18
|
+
jwt_key: str
|
|
20
19
|
|
|
21
|
-
def __init__(
|
|
22
|
-
self,
|
|
23
|
-
refresh_token: str,
|
|
24
|
-
client_id: str,
|
|
25
|
-
client_secret: typing.Optional[str] = None,
|
|
26
|
-
jwt_key: typing.Optional[str] = None,
|
|
27
|
-
) -> None:
|
|
20
|
+
def __init__(self, refresh_token: str, client_id: str, jwt_key: str) -> None:
|
|
28
21
|
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
29
22
|
...
|
|
30
23
|
|
|
@@ -85,7 +78,7 @@ class _Client:
|
|
|
85
78
|
server_url: str,
|
|
86
79
|
client_type: int,
|
|
87
80
|
credentials: typing.Optional[tuple[str, str]],
|
|
88
|
-
version: str = "1.6.5.
|
|
81
|
+
version: str = "1.6.5.dev7",
|
|
89
82
|
*,
|
|
90
83
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
91
84
|
):
|
|
@@ -203,20 +196,12 @@ class _Client:
|
|
|
203
196
|
...
|
|
204
197
|
|
|
205
198
|
@classmethod
|
|
206
|
-
async def from_oauth_credentials(
|
|
207
|
-
cls,
|
|
208
|
-
refresh_token: str,
|
|
209
|
-
*,
|
|
210
|
-
oauth_client_id: str,
|
|
211
|
-
oauth_client_secret: typing.Optional[str] = None,
|
|
212
|
-
oauth_jwt_key: typing.Optional[str] = None,
|
|
213
|
-
) -> _Client:
|
|
199
|
+
async def from_oauth_credentials(cls, refresh_token: str, *, oauth_client_id: str, oauth_jwt_key: str) -> _Client:
|
|
214
200
|
"""Constructor based on OAuth credentials; useful for managing Modal on behalf of third-party users.
|
|
215
201
|
|
|
216
202
|
Args:
|
|
217
203
|
refresh_token: OAuth refresh token returned by Modal's token endpoint.
|
|
218
204
|
oauth_client_id: Modal-issued OAuth client ID, with an `oc-` prefix.
|
|
219
|
-
oauth_client_secret: Modal-issued OAuth client secret, with an `ov-` prefix.
|
|
220
205
|
oauth_jwt_key: Unencrypted RSA private key encoded as PEM, with literal or escaped newlines.
|
|
221
206
|
Requires `modal[oauth]`.
|
|
222
207
|
|
|
@@ -228,7 +213,7 @@ class _Client:
|
|
|
228
213
|
client = modal.Client.from_oauth_credentials(
|
|
229
214
|
refresh_token,
|
|
230
215
|
oauth_client_id=oauth_client_id,
|
|
231
|
-
|
|
216
|
+
oauth_jwt_key=oauth_jwt_key,
|
|
232
217
|
)
|
|
233
218
|
|
|
234
219
|
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
@@ -310,7 +295,7 @@ class Client:
|
|
|
310
295
|
server_url: str,
|
|
311
296
|
client_type: int,
|
|
312
297
|
credentials: typing.Optional[tuple[str, str]],
|
|
313
|
-
version: str = "1.6.5.
|
|
298
|
+
version: str = "1.6.5.dev7",
|
|
314
299
|
*,
|
|
315
300
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
316
301
|
):
|
|
@@ -535,21 +520,12 @@ class Client:
|
|
|
535
520
|
from_credentials: typing.ClassVar[__from_credentials_spec]
|
|
536
521
|
|
|
537
522
|
class __from_oauth_credentials_spec(typing_extensions.Protocol):
|
|
538
|
-
def __call__(
|
|
539
|
-
self,
|
|
540
|
-
/,
|
|
541
|
-
refresh_token: str,
|
|
542
|
-
*,
|
|
543
|
-
oauth_client_id: str,
|
|
544
|
-
oauth_client_secret: typing.Optional[str] = None,
|
|
545
|
-
oauth_jwt_key: typing.Optional[str] = None,
|
|
546
|
-
) -> Client:
|
|
523
|
+
def __call__(self, /, refresh_token: str, *, oauth_client_id: str, oauth_jwt_key: str) -> Client:
|
|
547
524
|
"""Constructor based on OAuth credentials; useful for managing Modal on behalf of third-party users.
|
|
548
525
|
|
|
549
526
|
Args:
|
|
550
527
|
refresh_token: OAuth refresh token returned by Modal's token endpoint.
|
|
551
528
|
oauth_client_id: Modal-issued OAuth client ID, with an `oc-` prefix.
|
|
552
|
-
oauth_client_secret: Modal-issued OAuth client secret, with an `ov-` prefix.
|
|
553
529
|
oauth_jwt_key: Unencrypted RSA private key encoded as PEM, with literal or escaped newlines.
|
|
554
530
|
Requires `modal[oauth]`.
|
|
555
531
|
|
|
@@ -561,7 +537,7 @@ class Client:
|
|
|
561
537
|
client = modal.Client.from_oauth_credentials(
|
|
562
538
|
refresh_token,
|
|
563
539
|
oauth_client_id=oauth_client_id,
|
|
564
|
-
|
|
540
|
+
oauth_jwt_key=oauth_jwt_key,
|
|
565
541
|
)
|
|
566
542
|
|
|
567
543
|
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
@@ -569,21 +545,12 @@ class Client:
|
|
|
569
545
|
"""
|
|
570
546
|
...
|
|
571
547
|
|
|
572
|
-
async def aio(
|
|
573
|
-
self,
|
|
574
|
-
/,
|
|
575
|
-
refresh_token: str,
|
|
576
|
-
*,
|
|
577
|
-
oauth_client_id: str,
|
|
578
|
-
oauth_client_secret: typing.Optional[str] = None,
|
|
579
|
-
oauth_jwt_key: typing.Optional[str] = None,
|
|
580
|
-
) -> Client:
|
|
548
|
+
async def aio(self, /, refresh_token: str, *, oauth_client_id: str, oauth_jwt_key: str) -> Client:
|
|
581
549
|
"""Constructor based on OAuth credentials; useful for managing Modal on behalf of third-party users.
|
|
582
550
|
|
|
583
551
|
Args:
|
|
584
552
|
refresh_token: OAuth refresh token returned by Modal's token endpoint.
|
|
585
553
|
oauth_client_id: Modal-issued OAuth client ID, with an `oc-` prefix.
|
|
586
|
-
oauth_client_secret: Modal-issued OAuth client secret, with an `ov-` prefix.
|
|
587
554
|
oauth_jwt_key: Unencrypted RSA private key encoded as PEM, with literal or escaped newlines.
|
|
588
555
|
Requires `modal[oauth]`.
|
|
589
556
|
|
|
@@ -595,7 +562,7 @@ class Client:
|
|
|
595
562
|
client = modal.Client.from_oauth_credentials(
|
|
596
563
|
refresh_token,
|
|
597
564
|
oauth_client_id=oauth_client_id,
|
|
598
|
-
|
|
565
|
+
oauth_jwt_key=oauth_jwt_key,
|
|
599
566
|
)
|
|
600
567
|
|
|
601
568
|
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Copyright Modal Labs 2022
|
|
2
2
|
import copy
|
|
3
3
|
import inspect
|
|
4
|
+
import sys
|
|
4
5
|
import typing
|
|
5
6
|
from collections.abc import Callable, Collection, Sequence
|
|
6
7
|
from pathlib import PurePosixPath
|
|
@@ -43,8 +44,34 @@ if typing.TYPE_CHECKING:
|
|
|
43
44
|
import modal.app
|
|
44
45
|
|
|
45
46
|
|
|
47
|
+
def _get_annotations(user_cls: type) -> dict[str, Any]:
|
|
48
|
+
"""Annotations of `user_cls` and its bases, without failing on unresolvable forward references."""
|
|
49
|
+
annotations: dict[str, Any] = {}
|
|
50
|
+
for klass in reversed(user_cls.__mro__):
|
|
51
|
+
if sys.version_info >= (3, 14):
|
|
52
|
+
import annotationlib
|
|
53
|
+
|
|
54
|
+
# Evaluates resolvable annotations and returns ForwardRefs for the rest
|
|
55
|
+
annotations.update(inspect.get_annotations(klass, format=annotationlib.Format.FORWARDREF))
|
|
56
|
+
else:
|
|
57
|
+
# Leaves string annotations unevaluated
|
|
58
|
+
annotations.update(inspect.get_annotations(klass))
|
|
59
|
+
return annotations
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _get_parameters(user_cls: type) -> dict[str, "_Parameter"]:
|
|
63
|
+
"""Effective modal.parameter() declarations of `user_cls` and its bases."""
|
|
64
|
+
# Merge all attributes before filtering so a subclass attribute that is not a
|
|
65
|
+
# parameter shadows a parameter of the same name on a base class
|
|
66
|
+
attributes: dict[str, Any] = {}
|
|
67
|
+
for klass in reversed(user_cls.__mro__):
|
|
68
|
+
attributes.update(vars(klass))
|
|
69
|
+
|
|
70
|
+
return {name: value for name, value in attributes.items() if is_parameter(value)}
|
|
71
|
+
|
|
72
|
+
|
|
46
73
|
def _use_annotation_parameters(user_cls: type) -> bool:
|
|
47
|
-
has_parameters =
|
|
74
|
+
has_parameters = bool(_get_parameters(user_cls))
|
|
48
75
|
has_explicit_constructor = user_cls.__init__ != object.__init__
|
|
49
76
|
return has_parameters and not has_explicit_constructor
|
|
50
77
|
|
|
@@ -54,7 +81,7 @@ def _get_class_constructor_signature(user_cls: type) -> inspect.Signature:
|
|
|
54
81
|
return inspect.signature(user_cls)
|
|
55
82
|
else:
|
|
56
83
|
constructor_parameters = []
|
|
57
|
-
for name, annotation_value in
|
|
84
|
+
for name, annotation_value in _get_annotations(user_cls).items():
|
|
58
85
|
if hasattr(user_cls, name):
|
|
59
86
|
parameter_spec = getattr(user_cls, name)
|
|
60
87
|
if is_parameter(parameter_spec):
|
|
@@ -580,7 +607,7 @@ class _Cls(_Object, type_prefixes=("cs",)):
|
|
|
580
607
|
@staticmethod
|
|
581
608
|
def _validate_construction_mechanism(user_cls):
|
|
582
609
|
"""mdmd:hidden"""
|
|
583
|
-
params =
|
|
610
|
+
params = _get_parameters(user_cls)
|
|
584
611
|
# This also rejects constructors inherited from a base class
|
|
585
612
|
if user_cls.__init__ != object.__init__:
|
|
586
613
|
raise InvalidError(
|
|
@@ -596,7 +623,7 @@ class {user_cls.__name__}:
|
|
|
596
623
|
More information on class parameterization can be found here: https://modal.com/docs/guide/parametrized-functions
|
|
597
624
|
"""
|
|
598
625
|
)
|
|
599
|
-
annotations =
|
|
626
|
+
annotations = _get_annotations(user_cls)
|
|
600
627
|
missing_annotations = params.keys() - annotations.keys()
|
|
601
628
|
if missing_annotations:
|
|
602
629
|
raise InvalidError("All modal.parameter() specifications need to be type-annotated")
|
|
@@ -22,6 +22,14 @@ import typing_extensions
|
|
|
22
22
|
|
|
23
23
|
T = typing.TypeVar("T")
|
|
24
24
|
|
|
25
|
+
def _get_annotations(user_cls: type) -> dict[str, typing.Any]:
|
|
26
|
+
"""Annotations of `user_cls` and its bases, without failing on unresolvable forward references."""
|
|
27
|
+
...
|
|
28
|
+
|
|
29
|
+
def _get_parameters(user_cls: type) -> dict[str, _Parameter]:
|
|
30
|
+
"""Effective modal.parameter() declarations of `user_cls` and its bases."""
|
|
31
|
+
...
|
|
32
|
+
|
|
25
33
|
def _use_annotation_parameters(user_cls: type) -> bool: ...
|
|
26
34
|
def _get_class_constructor_signature(user_cls: type) -> inspect.Signature: ...
|
|
27
35
|
def _bind_instance_method(cls: _Cls, service_function: modal._functions._Function, method_name: str):
|
|
@@ -9,8 +9,8 @@ Client processes can authenticate in two ways:
|
|
|
9
9
|
1. Modal API tokens use `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET`. The
|
|
10
10
|
`modal token set` command stores these values in `.modal.toml`.
|
|
11
11
|
2. Third-party OAuth integrations typically inject `MODAL_OAUTH_REFRESH_TOKEN`,
|
|
12
|
-
`MODAL_OAUTH_CLIENT_ID`, and
|
|
13
|
-
|
|
12
|
+
`MODAL_OAUTH_CLIENT_ID`, and `MODAL_OAUTH_JWT_KEY` (an unencrypted RSA private
|
|
13
|
+
key in PEM) into the process.
|
|
14
14
|
|
|
15
15
|
The two authentication methods cannot be combined, and all values for the
|
|
16
16
|
selected method must be provided.
|
|
@@ -217,12 +217,12 @@ async def _lookup_workspace(
|
|
|
217
217
|
*,
|
|
218
218
|
oauth_refresh_token: str | None = None,
|
|
219
219
|
oauth_client_id: str | None = None,
|
|
220
|
-
|
|
220
|
+
oauth_jwt_key: str | None = None,
|
|
221
221
|
) -> api_pb2.WorkspaceNameLookupResponse:
|
|
222
222
|
from .client import _Client, _OAuthCredentials
|
|
223
223
|
|
|
224
224
|
has_token_config = bool(token_id or token_secret)
|
|
225
|
-
has_oauth_config = bool(oauth_refresh_token or oauth_client_id or
|
|
225
|
+
has_oauth_config = bool(oauth_refresh_token or oauth_client_id or oauth_jwt_key)
|
|
226
226
|
if has_token_config and has_oauth_config:
|
|
227
227
|
raise InvalidError("Modal token credentials and OAuth credentials cannot both be configured.")
|
|
228
228
|
if has_oauth_config:
|
|
@@ -231,18 +231,18 @@ async def _lookup_workspace(
|
|
|
231
231
|
for name, value in (
|
|
232
232
|
("refresh token", oauth_refresh_token),
|
|
233
233
|
("client ID", oauth_client_id),
|
|
234
|
-
("
|
|
234
|
+
("JWT key", oauth_jwt_key),
|
|
235
235
|
)
|
|
236
236
|
if not value
|
|
237
237
|
]
|
|
238
238
|
if missing_oauth_credentials:
|
|
239
239
|
raise InvalidError(f"OAuth credentials are incomplete; missing {', '.join(missing_oauth_credentials)}.")
|
|
240
|
-
assert oauth_refresh_token and oauth_client_id and
|
|
240
|
+
assert oauth_refresh_token and oauth_client_id and oauth_jwt_key
|
|
241
241
|
credentials = None
|
|
242
242
|
oauth_credentials = _OAuthCredentials(
|
|
243
243
|
refresh_token=oauth_refresh_token,
|
|
244
244
|
client_id=oauth_client_id,
|
|
245
|
-
|
|
245
|
+
jwt_key=oauth_jwt_key,
|
|
246
246
|
)
|
|
247
247
|
else:
|
|
248
248
|
if not token_id or not token_secret:
|
|
@@ -382,7 +382,6 @@ _SETTINGS = {
|
|
|
382
382
|
"token_secret": _Setting(),
|
|
383
383
|
"oauth_refresh_token": _Setting(),
|
|
384
384
|
"oauth_client_id": _Setting(),
|
|
385
|
-
"oauth_client_secret": _Setting(),
|
|
386
385
|
"oauth_jwt_key": _Setting(),
|
|
387
386
|
# --- Logging ----------------------------------------------------------------
|
|
388
387
|
"loglevel": _Setting("WARNING", lambda s: s.upper()),
|
|
@@ -902,6 +902,7 @@ async def _create_single_client_dependency_mount(
|
|
|
902
902
|
"--strict",
|
|
903
903
|
"--no-deps",
|
|
904
904
|
"--no-cache",
|
|
905
|
+
"--no-build",
|
|
905
906
|
"-r",
|
|
906
907
|
requirements,
|
|
907
908
|
"--compile-bytecode",
|
|
@@ -978,13 +979,17 @@ async def _create_client_dependency_mounts(
|
|
|
978
979
|
builder_versions: list[str] | None = None, # Pass "PREVIEW" during testing
|
|
979
980
|
check_if_exists=True,
|
|
980
981
|
dry_run=False,
|
|
982
|
+
archs: Sequence[str] = ("x86_64", "aarch64"),
|
|
981
983
|
):
|
|
982
984
|
from ._image import LATEST_IMAGE_BUILDER_VERSION, SUPPORTED_PYTHON_SERIES
|
|
983
985
|
|
|
984
|
-
arch = "x86_64"
|
|
985
986
|
platform_tags = [
|
|
986
|
-
(
|
|
987
|
-
|
|
987
|
+
(arch, platform, uv_python_platform)
|
|
988
|
+
for arch in archs
|
|
989
|
+
for platform, uv_python_platform in [
|
|
990
|
+
("manylinux_2_17", f"{arch}-manylinux_2_17"), # glibc >= 2.17
|
|
991
|
+
("musllinux_1_2", f"{arch}-unknown-linux-musl"), # musl >= 1.2
|
|
992
|
+
]
|
|
988
993
|
]
|
|
989
994
|
coros = []
|
|
990
995
|
for builder_version in builder_versions or [LATEST_IMAGE_BUILDER_VERSION]:
|
|
@@ -993,7 +998,7 @@ async def _create_client_dependency_mounts(
|
|
|
993
998
|
else:
|
|
994
999
|
builder_python_versions = python_versions
|
|
995
1000
|
for python_version in builder_python_versions:
|
|
996
|
-
for platform, uv_python_platform in platform_tags:
|
|
1001
|
+
for arch, platform, uv_python_platform in platform_tags:
|
|
997
1002
|
coros.append(
|
|
998
1003
|
_create_single_client_dependency_mount(
|
|
999
1004
|
client,
|
|
@@ -448,6 +448,7 @@ async def _create_client_dependency_mounts(
|
|
|
448
448
|
builder_versions: typing.Optional[list[str]] = None,
|
|
449
449
|
check_if_exists=True,
|
|
450
450
|
dry_run=False,
|
|
451
|
+
archs: collections.abc.Sequence[str] = ("x86_64", "aarch64"),
|
|
451
452
|
): ...
|
|
452
453
|
|
|
453
454
|
class __create_client_dependency_mounts_spec(typing_extensions.Protocol):
|
|
@@ -459,6 +460,7 @@ class __create_client_dependency_mounts_spec(typing_extensions.Protocol):
|
|
|
459
460
|
builder_versions: typing.Optional[list[str]] = None,
|
|
460
461
|
check_if_exists=True,
|
|
461
462
|
dry_run=False,
|
|
463
|
+
archs: collections.abc.Sequence[str] = ("x86_64", "aarch64"),
|
|
462
464
|
): ...
|
|
463
465
|
async def aio(
|
|
464
466
|
self,
|
|
@@ -468,6 +470,7 @@ class __create_client_dependency_mounts_spec(typing_extensions.Protocol):
|
|
|
468
470
|
builder_versions: typing.Optional[list[str]] = None,
|
|
469
471
|
check_if_exists=True,
|
|
470
472
|
dry_run=False,
|
|
473
|
+
archs: collections.abc.Sequence[str] = ("x86_64", "aarch64"),
|
|
471
474
|
): ...
|
|
472
475
|
|
|
473
476
|
create_client_dependency_mounts: __create_client_dependency_mounts_spec
|
|
@@ -204,7 +204,6 @@ async def _set_token(
|
|
|
204
204
|
"MODAL_TOKEN_SECRET",
|
|
205
205
|
"MODAL_OAUTH_REFRESH_TOKEN",
|
|
206
206
|
"MODAL_OAUTH_CLIENT_ID",
|
|
207
|
-
"MODAL_OAUTH_CLIENT_SECRET",
|
|
208
207
|
"MODAL_OAUTH_JWT_KEY",
|
|
209
208
|
]
|
|
210
209
|
env_vars = [var if os.environ.get(var) else None for var in credential_env_vars]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|