academy.exchange.cloud.config¶
Cloud exchange configuration file parsing.
ExchangeAuthConfig
pydantic-model
¶
Bases: BaseModel
Exchange 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.
Config:
extra
:forbid
Fields:
PythonBackendConfig
pydantic-model
¶
Bases: BaseModel
Config for using PythonBackend.
Config:
extra
:forbid
Fields:
get_backend
¶
get_backend() -> MailboxBackend
RedisBackendConfig
pydantic-model
¶
Bases: BaseModel
Config for RedisBackend.
Attributes:
-
hostname
(str
) –Redis host
-
port
(int
) –Redis port
-
kwargs
(Dict[str, Any]
) –Any additional args to Redis
Config:
extra
:forbid
Fields:
-
hostname
(str
) -
port
(int
) -
message_size_limit_kb
(int
) -
mailbox_expiration_d
(float
) -
gravestone_expiration_d
(float
) -
kwargs
(Dict[str, Any]
) -
kind
(Literal['redis']
)
get_backend
¶
get_backend() -> MailboxBackend
Construct an instance of the backend from the config.
Source code in academy/exchange/cloud/config.py
ExchangeServingConfig
pydantic-model
¶
Bases: BaseModel
Exchange serving configuration.
Attributes:
-
host
(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
(ExchangeAuthConfig
) –Authentication configuration.
-
log_file
(Optional[str]
) –Location to write logs.
-
log_level
(Union[int, str]
) –Verbosity of logs.
Fields:
-
host
(str
) -
port
(int
) -
certfile
(Optional[str]
) -
keyfile
(Optional[str]
) -
auth
(ExchangeAuthConfig
) -
backend
(BackendConfigT
) -
log_file
(Optional[str]
) -
log_level
(Union[int, str]
)
from_toml
classmethod
¶
Parse an TOML config file.
Example
Minimal config without SSL and without authentication.
Example
Serve with SSL and Globus Auth.
Note
Omitted values will be set to their defaults (if they are an optional value with a default).