Using environment variables in pipelines

    This page describes how to pass environment variables to Kubeflow pipelinecomponents.

    Set up your environment:

    In this example, you pass an environment variable to a lightweight Pythoncomponent, which writes the variable’s value to the log.

    To build a component, define a stand-alone Python function and then call to convert thefunction to a component that can be used in a pipeline. The following function gets anenvironment variable and writes it to the log.

    Transform the function into a component usingkfp.components.func_to_container_op(func).

    Add this component to a pipeline. Use to pass anenvironment variable into the component. This code is the same no matter if yourusing python lightweight components or a container operation.

    Was this page helpful?

    Glad to hear it! Please .

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