Sigopt-Config is an open-source tool for managing configuration for SigOpt deployments from sigopt-server.
Configuration files must be stored in a single directory with a flat structure (no sub-directories). Each configuration file must contain a top-level mapping. Currently only JSON and YAML are supported.
The configuration directory is loaded into a native object (object
in Javascript and dict
in Python) via the following algorithm:
- A list of the files in the specified directory is created.
- The list of files is sorted by ascending lexographical order of filename.
- The files are read and parsed as YAML into a list of data.
- The list of data is reduced in reverse order via JSON Merge Patch with the empty object as the initializer.
- The result of the reduction is the final configuration object.
This algorithm has the following desirable properties:
- Individual configuration files can be reused across multiple environments
- Configuration files can be organized according to their purpose
- File precedence can be set by using appropriate filename prefixes
- Nested objects are merged together predictably
- Easy to create a consistent implementation in a new language provided the language has a YAML parser and JSON Merge Patch implementation