question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement pipeline autodiscovery

See original GitHub issue

Following https://github.com/kedro-org/kedro/issues/1284 and a discussion with Ivan, here’s what we’re going to do:

1. Define a function find_pipelines

In kedro.framework.project.__init__.py, something like this:

def find_pipelines():
    registered_pipelines = {}
    pipeline in Path(f"{PACKAGE_NAME}.pipelines").iterdir():
        importlib.import_module(pipeline)
        if hasattr(pipeline, "create_pipeline"):
            registered_pipelines[pipeline] = pipeline.create_pipeline()
    registered_pipelines["__default__"] = pipeline([])
    return registered_pipelines

Name is TBD (note I changed from previously-suggested autoregister because it doesn’t actually register any more, just finds them). It’s also like setup.py’s find_packages here.

2. Call this function from project template and all starters

In pipeline_registry.py:

from kedro.framework.project import find_pipelines

def register_pipelines() -> Dict[str, Pipeline]:
    """Register the project's pipelines.

    MAKE THIS DOCSTRING MORE INFORMATIVE

    Returns:
        A mapping from a pipeline name to a ``Pipeline`` object.

    """
    pipelines = find_pipelines()
    pipelines["__default__"] = sum(pipelines.values())
    return pipelines

3. Add documentation, tests, etc.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
deepyamancommented, Jul 25, 2022

Personally I would do a whole new file docs/source/nodes_and_pipelines/pipeline_registry.md, but up to you really. I think the modular pipeline documentation needs some modifying as it stands, so I wouldn’t be surprised if these things move around a bit anyway. So long as it’s linked from and consistent with other relevant sections of the docs (e.g. linked from the instructions on “How to run a pipeline”; update spaceflights tutorial so there’s no need to edit pipeline_registry.py any more) I don’t mind much where it goes.

Great! I pinged @MerelTheisenQB on Friday, since I thought you were on holiday, and she was aligned in terms of creating a new page for the pipeline registry.

Also I know this is a fairly big documentation update, so do feel free to do bit by bit or in a separate PR if easier for you 🙂 🙏

I think the functionality is good to go on my current PR; just need to add the documentation. I’ll plan to:

  1. Write basic pipeline registry documentation, and merge that PR.
  2. Update it with a section on autodiscovery, and integrate into my open PR.

Alternatively, I’d also be happy to merge the current code (after review) and add the 1-2 documentation PRs on top of that.

1reaction
deepyamancommented, Aug 1, 2022

@deepyaman Either approach works for me - up to you. Just mark the PR(s) as ready for review whenever you want me to have a look through and I’ll do so.

Great! In that case, I’ve marked my current PR as ready for review. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to setup autodiscovery and creation of new pipelines in ...
Hi all. First time Azure DevOps user here and trying to figure out to migrate to Azure DevOps pipelines. I've managed to setup...
Read more >
The pipeline registry — Kedro 0.18.3 documentation - Read the Docs
Pipeline autodiscovery ¶. In the above example, you need to update the register_pipelines() function whenever you create a pipeline that should be returned ......
Read more >
Kubernetes Integrations Autodiscovery - Datadog Docs
This page covers how to configure integrations Autodiscovery with Kubernetes. If you are using Docker or Amazon ECS, see the Docker Integrations ...
Read more >
How to use custom ingest pipelines with docker autodiscover
I'm having a hard time using custom Elasticsearch ingest pipelines with Filebeat's Docker autodiscovery. I've started out with custom ...
Read more >
How to build your CI/CD pipeline for the full API lifecycle
In this example, we will deploy an application to CloudHub using Anypoint CLI and use property placeholders for configuring auto discovery ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found