Skip to content
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

lava: use new dotted-key syntax for storage settings section #293

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

gctucker
Copy link
Contributor

@gctucker gctucker commented Jul 27, 2023

Update how the name of the storage settings section is defined by following the TOML dotted-key syntax with sub-tables.

Update how the name of the storage settings section is defined by
following the TOML dotted-key syntax with sub-tables.

Signed-off-by: Guillaume Tucker <[email protected]>
@@ -29,8 +29,7 @@ def _get_api_helper(api_config_name, api_token):

def _get_storage(storage_config_name):
storage_config = CONFIGS['storage_configs'][storage_config_name]
section = SETTINGS[(':'.join(('storage', storage_config_name)))]
storage_cred = section['storage_cred']
storage_cred = SETTINGS['storage'][storage_config_name]['storage_cred']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use parse_opts instead to read the settings from TOML like other services?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because this is not a service like the other ones, it's a Flask application. There might be things we can do to try to make it look like a service but I made the design decision to rely directly on the YAML config and TOML settings as it seemed like the best choice in this case.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am aware it's a Flask app but I was wondering if we could use kernelci package somehow to read settings. But it seems not. Looks fine otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's just not very practical to run a Flask service which already has its own "main" function or WSGI connector as a kernelci-core command line tool. Also it's very straightforward to just read the settings and YAML config, I think a real improvement would be to help separate that logic from the helpers to run command line tools in kernelci-core. But that's really not a blocking issue at the moment, probably something to revisit once the old tools have been completely deprecated.

@gctucker gctucker enabled auto-merge August 2, 2023 15:02
@gctucker gctucker added this pull request to the merge queue Aug 2, 2023
Merged via the queue into kernelci:main with commit c4f8c73 Aug 2, 2023
3 checks passed
@gctucker gctucker deleted the lava-storage-section branch August 2, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants