Closed hansbogert closed 5 years ago
can you docker-topo --archive
your setup and send a link it to me?
Ah I get it now, ./config
should be relative to the yaml file location, is that intended? Seems like different behaviour as v1
this is how it works (for both v1 and v2). First, we extract CONF_DIR from the env variable or configuration file (defaulting to ./config
)
CONF_DIR = t_yml.get('CONF_DIR',os.getenv('CONF_DIR', CONF_DIR))
Second, we check if there a config/
directory present in the same location as the topology YAML file, and if it exists, overwrite CONF_DIR
confdir_alt = os.path.join(t_file_pwd, CONF_DIR)
if os.path.isdir(confdir_alt):
CONF_DIR = confdir_alt
Does that match what you're observing?
Yes this is what I see, I totally overlooked the config
directory in the examples/v2/ directory.
Not sure I agree with the order of precedence though
So if I understand correctly, in order of preference which config dir to load:
I'd argue that the environment should always take precedence, however this is another issue. Thank you for explaining the above.
TBH, this has evolved naturally over time, with little planning, so I'm happy to take suggestions. What order would make sense to you?
Ahh my conclusion was wrong, the environment variable does have precedence. The order makes sense.
/update: wrong again.. The yaml takes precedence it seems. I wanted to give my precedence order hereafter, but I'll refrain because it so highly circumstantial and opinion based
However I think the behaviour of CONF_DIR should be described in the README.md
Creating the
v2/3-node.yml
does not seem to load a config in./config/3-node_cEOS-1
for examplesteps to come to above conclusion: