modAL 1.2.4__tar.gz → 1.2.4.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modal-1.2.4 → modal-1.2.4.dev0}/PKG-INFO +1 -1
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_tunnel.py +2 -11
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_tunnel.pyi +3 -25
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/client.pyi +10 -2
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/experimental/flash.py +2 -4
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/experimental/flash.pyi +0 -4
- {modal-1.2.4 → modal-1.2.4.dev0}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_version/__init__.py +1 -1
- {modal-1.2.4 → modal-1.2.4.dev0}/LICENSE +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/README.md +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/__main__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_billing.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_clustered_functions.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_clustered_functions.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_container_entrypoint.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_functions.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_grpc_client.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_ipython.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_load_context.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_location.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_object.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_output.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_partial_function.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_pty.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_resolver.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_resources.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/asgi.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/execution_context.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/telemetry.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_serialization.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_traceback.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_type_manager.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/app_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/async_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/blob_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/deprecation.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/docker_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/function_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/git_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/hash_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/http_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/logger.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/mount_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/name_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/package_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/shell_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/task_command_router_client.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_utils/time_utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_vendor/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_vendor/tblib.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/_watcher.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/app.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/app.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/billing.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/builder/2023.12.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/builder/2024.04.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/builder/2024.10.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/builder/2025.06.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/builder/README.md +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/builder/base-images.json +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/call_graph.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/_download.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/_traceback.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/app.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/cluster.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/config.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/container.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/dict.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/entry_point.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/environment.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/import_refs.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/launch.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/network_file_system.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/profile.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/programs/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/programs/launch_instance_ssh.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/programs/run_jupyter.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/programs/run_marimo.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/programs/vscode.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/queues.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/run.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/secret.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/token.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/utils.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cli/volume.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/client.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cls.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/cls.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/config.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/container_process.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/container_process.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/dict.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/dict.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/environments.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/environments.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/exception.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/experimental/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/experimental/ipython.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/file_io.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/file_io.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/file_pattern_matcher.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/functions.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/functions.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/gpu.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/image.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/image.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/io_streams.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/io_streams.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/mount.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/mount.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/network_file_system.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/network_file_system.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/object.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/object.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/output.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/parallel_map.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/parallel_map.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/partial_function.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/partial_function.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/proxy.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/proxy.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/py.typed +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/queue.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/queue.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/retries.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/runner.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/runner.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/running_app.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/sandbox.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/sandbox.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/schedule.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/scheduler_placement.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/secret.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/secret.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/serving.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/serving.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/snapshot.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/snapshot.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/stream_type.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/token_flow.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/token_flow.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/volume.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal/volume.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal.egg-info/SOURCES.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal.egg-info/requires.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal.egg-info/top_level.txt +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_docs/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/__init__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/api.proto +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/api_grpc.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/api_pb2.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/api_pb2.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/api_pb2_grpc.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/api_pb2_grpc.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/modal_api_grpc.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/py.typed +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/sandbox_router.proto +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/sandbox_router_grpc.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/sandbox_router_pb2.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/sandbox_router_pb2.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/sandbox_router_pb2_grpc.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/sandbox_router_pb2_grpc.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/task_command_router.proto +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/modal_version/__main__.py +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/pyproject.toml +0 -0
- {modal-1.2.4 → modal-1.2.4.dev0}/setup.cfg +0 -0
|
@@ -51,17 +51,13 @@ class Tunnel:
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
@asynccontextmanager
|
|
54
|
-
async def _forward(
|
|
55
|
-
port: int, *, unencrypted: bool = False, h2_enabled: bool = False, client: Optional[_Client] = None
|
|
56
|
-
) -> AsyncIterator[Tunnel]:
|
|
54
|
+
async def _forward(port: int, *, unencrypted: bool = False, client: Optional[_Client] = None) -> AsyncIterator[Tunnel]:
|
|
57
55
|
"""Expose a port publicly from inside a running Modal container, with TLS.
|
|
58
56
|
|
|
59
57
|
If `unencrypted` is set, this also exposes the TCP socket without encryption on a random port
|
|
60
58
|
number. This can be used to SSH into a container (see example below). Note that it is on the public Internet, so
|
|
61
59
|
make sure you are using a secure protocol over TCP.
|
|
62
60
|
|
|
63
|
-
If `h2_enabled` is set, the TLS server will advertise support for HTTP/2.
|
|
64
|
-
|
|
65
61
|
**Important:** This is an experimental API which may change in the future.
|
|
66
62
|
|
|
67
63
|
**Usage:**
|
|
@@ -172,8 +168,6 @@ async def _forward(
|
|
|
172
168
|
raise InvalidError(f"The port argument should be an int, not {port!r}")
|
|
173
169
|
if port < 1 or port > 65535:
|
|
174
170
|
raise InvalidError(f"Invalid port number {port}")
|
|
175
|
-
if h2_enabled and unencrypted:
|
|
176
|
-
raise InvalidError("H2 can only be used with encrypted ports")
|
|
177
171
|
|
|
178
172
|
if not client:
|
|
179
173
|
client = await _Client.from_env()
|
|
@@ -181,11 +175,8 @@ async def _forward(
|
|
|
181
175
|
if client.client_type != api_pb2.CLIENT_TYPE_CONTAINER:
|
|
182
176
|
raise InvalidError("Forwarding ports only works inside a Modal container")
|
|
183
177
|
|
|
184
|
-
tunnel_type = api_pb2.TUNNEL_TYPE_H2 if h2_enabled else api_pb2.TUNNEL_TYPE_UNSPECIFIED
|
|
185
178
|
try:
|
|
186
|
-
response = await client.stub.TunnelStart(
|
|
187
|
-
api_pb2.TunnelStartRequest(port=port, unencrypted=unencrypted, tunnel_type=tunnel_type)
|
|
188
|
-
)
|
|
179
|
+
response = await client.stub.TunnelStart(api_pb2.TunnelStartRequest(port=port, unencrypted=unencrypted))
|
|
189
180
|
except GRPCError as exc:
|
|
190
181
|
if exc.status == Status.ALREADY_EXISTS:
|
|
191
182
|
raise InvalidError(f"Port {port} is already forwarded")
|
|
@@ -54,11 +54,7 @@ class Tunnel:
|
|
|
54
54
|
...
|
|
55
55
|
|
|
56
56
|
def _forward(
|
|
57
|
-
port: int,
|
|
58
|
-
*,
|
|
59
|
-
unencrypted: bool = False,
|
|
60
|
-
h2_enabled: bool = False,
|
|
61
|
-
client: typing.Optional[modal.client._Client] = None,
|
|
57
|
+
port: int, *, unencrypted: bool = False, client: typing.Optional[modal.client._Client] = None
|
|
62
58
|
) -> typing.AsyncContextManager[Tunnel]:
|
|
63
59
|
'''Expose a port publicly from inside a running Modal container, with TLS.
|
|
64
60
|
|
|
@@ -66,8 +62,6 @@ def _forward(
|
|
|
66
62
|
number. This can be used to SSH into a container (see example below). Note that it is on the public Internet, so
|
|
67
63
|
make sure you are using a secure protocol over TCP.
|
|
68
64
|
|
|
69
|
-
If `h2_enabled` is set, the TLS server will advertise support for HTTP/2.
|
|
70
|
-
|
|
71
65
|
**Important:** This is an experimental API which may change in the future.
|
|
72
66
|
|
|
73
67
|
**Usage:**
|
|
@@ -177,13 +171,7 @@ def _forward(
|
|
|
177
171
|
|
|
178
172
|
class __forward_spec(typing_extensions.Protocol):
|
|
179
173
|
def __call__(
|
|
180
|
-
self,
|
|
181
|
-
/,
|
|
182
|
-
port: int,
|
|
183
|
-
*,
|
|
184
|
-
unencrypted: bool = False,
|
|
185
|
-
h2_enabled: bool = False,
|
|
186
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
174
|
+
self, /, port: int, *, unencrypted: bool = False, client: typing.Optional[modal.client.Client] = None
|
|
187
175
|
) -> synchronicity.combined_types.AsyncAndBlockingContextManager[Tunnel]:
|
|
188
176
|
'''Expose a port publicly from inside a running Modal container, with TLS.
|
|
189
177
|
|
|
@@ -191,8 +179,6 @@ class __forward_spec(typing_extensions.Protocol):
|
|
|
191
179
|
number. This can be used to SSH into a container (see example below). Note that it is on the public Internet, so
|
|
192
180
|
make sure you are using a secure protocol over TCP.
|
|
193
181
|
|
|
194
|
-
If `h2_enabled` is set, the TLS server will advertise support for HTTP/2.
|
|
195
|
-
|
|
196
182
|
**Important:** This is an experimental API which may change in the future.
|
|
197
183
|
|
|
198
184
|
**Usage:**
|
|
@@ -301,13 +287,7 @@ class __forward_spec(typing_extensions.Protocol):
|
|
|
301
287
|
...
|
|
302
288
|
|
|
303
289
|
def aio(
|
|
304
|
-
self,
|
|
305
|
-
/,
|
|
306
|
-
port: int,
|
|
307
|
-
*,
|
|
308
|
-
unencrypted: bool = False,
|
|
309
|
-
h2_enabled: bool = False,
|
|
310
|
-
client: typing.Optional[modal.client.Client] = None,
|
|
290
|
+
self, /, port: int, *, unencrypted: bool = False, client: typing.Optional[modal.client.Client] = None
|
|
311
291
|
) -> typing.AsyncContextManager[Tunnel]:
|
|
312
292
|
'''Expose a port publicly from inside a running Modal container, with TLS.
|
|
313
293
|
|
|
@@ -315,8 +295,6 @@ class __forward_spec(typing_extensions.Protocol):
|
|
|
315
295
|
number. This can be used to SSH into a container (see example below). Note that it is on the public Internet, so
|
|
316
296
|
make sure you are using a secure protocol over TCP.
|
|
317
297
|
|
|
318
|
-
If `h2_enabled` is set, the TLS server will advertise support for HTTP/2.
|
|
319
|
-
|
|
320
298
|
**Important:** This is an experimental API which may change in the future.
|
|
321
299
|
|
|
322
300
|
**Usage:**
|
|
@@ -28,7 +28,11 @@ class _Client:
|
|
|
28
28
|
_snapshotted: bool
|
|
29
29
|
|
|
30
30
|
def __init__(
|
|
31
|
-
self,
|
|
31
|
+
self,
|
|
32
|
+
server_url: str,
|
|
33
|
+
client_type: int,
|
|
34
|
+
credentials: typing.Optional[tuple[str, str]],
|
|
35
|
+
version: str = "1.2.4.dev0",
|
|
32
36
|
):
|
|
33
37
|
"""mdmd:hidden
|
|
34
38
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -155,7 +159,11 @@ class Client:
|
|
|
155
159
|
_snapshotted: bool
|
|
156
160
|
|
|
157
161
|
def __init__(
|
|
158
|
-
self,
|
|
162
|
+
self,
|
|
163
|
+
server_url: str,
|
|
164
|
+
client_type: int,
|
|
165
|
+
credentials: typing.Optional[tuple[str, str]],
|
|
166
|
+
version: str = "1.2.4.dev0",
|
|
159
167
|
):
|
|
160
168
|
"""mdmd:hidden
|
|
161
169
|
The Modal client object is not intended to be instantiated directly by users.
|
|
@@ -30,14 +30,13 @@ class _FlashManager:
|
|
|
30
30
|
port: int,
|
|
31
31
|
process: Optional[subprocess.Popen] = None,
|
|
32
32
|
health_check_url: Optional[str] = None,
|
|
33
|
-
h2_enabled: bool = False,
|
|
34
33
|
):
|
|
35
34
|
self.client = client
|
|
36
35
|
self.port = port
|
|
37
36
|
# Health check is not currently being used
|
|
38
37
|
self.health_check_url = health_check_url
|
|
39
38
|
self.process = process
|
|
40
|
-
self.tunnel_manager = _forward_tunnel(port,
|
|
39
|
+
self.tunnel_manager = _forward_tunnel(port, client=client)
|
|
41
40
|
self.stopped = False
|
|
42
41
|
self.num_failures = 0
|
|
43
42
|
self.task_id = os.environ["MODAL_TASK_ID"]
|
|
@@ -171,7 +170,6 @@ async def flash_forward(
|
|
|
171
170
|
port: int,
|
|
172
171
|
process: Optional[subprocess.Popen] = None,
|
|
173
172
|
health_check_url: Optional[str] = None,
|
|
174
|
-
h2_enabled: bool = False,
|
|
175
173
|
) -> _FlashManager:
|
|
176
174
|
"""
|
|
177
175
|
Forward a port to the Modal Flash service, exposing that port as a stable web endpoint.
|
|
@@ -180,7 +178,7 @@ async def flash_forward(
|
|
|
180
178
|
"""
|
|
181
179
|
client = await _Client.from_env()
|
|
182
180
|
|
|
183
|
-
manager = _FlashManager(client, port, process=process, health_check_url=health_check_url
|
|
181
|
+
manager = _FlashManager(client, port, process=process, health_check_url=health_check_url)
|
|
184
182
|
await manager._start()
|
|
185
183
|
return manager
|
|
186
184
|
|
|
@@ -10,7 +10,6 @@ class _FlashManager:
|
|
|
10
10
|
port: int,
|
|
11
11
|
process: typing.Optional[subprocess.Popen] = None,
|
|
12
12
|
health_check_url: typing.Optional[str] = None,
|
|
13
|
-
h2_enabled: bool = False,
|
|
14
13
|
):
|
|
15
14
|
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
16
15
|
...
|
|
@@ -37,7 +36,6 @@ class FlashManager:
|
|
|
37
36
|
port: int,
|
|
38
37
|
process: typing.Optional[subprocess.Popen] = None,
|
|
39
38
|
health_check_url: typing.Optional[str] = None,
|
|
40
|
-
h2_enabled: bool = False,
|
|
41
39
|
): ...
|
|
42
40
|
|
|
43
41
|
class __is_port_connection_healthy_spec(typing_extensions.Protocol[SUPERSELF]):
|
|
@@ -94,7 +92,6 @@ class __flash_forward_spec(typing_extensions.Protocol):
|
|
|
94
92
|
port: int,
|
|
95
93
|
process: typing.Optional[subprocess.Popen] = None,
|
|
96
94
|
health_check_url: typing.Optional[str] = None,
|
|
97
|
-
h2_enabled: bool = False,
|
|
98
95
|
) -> FlashManager:
|
|
99
96
|
"""Forward a port to the Modal Flash service, exposing that port as a stable web endpoint.
|
|
100
97
|
This is a highly experimental method that can break or be removed at any time without warning.
|
|
@@ -108,7 +105,6 @@ class __flash_forward_spec(typing_extensions.Protocol):
|
|
|
108
105
|
port: int,
|
|
109
106
|
process: typing.Optional[subprocess.Popen] = None,
|
|
110
107
|
health_check_url: typing.Optional[str] = None,
|
|
111
|
-
h2_enabled: bool = False,
|
|
112
108
|
) -> FlashManager:
|
|
113
109
|
"""Forward a port to the Modal Flash service, exposing that port as a stable web endpoint.
|
|
114
110
|
This is a highly experimental method that can break or be removed at any time without warning.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|