Kubeflow Pipelines ローカルインストール

# Version

[v1.7.1](https://github.com/kubeflow/pipelines/releases/tag/1.7.1)

# Prerequisite

- [kind](https://kind.sigs.k8s.io/)
- [Python 3]()

# Installation

### kubeflow pipelinesのインストール

```
export PIPELINE_VERSION=1.7.1
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION"
kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/env/platform-agnostic-pns?ref=$PIPELINE_VERSION"
```

確認

```
kubectl get pod -A
NAMESPACE            NAME                                              READY   STATUS    RESTARTS   AGE
kube-system          coredns-558bd4d5db-29hhg                          1/1     Running   0          8m26s
kube-system          coredns-558bd4d5db-sbz8q                          1/1     Running   0          8m26s
kube-system          etcd-kind-control-plane                           1/1     Running   0          8m36s
kube-system          kindnet-nmrzh                                     1/1     Running   0          8m27s
kube-system          kube-apiserver-kind-control-plane                 1/1     Running   0          8m36s
kube-system          kube-controller-manager-kind-control-plane        1/1     Running   0          8m36s
kube-system          kube-proxy-sf7b9                                  1/1     Running   0          8m27s
kube-system          kube-scheduler-kind-control-plane                 1/1     Running   0          8m36s
kubeflow             cache-deployer-deployment-d95f8b79f-w4w9v         1/1     Running   0          8m11s
kubeflow             cache-server-55897df854-jllh7                     1/1     Running   0          8m11s
kubeflow             metadata-envoy-deployment-5b587ff9d4-zvq6b        1/1     Running   0          8m11s
kubeflow             metadata-grpc-deployment-6b5685488-g9gxs          1/1     Running   6          8m11s
kubeflow             metadata-writer-5c84d65485-t8zjj                  1/1     Running   1          8m11s
kubeflow             minio-5b65df66c9-p428b                            1/1     Running   0          8m11s
kubeflow             ml-pipeline-69c679bf86-fr7xz                      1/1     Running   6          8m11s
kubeflow             ml-pipeline-persistenceagent-69bdb89cfc-8tgnf     1/1     Running   1          8m11s
kubeflow             ml-pipeline-scheduledworkflow-f45d59698-9pl42     1/1     Running   0          8m11s
kubeflow             ml-pipeline-ui-78c69869b8-pmqcb                   1/1     Running   0          8m11s
kubeflow             ml-pipeline-viewer-crd-6d4dc67b48-96b67           1/1     Running   0          8m11s
kubeflow             ml-pipeline-visualizationserver-75d8c8cd9-8w4gh   1/1     Running   0          8m10s
kubeflow             mysql-f7b9b7dd4-748xh                             1/1     Running   0          8m10s
kubeflow             workflow-controller-99b6487-45xlx                 1/1     Running   0          8m10s
local-path-storage   local-path-provisioner-547f784dff-z6swz           1/1     Running   0          8m26s
```

UIの確認

```
kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80
```

-> http://localhost:8080

### cli `kfp`のインストール

```
pip install kfp --upgrade
```

コマンド類


確認 (上の例のport-forwardしてある状態で)

例.

```
kfp --endpoint http://localhost:8080 experiment list
+--------------------------------------+---------+---------------------------+
| Experiment ID                        | Name    | Created at                |
+======================================+=========+===========================+
| 7f39b6db-9c1b-4f41-8f56-2e6d4493dc4f | Default | 2021-12-13T22:26:59+00:00 |
+--------------------------------------+---------+---------------------------+
```
```
kfp --endpoint http://localhost:8080 pipeline list
+--------------------------------------+------------------------------------------------+---------------------------+
| Pipeline ID                          | Name                                           | Uploaded at               |
+======================================+================================================+===========================+
| b6b0c536-73f8-4931-b7d1-69a88e287b98 | [Tutorial] V2 lightweight Python components    | 2021-12-13T22:26:58+00:00 |
+--------------------------------------+------------------------------------------------+---------------------------+
| ee503a9a-d479-4691-b477-ac43bd504c6d | [Tutorial] DSL - Control structures            | 2021-12-13T22:26:57+00:00 |
+--------------------------------------+------------------------------------------------+---------------------------+
| 161d7936-5e5d-4737-9179-8673839f2348 | [Tutorial] Data passing in python components   | 2021-12-13T22:26:56+00:00 |
+--------------------------------------+------------------------------------------------+---------------------------+
| 1ab2b821-b187-48c3-97d5-2351ab511c9a | [Demo] TFX - Taxi tip prediction model trainer | 2021-12-13T22:26:55+00:00 |
+--------------------------------------+------------------------------------------------+---------------------------+
| 6c27cb99-5571-44a7-b061-1412a4a71c18 | [Demo] XGBoost - Iterative model training      | 2021-12-13T22:26:54+00:00 |
+--------------------------------------+------------------------------------------------+---------------------------+
```




# Clean up

```
export PIPELINE_VERSION=1.7.1
kubectl delete -k "github.com/kubeflow/pipelines/manifests/kustomize/env/platform-agnostic-pns?ref=$PIPELINE_VERSION"
kubectl delete -k "github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION"

```

# Reference
- [Information about local Deployment of Kubeflow Pipelines (kind, K3s, K3ai)](https://www.kubeflow.org/docs/components/pipelines/installation/localcluster-deployment/)