Configuration¶
Tweak the behavior of the kloch runtime using a configuration system.
Configuration are serialized on disk using yaml file with a simple flat key/value structure:
cli_logging_default_level: INFO
cli_logging_format: '{levelname: <7} | {asctime} [{name}] {message}'
cli_logging_paths: []
cli_session_dir: null
cli_session_dir_lifetime: 240.0
launcher_plugins: []
profile_roots: []
You specify which configuration file to use with the environment variable:
KLOCH_CONFIG_PATH
Each config key can also be set using an individual environment variable:
KLOCH_CONFIG_LAUNCHER_PLUGINS
KLOCH_CONFIG_CLI_LOGGING_PATHS
KLOCH_CONFIG_CLI_LOGGING_FORMAT
KLOCH_CONFIG_CLI_LOGGING_DEFAULT_LEVEL
KLOCH_CONFIG_CLI_SESSION_PATH
KLOCH_CONFIG_CLI_LIFETIME
KLOCH_CONFIG_PROFILE_ROOTS
Be aware that specifying a config key in an environment variable will override any value specified in the config file.
Content¶
Relative Paths
All config file key that expect a Path
and whose value is a relative path
are turned absolute to the config parent directory.
Example: config is read from C:/configs/kloch.yml
,
then cli_session_dir: ../sessions/
will produce C:/sessions/
Environment Variables in Paths
All config file key that expect a Path
can have environment variable that
will be resolved. Environment variable are specified like $MYVAR/mydir
.
You can escape the resolving by doubling the $
like $$myvar/mydir
.
key name |
||
---|---|---|
|
type |
List[str] |
default |
|
|
environment variable |
|
|
description |
A list of importable python module names containing new launchers to support. If specified in environment variable, this must be a comma-separated list of str like |
|
|
type |
List[pathlib.Path] |
default |
|
|
environment variable |
|
|
description |
Filesystem path to one or multiple log file that might exists. If specified all the logging will also be wrote to those files. The log path parent directory is created if it doesn’t exists. Logs are rotated between 2 files of 262.14Kb max. If specified from the environment, it must a list of path separated by the default system path separator (windows = |
|
|
type |
<class ‘str’> |
default |
|
|
environment variable |
|
|
description |
Formatting to use for all logged messages. See python logging module documentation.
The tokens must use the |
|
|
type |
Union[int, str] |
default |
|
|
environment variable |
|
|
description |
Logging level to use if None have been specified.
Can be an int or a level name as string as long as it is understandable by |
|
|
type |
Optional[pathlib.Path] |
default |
|
|
environment variable |
|
|
description |
Filesystem path to a directory that might exists. The directory is used to store temporarly any file generated during the executing of a launcher. If not specified, a system’s default temporary location is used. |
|
|
type |
<class ‘float’> |
default |
|
|
environment variable |
|
|
description |
Amount in hours before a session directory must be deleted. Note the deleting is performed only the next time kloch is started so it is possible a session directory exist longer if kloch is not launched for a while. |
|
|
type |
List[pathlib.Path] |
default |
|
|
environment variable |
|
|
description |
Filesystem path to one or multiple directory that might exists. The directories contain profile valid to be discoverable. If specified from the environment, it must a list of path separated by the default system path separator (windows = |