[Kubeflow] 03 - Create One Pipeline
主要是对 Pipelines SDK 阅读笔记。
作为复习时, review: How to build a Kubeflow Pipeline
之前的笔记主要增加一些必要的背景知识,当前page乃更为重要的 Best Practice。
A pipeline is a description of an ML workflow, including all of the components that make up the steps in the workflow and how the components interact with each other.
安装 SDK
pip3 install kfp --upgrade
After successful installation, the command dsl-compile
should be available.
kfp.compiler
includes classes and methods for compiling pipeline Python DSL into a workflow yaml spec Methods in this package include, but are not limited to, the following:
-
kfp.compiler.Compiler.compile
compiles your Python DSL code into a single static configuration (in YAML format) that the Kubeflow Pipelines service can process. The Kubeflow Pipelines service converts the static configuration into a set of Kubernetes resources for execution.
接口服务
The Kubeflow Pipelines REST API is available at the same endpoint as the Kubeflow Pipelines user interface (UI).
The SDK client can send requests to this endpoint to upload pipelines, create pipeline runs, schedule recurring runs, and more.
-
Export Port/API
You can use kubectl port-forward to port forward the Kubernetes service locally to your laptop outside of the cluster:
# Change the namespace if you deployed Kubeflow Pipelines in a different namespace. $ kubectl port-forward svc/ml-pipeline-ui 3000:80 --namespace kubeflow
-
Access Kubeflow Pipelines from Jupyter notebook
An additional per namespace (profile) manifest is required,其实也是启动了一个Notebook 服务。
Deploying Kubeflow Pipelines
Ref: https://www.kubeflow.org/docs/components/pipelines/v1/installation/localcluster-deployment/
根据官网安装即可。
Build a Pipeline
This document provides an overview of pipeline concepts and best practices, and instructions describing how to build an ML pipeline.
Ref: 使用Kubeflow pipelines
相似代码:https://github.com/liuweibin6566396837/kubeflow-examples/tree/master/mnist_stage
mnist_stage$ tree . . ├── client.py # ----> 如何去调用cluster的api的呢? ├── load_data │ ├── build_image.sh │ ├── Dockerfile │ └── load_data.py # 从本地读取源数据 -> 特征变换 -> 分割训练集 -> 存储数据集到本地 ├── predict │ ├── build_image.sh │ ├── Dockerfile │ └── predict.py └── train ├── build_image.sh ├── Dockerfile └── train.py
相关文章
- 【python开发】利用PIP3的时候出现的问题Fatal error in launcher: Unable to create process using '"'
- (喷血分享)利用.NET生成数据库表的创建脚本,类似SqlServer编写表的CREATE语句
- 解决 - java.lang.OutOfMemoryError: unable to create new native thread
- log4net:ERROR Could not create Appender [Console] of type [log4net.Appender.ColoredConsoleAppender]. Reported error
- Database "mem:h2" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-210] 90149/90149 解决
- java虚拟机内存不足,“Could not create the Java Virtual Machine”问题解决方案
- Craft App Height and Width expressions to create responsive canvas apps
- No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer and no properties discovered to create BeanSerializer
- [JS] Topic - Object.create vs new
- Create Volume 操作(Part II) - 每天5分钟玩转 OpenStack(51)
- 【问题】No manual entry for pthread_create in section 3
- The web application [ROOT] appears to have started a thread named [spring.cloud.inetutils] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
- [Windows Azure] Create a Virtual Network for Site-to-Site Cross-Premises Connectivity
- [Windows Azure] How to Create and Deploy a Cloud Service?