proxystore.p2p.relay.config¶
Relay server configuration file parsing.
RelayAuthConfig
¶
Bases: BaseModel
Relay authentication configuration.
Attributes:
-
method(Optional[Literal['globus']]) –Authentication method.
-
kwargs(Dict[str, Any]) –Arbitrary keyword arguments to pass to the authenticator. The kwargs are excluded from the
repr()of this class because they often contain secrets.
RelayLoggingConfig
¶
Bases: BaseModel
Relay logging configuration.
Attributes:
-
log_dir(Optional[str]) –Default logging directory.
-
default_level(Union[int, str]) –Default logging level for the root logger.
-
websockets_level(Union[int, str]) –Log level for the
websocketslogger. Websockets logs with much higher frequency so it is suggested to set this toWARNINGor higher. -
current_clients_interval(Union[int, str]) –Optional seconds between logging the number of currently connected clients and user.
-
current_client_limit(Optional[int]) –Max threshold for enumerating the detailed list of connected clients. If
None, no detailed list will be logged.
RelayServingConfig
¶
Bases: BaseModel
Relay serving configuration.
Attributes:
-
host(Optional[str]) –Network interface the server binds to.
-
port(int) –Network port the server binds to.
-
certfile(Optional[str]) –Certificate file (PEM format) use to enable TLS.
-
keyfile(Optional[str]) –Private key file. If not specified, the key will be taken from the certfile.
-
auth(RelayAuthConfig) –Authentication configuration.
-
logging(RelayLoggingConfig) –Logging configuration.
-
max_message_bytes(Optional[int]) –Maximum size in bytes of messages received by the relay server.
from_toml
classmethod
¶
Parse an TOML config file.
Example
Minimal config without SSL and without authentication.
Example
Serve with SSL and Globus Auth.
host = "0.0.0.0"
port = 8700
certfile = "/path/to/cert.pem"
keyfile = "/path/to/privkey.pem"
[auth]
method = "globus"
[auth.kwargs]
client_id = "..."
client_secret = "..."
[logging]
log_dir = "/path/to/log/dir"
default_log_level = "INFO"
websockets_log_level = "WARNING"
connected_client_logging_interval = 60
connected_client_logging_limit = 32
Note
Omitted values will be set to their defaults (if they are an optional value with a default).