You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if there is any standard way for defining configurations that would be used by multiple chaos experiments. For example, the aws chaos extension requires to define aws_region in each experiment. I wanted this value to be dynamic so I defined it in the configuration block of each experiment. Now that the number of experiments is growing, it is getting real difficult to manage this parameter on the experiment level. I came up with a solution by writing a control which would load the configurations defined on the settings.yaml file before each chaos run.
Few things to note
Variable that is defined on the settings.yaml file will be used by default
Variable defined in experiment top level will override the settings.yaml variable
Variable passed from the command line argument chaos run --var key=value will override the experiment defined variable
defconfigure_control(configuration: Configuration=None,
secrets: Secrets=None, settings: Settings=None,
experiment: Experiment=None):
""" Load configuration values from settings file Settings value can be overwritten by defining it in the experiment Usage: On settings file controls: global_values: provider: type: python module: custommodule.utils.control """settings_config=settings['configuration']
for (setting_key, setting_value) insettings_config.items():
if (configuration.get(setting_key)):
logger.info("Using %s:%s from local experiment",setting_key,setting_value)
else:
logger.info("Using %s:%s from settings file",setting_key,setting_value)
configuration[setting_key] =setting_value
The text was updated successfully, but these errors were encountered:
I am not sure if there is any standard way for defining configurations that would be used by multiple chaos experiments. For example, the aws chaos extension requires to define
aws_region
in each experiment. I wanted this value to be dynamic so I defined it in the configuration block of each experiment. Now that the number of experiments is growing, it is getting real difficult to manage this parameter on the experiment level. I came up with a solution by writing a control which would load the configurations defined on thesettings.yaml
file before each chaos run.chaos run --var key=value
will override the experiment defined variableThe text was updated successfully, but these errors were encountered: