Hello world demo
依赖
yum install python3 -y
# 安装pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
# anzhuang kfp
pip3 install kfp --upgrade
dsl-compile
python打包
import kfp
from kfp import dsl
@dsl.pipeline(
name='Exec order pipeline',
description='this is a test pipiline.'
)
def exec_order_pipeline(text1='message1', text2='message2'):
step1_task = dsl.ContainerOp(
name='echo1',
image='busybox',
command=['sh', '-c'],
arguments=['echo "$0" | tee /tmp/output1', text1]
)
step2_task = dsl.ContainerOp(
name='echo2',
image='busybox',
command=['sh', '-c'],
arguments=['echo "$0" | tee /tmp/output2', text2]
)
step2_task.after(step1_task)
dsl-compile --py test.py --output test.tar.gz
上传并运行