diff --git a/helm-charts/common/speecht5/templates/deployment.yaml b/helm-charts/common/speecht5/templates/deployment.yaml index 475a99b8..dd718728 100644 --- a/helm-charts/common/speecht5/templates/deployment.yaml +++ b/helm-charts/common/speecht5/templates/deployment.yaml @@ -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 }} diff --git a/helm-charts/common/speecht5/values.yaml b/helm-charts/common/speecht5/values.yaml index 9e614f73..f6abcc0c 100644 --- a/helm-charts/common/speecht5/values.yaml +++ b/helm-charts/common/speecht5/values.yaml @@ -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: "" diff --git a/helm-charts/common/tei/templates/deployment.yaml b/helm-charts/common/tei/templates/deployment.yaml index cbb2e3ca..7467b9ab 100644 --- a/helm-charts/common/tei/templates/deployment.yaml +++ b/helm-charts/common/tei/templates/deployment.yaml @@ -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 }} diff --git a/helm-charts/common/tei/values.yaml b/helm-charts/common/tei/values.yaml index 9ce013fd..a9edda93 100644 --- a/helm-charts/common/tei/values.yaml +++ b/helm-charts/common/tei/values.yaml @@ -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: "" diff --git a/helm-charts/common/teirerank/templates/deployment.yaml b/helm-charts/common/teirerank/templates/deployment.yaml index 3a75f877..4a85b7fc 100644 --- a/helm-charts/common/teirerank/templates/deployment.yaml +++ b/helm-charts/common/teirerank/templates/deployment.yaml @@ -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 }} diff --git a/helm-charts/common/teirerank/values.yaml b/helm-charts/common/teirerank/values.yaml index 2b8e90fc..80a4cf73 100644 --- a/helm-charts/common/teirerank/values.yaml +++ b/helm-charts/common/teirerank/values.yaml @@ -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: "" diff --git a/helm-charts/common/tgi/templates/deployment.yaml b/helm-charts/common/tgi/templates/deployment.yaml index 9dea3dc1..2ef224b5 100644 --- a/helm-charts/common/tgi/templates/deployment.yaml +++ b/helm-charts/common/tgi/templates/deployment.yaml @@ -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 }} diff --git a/helm-charts/common/tgi/values.yaml b/helm-charts/common/tgi/values.yaml index 26893ecd..0222c75b 100644 --- a/helm-charts/common/tgi/values.yaml +++ b/helm-charts/common/tgi/values.yaml @@ -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: "" diff --git a/helm-charts/common/whisper/templates/deployment.yaml b/helm-charts/common/whisper/templates/deployment.yaml index 8a9c1a1f..1e1860ac 100644 --- a/helm-charts/common/whisper/templates/deployment.yaml +++ b/helm-charts/common/whisper/templates/deployment.yaml @@ -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 }} diff --git a/helm-charts/common/whisper/values.yaml b/helm-charts/common/whisper/values.yaml index 8c207fb8..2d72d886 100644 --- a/helm-charts/common/whisper/values.yaml +++ b/helm-charts/common/whisper/values.yaml @@ -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: "" diff --git a/helm-charts/update_manifests.sh b/helm-charts/update_manifests.sh index 8ff57c38..42ee9b5c 100755 --- a/helm-charts/update_manifests.sh +++ b/helm-charts/update_manifests.sh @@ -5,6 +5,7 @@ CUR_DIR=$(cd $(dirname "$0") && pwd) OUTPUTDIR=${CUR_DIR}/../microservices-connector/config/manifests +MODELPATH="/mnt/opea-models" # # generate_yaml @@ -18,7 +19,7 @@ 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) @@ -26,7 +27,7 @@ function generate_yaml { 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 } @@ -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