proxystore.p2p.relay.run¶
CLI and serving functions for running a Globus Auth relay server.
periodic_client_logger
¶
periodic_client_logger(
server: RelayServer[UserT],
interval: float = 60,
limit: float | None = 60,
level: int = INFO,
) -> Task[None]
Create an asyncio task which logs currently connected clients.
Parameters:
-
server(RelayServer[UserT]) –Relay server instance to log connected clients of.
-
interval(float, default:60) –Seconds between logging connected clients.
-
limit(float | None, default:60) –Only log detailed client list if the number of clients is less than this number. Useful for debugging or avoiding clobbering the logs by printing thousands of clients.
-
level(int, default:INFO) –Logging level.
Returns:
-
Task[None]–Asyncio task.
Source code in proxystore/p2p/relay/run.py
serve
async
¶
serve(config: RelayServingConfig) -> None
Run the relay server.
Initializes a
RelayServer
and starts a websocket server listening for new connections
and incoming messages.
Note
This function will not configure any logging. Configuring logging
according to
RelayServingConfig.logging
is the responsibility of the caller.
Parameters:
-
config(RelayServingConfig) –Serving configuration.
Source code in proxystore/p2p/relay/run.py
cli
¶
cli(
config_path: str | None,
host: str | None,
port: int | None,
log_dir: str | None,
log_level: str | None,
) -> None
Run a relay server instance.
The relay server is used by clients to establish peer-to-peer
WebRTC connections. If no configuration file is provided, a default
configuration will be created from
RelayServingConfig().
The remaining CLI options will override the options provided in the
configuration object.