Skip to content

157 add a config db table - #251

Open
pmslavin wants to merge 29 commits into
masterfrom
157-add-a-config-db-table
Open

157 add a config db table#251
pmslavin wants to merge 29 commits into
masterfrom
157-add-a-config-db-table

Conversation

@pmslavin

@pmslavin pmslavin commented Jan 28, 2025

Copy link
Copy Markdown
Contributor

Removes hydra.ini and any other file-based config from Hydra configuration.

Config values which are required by the start-up routines and/or are essential to the import of common modules are now defined as environment variables, see the env section in .github/workflows/ci.yml for examples.

All other config values used at runtime may now be defined programatically and reside in the db. These are managed using the interface defined in lib/hydraconfig and usage examples are found in tests/test_hydraconfig.py.

A ConfigSet is introduced which represents a snapshot of the configuration state. These can be serialised along with an HMAC signature which verifies their correctness and origin. The file default_configset.json, or an equivalent file indicated by the HYDRA_CONFIGSET env var contains an initial state for the Hydra startup routines and is loaded into the db once on the first run following deployment.

The config.get() function in hydra_base/config.py no longer takes a "section" argument - all config keys exist in a single namespace without sections. It is recommended that config keys be given consistent and descriptive names which makes clear their role in Hydra and relation to otther keys.

@pmslavin pmslavin linked an issue Jan 28, 2025 that may be closed by this pull request
Comment thread hydra_base/config.py
from hydra_base.lib.hydraconfig import (
config_key_get_value
)
"""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This use of inspect is present only to allow the CI tests to pass with hydra-client-python master, which uses the old config.get() syntax with .ini file sections.

@pmslavin

Copy link
Copy Markdown
Contributor Author

See also corresponding hydra-client changes in hydraplatform/hydra-client-python#19

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.

Add a config DB table

1 participant