mirror of
https://github.com/clearml/clearml
synced 2025-06-23 01:55:38 +00:00
Add CLEARNL_CONFIG_VERBOSE to allow external control over verbosity of the configuration loading process
This commit is contained in:
parent
e93d65b871
commit
7bb78c01bf
@ -10,7 +10,7 @@ def load(*additional_module_paths):
|
|||||||
configurations should be loaded as well
|
configurations should be loaded as well
|
||||||
:return: Config object
|
:return: Config object
|
||||||
"""
|
"""
|
||||||
config = Config(verbose=False)
|
config = Config()
|
||||||
this_module_path = Path(__file__).parent
|
this_module_path = Path(__file__).parent
|
||||||
config.load_relative_to(this_module_path, *additional_module_paths)
|
config.load_relative_to(this_module_path, *additional_module_paths)
|
||||||
return config
|
return config
|
||||||
|
@ -29,6 +29,7 @@ from .defs import (
|
|||||||
LOCAL_CONFIG_FILES,
|
LOCAL_CONFIG_FILES,
|
||||||
LOCAL_CONFIG_FILE_OVERRIDE_VAR,
|
LOCAL_CONFIG_FILE_OVERRIDE_VAR,
|
||||||
ENV_CONFIG_PATH_OVERRIDE_VAR,
|
ENV_CONFIG_PATH_OVERRIDE_VAR,
|
||||||
|
CONFIG_VERBOSE,
|
||||||
)
|
)
|
||||||
from .defs import is_config_file
|
from .defs import is_config_file
|
||||||
from .entry import Entry, NotSet
|
from .entry import Entry, NotSet
|
||||||
@ -64,12 +65,6 @@ class ConfigEntry(Entry):
|
|||||||
|
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
"""
|
|
||||||
Represents a server configuration.
|
|
||||||
If watch=True, will watch configuration folders for changes and reload itself.
|
|
||||||
NOTE: will not watch folders that were created after initialization.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# used in place of None in Config.get as default value because None is a valid value
|
# used in place of None in Config.get as default value because None is a valid value
|
||||||
_MISSING = object()
|
_MISSING = object()
|
||||||
|
|
||||||
@ -77,14 +72,14 @@ class Config(object):
|
|||||||
self,
|
self,
|
||||||
config_folder=None,
|
config_folder=None,
|
||||||
env=None,
|
env=None,
|
||||||
verbose=True,
|
verbose=None,
|
||||||
relative_to=None,
|
relative_to=None,
|
||||||
app=None,
|
app=None,
|
||||||
is_server=False,
|
is_server=False,
|
||||||
**_
|
**_
|
||||||
):
|
):
|
||||||
self._app = app
|
self._app = app
|
||||||
self._verbose = verbose
|
self._verbose = verbose if verbose is not None else CONFIG_VERBOSE.get()
|
||||||
self._folder_name = config_folder or DEFAULT_CONFIG_FOLDER
|
self._folder_name = config_folder or DEFAULT_CONFIG_FOLDER
|
||||||
self._roots = []
|
self._roots = []
|
||||||
self._config = ConfigTree()
|
self._config = ConfigTree()
|
||||||
|
@ -42,6 +42,8 @@ ENV_CONFIG_PATH_OVERRIDE_VAR = EnvEntry("CLEARML_CONFIG_PATH", "TRAINS_CONFIG_PA
|
|||||||
Environment-related config path override environment variable. If this is set, no other env config path will be used.
|
Environment-related config path override environment variable. If this is set, no other env config path will be used.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
CONFIG_VERBOSE = EnvEntry("CLEARML_CONFIG_VERBOSE", type=bool)
|
||||||
|
|
||||||
|
|
||||||
class Environment(object):
|
class Environment(object):
|
||||||
""" Supported environment names """
|
""" Supported environment names """
|
||||||
|
Loading…
Reference in New Issue
Block a user