Make config loading consistently happen before pipelines are registered to allow for dynamic pipelines with OmegaConf #3093
Labels
Issue: Feature Request
New feature or improvement to existing feature
Description
Currently the order between pipelines loading and config loading varies, depending on kedro command. If pipelines were to be ever dynamic depending on config/params, then they should always be read before pipelines are registered. Examples:
I wrote hello world functions to pipeline registry and config handler functions to demonstrate the order of loading:
✅ Command `kedro catalog list`
❌ Command `kedro run`
❌ Command `kedro registry list`
✅ Command `kedro ipython`
I think that's all the places that read the
pipelines
fromkedro.framework.project
.Context
I wrote an example based on Spaceflights starter that uses modular pipelines feature and omegaconf resolver to create pseudo dynamic pipelines (I will soon publish this for review):
Currently MODEL_FAMILIES is a static variable that is validated against what is defined in parameters, configuration like:
Configuration sample
It would be fully dynamic if the order of loading were consistent and then custom omegaconf resolver could populate
MODEL_FAMILIES
that defines namespaces of modular pipelines shown before. I believe this is minimum effort change to achieve dynamic pipelines functionality.Possible Implementation
Due to lazy evaluation of many of kedro resources, for
KedroSession
its sufficient to load catalog before reading pipeline to run. They don't depend on each other and it can be simply swapped.For kedro registry some config read could be introduced.
However, for better consistency in all places, the
_ProjectPipelines
class fromkedro.framework.project
should refer to config in some way to make it actually load.Related issues:
before/after_pipelines_registered
hook ORbefore/after_pipeline_filtered
#3000The text was updated successfully, but these errors were encountered: