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

Set model-volume default to tmp volume #293

Merged
merged 1 commit into from
Aug 13, 2024
Merged
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
8 changes: 4 additions & 4 deletions helm-charts/common/speecht5/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: model-volume
{{- if .Values.global.modelUseHostPath }}
{{- if .Values.global.modelUsePVC }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePVC }}
{{- else if .Values.global.modelUseHostPath }}
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
13 changes: 8 additions & 5 deletions helm-charts/common/speecht5/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ global:
no_proxy: ""

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
# Set modelUseHostPath for local directory, this is good for one node test. Example:
# modelUseHostPath: /mnt/opea-models
# Set modelUsePVC for PersistentVolumeClaim(PVC), which is suitable for multinode deployment. Example:
# modelUsePVC: model-volume
# You can only set one of the following var, the behavior is not defined is both are set.
# By default, both var are set to empty, the model will be downloaded and saved to a tmp volume.
modelUseHostPath: ""
modelUsePVC: ""
8 changes: 4 additions & 4 deletions helm-charts/common/tei/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: model-volume
{{- if .Values.global.modelUseHostPath }}
{{- if .Values.global.modelUsePVC }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePVC }}
{{- else if .Values.global.modelUseHostPath }}
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
13 changes: 8 additions & 5 deletions helm-charts/common/tei/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ global:
no_proxy: ""

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
# Set modelUseHostPath for local directory, this is good for one node test. Example:
# modelUseHostPath: /mnt/opea-models
# Set modelUsePVC for PersistentVolumeClaim(PVC), which is suitable for multinode deployment. Example:
# modelUsePVC: model-volume
# You can only set one of the following var, the behavior is not defined is both are set.
# By default, both var are set to empty, the model will be downloaded and saved to a tmp volume.
modelUseHostPath: ""
modelUsePVC: ""
8 changes: 4 additions & 4 deletions helm-charts/common/teirerank/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: model-volume
{{- if .Values.global.modelUseHostPath }}
{{- if .Values.global.modelUsePVC }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePVC }}
{{- else if .Values.global.modelUseHostPath }}
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
13 changes: 8 additions & 5 deletions helm-charts/common/teirerank/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ global:
no_proxy: ""

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
# Set modelUseHostPath for local directory, this is good for one node test. Example:
# modelUseHostPath: /mnt/opea-models
# Set modelUsePVC for PersistentVolumeClaim(PVC), which is suitable for multinode deployment. Example:
# modelUsePVC: model-volume
# You can only set one of the following var, the behavior is not defined is both are set.
# By default, both var are set to empty, the model will be downloaded and saved to a tmp volume.
modelUseHostPath: ""
modelUsePVC: ""
8 changes: 4 additions & 4 deletions helm-charts/common/tgi/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: model-volume
{{- if .Values.global.modelUseHostPath }}
{{- if .Values.global.modelUsePVC }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePVC }}
{{- else if .Values.global.modelUseHostPath }}
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
13 changes: 8 additions & 5 deletions helm-charts/common/tgi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,11 @@ global:
HUGGINGFACEHUB_API_TOKEN: "insert-your-huggingface-token-here"

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
# Set modelUseHostPath for local directory, this is good for one node test. Example:
# modelUseHostPath: /mnt/opea-models
# Set modelUsePVC for PersistentVolumeClaim(PVC), which is suitable for multinode deployment. Example:
# modelUsePVC: model-volume
# You can only set one of the following var, the behavior is not defined is both are set.
# By default, both var are set to empty, the model will be downloaded and saved to a tmp volume.
modelUseHostPath: ""
modelUsePVC: ""
8 changes: 4 additions & 4 deletions helm-charts/common/whisper/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: model-volume
{{- if .Values.global.modelUseHostPath }}
{{- if .Values.global.modelUsePVC }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePVC }}
{{- else if .Values.global.modelUseHostPath }}
hostPath:
path: {{ .Values.global.modelUseHostPath }}
type: Directory
{{- else if .Values.global.modelUsePV }}
persistentVolumeClaim:
claimName: {{ .Values.global.modelUsePV }}
{{- else }}
emptyDir: {}
{{- end }}
Expand Down
13 changes: 8 additions & 5 deletions helm-charts/common/whisper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ global:
no_proxy: ""

# Choose where to save your downloaded models
# modelUseHostPath: Host directory path, this is good for one node test.
# modelUsePV: PersistentVolumeClaim(PVC) name, which is suitable for multinode deployment
# comment out both will not have model cache directory and download the model from huggingface.
modelUseHostPath: /mnt/opea-models
# modelUsePV: model-volume
# Set modelUseHostPath for local directory, this is good for one node test. Example:
# modelUseHostPath: /mnt/opea-models
# Set modelUsePVC for PersistentVolumeClaim(PVC), which is suitable for multinode deployment. Example:
# modelUsePVC: model-volume
# You can only set one of the following var, the behavior is not defined is both are set.
# By default, both var are set to empty, the model will be downloaded and saved to a tmp volume.
modelUseHostPath: ""
modelUsePVC: ""
7 changes: 4 additions & 3 deletions helm-charts/update_manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

CUR_DIR=$(cd $(dirname "$0") && pwd)
OUTPUTDIR=${CUR_DIR}/../microservices-connector/config/manifests
MODELPATH="/mnt/opea-models"

#
# generate_yaml <chart> <outputdir>
Expand All @@ -18,15 +19,15 @@ function generate_yaml {
extraparams="--set image.tag=latest"
fi

helm template $chart ./common/$chart --skip-tests --values ./common/$chart/values.yaml --set global.extraEnvConfig=extra-env-config,noProbe=true $extraparams > ${outputdir}/$chart.yaml
helm template $chart ./common/$chart --skip-tests --values ./common/$chart/values.yaml --set global.extraEnvConfig=extra-env-config,global.modelUseHostPath=$MODELPATH,noProbe=true $extraparams > ${outputdir}/$chart.yaml

for f in `ls ./common/$chart/*-values.yaml 2>/dev/null `; do
ext=$(basename $f | cut -d'-' -f1)
extraparams=""
if [[ $(grep -c 'tag: ""' $f) != 0 ]]; then
extraparams="--set image.tag=latest"
fi
helm template $chart ./common/$chart --skip-tests --values ${f} --set global.extraEnvConfig=extra-env-config,noProbe=true $extraparams > ${outputdir}/${chart}_${ext}.yaml
helm template $chart ./common/$chart --skip-tests --values ${f} --set global.extraEnvConfig=extra-env-config,global.modelUseHostPath=$MODELPATH,noProbe=true $extraparams > ${outputdir}/${chart}_${ext}.yaml
done
}

Expand All @@ -42,4 +43,4 @@ done

# we need special version of docsum-llm-uservice
echo "Update manifest for docsum-llm-uservice..."
helm template docsum ./common/llm-uservice --skip-tests --set global.extraEnvConfig=extra-env-config,noProbe=true,image.repository=opea/llm-docsum-tgi,image.tag=latest> ${OUTPUTDIR}/docsum-llm-uservice.yaml
helm template docsum ./common/llm-uservice --skip-tests --set global.extraEnvConfig=extra-env-config,global.modelUseHostPath=$MODELPATH,noProbe=true,image.repository=opea/llm-docsum-tgi,image.tag=latest> ${OUTPUTDIR}/docsum-llm-uservice.yaml