proxystore.store.config¶
Store configuration model.
ConnectorConfig
¶
Bases: BaseModel
Connector configuration.
Example
Attributes:
-
kind(str) – -
options(Dict[str, Any]) –Dictionary of keyword arguments to pass to the
Connectorconstructor.
get_connector_type
¶
Resolve the class type for the specified connector.
This method works by first attempting to import the class
by treating kind as a fully-qualified path. For example,
if kind='proxystore.connectors.local.LocalConnector', the
LocalConnector is
imported from
proxystore.connectors.local.
If the import fails, kind will be checked against a list of known
(i.e., builtin)
Connector types.
kind will be psuedo-fuzzy matched against the class names of the
known Connector types.
For example, kind='local' and kind='LocalConnector' will both
match to 'proxystore.connectors.local.LocalConnector'.
Returns:
Raises:
-
ValueError–If a
Connectornamedkindfailed to import or ifkinddoes not match a builtin connector.
Source code in proxystore/store/config.py
get_connector
¶
Get the connector specified by the configuration.
Returns:
Source code in proxystore/store/config.py
StoreConfig
¶
Bases: BaseModel
Store configuration.
Tip
See the Store parameters for more
information about each configuration option.
Attributes:
-
name(str) –Store name.
-
connector(ConnectorConfig) –Connector configuration.
-
serializer(Optional[SerializerT]) –Optional serializer.
-
deserializer(Optional[DeserializerT]) –Optional deserializer.
-
cache_size(int) –Cache size.
-
metrics(bool) –Enable recording operation metrics.
-
populate_target(bool) –Set the default value for the
populate_targetparameter of proxy methods. -
auto_register(bool) –Auto-register the store.
from_toml
classmethod
¶
Create a configuration file from a TOML file.
Example
See
write_toml().
Parameters:
Source code in proxystore/store/config.py
write_toml
¶
Write a configuration to a TOML file.
Example
from proxystore.store.config import ConnectorConfig
from proxystore.store.config import StoreConfig
config = StoreConfig(
name='example',
connector=ConnectorConfig(
kind='file',
options={'store_dir': '/tmp/proxystore-cache'},
),
)
config.write_toml('config.toml')
StoreConfig.from_toml('config.toml').
Parameters: