Skip to content

Instantly share code, notes, and snippets.

@ftnext
Last active April 14, 2024 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ftnext/0a10040dff26b4611f6a6a65a7b86c16 to your computer and use it in GitHub Desktop.
Save ftnext/0a10040dff26b4611f6a6a65a7b86c16 to your computer and use it in GitHub Desktop.
# 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