Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for KIND deployment #266

Merged

Conversation

ckadner
Copy link
Member

@ckadner ckadner commented Nov 28, 2021

Add first draft document for deploying MLX on KIND (Kubernetes in Docker).

https://github.com/ckadner/mlx/blob/add_kind_deployment_doc/docs/install-mlx-on-kind.md


Deploy MLX on KIND

Kubernetes in Docker (KIND) provides an easy way to deploy MLX locally including
Kubeflow Pipelines which makes it possible to run generated sample pipelines for
any of the registered MLX assets.

Installation

Install Required CLIs (macOS)

After installing Docker and Homebrew (linked above) you can install the kind,
kustomize, and kubectl CLIs with brew install. For Windows and Linux follow
the respective home pages for installation instructions.

brew install kind
kind --version

brew install kubectl
kubectl version --client

brew install kustomize
kustomize version

Note: We successfully tested this KIND deployment with the latest version of kustomize v4.4.0.
However, there have been issues in the past with versions later then v3.2.0. To be on the safe side
you could download the kustomize v3.2.0 binary as described
here

Docker Resources

Increase the default resources for Docker:

  • CPUs: 4 Cores
  • Memory: 8 GB RAM
  • Disk: 32+ GB

Note: We found that on older laptops, like a 2016 15 in MacBook Pro (2.7 GHz i7, 16 GB) the MLX
deployment on KIND may require to give all available resources to the Docker daemon in order to be
able to deploy the manifests and run basic pipelines. Even then, trying to run notebooks or deploying
a model, will cause the laptop to get very slow with fans running full throttle. It may even cause
other application to crash.

Create KIND Cluster

kind create cluster --name mlx
kubectl cluster-info --context kind-mlx
kubectl get pods --all-namespaces

Deploy MLX (Single-User)

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

# run the below command two times if the CRDs take too long to provision.
while ! kustomize build mlx-single-kind | \
  kubectl apply -f -; do echo "Retrying to apply resources"; sleep 10; done

# check pod status
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

Now paste the URL http://localhost:3000/ into your browser and proceed to
import the MLX catalog.

Delete the mlx cluster when it is no longer needed:

kind delete cluster --name mlx

Install Kubeflow Pipelines (for reference, optional)

kind create cluster --name kfp
kubectl cluster-info --context kind-kfp

# env/platform-agnostic-pns hasn't been publically released, so you will install it from master
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 pods --all-namespaces

# make the Kubeflow Pipelines UI available on http://localhost:8080/#/pipelines
kubectl port-forward -n kubeflow svc/ml-pipeline-ui 8080:80

kind delete cluster --name kfp

@Tomcli @yhwang

@mlx-bot
Copy link
Collaborator

mlx-bot commented Nov 28, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ckadner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ckadner ckadner linked an issue Nov 28, 2021 that may be closed by this pull request
@Tomcli
Copy link
Member

Tomcli commented Nov 29, 2021

I have the 2016 15 inch macbook pro. Here are my spec
2.7 GHz Quad-Core Intel Core i7
16 GB 2133 MHz LPDDR3

By giving all my resources to the Docker daemon, I'm able to deploy the manifests and run basic pipelines. However, if I try to run notebooks or after the model is deployed, my laptop will get very slow and loud to a point that start to crash my apps.

@ckadner
Copy link
Member Author

ckadner commented Nov 29, 2021

Thanks @Tomcli @yhwang -- I updated the doc with your comments

Signed-off-by: Christian Kadner <[email protected]>
brew install kubectl
kubectl version --client

brew install kustomize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need kustomize 3.2 for this manifest. Can you point to the kustomize instruction like the one on ibm kubeflow?
https://www.kubeflow.org/docs/distributions/ibm/deploy/deployment-process/#kubeflow-installation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this para:

Note: We successfully tested this KIND deployment with the latest version of kustomize v4.4.0.
However, there have been issues in the past with versions later then v3.2.0. To be on the safe side
you could download the kustomize v3.2.0 binary as described
here

@@ -67,7 +67,7 @@ git clone https://github.com/IBM/manifests -b v1.4.0-mlx
cd manifests

# run the below command two times if the CRDs take too long to provision.
while ! kustomize build mlx-single | \
while ! kustomize build mlx-single-kind | \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yhwang and @Tomcli for the manifest updates

@ckadner
Copy link
Member Author

ckadner commented Dec 2, 2021

@yhwang @Tomcli -- I think the install-mlx-on-kind.md is ready to be merged, unless you have further change requests.

We can improve it in follow up PRs, like coming up with a better alternative to the port-forwarding:

Instead of:

kubectl port-forward -n istio-system svc/istio-ingressgateway 3000:80

Use a kind cluster configuration like this

apiVersion: kind.x-k8s.io/v1alpha4
kind: Cluster
nodes:
- role: control-plane
  extraPortMappings:
  - containerPort: 3000
    hostPort: 80
- role: worker

@ckadner ckadner changed the title [WIP] Add docs for KIND deployment Add docs for KIND deployment Dec 2, 2021
@ckadner ckadner requested a review from Tomcli December 2, 2021 19:52
@ckadner
Copy link
Member Author

ckadner commented Dec 2, 2021

@phu since you got the most powerful laptop in the team now, would you mind giving this KIND deployment a spin and let us know your feedback? Deployment takes about 20 minutes on older machines. I am curious what deployment times you'll get :-) Thanks!

@Tomcli
Copy link
Member

Tomcli commented Dec 2, 2021

/lgtm

@mlx-bot mlx-bot added the lgtm label Dec 2, 2021
@mlx-bot mlx-bot merged commit 680e34b into machine-learning-exchange:main Dec 2, 2021
ckadner added a commit to ckadner/mlx that referenced this pull request Dec 5, 2021
* Add link to KIND deployment doc
* Update the script that checks for broken links
* Fix broken links in usage steps and API README
* Update the resource requirements for KIND
* Add a deployment wait-loop for KIND
* Update the import assets documentation

Related machine-learning-exchange#266

Signed-off-by: Christian Kadner <[email protected]>
mlx-bot pushed a commit that referenced this pull request Dec 6, 2021
* Add link to KIND deployment doc
* Update the script that checks for broken links
* Fix broken links in usage steps and API README
* Update the resource requirements for KIND
* Add a deployment wait-loop for KIND
* Update the import assets documentation

Related #266

Signed-off-by: Christian Kadner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create KIND deployment option for MLX including KFP
3 participants