Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ cscope.*

/bazel-*
*.pyc

# Helm chart dependecies cache
**/Chart.lock
**/charts/*.tgz

# Helm chart output directory
ai/ai-starter-kit/out
70 changes: 70 additions & 0 deletions ai/ai-starter-kit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.PHONY: check_hf_token check_OCI_target package_helm lint dep_update install install_gke start uninstall push_helm

check_hf_token:
ifndef HF_TOKEN
$(error HF_TOKEN is not set)
endif

check_OCI_target:
ifndef OCI_HELM_TARGET
$(error OCI_HELM_TARGET is not set)
endif

package_helm:
helm package helm-chart/ai-starter-kit/ --destination out/

push_helm: check_OCI_target
helm push out/ai-starter-kit* oci://$$OCI_HELM_TARGET

lint:
helm lint helm-chart/ai-starter-kit

dep_update:
helm dependency update helm-chart/ai-starter-kit

install: check_hf_token
helm upgrade --install ai-starter-kit helm-chart/ai-starter-kit --set huggingface.token="$$HF_TOKEN" --timeout 10m -f helm-chart/ai-starter-kit/values.yaml

install_gke: check_hf_token
helm upgrade --install ai-starter-kit helm-chart/ai-starter-kit --set huggingface.token="$$HF_TOKEN" --timeout 10m -f helm-chart/ai-starter-kit/values-gke.yaml

install_gke_gpu: check_hf_token
helm upgrade --install ai-starter-kit helm-chart/ai-starter-kit --set huggingface.token="$$HF_TOKEN" --timeout 10m -f helm-chart/ai-starter-kit/values-gke-gpu.yaml

start:
mkdir -p /tmp/models-cache
minikube start --cpus 4 --memory 15000 --mount --mount-string="/tmp/models-cache:/tmp/models-cache"

start_gpu:
mkdir -p $HOME/models-cache
minikube start --driver krunkit --cpus 4 --memory 15000 --mount --mount-string="$HOME/models-cache:$HOME/models-cache"

uninstall:
helm uninstall ai-starter-kit
kubectl delete pod jupyter-user
kubectl delete pvc ai-starter-kit-jupyterhub-hub-db-dir

destroy:
minikube delete

validate_jupyterhub:
kubectl get pods; \
kubectl wait --for=condition=Ready pods -l 'component!=continuous-image-puller' --timeout=1800s; \
kubectl get pods; \
kubectl get services; \
kubectl port-forward service/ai-starter-kit-jupyterhub-proxy-public 8081:80 & \
PID=$$!; \
echo "Port-forward PID=$${PID}"; \
sleep 5s; \
python3 ./ci/test_hub.py "127.0.0.1:8081"; \
kill $$PID

validate_ray:
kubectl wait --for=condition=Ready pods -l 'app.kubernetes.io/created-by=kuberay-operator' --timeout=1800s; \
kubectl get pods; \
kubectl get services; \
kubectl port-forward service/ai-starter-kit-kuberay-head-svc 8265:8265 & \
PID=$$!; \
sleep 10s; \
ray job submit --address=http://127.0.0.1:8265 -- python -c "import ray; ray.init(); print(ray.cluster_resources())"; \
kill $$PID
23 changes: 23 additions & 0 deletions ai/ai-starter-kit/helm-chart/ai-starter-kit/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
45 changes: 45 additions & 0 deletions ai/ai-starter-kit/helm-chart/ai-starter-kit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: v2
name: ai-starter-kit
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.0"


dependencies:
- name: kuberay-operator
condition: ray-cluster.enabled
version: "1.3.0"
repository: "https://ray-project.github.io/kuberay-helm"
- condition: ray-cluster.enabled
name: ray-cluster
version: "1.3.0"
repository: "https://ray-project.github.io/kuberay-helm"
- name: jupyterhub
version: "4.2.0"
repository: "https://hub.jupyter.org/helm-chart/"
- name: mlflow
version: "0.12.0"
repository: "https://community-charts.github.io/helm-charts"
- name: ollama
condition: ollama.enabled
version: "1.27.0"
repository: "https://helm.otwld.com"
Loading