RVConfig#
- class RVConfig[source]#
Bases:
object
A store of global user-specific configuration not tied to particular pipelines.
This is used to store user-specific configuration like the root temporary directory, verbosity, and other system-wide configuration handled by Everett (eg. which AWS Batch job queue to use).
Attributes
Methods
__init__
()Return the cache directory.
get_config_dict
(rv_config_schema)Get all Everett configuration.
get_namespace_config
(namespace)Get the key-val pairs associated with a namespace.
Return a new TemporaryDirectory object.
Return the root of all temp dirs.
Returns verbosity level for logging.
set_everett_config
([profile, rv_home, ...])Set Everett config.
set_tmp_dir_root
([tmp_dir_root])Set root of all temporary directories.
set_verbosity
([verbosity])Set verbosity level for logging.
- get_cache_dir() TemporaryDirectory [source]#
Return the cache directory.
- Return type
- get_config_dict(rv_config_schema: Dict[str, List[str]]) Dict[str, str] [source]#
Get all Everett configuration.
This method is used to serialize an Everett configuration so it can be used on a remote instance.
- get_namespace_config(namespace: str) Dict[str, str] [source]#
Get the key-val pairs associated with a namespace.
- get_tmp_dir() TemporaryDirectory [source]#
Return a new TemporaryDirectory object.
- Return type
- set_everett_config(profile: Optional[str] = None, rv_home: Optional[str] = None, config_overrides: Optional[Dict[str, str]] = None)[source]#
Set Everett config.
This sets up any other configuration using the Everett library. See https://everett.readthedocs.io/
It roughly mimics the behavior of how the AWS CLI is configured, if that is a helpful analogy. Configuration can be specified through configuration files, environment variables, and the config_overrides argument in increasing order of precedence.
Configuration files are in the following format: ``` [namespace_1] key_11=val_11 … key_1n=val_1n
…
[namespace_m] key_m1=val_m1 … key_mn=val_mn ```
Each namespace can be used for the configuration of a different plugin. Each configuration file is a “profile” with the name of the file being the name of the profile. This supports switching between different configuration sets. The corresponding environment variable setting for namespace_i and key_ij is namespace_i_key_ij=val_ij.
- Parameters
profile (Optional[str]) – name of the RV configuration profile to use. If not set, defaults to value of RV_PROFILE env var, or DEFAULT_PROFILE.
rv_home (Optional[str]) – a local dir with RV configuration files. If not set, attempts to use ~/.rastervision.
config_overrides (Optional[Dict[str, str]]) – any configuration to override. Each key is of form namespace_i_key_ij with corresponding value val_ij.
- set_tmp_dir_root(tmp_dir_root: Optional[str] = None)[source]#
Set root of all temporary directories.
To set the value, the following rules are used in decreasing priority:
the tmp_dir_root argument if it is not None
an environment variable (TMPDIR, TEMP, or TMP)
a default temporary directory which is
a directory returned by tempfile.TemporaryDirectory()