fetchai / agents-aea

A framework for autonomous economic agent (AEA) development
https://docs.fetch.ai/aea/
Apache License 2.0
203 stars 62 forks source link

Configuration management refactoring #1666

Open marcofavorito opened 4 years ago

marcofavorito commented 4 years ago

Is your feature request related to a problem? Please describe. The implementation of configuration management could be simplified and cleaned up.

Among other things:

Describe the solution you'd like Address some of the above.

Describe alternatives you've considered n/a

Additional context low priority.

DavidMinarsch commented 3 years ago

Related https://github.com/fetchai/agents-aea/issues/969

solarw commented 3 years ago

some thoughts:

  1. Change internal configuration representation. use dict/mapping instead of variables inside the Configuration classes to make it more from/to json compatible, all the properties will stay the same, init method the same, the primary goal is to unify: to/from json methods on base class, instead of writing it for every class. also, dict/mapping inside the config can help to use some yaml friendly mapping to preserve order while dealing with configs

  2. Use AgentConfigManager for loading/accessing/modifying agent-wide configurations including overrides. just to have a single point of responsibility with all validation in one place. so every time config for aea project loaded from the file system, it's better to handle it with config manager, to avoid direct modifications.

  3. would be nice to find the way to unify agent configuration properties with builders some, to avoid code duplication when new aea configuraion option is added.