GoogleCloudPlatform / automlops

Build MLOps Pipelines in Minutes
Apache License 2.0
143 stars 34 forks source link

add kfp outputs #46

Closed msokoloff1 closed 6 months ago

msokoloff1 commented 8 months ago

Automatically define kubeflow component outputs from return type hint.

Waiting on confirmation to proceed with cleanup and testing: https://github.com/GoogleCloudPlatform/automlops/issues/47

Example use case:

@AutoMLOps.component(
def run_simulation(...) -> NamedTuple("outputs", [("output_1", str), ("output_2", str)]):
   ...

@AutoMLOps.pipeline
def pipeline():   
    result = run_simulation(...)
    validate_simulation(
            output_1=result.outputs["output_1"],
            output_2=result.outputs["output_2"],
        )

Without this code change, result.outputs is not possible.