pipelines/sdk/python
Kevin James 0b92f86408
refactor: fix invalid escape sequences (#11147)
Signed-off-by: Kevin James <KevinJames@thekev.in>
2024-09-20 16:24:30 +00:00
..
kfp refactor: fix invalid escape sequences (#11147) 2024-09-20 16:24:30 +00:00
test_data chore: fix CI by adding a dependency of python/sdk for the e2e-test (#11221) 2024-09-17 21:30:27 +00:00
tests chore: Set Python 3.9 as the Minimum Supported Version (#11159) 2024-09-12 19:10:22 +00:00
MANIFEST.in add registry json to package data (#7987) 2022-07-07 10:48:40 -06:00
README.md fix(sdk): fix kfp sdk v2 readme (#9668) 2023-06-21 00:15:40 +00:00
build.sh chore(sdk): undo creation of kfp-dsl namespace package (#9874) 2023-08-15 16:24:52 -07:00
requirements-deprecated.txt chore(sdk): remove v1 dependencies from SDK v2 (#8668) 2023-01-19 12:53:27 -08:00
requirements-dev.txt chore(sdk): remove v1 dependencies from SDK v2 (#8668) 2023-01-19 12:53:27 -08:00
requirements.in feat(sdk)!: Pin kfp-pipeline-spec==0.4.0, kfp-server-api>=2.1.0,<2.4.0 (#11192) 2024-09-09 23:06:20 +00:00
requirements.txt feat(sdk)!: Pin kfp-pipeline-spec==0.4.0, kfp-server-api>=2.1.0,<2.4.0 (#11192) 2024-09-09 23:06:20 +00:00
setup.py chore: Set Python 3.9 as the Minimum Supported Version (#11159) 2024-09-12 19:10:22 +00:00

README.md

Kubeflow Pipelines is a platform for building and deploying portable, scalable machine learning workflows based on Docker containers within the Kubeflow project.

Use Kubeflow Pipelines to compose a multi-step workflow (pipeline) as a graph of containerized tasks using Python code and/or YAML. Then, run your pipeline with specified pipeline arguments, rerun your pipeline with new arguments or data, schedule your pipeline to run on a recurring basis, organize your runs into experiments, save machine learning artifacts to compliant artifact registries, and visualize it all through the Kubeflow Dashboard.

Installation

To install kfp, run:

pip install kfp

Getting started

The following is an example of a simple pipeline that uses the kfp v2 syntax:

from kfp import dsl
import kfp


@dsl.component
def add(a: float, b: float) -> float:
    '''Calculates sum of two arguments'''
    return a + b


@dsl.pipeline(
    name='Addition pipeline',
    description='An example pipeline that performs addition calculations.')
def add_pipeline(
    a: float = 1.0,
    b: float = 7.0,
):
    first_add_task = add(a=a, b=4.0)
    second_add_task = add(a=first_add_task.output, b=b)


client = kfp.Client(host='<my-host-url>')
client.create_run_from_pipeline_func(
    add_pipeline, arguments={
        'a': 7.0,
        'b': 8.0
    })