small fixes
This commit is contained in:
parent
b487ab06fb
commit
e10c73cb69
|
|
@ -11,6 +11,7 @@ install_minikube:
|
||||||
helm upgrade --install ai-starter-kit helm-chart/ai-starter-kit --set huggingface.token="your_hf_token" --timeout 10m -f helm-chart/ai-starter-kit/values-minikube.yaml
|
helm upgrade --install ai-starter-kit helm-chart/ai-starter-kit --set huggingface.token="your_hf_token" --timeout 10m -f helm-chart/ai-starter-kit/values-minikube.yaml
|
||||||
|
|
||||||
start:
|
start:
|
||||||
|
mkdir -p /tmp/models-cache
|
||||||
minikube start --cpus 4 --memory 15000 --mount --mount-string="/tmp/models-cache:/tmp/models-cache"
|
minikube start --cpus 4 --memory 15000 --mount --mount-string="/tmp/models-cache:/tmp/models-cache"
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,17 @@ jupyterhub:
|
||||||
name: jupyterhub/k8s-singleuser-sample
|
name: jupyterhub/k8s-singleuser-sample
|
||||||
tag: "4.2.0"
|
tag: "4.2.0"
|
||||||
initContainers:
|
initContainers:
|
||||||
|
# This init cntainer makes sure that home folder that we mount has correct owner
|
||||||
|
- name: chown-home-mount-dir
|
||||||
|
image: jupyterhub/k8s-singleuser-sample:4.2.0
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
|
command: ["chown", "jovyan", "/home/jovyan"]
|
||||||
|
volumeMounts:
|
||||||
|
- name: home
|
||||||
|
mountPath: /home/jovyan
|
||||||
|
subPath: admin
|
||||||
|
|
||||||
- name: model-initializer
|
- name: model-initializer
|
||||||
image: jupyterhub/k8s-singleuser-sample:4.2.0
|
image: jupyterhub/k8s-singleuser-sample:4.2.0
|
||||||
env:
|
env:
|
||||||
|
|
@ -71,9 +82,6 @@ jupyterhub:
|
||||||
- name: welcome-ipynb
|
- name: welcome-ipynb
|
||||||
configMap:
|
configMap:
|
||||||
name: "ai-starter-kit-welcome-ipynb"
|
name: "ai-starter-kit-welcome-ipynb"
|
||||||
- name: chat-bot-ipynb
|
|
||||||
configMap:
|
|
||||||
name: "ai-starter-kit-chat-bot-ipynb"
|
|
||||||
- name: hf-token-secret
|
- name: hf-token-secret
|
||||||
secret:
|
secret:
|
||||||
secretName: "ai-starter-kit-hf-token-secret"
|
secretName: "ai-starter-kit-hf-token-secret"
|
||||||
|
|
@ -85,9 +93,6 @@ jupyterhub:
|
||||||
- name: download-models-py
|
- name: download-models-py
|
||||||
mountPath: /tmp/download_models.py
|
mountPath: /tmp/download_models.py
|
||||||
subPath: download_models.py
|
subPath: download_models.py
|
||||||
- name: chat-bot-ipynb
|
|
||||||
mountPath: /tmp/chat_bot.ipynb
|
|
||||||
subPath: chat_bot.ipynb
|
|
||||||
# This environment variables list have its own format: https://z2jh.jupyter.org/en/latest/resources/reference.html#singleuser-extraenv
|
# This environment variables list have its own format: https://z2jh.jupyter.org/en/latest/resources/reference.html#singleuser-extraenv
|
||||||
extraEnv:
|
extraEnv:
|
||||||
HF_TOKEN:
|
HF_TOKEN:
|
||||||
|
|
|
||||||
|
|
@ -1,126 +1,113 @@
|
||||||
jupyterhub:
|
jupyterhub:
|
||||||
nameOverride: "jupyterhub"
|
nameOverride: "jupyterhub"
|
||||||
postgresql:
|
# This value has to be null in order apply release name on this chart's resources.
|
||||||
nameOverride: "jupyterhub-postgresql"
|
# https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/b4b51301ac886511c643cc5d428b15ff38006bee/jupyterhub/values.yaml#L1
|
||||||
enabled: true
|
fullnameOverride:
|
||||||
auth:
|
|
||||||
password: "changeme"
|
|
||||||
|
|
||||||
singleuser:
|
singleuser:
|
||||||
fsGid: 100
|
fsGid: 100
|
||||||
defaultUrl: "/lab/tree/welcome.ipynb"
|
defaultUrl: "/lab/tree/welcome.ipynb"
|
||||||
lifecycleHooks:
|
|
||||||
postStart: null
|
|
||||||
image:
|
image:
|
||||||
tag: "5.0.0-debian-12-r2"
|
name: jupyterhub/k8s-singleuser-sample
|
||||||
|
tag: "4.2.0"
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: model-initializer
|
- name: model-initializer
|
||||||
image: python:3.9-slim-bullseye
|
image: jupyterhub/k8s-singleuser-sample:4.2.0
|
||||||
env:
|
env:
|
||||||
- name: TRANSFORMERS_CACHE
|
- name: HF_TOKEN
|
||||||
value: /tmp/models-cache
|
valueFrom:
|
||||||
- name: HF_HOME
|
secretKeyRef:
|
||||||
value: /tmp/models-cache
|
name: ai-starter-kit-hf-token-secret
|
||||||
- name: TMPDIR
|
key: token
|
||||||
value: /tmp/models-cache
|
|
||||||
- name: PIP_CACHE_DIR
|
|
||||||
value: /tmp/models-cache
|
|
||||||
- name: PIP_NO_CACHE_DIR
|
|
||||||
value: "1"
|
|
||||||
- name: PYTHONUSERBASE
|
|
||||||
value: /tmp/models-cache
|
|
||||||
- name: PYTHONUNBUFFERED
|
|
||||||
value: "1"
|
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
set -e
|
set -e
|
||||||
pip install --user --no-cache-dir -r /tmp/requirements.txt
|
pip install -r /tmp/requirements.txt
|
||||||
pip install --user mlflow numpy tensorflow
|
|
||||||
python /tmp/download_models.py
|
python /tmp/download_models.py
|
||||||
|
|
||||||
|
# populate workspace with initial files
|
||||||
|
if [ ! -f /home/jovyan/welcome.ipynb ]; then
|
||||||
|
cp /tmp/welcome.ipynb /home/jovyan/welcome.ipynb
|
||||||
|
fi
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: requirements-txt
|
- name: requirements-txt
|
||||||
mountPath: /tmp/requirements.txt
|
mountPath: /tmp/requirements.txt
|
||||||
subPath: requirements.txt
|
subPath: requirements.txt
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- name: hf-download-script
|
# This 'home' volume is created by the helm chart's 'homeMountPath' option.
|
||||||
|
# We mount it to initContainer too, so all downloads and installations are persisted in this mounted home folder.
|
||||||
|
- name: home
|
||||||
|
mountPath: /home/jovyan
|
||||||
|
subPath: admin
|
||||||
|
- name: "download-models-py"
|
||||||
mountPath: /tmp/download_models.py
|
mountPath: /tmp/download_models.py
|
||||||
subPath: download_models.py
|
subPath: download_models.py
|
||||||
readOnly: true
|
readOnly: true
|
||||||
- name: hf-token-secret
|
- name: hf-token-secret
|
||||||
mountPath: "/etc/secrets/huggingface"
|
mountPath: "/etc/secrets/huggingface"
|
||||||
readOnly: true
|
readOnly: true
|
||||||
resources:
|
- name: welcome-ipynb
|
||||||
requests:
|
mountPath: "/tmp/welcome.ipynb"
|
||||||
cpu: "2"
|
subPath: welcome.ipynb
|
||||||
memory: 16Gi
|
readOnly: true
|
||||||
ephemeral-storage: 10Gi
|
|
||||||
limits:
|
|
||||||
cpu: "4"
|
|
||||||
memory: 32Gi
|
|
||||||
ephemeral-storage: 10Gi
|
|
||||||
extraVolumes:
|
|
||||||
- name: requirements-txt
|
|
||||||
configMap:
|
|
||||||
name: "{{ .Release.Name }}-requirements-txt"
|
|
||||||
- name: hf-download-script
|
|
||||||
configMap:
|
|
||||||
name: "{{ .Release.Name }}-hf-download-script"
|
|
||||||
- name: welcome-notebook
|
|
||||||
configMap:
|
|
||||||
name: "{{ .Release.Name }}-welcome-notebook"
|
|
||||||
- name: ray-notebook
|
|
||||||
configMap:
|
|
||||||
name: "{{ .Release.Name }}-ray-notebook"
|
|
||||||
- name: hf-token-secret
|
|
||||||
secret:
|
|
||||||
secretName: "{{ .Release.Name }}-hf-token-secret"
|
|
||||||
optional: true
|
|
||||||
extraVolumeMounts:
|
|
||||||
- name: requirements-txt
|
|
||||||
mountPath: /tmp/requirements.txt
|
|
||||||
subPath: requirements.txt
|
|
||||||
- name: hf-download-script
|
|
||||||
mountPath: /tmp/download_models.py
|
|
||||||
subPath: download_models.py
|
|
||||||
- name: welcome-notebook
|
|
||||||
mountPath: /tmp/welcome.ipynb
|
|
||||||
subPath: welcome.ipynb
|
|
||||||
- name: ray-notebook
|
|
||||||
mountPath: /tmp/ray.ipynb
|
|
||||||
subPath: ray.ipynb
|
|
||||||
- name: hf-token-secret
|
|
||||||
mountPath: "/etc/secrets/huggingface"
|
|
||||||
readOnly: true
|
|
||||||
extraEnvVars:
|
|
||||||
RAY_ADDRESS: "ray://{{ .Release.Name }}-kuberay-head-svc:10001"
|
|
||||||
MLFLOW_TRACKING_URI: "http://{{ .Release.Name }}-mlflow:5000"
|
|
||||||
HF_HOME: "/tmp/models-cache"
|
|
||||||
TRANSFORMERS_CACHE: "/tmp/models-cache/"
|
|
||||||
TMPDIR: "/tmp/models-cache/"
|
|
||||||
PIP_CACHE_DIR: "/tmp/models-cache/"
|
|
||||||
PYTHONUSERBASE: "/tmp/models-cache/"
|
|
||||||
PYTHONPATH: "/tmp/models-cache/lib/python3.9/site-packages"
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
memory: 32Gi
|
|
||||||
ephemeral-storage: 10Gi
|
|
||||||
requests:
|
|
||||||
memory: 16Gi
|
|
||||||
ephemeral-storage: 10Gi
|
|
||||||
hub:
|
|
||||||
password: "sneakypass"
|
|
||||||
extraEnvVars:
|
|
||||||
- name: "RAY_ADDRESS"
|
|
||||||
value: "{{ .Release.Name }}-kuberay-head-svc"
|
|
||||||
- name: "MLFLOW_TRACKING_URI"
|
|
||||||
value: "http://{{ .Release.Name }}-mlflow-tracking"
|
|
||||||
extraConfig:
|
|
||||||
00-spawner-timeouts: |
|
|
||||||
c.KubeSpawner.start_timeout = 1800
|
|
||||||
c.KubeSpawner.http_timeout = 60
|
|
||||||
|
|
||||||
|
storage:
|
||||||
|
type: static
|
||||||
|
static:
|
||||||
|
pvcName: "ai-starter-kit-models-cache-pvc"
|
||||||
|
subPath: "{username}"
|
||||||
|
capacity: 20Gi
|
||||||
|
homeMountPath: /home/jovyan
|
||||||
|
extraVolumes:
|
||||||
|
- name: requirements-txt
|
||||||
|
configMap:
|
||||||
|
name: "ai-starter-kit-requirements-txt"
|
||||||
|
- name: models-cache
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: "ai-starter-kit-models-cache-pvc"
|
||||||
|
- name: download-models-py
|
||||||
|
configMap:
|
||||||
|
name: "ai-starter-kit-download-models-py"
|
||||||
|
- name: welcome-ipynb
|
||||||
|
configMap:
|
||||||
|
name: "ai-starter-kit-welcome-ipynb"
|
||||||
|
- name: hf-token-secret
|
||||||
|
secret:
|
||||||
|
secretName: "ai-starter-kit-hf-token-secret"
|
||||||
|
optional: true
|
||||||
|
extraVolumeMounts:
|
||||||
|
- name: requirements-txt
|
||||||
|
mountPath: /tmp/requirements.txt
|
||||||
|
subPath: requirements.txt
|
||||||
|
- name: download-models-py
|
||||||
|
mountPath: /tmp/download_models.py
|
||||||
|
subPath: download_models.py
|
||||||
|
# This environment variables list have its own format: https://z2jh.jupyter.org/en/latest/resources/reference.html#singleuser-extraenv
|
||||||
|
extraEnv:
|
||||||
|
HF_TOKEN:
|
||||||
|
name: HF_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: ai-starter-kit-hf-token-secret
|
||||||
|
key: token
|
||||||
|
RAY_ADDRESS: "ai-starter-kit-kuberay-head-svc:6379"
|
||||||
|
MLFLOW_TRACKING_URI: "http://ai-starter-kit-mlflow-tracking"
|
||||||
|
hub:
|
||||||
|
db:
|
||||||
|
type: sqlite-pvc
|
||||||
|
pvc:
|
||||||
|
annotations:
|
||||||
|
# Without this helm will not keep the pvc after uninstallation
|
||||||
|
# https://github.com/jupyterhub/zero-to-jupyterhub-k8s/issues/3718
|
||||||
|
helm.sh/resource-policy: keep
|
||||||
|
extraConfig:
|
||||||
|
00-dummy-authenticator: |
|
||||||
|
c.DummyAuthenticator.password = "sneakypass"
|
||||||
|
01-spawner-timeouts: |
|
||||||
|
c.KubeSpawner.start_timeout = 1800
|
||||||
ray-cluster:
|
ray-cluster:
|
||||||
image:
|
image:
|
||||||
tag: 2.41.0-py311-gpu
|
tag: 2.41.0-py311-gpu
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue