-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration behaviour is confusing and poorly documented. #1258
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Lets expand the scope of this to cover documenting how ODC finds it's configuration and determines which Database to connect to. The only existing documentation is Installing & Managing -> Configuring -> Database Setup -> Create Configuration File I would expect to find information in the Data Access ... -> Connecting to ODC, but this page has a non-link to Setting up your environment. The link needs fixing, if that page even exists. I think this should also be documented in the API docs for |
The current behaviour is complicated and confusing, involving many possible environment variables and configuration files, on top of flags to CLI applications and arguments passed to The precedence of configuration files is in https://github.com/opendatacube/datacube-core/blob/develop/datacube/config.py#L19-L30 , and the logic in the rest of config.py determines how they're used. Configuration file precedence
Environment Variables These are on top of all the PostgreSQL configuration options, including |
I've found an "interesting" undocumented feature lurking in the ODC configuration code. If you run There are a bunch of tests on how the configuration settings work in |
The documentation for the configuration file needs improving too. The canonical source in the docs seems to be Database Setup -> Create Configuration File. It is mostly made up of a commented example configuration file, but doesn't mention |
Oh my, there's more complexity in choosing the "Datacube Environment" to use. The priority for choosing the environment is (to the best of my understanding):
[user]
default_environment=value
(See Also: I don't think "Datacube Environment" is defined clearly anywhere. |
Okay, after thinking I understood this now, and tearing my hair out.... there's more. The above logic is only called when creating a If you're using the It respects the environment variables |
Oh wow, I've been through this code fairly recently but didn't spot all of these gotchas. |
See also @Kirill888 's comments on #1329 re: using postgres with conda. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Configuration file precedence
Note this list is in reverse precedence order - the ones lower in the list override the one's higher in the list. This means that the priority of the environment variable is surprisingly low - should really be the highest precedence. |
@SpacemanPaul can you confirm what granularity of the override is?
Is it fusing multiple configs "somehow" or just picks last found one? |
Also I'm guessing that "alternative to global config that is usually in |
I'm just looking starting to look at that now - but on first glance, yes, it looks like it might be fusing them (and there's even yet another base default config not mentioned in this list that is defined statically in the source code). Immediate progress will be slow because I'm about to go on leave but cleaning this up for 1.9 is my next priority - I'll clean up the 1.8 documentation at the same time. |
Looks to me like |
Then there's I think it's all tied up with the executer/worker framework which iirc we had already said we were going to remove. (We already partly removed celery support). |
Honestly, the behaviour in 1.8 is so complex, conditional and inconsistent, I'm not sure it's even possible to write complete, accurate and comprehensible documentation. |
This threads sums up nicely our "understanding" - we use everything but the IAM stuff at the moment, but that's because it's completely undocumented and I've not been brave enough to dig into the rabbit hole.... |
EP-10 ^^ is now mostly complete design. Thanks to Damien and Rob for their feedback while working through this. I'm pretty sure the new design provides a way to do everything that current system can do except merging multiple files - and as I discuss, with the way I have the config loading process laid out, I think it would be possible to do multiple file merging with only minor tweaks if we decide we can't do without it - but I think some of the other new features I've introduced make it unnecessary. |
Expected behaviour
The behaviour of the
$DATACUBE_DB_URL
environment variable is clearly documented.Actual behaviour
The
$DATACUBE_DB_URL
environment variable is not mentioned at all in the docs.The text was updated successfully, but these errors were encountered: