Skip to content

Galileo-Galilei/kedro-serving

Repository files navigation

General informations

Python Version License Code Style: Black SemVer


Software repository Latest release Total downloads
Pypi PyPI version Downloads

Code health


Branch Tests Coverage Links Documentation Deployment Activity
main test codecov links Documentation publish commit

What is kedro-serving?

kedro-serving is a kedro-plugn for serving kedro pipelines. It aims to be easy to use, flexible, robust to be production ready. As it is in its early stage of developpement, it is highly discouraged to use it for production in its current state.

Coming soon:

  • enable parameters injection at runtime
  • supporting other inputs than pandas dataframe
  • documentation & examples
  • support for production-ready ASGI server (e.g., gunicorn)
  • extended configuration for artifacts
  • tests

How do I install kedro-serving?

kedro-serving is available on PyPI, so you can install it with pip:

pip install kedro-serving

If you want to use the most up to date version of the package which is under development and not released yet, you can install the package from github:

pip install --upgrade git+https://github.com/Galileo-Galilei/kedro-serving.git

Getting started

  • Run kedro info to check if kedro recognizes kedro-serving as a plugin.
  • Change directory into your kedro project.
  • kedro serving serve --pipeline my_pipeline_name --input-name my-input-name
    • For example, using the spaceflight starter project, I could run kedro-serving with this command: kedro serving serve --pipeline data_processing --input-name companies
    • This sets up a server at http://localhost:5000 with two endpoints, health and run
  • Go to http://localhost:5000/health to verify the server is running.
  • Use postman or similar to POST to http://localhost:5000/run with a body containing a JSON list of records, like this example that works for the spaceflights starter:
    • [{"id": 1, "company_rating": 3, "company_location": "TX", "total_fleet_count": 23, "iata_approved": "n"}]
    • These records replace the input-name called out in the kedro-serving command when running the pipeline called out in the kedro-serving command.
  • If the records you pass in do not match the schema of the input-name you selected when initiating kedro-server, you will receive an error in JSON form.
  • If the pipeline run is successful, you will receive a response in JSON form containing the output data from the pipeline.

Release and roadmap

The release history centralizes packages improvements across time. The main features coming in next releases are listed on github milestones. Feel free to upvote/downvote and discuss prioritization in associated issues.

Disclaimer

This package is still in active development. We use SemVer principles to version our releases. Until we reach 1.0.0 milestone, breaking changes will lead to <minor> version number increment, while releases which do not introduce breaking changes in the API will lead to <patch> version number increment.

If you want to see how to migrate from one version of kedro-serving to another, see the migration guide.

Can I contribute?

We'd be happy to receive help to maintain and improve the package. Any PR will be considered (from typo in the docs to core features add-on) Please check the contributing guidelines.

Main contributors

The following people actively maintain, enhance and discuss design to make this package as good as possible: