Pipeline Parameters

Passing data between pipeline components

The kfp.dsl.PipelineParamclassrepresents a reference to future data that will be passed to the pipeline or produced by a task.

You pipeline function should have parameters, so that they can later be configured in the Kubeflow Pipelines UI.

When your pipeline function is called, each function argument will be a PipelineParam object.You can pass those objects to the components as arguments to instantiate them and create tasks.A PipelineParam can also represent an intermediate value that you pass between pipeline tasks.Each task has outputs and you can get references to them from the task.outputs[<output_name>] dictionary.The task output references can again be passed to other components as arguments.

In most cases you do not need to construct PipelineParam objects manually.

The following code sample shows how to define pipeline with parameters:

  1. @kfp.dsl.pipeline(
  2. name='My pipeline',
  3. description='My machine learning pipeline'
  4. )
  5. def my_pipeline(
  6. my_num: int = 1000,
  7. my_name: str = 'some text',
  8. my_url: str = 'http://example.com'
  9. ):
  10. ...

See more in the guide to building acomponent.

Feedback

Was this page helpful?

Glad to hear it! Please tell us how we can improve.

Sorry to hear that. Please tell us how we can improve.

Last modified 29.09.2019: Deemphasized manual creation of PipelineParam objects (#1161) (391b650f)