Suppose you want to benchmark your application on each of PostgreSQL and MySQL. To do this, use config groups.
A Config Group is a named group with a set of valid options. Selecting a non-existent config option generates an error message with the valid options.
To create a config group, create a directory. e.g.
db to hold a file for each database configuration option.
Since we are expecting to have multiple config groups, we will proactively move all the configuration files
Since we moved all the configs into the
conf directory, we need to tell Hydra where to find them using the
config_path is a directory relative to
my_app.py without requesting a configuration will print an empty config.
Select an item from a config group with
By default, the config group determines where the config content is placed inside the final config object.
In Hydra, the path to the config content is referred to as the config
The package of
Like before, you can still override individual values in the resulting config:
- Config content can be relocated via package overrides. See Reference Manual/Packages.
- Multiple options can be selected from the same Config Group by specifying them as a list.
See Common Patterns/Selecting multiple configs from a Config Group