Skip to content

Commit

Permalink
Update MLX setup instructions for KF 1.5 (#346)
Browse files Browse the repository at this point in the history
* Update MLX setup instructions for KF 1.5

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
  • Loading branch information
ckadner committed Jun 24, 2022
1 parent d78055e commit 6680f55
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 14 deletions.
5 changes: 3 additions & 2 deletions docs/install-mlx-on-kind.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ kubectl get pods --all-namespaces
## Deploy MLX (Single-User)

```Bash
git clone https://github.com/IBM/manifests -b v1.4.0-mlx
git clone https://github.com/IBM/manifests -b v1.5-branch
cd manifests

# run the below command two times if the CRDs take too long to provision
Expand All @@ -80,7 +80,8 @@ done
kubectl get pods --all-namespaces

# make the MLX UI available to your local browser on http://localhost:3000/
kubectl port-forward -n istio-system svc/istio-ingressgateway 3000:80 &
kubectl wait -n kubeflow --for=condition=ready pod -l service=mlx-ui && \
kubectl port-forward -n istio-system svc/istio-ingressgateway 3000:80 &
```

Now paste the URL http://localhost:3000/login into your browser and proceed to
Expand Down
47 changes: 36 additions & 11 deletions docs/mlx-setup.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Deploy MLX on an existing Kubernetes cluster

## Prerequisites

* An existing Kubernetes cluster:
- **Min version: 1.17**
- **Min version: 1.21**
- **Max version: 1.21**
* The recommended minimum capacity requirement for MLX are:
- **CPUs**: 8 Cores
Expand All @@ -19,9 +20,9 @@
mv kustomize /usr/local/bin
```

## Deploy
## Deployment

To deploy the MLX single-user mode on an existing Kubernetes Cluster, clone the MLX manifests and deploy it with Kustomize.
To deploy the MLX **single-user** mode on an existing Kubernetes Cluster, clone the MLX manifests and deploy it with Kustomize.

This MLX deployment includes:
- [Istio](https://istio.io/)
Expand All @@ -30,11 +31,33 @@ This MLX deployment includes:
- [Datashim](https://datashim-io.github.io/datashim/) to provide access to S3 and NFS Datasets within pods
- MLX API and UI

**Note:** Before deploying MLX on OpenShift on Fyre, you need to install a persistent
storage provider like [Portworx](https://docs.portworx.com/install-portworx/openshift/)
and set it as the `default` storage class. This is only required to support mounting
Persistent Volumes for Datasets using Datashim.

To deploy MLX on your Kubernetes or OpenShift cluster, first set the `MLX_DEPLOYMENT_TYPE`
environment variable based on your Kubernetes service provider by uncommenting
one of the `export` commands below:

```Shell
# export MLX_DEPLOYMENT_TYPE=mlx-single-ibmcloud # IBM Cloud - Kubernetes
# export MLX_DEPLOYMENT_TYPE=mlx-single-ibmcloud-openshift # IBM Cloud - OpenShift
# export MLX_DEPLOYMENT_TYPE=mlx-single-fyre-openshift # IBM Fyre - OpenShift

echo "MLX deployment type: ${MLX_DEPLOYMENT_TYPE:-"UNDEFINED"}"
```

Then clone the [IBM/manifest](https://github.com/IBM/manifests/tree/v1.5-branch)
repository and apply the manifests to your cluster:

```shell
git clone https://github.com/machine-learning-exchange/manifests -b mlx-single-user
cd manifests
# run the below command two times if the CRDs take too long to provision.
while ! kustomize build example | kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done
# clone the manifest repo
git clone https://github.com/IBM/manifests -b v1.5-branch && cd manifests

# run the following command twice if the CRDs take too long to provision
while ! kustomize build ${MLX_DEPLOYMENT_TYPE} | \
kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done
```

Then access the MLX web page on http://<cluster_node_ip>:30380/mlx/
Expand All @@ -44,14 +67,16 @@ This MLX deployment doesn't include or support:
- Multi-user mode
- Istio mutual TLS

To get these features, please install the additional plugins by following the instructions for [MLX deployment an existing Kubeflow cluster](/docs/install-mlx-on-kubeflow.md#deploy-mlx-on-an-existing-kubeflow-cluster).
To get those features, please install the additional plugins by following the instructions for
[MLX deployment an existing Kubeflow cluster](/docs/install-mlx-on-kubeflow.md#deploy-mlx-on-an-existing-kubeflow-cluster).

## Delete the MLX deployment

## Deleting the MLX Deployment

To delete this MLX deployment, run the following commands in the same manifests folder.

```
kustomize build example | kubectl delete -f -
```Shell
kustomize build ${MLX_DEPLOYMENT_TYPE} | kubectl delete -f -
```

## Troubleshooting
Expand Down
3 changes: 2 additions & 1 deletion docs/mlx-workshop.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ For MLX on KIND we need to make the port available on localhost by running the
following command:

```Bash
kubectl port-forward svc/codenet-language-classification 5000:5000
kubectl wait --for=condition=ready pod -l app=codenet-language-classification && \
kubectl port-forward svc/codenet-language-classification 5000:5000
```

Now we should be able to access the UI page for the deployed model by pasting
Expand Down

0 comments on commit 6680f55

Please sign in to comment.