Skip to content

Commit

Permalink
Set model-volume default to tmp volume (#293)
Browse files Browse the repository at this point in the history
Set default value for model-volume to tmp volume.
Change modelUsePV to modelUsePVC as this is PVC.
Make modelUsePVC high priority than modelUseHostPath.

Signed-off-by: Dolpher Du <[email protected]>
  • Loading branch information
yongfengdu authored Aug 13, 2024
1 parent c0d2ba6 commit b5c14cd
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 48 deletions.
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

0 comments on commit b5c14cd

Please sign in to comment.