Last active
April 14, 2024 03:46
-
-
Save ftnext/0a10040dff26b4611f6a6a65a7b86c16 to your computer and use it in GitHub Desktop.
ref: https://nikkie-ftnext.hatenablog.com/entry/upload-kfp-compile-yaml-to-vertex-ai-pipelines-first-step
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://speakerdeck.com/asei/kubeflow-pipelines-v2-debian-waruji-jie-xue-xi-paipurainkai-fa?slide=10 | |
from kfp import compiler, dsl | |
@dsl.component(base_image="python:3.9") | |
def hello_world(text: str) -> str: | |
print(text) | |
return text | |
@dsl.pipeline( | |
name="intro-pipeline", | |
description="A simple intro pipeline", | |
pipeline_root="gs://mlops-study-hello-world", # GCSにバケットを作って指定 | |
) | |
def pipeline(text: str = "hi there"): | |
first_task = hello_world(text=text) | |
second_task = hello_world(text=first_task.output) | |
if __name__ == "__main__": | |
compiler.Compiler().compile( | |
pipeline_func=pipeline, package_path="intro_pipeline.yaml" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment