Definitions
In this document, we separate the Decision Engine (DE) initialization into two phases:
- Configuration: The reading and processing of user-specified parameters that influence the run-time behavior of the program, and their subsequent preparation for use during the construction phase.
- Construction: The formation of valid in-memory objects based on parameters provided from the configuration stage.
The configuration system refers to the collection of utilities used for the configuration stage, as defined above. Important components of the configuration system include the:
- Configuration language
- In-memory representation of the parameters and their corresponding values
- Interface for the framework and module code that must access the configuration parameters
- Infrastructure responsible for recording and persisting configuration history
- Infrastructure or procedures used to validate user-supplied configuration artifacts
- Configuration documentation facility to aid operators and developers in understanding how to successfully configure various components of the decision-engine system or cycle
- Tools available for inspecting and debugging configurations
In what follows, to reconfigure a DE component means to apply a configuration change to an object that is already active in either the DE application itself or a decision channel.
Current configuration system
The configuration of the DE system can be broken into three categories: the DE application itself, a DE channel, and a module used in the channel. See below for the supported configurations (heuristically) of each category. At the moment, in order to change the configuration of a DE channel (and its modules), either the DE application must be restarted, or the channels must be reloaded by means of a signal handler, registered in the DE constructor.
DE application
decision_engine: {
server_address: (address_string, port_number) # for internet protocol
logger: {
log_file: file_name_str
max_file_size: num_in_bytes # default is 200 MB
max_backup_count: num # default is 6
}
dataspace: {
datasource: {
name: ""
module: ""
config: ""
}
}
}
DE channel
channel: {
sources: {}
publishers: {}
logicengines: {}
transforms: {}
# Optional parameters
task_manager: {
data_TO: timeout_in_seconds # default is 300 (5 min.)
}
}
DE module
module_name: {
name: ""
module: ""
schedule: num # default is 300 (5 min.)
parameters: {
...
}
}
Configuration system requirements
Basic attributes:
- Each configurable DE component (e.g. framework, user module, monitoring plugin) shall be configurable through a human-readable, text file.
- A configuration parameter shall consist of a value bound to a name.
- The supported value types shall be:
- atomic: values with no underlying structure (e.g character strings, numbers, etc.), or
- composite: values that can be represented by either a list of other values, or a collection of configuration parameters.
- It shall be possible to specify a name within a named, enclosing scope; the named, enclosing scope is thus a parameter with a composite value.
- A parameter named in one scope shall be distinct from a parameter named in a different scope, even if the parameter name is the same.
To avoid duplicate configuration specifications:
- Within a configuration file, it shall be possible to substitute the value of a previously named parameter within that same file.
- Within a configuration file, it shall be possible to refer to or reuse values from other configuration files (hereafter referenced configuration files).
- A lookup policy shall be specified to locate referenced configuration files.
On default values:
- The configuration system shall support default values that can be overriden by an explicit parameter assignment.
- It shall be possible to easily ascertain what the default configuration values are.
System-wide:
- The configuration system shall make a fully processed configuration available on demand for parameter inspection.
- The configuration system shall have the ability to provide diagnostic information as to the source of the final parameter values of a fully processed configuration.
- A fully processed configuration shall not be modified/modifiable by the DE framework or by any DE components (such as modules, monitoring infrastructure, etc.).
- It must be clear to an operator which configuration changes require a restart of the DE application.
- e.g. Upon reconfiguring a DE workflow component that requires a restart of the DE application, a confirm request shall be asked of the operator.
- Any changes to a decision-channel configuration shall not require a restart of the DE application.
- It shall be possible to exclude resource types without changing the code of the DE framework, module, or any other DE component.
- To the extent possible, reconfiguring a DE component shall not influence any logically separate, yet active DE components.
- To the extent possible, reconfiguring a DE component shall not require a restart of the DE application, with the exception of reconfiguring the application itself.
- Enough configuration history shall be archived to replay a decision cycle.
Note that the configuration system meeting the requirements above is not required to support any configuration artifacts that pre-date it.
Configuration system preferences
The following items, while desirable, are not strictly necessary in realizing the configuration system design:
- A fully processed configuration for the DE application or a DE channel should be representable as a valid configuration file.
- The configuration language should not be sensitive to whitespace differences (e.g. Python is a poor match).
- For backwards compatibility reasons, it is preferable if the Python configuration object passed to a DE component is similar in interface to a Python dictionary.
- The configuration should be versioned, and that version should be recorded in the data block.
- The system should be able to print out what configuration parameters a given module supports.
- The system should be able to print out a valid configuration snippet based on the parameters supported by a given module.
- Various tools should be provided:
- A validation mechanism to ensure that a configuration file is valid before it is scheduled for use.
- Utilities to determine how configuration files relate to one another.
- A view into the actual configuration data without having to understand the representation used in recording or persisting the configuration.
- The syntax of the configuration language should either be supported or be easily supportable by most text editors.