Hello world demo

依赖

  1. yum install python3 -y
  2. # 安装pip
  3. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  4. python3 get-pip.py
  5. # anzhuang kfp
  6. pip3 install kfp --upgrade
  7. dsl-compile

python打包

  1. import kfp
  2. from kfp import dsl
  3. @dsl.pipeline(
  4. name='Exec order pipeline',
  5. description='this is a test pipiline.'
  6. )
  7. def exec_order_pipeline(text1='message1', text2='message2'):
  8. step1_task = dsl.ContainerOp(
  9. name='echo1',
  10. image='busybox',
  11. command=['sh', '-c'],
  12. arguments=['echo "$0" | tee /tmp/output1', text1]
  13. )
  14. step2_task = dsl.ContainerOp(
  15. name='echo2',
  16. image='busybox',
  17. command=['sh', '-c'],
  18. arguments=['echo "$0" | tee /tmp/output2', text2]
  19. )
  20. step2_task.after(step1_task)
  1. dsl-compile --py test.py --output test.tar.gz

上传并运行

image.png
image.png
image.png
image.png
image.png