KubeFlow(https://github.com/kubeflow)是一个机器学习框架,主要面向Kubernetes容器集群环境执行的机器学习研发和人工智能服务。目前已经发展了多个子项目,包括:交互式的模型开发、训练流水线、超参数(模型)仓库、模型服务器、Operator操作器等。主要支持TensorFlow,也支持PyTorch等引擎(开发中)。
上图,KubeFlow的总体架构示意图。
1、KubeFlow Project系列
KubeFlow现在提供了一个中心控制面板,可以交互式选择使用相应的功能。如下:
KubeFlow目前的主要子项目包括:
- 交互式模型开发,是基于Jupyter 开发的UI,可以使用notebook环境。
- 训练流水线-piplines, reusable end-to-end ML workflows built using the Kubeflow Pipelines SDK。
- 超参数(模型)仓库-katib,Kubernetes Native System for Hyperparameter Tuning and Neural Architecture Search。
- 模型服务器-kfserving,Kubernetes Custom Resource Definition for serving machine learning (ML) models on arbitrary frameworks。
- Operator操作器-tfoperator,Kubernetes custom resource that makes it easy to run distributed or non-distributed TensorFlow jobs on Kubernetes。
更多参考:https://github.com/kubeflow
图二,机器学习流程示意图
2、Kubernetes支持版本
运行环境要求
-
集群至少有一个节点,最低配置参数如下:
- 4 CPU
- 50 GB storage
- 12 GB memory
-
建议 Kubernetes 版本为1.14。目前Kubeflow 测试和验证在 Kubernetes 1.14。
- 集群Kubernetes 版本不低于1.11。
- 目前Kubeflow 在 Kubernetes 1.16上无法工作,包括以上版本。
- 旧版本的 Kubernetes 可能无法与最新的 Kubeflow 完全兼容。下面是Kubeflow和Kubernetes版本匹配的列表。
Kubernetes Versions | Kubeflow 0.4 | Kubeflow 0.5 | Kubeflow 0.6 | Kubeflow 0.7 |
---|---|---|---|---|
1.11 | compatible | compatible | incompatible | incompatible |
1.12 | compatible | compatible | incompatible | incompatible |
1.13 | compatible | compatible | incompatible | incompatible |
1.14 | compatible | compatible | compatible | compatible |
1.15 | incompatible | compatible | compatible | compatible |
1.16 | incompatible | incompatible | incompatible | incompatible |
云平台安装
KubeFlow可以支持多个云平台服务商,如下:
Deployment platform | Manifest | Deployment guide |
---|---|---|
Existing Kubernetes cluster using a standard Kubeflow installation | kfctl_k8s_istio.0.7.1.yaml | Docs |
Existing Kubernetes cluster using Dex for authentication | kfctl_existing_arrikto.0.7.1.yaml | Docs |
Amazon Web Services (AWS) using the standard setup | kfctl_aws.0.7.1.yaml | Docs |
Amazon Web Services (AWS) with authentication | kfctl_aws_cognito.0.7.1.yaml | Docs |
Microsoft Azure | kfctl_k8s_istio.0.7.1.yaml | Docs |
Google Cloud Platform (GCP) with basic authentication | kfctl_gcp_basic_auth.0.7.1.yaml | Docs |
Google Cloud Platform (GCP) with Cloud Identity-Aware Proxy (Cloud IAP) | kfctl_gcp_iap.0.7.1.yaml | Docs |
IBM Cloud Private | kfctl_k8s_istio.0.7.1.yaml | Docs |
3、快速安装KubeFlow
-
安装过程
-
下载 kfctl ,到 Kubeflow releases page。
-
根据kubectl进行安装和设置,参考 Kubernetes documentation。
-
定制和设置参考 kustomize in Kubeflow。
-
-
集群服务器安装
-
Kubeflow部署(通过 kfctl_k8s_istio),https://www.kubeflow.org/docs/started/k8s/kfctl-k8s-istio/
-
-
工作站版本安装
-
Kubeflow on Linux,Linux安装Kubeflow。
-
Kubeflow on Windows,Windows安装Kubeflow。
-
Kubeflow on macOS,macOS安装Kubeflow。
-
Deploy using MiniKF on GCP,使用 Google Cloud Marketplace 部署 MiniKF (mini Kubeflow) 到 Google Cloud Platform (GCP)。
-
4、Kubernetes上使用GPU
在KubeFlow中使用GPU能力,需要操作系统安装驱动、Docker扩展以及Kubernetes插件。