From 131861f25e32cfeef7a3eb5268089cce1f3418ea Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 9 Oct 2024 14:40:02 +0800 Subject: [PATCH 01/28] Optimize path and link validity check. (#462) * Optimize path and link validity check. Signed-off-by: ZePan110 * debug Signed-off-by: ZePan110 * debug2 Signed-off-by: ZePan110 * Fix issue Signed-off-by: ZePan110 * Remove debug output Signed-off-by: ZePan110 * test Signed-off-by: ZePan110 * Fix issue. Signed-off-by: ZePan110 * Fix issue Signed-off-by: ZePan110 * Restore test file Signed-off-by: ZePan110 --------- Signed-off-by: ZePan110 Signed-off-by: Krishna Murti --- .github/workflows/pr-path-detection.yml | 87 +++++++----- helm-charts/common/data-prep/Chart.yaml | 4 + .../common/data-prep/templates/configmap.yaml | 12 +- .../data-prep/templates/deployment.yaml | 8 +- .../common/data-prep/templates/service.yaml | 2 +- helm-charts/common/data-prep/values.yaml | 3 +- helm-charts/common/data-prep/vdms-values.yaml | 16 +++ .../embedding-usvc/templates/deployment.yaml | 2 +- .../embedding-usvc/templates/service.yaml | 2 +- helm-charts/common/embedding-usvc/values.yaml | 1 + .../common/embedding-usvc/vdms-values.yaml | 8 ++ .../reranking-usvc/templates/configmap.yaml | 9 ++ .../reranking-usvc/templates/deployment.yaml | 2 +- .../reranking-usvc/templates/service.yaml | 2 +- helm-charts/common/reranking-usvc/values.yaml | 1 + .../common/reranking-usvc/vdms-valaues.yaml | 12 ++ helm-charts/common/retriever-usvc/Chart.yaml | 4 + .../retriever-usvc/templates/configmap.yaml | 17 ++- .../retriever-usvc/templates/deployment.yaml | 8 +- .../retriever-usvc/templates/service.yaml | 2 +- helm-charts/common/retriever-usvc/values.yaml | 3 +- .../common/retriever-usvc/vdms-values.yaml | 17 +++ .../common/ui/templates/configmap.yaml | 6 + helm-charts/common/ui/videoqna-values.yaml | 14 ++ helm-charts/common/vdms-vector-db/.helmignore | 23 ++++ helm-charts/common/vdms-vector-db/Chart.yaml | 9 ++ .../vdms-vector-db/templates/_helpers.tpl | 62 +++++++++ .../vdms-vector-db/templates/deployment.yaml | 70 ++++++++++ .../vdms-vector-db/templates/service.yaml | 18 +++ .../templates/tests/test-connection.yaml | 18 +++ helm-charts/common/vdms-vector-db/values.yaml | 61 +++++++++ helm-charts/videoqna/.helmignore | 23 ++++ helm-charts/videoqna/Chart.yaml | 37 +++++ helm-charts/videoqna/templates/NOTES.txt | 22 +++ helm-charts/videoqna/templates/_helpers.tpl | 62 +++++++++ .../videoqna/templates/deployment.yaml | 71 ++++++++++ helm-charts/videoqna/templates/hpa.yaml | 35 +++++ helm-charts/videoqna/templates/ingress.yaml | 46 +++++++ helm-charts/videoqna/templates/service.yaml | 18 +++ .../videoqna/templates/serviceaccount.yaml | 16 +++ .../templates/tests/test-connection.yaml | 18 +++ helm-charts/videoqna/values.yaml | 126 ++++++++++++++++++ 42 files changed, 926 insertions(+), 51 deletions(-) create mode 100644 helm-charts/common/data-prep/vdms-values.yaml create mode 100644 helm-charts/common/embedding-usvc/vdms-values.yaml create mode 100644 helm-charts/common/reranking-usvc/vdms-valaues.yaml create mode 100644 helm-charts/common/retriever-usvc/vdms-values.yaml create mode 100644 helm-charts/common/ui/videoqna-values.yaml create mode 100644 helm-charts/common/vdms-vector-db/.helmignore create mode 100644 helm-charts/common/vdms-vector-db/Chart.yaml create mode 100644 helm-charts/common/vdms-vector-db/templates/_helpers.tpl create mode 100644 helm-charts/common/vdms-vector-db/templates/deployment.yaml create mode 100644 helm-charts/common/vdms-vector-db/templates/service.yaml create mode 100644 helm-charts/common/vdms-vector-db/templates/tests/test-connection.yaml create mode 100644 helm-charts/common/vdms-vector-db/values.yaml create mode 100644 helm-charts/videoqna/.helmignore create mode 100644 helm-charts/videoqna/Chart.yaml create mode 100644 helm-charts/videoqna/templates/NOTES.txt create mode 100644 helm-charts/videoqna/templates/_helpers.tpl create mode 100644 helm-charts/videoqna/templates/deployment.yaml create mode 100644 helm-charts/videoqna/templates/hpa.yaml create mode 100644 helm-charts/videoqna/templates/ingress.yaml create mode 100644 helm-charts/videoqna/templates/service.yaml create mode 100644 helm-charts/videoqna/templates/serviceaccount.yaml create mode 100644 helm-charts/videoqna/templates/tests/test-connection.yaml create mode 100644 helm-charts/videoqna/values.yaml diff --git a/.github/workflows/pr-path-detection.yml b/.github/workflows/pr-path-detection.yml index 408a84461..9d43d0e90 100644 --- a/.github/workflows/pr-path-detection.yml +++ b/.github/workflows/pr-path-detection.yml @@ -17,28 +17,38 @@ jobs: - name: Checkout Repo GenAIInfra uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Check the Validity of Hyperlinks run: | cd ${{github.workspace}} fail="FALSE" - url_lines=$(grep -Eo '\]\(http[s]?://[^)]+\)' --include='*.md' -r .|grep -Ev 'GenAIEval/blob/main') - if [ -n "$url_lines" ]; then - for url_line in $url_lines; do - url=$(echo "$url_line"|cut -d '(' -f2 | cut -d ')' -f1|sed 's/\.git$//') - path=$(echo "$url_line"|cut -d':' -f1 | cut -d'/' -f2-) - response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url") - if [ "$response" -ne 200 ]; then - echo "**********Validation failed, try again**********" - response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url") - if [ "$response_retry" -eq 200 ]; then - echo "*****Retry successfully*****" - else - echo "Invalid link from ${{github.workspace}}/$path: $url" - fail="TRUE" - fi + merged_commit=$(git log -1 --format='%H') + changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')" + if [ -n "changed_files" ]; then + for changed_file in $changed_files; do + url_lines=$(grep -H -Eo '\]\(http[s]?://[^)]+\)' "$changed_file" | grep -Ev 'GenAIEval/blob/main') + if [ -n "$url_lines" ]; then + for url_line in $url_lines; do + url=$(echo "$url_line"|cut -d '(' -f2 | cut -d ')' -f1|sed 's/\.git$//') + path=$(echo "$url_line"|cut -d':' -f1 | cut -d'/' -f2-) + response=$(curl -L -s -o /dev/null -w "%{http_code}" "$url") + if [ "$response" -ne 200 ]; then + echo "**********Validation failed, try again**********" + response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url") + if [ "$response_retry" -eq 200 ]; then + echo "*****Retry successful*****" + else + echo "Invalid link from ${{github.workspace}}/$path: $url" + fail="TRUE" + fi + fi + done fi done + else + echo "No changed .md file." fi if [[ "$fail" == "TRUE" ]]; then @@ -56,6 +66,8 @@ jobs: - name: Checkout Repo GenAIInfra uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Checking Relative Path Validity run: | @@ -69,33 +81,33 @@ jobs: branch="https://github.com/opea-project/GenAIInfra/blob/${{ github.event.pull_request.head.ref }}" fi link_head="https://github.com/opea-project/GenAIInfra/blob/main" + + merged_commit=$(git log -1 --format='%H') + changed_files="$(git diff --name-status --diff-filter=ARM ${{ github.event.pull_request.base.sha }} ${merged_commit} | awk '/\.md$/ {print $NF}')" png_lines=$(grep -Eo '\]\([^)]+\)' --include='*.md' -r .|grep -Ev 'http') if [ -n "$png_lines" ]; then for png_line in $png_lines; do refer_path=$(echo "$png_line"|cut -d':' -f1 | cut -d'/' -f2-) png_path=$(echo "$png_line"|cut -d '(' -f2 | cut -d ')' -f1) if [[ "${png_path:0:1}" == "/" ]]; then - check_path=${{github.workspace}}$png_path - elif [[ "${png_path:0:1}" == "#" ]]; then - check_path=${{github.workspace}}/$refer_path$png_path + check_path=$png_path + elif [[ "$png_path" == *#* ]]; then + relative_path=$(echo "$png_path" | cut -d '#' -f1) + if [ -n "$relative_path" ]; then + check_path=$(dirname "$refer_path")/$relative_path + png_path=$(echo "$png_path" | awk -F'#' '{print "#" $2}') + else + check_path=$refer_path + fi else - check_path=${{github.workspace}}/$(dirname "$refer_path")/$png_path + check_path=$(dirname "$refer_path")/$png_path fi - real_path=$(realpath $check_path) - if [ $? -ne 0 ]; then - echo "Path $png_path in file ${{github.workspace}}/$refer_path does not exist" - fail="TRUE" - else - url=$link_head$(echo "$real_path" | sed 's|.*/GenAIInfra||') - response=$(curl -I -L -s -o /dev/null -w "%{http_code}" "$url") - if [ "$response" -ne 200 ]; then - echo "**********Validation failed, try again**********" - response_retry=$(curl -s -o /dev/null -w "%{http_code}" "$url") - if [ "$response_retry" -eq 200 ]; then - echo "*****Retry successfully*****" - else - echo "Retry failed. Check branch ${{ github.event.pull_request.head.ref }}" - url_dev=$branch$(echo "$real_path" | sed 's|.*/GenAIInfra||') + + if [ -e "$check_path" ]; then + real_path=$(realpath $check_path) + if [[ "$png_line" == *#* ]]; then + if [ -n "changed_files" ] && echo "$changed_files" | grep -q "^${refer_path}$"; then + url_dev=$branch$(echo "$real_path" | sed 's|.*/GenAIComps||')$png_path response=$(curl -I -L -s -o /dev/null -w "%{http_code}" "$url_dev") if [ "$response" -ne 200 ]; then echo "**********Validation failed, try again**********" @@ -103,14 +115,17 @@ jobs: if [ "$response_retry" -eq 200 ]; then echo "*****Retry successfully*****" else - echo "Invalid path from ${{github.workspace}}/$refer_path: $png_path" + echo "Invalid path from ${{github.workspace}}/$refer_path: $png_path, link: $url_dev" fail="TRUE" fi else - echo "Check branch ${{ github.event.pull_request.head.ref }} successfully." + echo "Validation succeed $png_line" fi fi fi + else + echo "$check_path does not exist" + fail="TRUE" fi done fi diff --git a/helm-charts/common/data-prep/Chart.yaml b/helm-charts/common/data-prep/Chart.yaml index a001cda9a..111fb99d0 100644 --- a/helm-charts/common/data-prep/Chart.yaml +++ b/helm-charts/common/data-prep/Chart.yaml @@ -17,3 +17,7 @@ dependencies: version: 1.0.0 repository: file://../redis-vector-db condition: autodependency.enabled + - name: vdms-vector-db + version: 1.0.0 + repository: file://../vdms-vector-db + condition: autodependency.vdms diff --git a/helm-charts/common/data-prep/templates/configmap.yaml b/helm-charts/common/data-prep/templates/configmap.yaml index 84b26d634..43035aed6 100644 --- a/helm-charts/common/data-prep/templates/configmap.yaml +++ b/helm-charts/common/data-prep/templates/configmap.yaml @@ -8,6 +8,14 @@ metadata: labels: {{- include "data-prep.labels" . | nindent 4 }} data: + {{- if .Values.vdmsHost }} + VDMS_HOST: {{ .Values.vdmsHost | quote }} + {{- else }} + VDMS_HOST: "{{ .Release.Name }}-vdms-vector-db" + {{- end }} + {{- if .Values.vdmsPort }} + VDMS_PORT: {{ .Values.vdmsPort | quote }} + {{- end }} {{- if .Values.TEI_EMBEDDING_ENDPOINT }} TEI_ENDPOINT: {{ .Values.TEI_EMBEDDING_ENDPOINT | quote}} {{- else if not .Values.EMBED_MODEL }} @@ -19,7 +27,7 @@ data: {{- else }} REDIS_URL: "redis://{{ .Release.Name }}-redis-vector-db:6379" {{- end }} - INDEX_NAME: {{ .Values.INDEX_NAME | quote }} + INDEX_NAME: {{ .Values.indexName | quote }} KEY_INDEX_NAME: {{ .Values.KEY_INDEX_NAME | quote }} SEARCH_BATCH_SIZE: {{ .Values.SEARCH_BATCH_SIZE | quote }} HUGGINGFACEHUB_API_TOKEN: {{ .Values.global.HUGGINGFACEHUB_API_TOKEN | quote}} @@ -30,7 +38,7 @@ data: http_proxy: {{ .Values.global.http_proxy | quote }} https_proxy: {{ .Values.global.https_proxy | quote }} {{- if and (not .Values.REDIS_URL) (and (not .Values.TEI_EMBEDDING_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy)) }} - no_proxy: "{{ .Release.Name }}-tei,{{ .Release.Name }}-redis-vector-db,{{ .Values.global.no_proxy }}" + no_proxy: "{{ .Release.Name }}-tei,{{ .Release.Name }}-redis-vector-db,{{ .Release.Name }}-vdms-vector-db,{{ .Values.global.no_proxy }}" {{- else }} no_proxy: {{ .Values.global.no_proxy | quote }} {{- end }} diff --git a/helm-charts/common/data-prep/templates/deployment.yaml b/helm-charts/common/data-prep/templates/deployment.yaml index 39099732b..7744aa0a3 100644 --- a/helm-charts/common/data-prep/templates/deployment.yaml +++ b/helm-charts/common/data-prep/templates/deployment.yaml @@ -41,9 +41,15 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.entryCommand }} + command: {{ .Values.entryCommand }} + args: + - "-c" + - "sleep 15 && python ingest_videos.py" + {{- end }} ports: - name: data-prep - containerPort: 6007 + containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: - mountPath: /tmp diff --git a/helm-charts/common/data-prep/templates/service.yaml b/helm-charts/common/data-prep/templates/service.yaml index 7b8ab7dfc..793ba2ae4 100644 --- a/helm-charts/common/data-prep/templates/service.yaml +++ b/helm-charts/common/data-prep/templates/service.yaml @@ -11,7 +11,7 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: 6007 + targetPort: {{ .Values.service.containerPort }} protocol: TCP name: data-prep selector: diff --git a/helm-charts/common/data-prep/values.yaml b/helm-charts/common/data-prep/values.yaml index a18b68f2e..eb14453ab 100644 --- a/helm-charts/common/data-prep/values.yaml +++ b/helm-charts/common/data-prep/values.yaml @@ -39,6 +39,7 @@ securityContext: service: type: ClusterIP port: 6007 + containerPort: 6007 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious @@ -91,7 +92,7 @@ EMBED_MODEL: "" # redis DB service URL, e.g. redis://: REDIS_URL: "" -INDEX_NAME: "rag-redis" +indexName: "rag-redis" KEY_INDEX_NAME: "file-keys" SEARCH_BATCH_SIZE: 10 diff --git a/helm-charts/common/data-prep/vdms-values.yaml b/helm-charts/common/data-prep/vdms-values.yaml new file mode 100644 index 000000000..a996592bd --- /dev/null +++ b/helm-charts/common/data-prep/vdms-values.yaml @@ -0,0 +1,16 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +autodependency: + vdms: false + +image: + repository: opea/dataprep-multimodal-vdm + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +indexName: "mega-videoqna" +vdmsHost: "" +vdmsPort: "8001" +entryCommand: ["/bin/sh"] diff --git a/helm-charts/common/embedding-usvc/templates/deployment.yaml b/helm-charts/common/embedding-usvc/templates/deployment.yaml index 2fff1e6d5..33de4066d 100644 --- a/helm-charts/common/embedding-usvc/templates/deployment.yaml +++ b/helm-charts/common/embedding-usvc/templates/deployment.yaml @@ -43,7 +43,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: embedding-usvc - containerPort: 6000 + containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: - mountPath: /tmp diff --git a/helm-charts/common/embedding-usvc/templates/service.yaml b/helm-charts/common/embedding-usvc/templates/service.yaml index 2aff873f2..2614b270d 100644 --- a/helm-charts/common/embedding-usvc/templates/service.yaml +++ b/helm-charts/common/embedding-usvc/templates/service.yaml @@ -11,7 +11,7 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: 6000 + targetPort: {{ .Values.service.containerPort }} protocol: TCP name: embedding-usvc selector: diff --git a/helm-charts/common/embedding-usvc/values.yaml b/helm-charts/common/embedding-usvc/values.yaml index dfab98260..e4d2e5ce2 100644 --- a/helm-charts/common/embedding-usvc/values.yaml +++ b/helm-charts/common/embedding-usvc/values.yaml @@ -45,6 +45,7 @@ service: type: ClusterIP # The default port for embedding service is 9000 port: 6000 + containerPort: 6000 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/helm-charts/common/embedding-usvc/vdms-values.yaml b/helm-charts/common/embedding-usvc/vdms-values.yaml new file mode 100644 index 000000000..8ec573a68 --- /dev/null +++ b/helm-charts/common/embedding-usvc/vdms-values.yaml @@ -0,0 +1,8 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +image: + repository: opea/embedding-multimodal-clip + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" diff --git a/helm-charts/common/reranking-usvc/templates/configmap.yaml b/helm-charts/common/reranking-usvc/templates/configmap.yaml index 69b1fcd91..133f060b0 100644 --- a/helm-charts/common/reranking-usvc/templates/configmap.yaml +++ b/helm-charts/common/reranking-usvc/templates/configmap.yaml @@ -8,6 +8,15 @@ metadata: labels: {{- include "reranking-usvc.labels" . | nindent 4 }} data: + {{- if .Values.chunkDuration }} + CHUNK_DURATION: {{ .Values.chunkDuration | quote }} + {{- end }} + {{- if .Values.fileServerEndpoint }} + FILE_SERVER_ENDPOINT: {{ .Values.fileServerEndpoint | quote }} + {{- end }} + {{- if .Values.getVideoListEndpoint }} + DATAPREP_GET_VIDEO_LIST_ENDPOINT: {{ .Values.getVideoListEndpoint | quote }} + {{- end }} {{- if .Values.TEI_RERANKING_ENDPOINT }} TEI_RERANKING_ENDPOINT: {{ .Values.TEI_RERANKING_ENDPOINT | quote }} {{- else }} diff --git a/helm-charts/common/reranking-usvc/templates/deployment.yaml b/helm-charts/common/reranking-usvc/templates/deployment.yaml index 319026554..e329f29d2 100644 --- a/helm-charts/common/reranking-usvc/templates/deployment.yaml +++ b/helm-charts/common/reranking-usvc/templates/deployment.yaml @@ -43,7 +43,7 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: reranking-usvc - containerPort: 8000 + containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: - mountPath: /tmp diff --git a/helm-charts/common/reranking-usvc/templates/service.yaml b/helm-charts/common/reranking-usvc/templates/service.yaml index 2b1bb7afa..4abca325d 100644 --- a/helm-charts/common/reranking-usvc/templates/service.yaml +++ b/helm-charts/common/reranking-usvc/templates/service.yaml @@ -11,7 +11,7 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: 8000 + targetPort: {{ .Values.service.containerPort }} protocol: TCP name: reranking-usvc selector: diff --git a/helm-charts/common/reranking-usvc/values.yaml b/helm-charts/common/reranking-usvc/values.yaml index 56454d11b..7daaf08ae 100644 --- a/helm-charts/common/reranking-usvc/values.yaml +++ b/helm-charts/common/reranking-usvc/values.yaml @@ -45,6 +45,7 @@ service: type: ClusterIP # The default port for reranking service is 9000 port: 8000 + containerPort: 8000 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/helm-charts/common/reranking-usvc/vdms-valaues.yaml b/helm-charts/common/reranking-usvc/vdms-valaues.yaml new file mode 100644 index 000000000..5c6a70c3c --- /dev/null +++ b/helm-charts/common/reranking-usvc/vdms-valaues.yaml @@ -0,0 +1,12 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +image: + repository: opea/reranking-videoqna + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +chunkDuration: "" +fileServerEndpoint: "/v1/dataprep/get_file" +getVideoListEndpoint: "/v1/dataprep/get_videos" diff --git a/helm-charts/common/retriever-usvc/Chart.yaml b/helm-charts/common/retriever-usvc/Chart.yaml index 020eb26c2..31f0f86cf 100644 --- a/helm-charts/common/retriever-usvc/Chart.yaml +++ b/helm-charts/common/retriever-usvc/Chart.yaml @@ -17,3 +17,7 @@ dependencies: version: 1.0.0 repository: file://../redis-vector-db condition: autodependency.enabled + - name: vdms-vector-db + version: 1.0.0 + repository: file://../vdms-vector-db + condition: autodependency.vdms diff --git a/helm-charts/common/retriever-usvc/templates/configmap.yaml b/helm-charts/common/retriever-usvc/templates/configmap.yaml index 39a4271a8..45b1889c8 100644 --- a/helm-charts/common/retriever-usvc/templates/configmap.yaml +++ b/helm-charts/common/retriever-usvc/templates/configmap.yaml @@ -8,6 +8,17 @@ metadata: labels: {{- include "retriever-usvc.labels" . | nindent 4 }} data: + {{- if .Values.vdmsHost }} + VDMS_HOST: {{ .Values.vdmsHost | quote }} + {{- else }} + VDMS_HOST: "{{ .Release.Name }}-vdms-vector-db" + {{- end }} + {{- if .Values.vdmsPort }} + VDMS_PORT: {{ .Values.vdmsPort | quote }} + {{- end }} + {{- if .Values.useClip }} + USECLIP: {{ .Values.useClip | quote }} + {{- end }} {{- if .Values.TEI_EMBEDDING_ENDPOINT }} TEI_EMBEDDING_ENDPOINT: {{ .Values.TEI_EMBEDDING_ENDPOINT | quote }} {{- else if not .Values.EMBED_MODEL }} @@ -15,16 +26,16 @@ data: {{- end }} EMBED_MODEL: {{ .Values.EMBED_MODEL | quote }} {{- if .Values.REDIS_URL }} - REDIS_URL: {{ .Values.REDIS_URL | quote}} + REDIS_URL: {{ .Values.REDIS_URL | quote }} {{- else }} REDIS_URL: "redis://{{ .Release.Name }}-redis-vector-db:6379" {{- end }} - INDEX_NAME: {{ .Values.INDEX_NAME | quote }} + INDEX_NAME: {{ .Values.indexName | quote }} EASYOCR_MODULE_PATH: "/tmp/.EasyOCR" http_proxy: {{ .Values.global.http_proxy | quote }} https_proxy: {{ .Values.global.https_proxy | quote }} {{- if and (not .Values.REDIS_URL) (and (not .Values.TEI_EMBEDDING_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy)) }} - no_proxy: "{{ .Release.Name }}-tei,{{ .Release.Name }}-redis-vector-db,{{ .Values.global.no_proxy }}" + no_proxy: "{{ .Release.Name }}-tei,{{ .Release.Name }}-redis-vector-db,{{ .Release.Name }}-vdms-vector-db,{{ .Values.global.no_proxy }}" {{- else }} no_proxy: {{ .Values.global.no_proxy | quote }} {{- end }} diff --git a/helm-charts/common/retriever-usvc/templates/deployment.yaml b/helm-charts/common/retriever-usvc/templates/deployment.yaml index e4f2483b1..7e59c61ad 100644 --- a/helm-charts/common/retriever-usvc/templates/deployment.yaml +++ b/helm-charts/common/retriever-usvc/templates/deployment.yaml @@ -41,9 +41,15 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.entryCommand }} + command: {{ .Values.entryCommand }} + args: + - "-c" + - "sleep 30 && python retriever_vdms.py" + {{- end }} ports: - name: retriever-usvc - containerPort: 7000 + containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: - mountPath: /tmp diff --git a/helm-charts/common/retriever-usvc/templates/service.yaml b/helm-charts/common/retriever-usvc/templates/service.yaml index 8f9804a05..e6cf33d3d 100644 --- a/helm-charts/common/retriever-usvc/templates/service.yaml +++ b/helm-charts/common/retriever-usvc/templates/service.yaml @@ -11,7 +11,7 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: 7000 + targetPort: {{ .Values.service.containerPort }} protocol: TCP name: retriever-usvc selector: diff --git a/helm-charts/common/retriever-usvc/values.yaml b/helm-charts/common/retriever-usvc/values.yaml index 19157edd2..919381cbb 100644 --- a/helm-charts/common/retriever-usvc/values.yaml +++ b/helm-charts/common/retriever-usvc/values.yaml @@ -18,7 +18,7 @@ TEI_EMBEDDING_ENDPOINT: "" EMBED_MODEL: "" REDIS_URL: "" -INDEX_NAME: "rag-redis" +indexName: "rag-redis" image: repository: opea/retriever-redis @@ -50,6 +50,7 @@ service: type: ClusterIP # The default port for retriever service is 7000 port: 7000 + containerPort: 7000 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/helm-charts/common/retriever-usvc/vdms-values.yaml b/helm-charts/common/retriever-usvc/vdms-values.yaml new file mode 100644 index 000000000..fc8da4ba2 --- /dev/null +++ b/helm-charts/common/retriever-usvc/vdms-values.yaml @@ -0,0 +1,17 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +autodependency: + vdms: false + +image: + repository: opea/retriever-vdms + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +indexName: "mega-videoqna" +vdmsHost: "" +vdmsPort: "8001" +useClip: "1" +entryCommand: ["/bin/sh"] diff --git a/helm-charts/common/ui/templates/configmap.yaml b/helm-charts/common/ui/templates/configmap.yaml index d6bfef1ae..8eba994ed 100644 --- a/helm-charts/common/ui/templates/configmap.yaml +++ b/helm-charts/common/ui/templates/configmap.yaml @@ -8,6 +8,12 @@ metadata: labels: {{- include "ui.labels" . | nindent 4 }} data: + {{- if .Values.backendHealthCheckEndpoint }} + BACKEND_HEALTH_CHECK_ENDPOINT: {{ .Values.backendHealthCheckEndpoint | quote }} + {{- end }} + {{- if .Values.backendServiceEndpoint }} + BACKEND_SERVICE_ENDPOINT: {{ .Values.backendServiceEndpoint | quote }} + {{- end }} APP_BACKEND_SERVICE_ENDPOINT: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} APP_DATA_PREP_SERVICE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }} CHAT_BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} diff --git a/helm-charts/common/ui/videoqna-values.yaml b/helm-charts/common/ui/videoqna-values.yaml new file mode 100644 index 000000000..9f3f0a117 --- /dev/null +++ b/helm-charts/common/ui/videoqna-values.yaml @@ -0,0 +1,14 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +image: + repository: opea/videoqna-ui:latest + pullPolicy: IfNotPresent + tag: "latest" + +backendServiceEndpoint: "/v1/videoqna" +backendHealthCheckEndpoint: "/v1/health_check" + +service: + type: ClusterIP + port: 5173 diff --git a/helm-charts/common/vdms-vector-db/.helmignore b/helm-charts/common/vdms-vector-db/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/.helmignore @@ -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/ diff --git a/helm-charts/common/vdms-vector-db/Chart.yaml b/helm-charts/common/vdms-vector-db/Chart.yaml new file mode 100644 index 000000000..8cf33fa90 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/Chart.yaml @@ -0,0 +1,9 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v2 +name: vdms-vector-db +description: A Helm chart for Intel VDMS Vector DB +type: application +version: 1.0.0 +appVersion: "v2.8.0" diff --git a/helm-charts/common/vdms-vector-db/templates/_helpers.tpl b/helm-charts/common/vdms-vector-db/templates/_helpers.tpl new file mode 100644 index 000000000..fa206e852 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "vdms-vector-db.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "vdms-vector-db.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "vdms-vector-db.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "vdms-vector-db.labels" -}} +helm.sh/chart: {{ include "vdms-vector-db.chart" . }} +{{ include "vdms-vector-db.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "vdms-vector-db.selectorLabels" -}} +app.kubernetes.io/name: {{ include "vdms-vector-db.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "vdms-vector-db.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "vdms-vector-db.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm-charts/common/vdms-vector-db/templates/deployment.yaml b/helm-charts/common/vdms-vector-db/templates/deployment.yaml new file mode 100644 index 000000000..3990d67c6 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/templates/deployment.yaml @@ -0,0 +1,70 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "vdms-vector-db.fullname" . }} + labels: + {{- include "vdms-vector-db.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + {{- include "vdms-vector-db.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "vdms-vector-db.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.containerPort }} + protocol: TCP + startupProbe: + tcpSocket: + port: {{ .Values.service.containerPort }} # Probe the Redis port + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 120 + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm-charts/common/vdms-vector-db/templates/service.yaml b/helm-charts/common/vdms-vector-db/templates/service.yaml new file mode 100644 index 000000000..6569cb7b0 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/templates/service.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "vdms-vector-db.fullname" . }} + labels: + {{- include "vdms-vector-db.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.containerPort }} + protocol: TCP + name: http + selector: + {{- include "vdms-vector-db.selectorLabels" . | nindent 4 }} diff --git a/helm-charts/common/vdms-vector-db/templates/tests/test-connection.yaml b/helm-charts/common/vdms-vector-db/templates/tests/test-connection.yaml new file mode 100644 index 000000000..c28b30bc3 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/templates/tests/test-connection.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "vdms-vector-db.fullname" . }}-test-connection" + labels: + {{- include "vdms-vector-db.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "vdms-vector-db.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm-charts/common/vdms-vector-db/values.yaml b/helm-charts/common/vdms-vector-db/values.yaml new file mode 100644 index 000000000..c25e14a27 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/values.yaml @@ -0,0 +1,61 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for vdms-vector-db. + +replicaCount: 1 + +image: + repository: intellabs/vdms + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "v2.8.0" + +imagePullSecrets: [] +# This is to override the chart name. +nameOverride: "" +fullnameOverride: "" + + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 1000 + allowPrivilegeEscalation: false + seccompProfile: + type: RuntimeDefault + +service: + type: ClusterIP + port: 8001 + targetPort: 55555 + + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/helm-charts/videoqna/.helmignore b/helm-charts/videoqna/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/helm-charts/videoqna/.helmignore @@ -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/ diff --git a/helm-charts/videoqna/Chart.yaml b/helm-charts/videoqna/Chart.yaml new file mode 100644 index 000000000..0f6bd2187 --- /dev/null +++ b/helm-charts/videoqna/Chart.yaml @@ -0,0 +1,37 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v2 +name: videoqna +description: A Helm chart to deploy VideoQnA Application Suite +type: application +version: 1.0.0 +appVersion: "1.0" +dependencies: + - name: data-prep + version: 1.0.0 + repository: "file://../common/data-prep" + - name: embedding-usvc + version: 1.0.0 + repository: "file://../common/embedding-usvc" + - name: reranking-usvc + version: 1.0.0 + repository: "file://../common/reranking-usvc" + - name: retriever-usvc + version: 1.0.0 + repository: "file://../common/retriever-usvc" + - name: vdms-vector-db + version: 1.0.0 + repository: "file://../common/vdms-vector-db" + - name: lvm-server + version: 1.0.0 + repository: "file://../common/lvm-server" + - name: lvm + version: 1.0.0 + repository: "file://../common/lvm" + - name: ui + version: 1.0.0 + alias: videoqna-ui + repository: "file://../common/ui" +version: 1.0.0 +appVersion: "v1.0" diff --git a/helm-charts/videoqna/templates/NOTES.txt b/helm-charts/videoqna/templates/NOTES.txt new file mode 100644 index 000000000..2044e5875 --- /dev/null +++ b/helm-charts/videoqna/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "videoqna.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "videoqna.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "videoqna.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "videoqna.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/helm-charts/videoqna/templates/_helpers.tpl b/helm-charts/videoqna/templates/_helpers.tpl new file mode 100644 index 000000000..75b98a8f7 --- /dev/null +++ b/helm-charts/videoqna/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "videoqna.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "videoqna.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "videoqna.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "videoqna.labels" -}} +helm.sh/chart: {{ include "videoqna.chart" . }} +{{ include "videoqna.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "videoqna.selectorLabels" -}} +app.kubernetes.io/name: {{ include "videoqna.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "videoqna.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "videoqna.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm-charts/videoqna/templates/deployment.yaml b/helm-charts/videoqna/templates/deployment.yaml new file mode 100644 index 000000000..40ab564f5 --- /dev/null +++ b/helm-charts/videoqna/templates/deployment.yaml @@ -0,0 +1,71 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "videoqna.fullname" . }} + labels: + {{- include "videoqna.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "videoqna.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "videoqna.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "videoqna.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm-charts/videoqna/templates/hpa.yaml b/helm-charts/videoqna/templates/hpa.yaml new file mode 100644 index 000000000..bf62ddd6b --- /dev/null +++ b/helm-charts/videoqna/templates/hpa.yaml @@ -0,0 +1,35 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "videoqna.fullname" . }} + labels: + {{- include "videoqna.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "videoqna.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm-charts/videoqna/templates/ingress.yaml b/helm-charts/videoqna/templates/ingress.yaml new file mode 100644 index 000000000..a8d837591 --- /dev/null +++ b/helm-charts/videoqna/templates/ingress.yaml @@ -0,0 +1,46 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "videoqna.fullname" . }} + labels: + {{- include "videoqna.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- with .pathType }} + pathType: {{ . }} + {{- end }} + backend: + service: + name: {{ include "videoqna.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm-charts/videoqna/templates/service.yaml b/helm-charts/videoqna/templates/service.yaml new file mode 100644 index 000000000..e5179ddb8 --- /dev/null +++ b/helm-charts/videoqna/templates/service.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "videoqna.fullname" . }} + labels: + {{- include "videoqna.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "videoqna.selectorLabels" . | nindent 4 }} diff --git a/helm-charts/videoqna/templates/serviceaccount.yaml b/helm-charts/videoqna/templates/serviceaccount.yaml new file mode 100644 index 000000000..2c6c9f2df --- /dev/null +++ b/helm-charts/videoqna/templates/serviceaccount.yaml @@ -0,0 +1,16 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "videoqna.serviceAccountName" . }} + labels: + {{- include "videoqna.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/helm-charts/videoqna/templates/tests/test-connection.yaml b/helm-charts/videoqna/templates/tests/test-connection.yaml new file mode 100644 index 000000000..74e83f2db --- /dev/null +++ b/helm-charts/videoqna/templates/tests/test-connection.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "videoqna.fullname" . }}-test-connection" + labels: + {{- include "videoqna.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "videoqna.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml new file mode 100644 index 000000000..8a8767203 --- /dev/null +++ b/helm-charts/videoqna/values.yaml @@ -0,0 +1,126 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for videoqna. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ +replicaCount: 1 + +# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ +image: + repository: nginx + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: [] +# This is to override the chart name. +nameOverride: "" +fullnameOverride: "" + +#This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +# This is for setting Kubernetes Annotations to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +podAnnotations: {} +# This is for setting Kubernetes Labels to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ +service: + # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + type: ClusterIP + # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports + port: 80 + +# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + httpGet: + path: / + port: http +readinessProbe: + httpGet: + path: / + port: http + +#This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} From 7cd488a0fad3246f7311b1e02aad75c2619e3c26 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Thu, 17 Oct 2024 05:28:07 +0530 Subject: [PATCH 02/28] =?UTF-8?q?=F0=9F=9A=A8=20linter=20and=20pre-commit?= =?UTF-8?q?=20check=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/values.yaml | 1 + helm-charts/common/lvm-serving/.helmignore | 23 +++ helm-charts/common/lvm-serving/Chart.yaml | 9 + .../common/lvm-serving/templates/_helpers.tpl | 62 +++++++ .../lvm-serving/templates/configmap.yaml | 14 ++ .../lvm-serving/templates/deployment.yaml | 82 +++++++++ .../common/lvm-serving/templates/service.yaml | 18 ++ .../templates/tests/test-connection.yaml | 18 ++ helm-charts/common/lvm-serving/values.yaml | 95 +++++++++++ helm-charts/common/lvm-uservice/.helmignore | 23 +++ helm-charts/common/lvm-uservice/Chart.yaml | 14 ++ .../lvm-uservice/templates/_helpers.tpl | 62 +++++++ .../lvm-uservice/templates/configmap.yaml | 23 +++ .../lvm-uservice/templates/deployment.yaml | 71 ++++++++ .../lvm-uservice/templates/service.yaml | 18 ++ .../templates/tests/test-connection.yaml | 18 ++ helm-charts/common/lvm-uservice/values.yaml | 96 +++++++++++ helm-charts/common/retriever-usvc/values.yaml | 1 + helm-charts/videoqna/Chart.yaml | 8 +- helm-charts/videoqna/templates/NOTES.txt | 22 --- .../videoqna/templates/deployment.yaml | 8 +- helm-charts/videoqna/templates/hpa.yaml | 35 ---- helm-charts/videoqna/templates/ingress.yaml | 46 ----- .../videoqna/templates/nginx-deployment.yaml | 117 +++++++++++++ helm-charts/videoqna/templates/service.yaml | 2 +- .../videoqna/templates/serviceaccount.yaml | 16 -- helm-charts/videoqna/values.yaml | 161 +++++++++--------- 27 files changed, 855 insertions(+), 208 deletions(-) create mode 100644 helm-charts/common/lvm-serving/.helmignore create mode 100644 helm-charts/common/lvm-serving/Chart.yaml create mode 100644 helm-charts/common/lvm-serving/templates/_helpers.tpl create mode 100644 helm-charts/common/lvm-serving/templates/configmap.yaml create mode 100644 helm-charts/common/lvm-serving/templates/deployment.yaml create mode 100644 helm-charts/common/lvm-serving/templates/service.yaml create mode 100644 helm-charts/common/lvm-serving/templates/tests/test-connection.yaml create mode 100644 helm-charts/common/lvm-serving/values.yaml create mode 100644 helm-charts/common/lvm-uservice/.helmignore create mode 100644 helm-charts/common/lvm-uservice/Chart.yaml create mode 100644 helm-charts/common/lvm-uservice/templates/_helpers.tpl create mode 100644 helm-charts/common/lvm-uservice/templates/configmap.yaml create mode 100644 helm-charts/common/lvm-uservice/templates/deployment.yaml create mode 100644 helm-charts/common/lvm-uservice/templates/service.yaml create mode 100644 helm-charts/common/lvm-uservice/templates/tests/test-connection.yaml create mode 100644 helm-charts/common/lvm-uservice/values.yaml delete mode 100644 helm-charts/videoqna/templates/NOTES.txt delete mode 100644 helm-charts/videoqna/templates/hpa.yaml delete mode 100644 helm-charts/videoqna/templates/ingress.yaml create mode 100644 helm-charts/videoqna/templates/nginx-deployment.yaml delete mode 100644 helm-charts/videoqna/templates/serviceaccount.yaml diff --git a/helm-charts/common/data-prep/values.yaml b/helm-charts/common/data-prep/values.yaml index eb14453ab..0aa139342 100644 --- a/helm-charts/common/data-prep/values.yaml +++ b/helm-charts/common/data-prep/values.yaml @@ -7,6 +7,7 @@ autodependency: enabled: false + vdms: false replicaCount: 1 diff --git a/helm-charts/common/lvm-serving/.helmignore b/helm-charts/common/lvm-serving/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/helm-charts/common/lvm-serving/.helmignore @@ -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/ diff --git a/helm-charts/common/lvm-serving/Chart.yaml b/helm-charts/common/lvm-serving/Chart.yaml new file mode 100644 index 000000000..50d32a3e0 --- /dev/null +++ b/helm-charts/common/lvm-serving/Chart.yaml @@ -0,0 +1,9 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v2 +name: lvm-serving +description: A Helm chart for serving LVM +type: application +version: 1.0.0 +appVersion: "v1.0" diff --git a/helm-charts/common/lvm-serving/templates/_helpers.tpl b/helm-charts/common/lvm-serving/templates/_helpers.tpl new file mode 100644 index 000000000..0c17e2c66 --- /dev/null +++ b/helm-charts/common/lvm-serving/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "lvm-serving.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "lvm-serving.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "lvm-serving.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "lvm-serving.labels" -}} +helm.sh/chart: {{ include "lvm-serving.chart" . }} +{{ include "lvm-serving.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "lvm-serving.selectorLabels" -}} +app.kubernetes.io/name: {{ include "lvm-serving.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "lvm-serving.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "lvm-serving.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm-charts/common/lvm-serving/templates/configmap.yaml b/helm-charts/common/lvm-serving/templates/configmap.yaml new file mode 100644 index 000000000..186dc0697 --- /dev/null +++ b/helm-charts/common/lvm-serving/templates/configmap.yaml @@ -0,0 +1,14 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "lvm-serving.fullname" . }}-config + labels: + {{- include "lvm-serving.labels" . | nindent 4 }} +data: + llm_download: {{ .Values.llmDownloadFlag }} + http_proxy: {{ .Values.global.http_proxy | quote }} + https_proxy: {{ .Values.global.https_proxy | quote }} + no_proxy: {{ .Values.global.no_proxy | quote }} diff --git a/helm-charts/common/lvm-serving/templates/deployment.yaml b/helm-charts/common/lvm-serving/templates/deployment.yaml new file mode 100644 index 000000000..f1dba0cd4 --- /dev/null +++ b/helm-charts/common/lvm-serving/templates/deployment.yaml @@ -0,0 +1,82 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "lvm-serving.fullname" . }} + labels: + {{- include "lvm-serving.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "lvm-serving.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "lvm-serving.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "lvm-serving.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.containerPort }} + protocol: TCP + volumeMounts: + - mountPath: /data + name: video-llama-model + - mountPath: /tmp + name: tmp + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumes: + - name: video-llama-model + {{- if .Values.global.modelUsePVC }} + persistentVolumeClaim: + claimName: {{ .Values.global.modelUsePVC }} + {{- else if .Values.global.modelUseHostPath }} + hostPath: + path: {{ .Values.global.modelUseHostPath }} + type: Directory + {{- else }} + emptyDir: {} + {{- end }} + - name: tmp + emptyDir: {} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm-charts/common/lvm-serving/templates/service.yaml b/helm-charts/common/lvm-serving/templates/service.yaml new file mode 100644 index 000000000..79900e7da --- /dev/null +++ b/helm-charts/common/lvm-serving/templates/service.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "lvm-serving.fullname" . }} + labels: + {{- include "lvm-serving.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.containerPort }} + protocol: TCP + name: http + selector: + {{- include "lvm-serving.selectorLabels" . | nindent 4 }} diff --git a/helm-charts/common/lvm-serving/templates/tests/test-connection.yaml b/helm-charts/common/lvm-serving/templates/tests/test-connection.yaml new file mode 100644 index 000000000..8aadfae87 --- /dev/null +++ b/helm-charts/common/lvm-serving/templates/tests/test-connection.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "lvm-serving.fullname" . }}-test-connection" + labels: + {{- include "lvm-serving.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "lvm-serving.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm-charts/common/lvm-serving/values.yaml b/helm-charts/common/lvm-serving/values.yaml new file mode 100644 index 000000000..c51745e67 --- /dev/null +++ b/helm-charts/common/lvm-serving/values.yaml @@ -0,0 +1,95 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for lvm-serving. + +replicaCount: 1 + +llmDownloadFlag: "True" + +image: + repository: opea/video-llama-lvm-server + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +imagePullSecrets: [] +# This is to override the chart name. +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + runAsNonRoot: true + runAsUser: 1000 + seccompProfile: + type: RuntimeDefault + +service: + type: ClusterIP + port: 80 + containerPort: 9009 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + tcpSocket: + port: http + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 24 +readinessProbe: + tcpSocket: + port: http + initialDelaySeconds: 5 + periodSeconds: 5 +startupProbe: + tcpSocket: + port: http + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 120 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +global: + http_proxy: "" + https_proxy: "" + no_proxy: "" + HUGGINGFACEHUB_API_TOKEN: "insert-your-huggingface-token-here" + + # Choose where to save your downloaded models + # 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/lvm-uservice/.helmignore b/helm-charts/common/lvm-uservice/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/helm-charts/common/lvm-uservice/.helmignore @@ -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/ diff --git a/helm-charts/common/lvm-uservice/Chart.yaml b/helm-charts/common/lvm-uservice/Chart.yaml new file mode 100644 index 000000000..97492fb23 --- /dev/null +++ b/helm-charts/common/lvm-uservice/Chart.yaml @@ -0,0 +1,14 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v2 +name: lvm-uservice +description: A Helm chart for deploying LVM Microservice +type: application +version: 1.0.0 +appVersion: "v1.0" +dependencies: + - name: tgi + version: 1.0.0 + repository: file://../lvm-serving + condition: autodependency.enabled diff --git a/helm-charts/common/lvm-uservice/templates/_helpers.tpl b/helm-charts/common/lvm-uservice/templates/_helpers.tpl new file mode 100644 index 000000000..86c26b0e6 --- /dev/null +++ b/helm-charts/common/lvm-uservice/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "lvm-uservice.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "lvm-uservice.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "lvm-uservice.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "lvm-uservice.labels" -}} +helm.sh/chart: {{ include "lvm-uservice.chart" . }} +{{ include "lvm-uservice.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "lvm-uservice.selectorLabels" -}} +app.kubernetes.io/name: {{ include "lvm-uservice.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "lvm-uservice.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "lvm-uservice.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm-charts/common/lvm-uservice/templates/configmap.yaml b/helm-charts/common/lvm-uservice/templates/configmap.yaml new file mode 100644 index 000000000..e04fd428b --- /dev/null +++ b/helm-charts/common/lvm-uservice/templates/configmap.yaml @@ -0,0 +1,23 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "lvm-uservice.fullname" . }}-config + labels: + {{- include "lvm-uservice.labels" . | nindent 4 }} +data: + {{- if .Values.lvmEndpoint }} + LVM_ENDPOINT: {{ .Values.lvmEndpoint }} + {{- else }} + LVM_ENDPOINT: "http://{{ .Release.Name }}-lvm-serving" + {{- end }} + http_proxy: {{ .Values.global.http_proxy | quote }} + https_proxy: {{ .Values.global.https_proxy | quote }} + {{- if and (not .Values.TGI_LLM_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy) }} + no_proxy: "{{ .Release.Name }}-tgi,{{ .Release.Name }}-lvm-serving,{{ .Values.global.no_proxy }}" + {{- else }} + no_proxy: {{ .Values.global.no_proxy | quote }} + {{- end }} + LOGFLAG: {{ .Values.LOGFLAG | quote }} diff --git a/helm-charts/common/lvm-uservice/templates/deployment.yaml b/helm-charts/common/lvm-uservice/templates/deployment.yaml new file mode 100644 index 000000000..a7747cc46 --- /dev/null +++ b/helm-charts/common/lvm-uservice/templates/deployment.yaml @@ -0,0 +1,71 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "lvm-uservice.fullname" . }} + labels: + {{- include "lvm-uservice.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "lvm-uservice.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "lvm-uservice.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "lvm-uservice.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.containerPort }} + protocol: TCP + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/helm-charts/common/lvm-uservice/templates/service.yaml b/helm-charts/common/lvm-uservice/templates/service.yaml new file mode 100644 index 000000000..012e6f92b --- /dev/null +++ b/helm-charts/common/lvm-uservice/templates/service.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Service +metadata: + name: {{ include "lvm-uservice.fullname" . }} + labels: + {{- include "lvm-uservice.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.containerPort }} + protocol: TCP + name: http + selector: + {{- include "lvm-uservice.selectorLabels" . | nindent 4 }} diff --git a/helm-charts/common/lvm-uservice/templates/tests/test-connection.yaml b/helm-charts/common/lvm-uservice/templates/tests/test-connection.yaml new file mode 100644 index 000000000..21ebde314 --- /dev/null +++ b/helm-charts/common/lvm-uservice/templates/tests/test-connection.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "lvm-uservice.fullname" . }}-test-connection" + labels: + {{- include "lvm-uservice.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "lvm-uservice.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm-charts/common/lvm-uservice/values.yaml b/helm-charts/common/lvm-uservice/values.yaml new file mode 100644 index 000000000..fe6bdcfd5 --- /dev/null +++ b/helm-charts/common/lvm-uservice/values.yaml @@ -0,0 +1,96 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for lvm-uservice. + +autodependency: + enabled: false + +replicaCount: 1 + +lvmEndpoint: "" +image: + repository: opea/lvm-video-llama + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +imagePullSecrets: [] +# This is to override the chart name. +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + runAsNonRoot: true + runAsUser: 1000 + seccompProfile: + type: RuntimeDefault + +service: + type: ClusterIP + port: 9000 + containerPort: 9000 + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +livenessProbe: + tcpSocket: + port: http + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 24 +readinessProbe: + tcpSocket: + port: http + initialDelaySeconds: 5 + periodSeconds: 5 +startupProbe: + tcpSocket: + port: http + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 120 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +global: + http_proxy: "" + https_proxy: "" + no_proxy: "" + HUGGINGFACEHUB_API_TOKEN: "insert-your-huggingface-token-here" + + # Choose where to save your downloaded models + # 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/retriever-usvc/values.yaml b/helm-charts/common/retriever-usvc/values.yaml index 919381cbb..1c5e172f6 100644 --- a/helm-charts/common/retriever-usvc/values.yaml +++ b/helm-charts/common/retriever-usvc/values.yaml @@ -7,6 +7,7 @@ autodependency: enabled: false + vdms: false replicaCount: 1 diff --git a/helm-charts/videoqna/Chart.yaml b/helm-charts/videoqna/Chart.yaml index 0f6bd2187..e33a0ce3b 100644 --- a/helm-charts/videoqna/Chart.yaml +++ b/helm-charts/videoqna/Chart.yaml @@ -23,12 +23,12 @@ dependencies: - name: vdms-vector-db version: 1.0.0 repository: "file://../common/vdms-vector-db" - - name: lvm-server + - name: lvm-serving version: 1.0.0 - repository: "file://../common/lvm-server" - - name: lvm + repository: "file://../common/lvm-serving" + - name: lvm-uservice version: 1.0.0 - repository: "file://../common/lvm" + repository: "file://../common/lvm-uservice" - name: ui version: 1.0.0 alias: videoqna-ui diff --git a/helm-charts/videoqna/templates/NOTES.txt b/helm-charts/videoqna/templates/NOTES.txt deleted file mode 100644 index 2044e5875..000000000 --- a/helm-charts/videoqna/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "videoqna.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "videoqna.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "videoqna.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "videoqna.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/helm-charts/videoqna/templates/deployment.yaml b/helm-charts/videoqna/templates/deployment.yaml index 40ab564f5..1d9e559c4 100644 --- a/helm-charts/videoqna/templates/deployment.yaml +++ b/helm-charts/videoqna/templates/deployment.yaml @@ -39,9 +39,15 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.entryCommand }} + command: {{ .Values.entryCommand }} + args: + - "-c" + - "sleep 45 && python videoqna.py" + {{- end }} ports: - name: http - containerPort: {{ .Values.service.port }} + containerPort: {{ .Values.service.containerPort }} protocol: TCP livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} diff --git a/helm-charts/videoqna/templates/hpa.yaml b/helm-charts/videoqna/templates/hpa.yaml deleted file mode 100644 index bf62ddd6b..000000000 --- a/helm-charts/videoqna/templates/hpa.yaml +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "videoqna.fullname" . }} - labels: - {{- include "videoqna.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "videoqna.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/helm-charts/videoqna/templates/ingress.yaml b/helm-charts/videoqna/templates/ingress.yaml deleted file mode 100644 index a8d837591..000000000 --- a/helm-charts/videoqna/templates/ingress.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -{{- if .Values.ingress.enabled -}} -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ include "videoqna.fullname" . }} - labels: - {{- include "videoqna.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- with .Values.ingress.className }} - ingressClassName: {{ . }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- with .pathType }} - pathType: {{ . }} - {{- end }} - backend: - service: - name: {{ include "videoqna.fullname" $ }} - port: - number: {{ $.Values.service.port }} - {{- end }} - {{- end }} -{{- end }} diff --git a/helm-charts/videoqna/templates/nginx-deployment.yaml b/helm-charts/videoqna/templates/nginx-deployment.yaml new file mode 100644 index 000000000..f727ff080 --- /dev/null +++ b/helm-charts/videoqna/templates/nginx-deployment.yaml @@ -0,0 +1,117 @@ +apiVersion: v1 +data: + default.conf: |+ + # Copyright (C) 2024 Intel Corporation + # SPDX-License-Identifier: Apache-2.0 + + + server { + listen 80; + listen [::]:80; + + location /home { + alias /usr/share/nginx/html/index.html; + } + + location / { + proxy_pass http://{{ include "ui.fullname" (index .Subcharts "videoqna-ui") }}:{{ index .Values "videoqna-ui" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /v1/videoqna { + proxy_pass http://{{ include "videoqna.fullname" . }}:{{ .Values.service.port }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /v1/dataprep { + proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /v1/dataprep/get_file { + proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /v1/dataprep/delete_file { + proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + +kind: ConfigMap +metadata: + name: {{ include "videoqna.fullname" . }}-nginx-config +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "videoqna.fullname" . }}-nginx + labels: + {{- include "videoqna.labels" . | nindent 4 }} + app: {{ include "videoqna.fullname" . }}-nginx +spec: + selector: + matchLabels: + {{- include "videoqna.selectorLabels" . | nindent 6 }} + app: {{ include "videoqna.fullname" . }}-nginx + template: + metadata: + labels: + {{- include "videoqna.selectorLabels" . | nindent 8 }} + app: {{ include "videoqna.fullname" . }}-nginx + spec: + containers: + - image: nginx:1.27.1 + imagePullPolicy: {{ .Values.image.pullPolicy }} + name: nginx + volumeMounts: + - mountPath: /etc/nginx/conf.d + name: nginx-config-volume + securityContext: {} + volumes: + - configMap: + defaultMode: 420 + name: {{ include "videoqna.fullname" . }}-nginx-config + name: nginx-config-volume + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "videoqna.fullname" . }}-nginx +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + {{- include "videoqna.selectorLabels" . | nindent 4 }} + app: {{ include "videoqna.fullname" . }}-nginx + type: NodePort diff --git a/helm-charts/videoqna/templates/service.yaml b/helm-charts/videoqna/templates/service.yaml index e5179ddb8..935e54320 100644 --- a/helm-charts/videoqna/templates/service.yaml +++ b/helm-charts/videoqna/templates/service.yaml @@ -11,7 +11,7 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} - targetPort: http + targetPort: {{ .Values.service.containerPort }} protocol: TCP name: http selector: diff --git a/helm-charts/videoqna/templates/serviceaccount.yaml b/helm-charts/videoqna/templates/serviceaccount.yaml deleted file mode 100644 index 2c6c9f2df..000000000 --- a/helm-charts/videoqna/templates/serviceaccount.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "videoqna.serviceAccountName" . }} - labels: - {{- include "videoqna.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automount }} -{{- end }} diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index 8a8767203..89279afcb 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -2,79 +2,40 @@ # SPDX-License-Identifier: Apache-2.0 # Default values for videoqna. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ replicaCount: 1 -# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ image: - repository: nginx + repository: opea/videoqna # This sets the pull policy for images. pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: "latest" -# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: [] # This is to override the chart name. nameOverride: "" fullnameOverride: "" -#This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ -serviceAccount: - # Specifies whether a service account should be created - create: true - # Automatically mount a ServiceAccount's API credentials? - automount: true - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -# This is for setting Kubernetes Annotations to a Pod. -# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ podAnnotations: {} -# This is for setting Kubernetes Labels to a Pod. -# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ podLabels: {} podSecurityContext: {} # fsGroup: 2000 securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ + capabilities: + drop: + - ALL + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + runAsNonRoot: true + runAsUser: 1000 + service: - # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types type: ClusterIP - # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports - port: 80 - -# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local + port: 8888 + containerPort: 8888 + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious @@ -88,39 +49,73 @@ resources: {} # cpu: 100m # memory: 128Mi -# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ -livenessProbe: - httpGet: - path: / - port: http -readinessProbe: - httpGet: - path: / - port: http - -#This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -# Additional volumes on the output Deployment definition. -volumes: [] -# - name: foo -# secret: -# secretName: mysecret -# optional: false - -# Additional volumeMounts on the output Deployment definition. -volumeMounts: [] -# - name: foo -# mountPath: "/etc/foo" -# readOnly: true - nodeSelector: {} tolerations: [] affinity: {} + +entryCommand: ["/bin/sh"] + +ui: + image: + repository: opea/videoqna-ui:latest + pullPolicy: IfNotPresent + tag: "latest" + + backendServiceEndpoint: "/v1/videoqna" + backendHealthCheckEndpoint: "/v1/health_check" + + service: + type: ClusterIP + port: 5173 + +data-prep: + image: + repository: opea/dataprep-multimodal-vdm + pullPolicy: IfNotPresent + tag: "latest" + + indexName: "mega-videoqna" + vdmsHost: "" + vdmsPort: "8001" + entryCommand: ["/bin/sh"] + +embedding-usvc: + image: + repository: opea/embedding-multimodal-clip + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +retriever-usvc: + image: + repository: opea/retriever-vdms + pullPolicy: IfNotPresent + tag: "latest" + + indexName: "mega-videoqna" + vdmsHost: "" + vdmsPort: "8001" + useClip: "1" + entryCommand: ["/bin/sh"] + +reranking-usvc: + image: + repository: opea/reranking-videoqna + pullPolicy: IfNotPresent + tag: "latest" + + chunkDuration: "" + fileServerEndpoint: "/v1/dataprep/get_file" + getVideoListEndpoint: "/v1/dataprep/get_videos" + +global: + http_proxy: "" + https_proxy: "" + no_proxy: "" + HUGGINGFACEHUB_API_TOKEN: "insert-your-huggingface-token-here" + # set modelUseHostPath or modelUsePVC to use model cache. + modelUseHostPath: "" + # modelUseHostPath: /mnt/opea-models + # modelUsePVC: model-volume From 1f121e95122454ed8df409c7c6a574fa6166e7c2 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Thu, 17 Oct 2024 05:28:07 +0530 Subject: [PATCH 03/28] =?UTF-8?q?=E2=9C=85=20Added=20helm=20tests=20for=20?= =?UTF-8?q?all=20services=20|=20linting=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- .../data-prep/templates/tests/test-pod.yaml | 16 ++++++++++ helm-charts/common/data-prep/vdms-values.yaml | 2 +- .../lvm-serving/templates/tests/test-pod.yaml | 29 +++++++++++++++++++ .../templates/tests/test-pod.yaml | 29 +++++++++++++++++++ .../templates/tests/test-connection.yaml | 18 ------------ .../templates/tests/test-pod.yaml | 22 ++++++++++++++ .../templates/tests/test-connection.yaml | 18 ------------ .../videoqna/templates/tests/test-pod.yaml | 28 ++++++++++++++++++ helm-charts/videoqna/values.yaml | 1 - 9 files changed, 125 insertions(+), 38 deletions(-) create mode 100644 helm-charts/common/lvm-serving/templates/tests/test-pod.yaml create mode 100644 helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml delete mode 100644 helm-charts/common/vdms-vector-db/templates/tests/test-connection.yaml create mode 100644 helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml delete mode 100644 helm-charts/videoqna/templates/tests/test-connection.yaml create mode 100644 helm-charts/videoqna/templates/tests/test-pod.yaml diff --git a/helm-charts/common/data-prep/templates/tests/test-pod.yaml b/helm-charts/common/data-prep/templates/tests/test-pod.yaml index 63fb55886..f6902fb1a 100644 --- a/helm-charts/common/data-prep/templates/tests/test-pod.yaml +++ b/helm-charts/common/data-prep/templates/tests/test-pod.yaml @@ -15,6 +15,21 @@ spec: - name: curl image: python:3.10.14 command: ['bash', '-c'] + {{- if contains "dataprep-multimodal-vdms" .Values.image.repository }} + args: + - | + curl -LO "https://github.com/opea-project/GenAIExamples/raw/refs/heads/main/VideoQnA/docker_compose/intel/cpu/xeon/data/op_1_0320241830.mp4" + max_retry=5 + for ((i=1; i<=max_retry; i++)); do + curl http://{{ include "data-prep.fullname" . }}:{{ .Values.service.port }}/v1/dataprep -sS --fail-with-body \ + -X POST \ + -H "Content-Type: multipart/form-data" \ + -F "files=@./op_1_0320241830.mp4" && break; + curlcode=$? + if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; + done; + if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + {{- else }} args: - | echo "test file" > /tmp/file1.txt; @@ -28,4 +43,5 @@ spec: if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; done; if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + {{- end }} restartPolicy: Never diff --git a/helm-charts/common/data-prep/vdms-values.yaml b/helm-charts/common/data-prep/vdms-values.yaml index a996592bd..a97cfa53a 100644 --- a/helm-charts/common/data-prep/vdms-values.yaml +++ b/helm-charts/common/data-prep/vdms-values.yaml @@ -5,7 +5,7 @@ autodependency: vdms: false image: - repository: opea/dataprep-multimodal-vdm + repository: opea/dataprep-multimodal-vdms pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "latest" diff --git a/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml b/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml new file mode 100644 index 000000000..41aaa0f84 --- /dev/null +++ b/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml @@ -0,0 +1,29 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "lvm-serving.fullname" . }}-test-connection" + labels: + {{- include "lvm-serving.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: curl + image: python:3.10.14 + command: ['bash', '-c'] + args: + - | + max_retry=10 + for ((i=1; i<=max_retry; i++)); do + curl http://{{ include "lvm-serving.fullname" . }}:{{ .Values.service.port }}/generate?video_url=silence_girl.mp4&start=0.0&duration=9&prompt=What%20is%20the%20person%20doing%3F&max_new_tokens=150" -sS --fail-with-body \ + -X POST \ + -H "accept: */*" \ + -d '' && break; + curlcode=$? + if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; + done; + if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + restartPolicy: Never diff --git a/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml b/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml new file mode 100644 index 000000000..565e1b952 --- /dev/null +++ b/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml @@ -0,0 +1,29 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "lvm-uservice.fullname" . }}-test-connection" + labels: + {{- include "lvm-uservice.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: curl + image: python:3.10.14 + command: ['bash', '-c'] + args: + - | + max_retry=10 + for ((i=1; i<=max_retry; i++)); do + curl http://{{ include "lvm-uservice.fullname" . }}:{{ .Values.service.port }}/v1/lvm -sS --fail-with-body \ + -X POST \ + -d '{"video_url":"https://github.com/DAMO-NLP-SG/Video-LLaMA/raw/main/examples/silence_girl.mp4","chunk_start": 0,"chunk_duration": 7,"prompt":"What is the person doing?","max_new_tokens": 50}' \ + -H 'Content-Type: application/json' && break; + curlcode=$? + if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; + done; + if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + restartPolicy: Never diff --git a/helm-charts/common/vdms-vector-db/templates/tests/test-connection.yaml b/helm-charts/common/vdms-vector-db/templates/tests/test-connection.yaml deleted file mode 100644 index c28b30bc3..000000000 --- a/helm-charts/common/vdms-vector-db/templates/tests/test-connection.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "vdms-vector-db.fullname" . }}-test-connection" - labels: - {{- include "vdms-vector-db.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "vdms-vector-db.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml b/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml new file mode 100644 index 000000000..06b6c37ff --- /dev/null +++ b/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml @@ -0,0 +1,22 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "vdms-vector-db.fullname" . }}-test-pod" + labels: + {{- include "vdms-vector-db.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: curl + image: alpine/curl + command: ['sh', '-c'] + args: + - | + curl http://{{ include "vdms-vector-db.fullname" . }}:{{ .Values.service.port }} -sS --fail-with-body \ + -X HEAD + + restartPolicy: Never diff --git a/helm-charts/videoqna/templates/tests/test-connection.yaml b/helm-charts/videoqna/templates/tests/test-connection.yaml deleted file mode 100644 index 74e83f2db..000000000 --- a/helm-charts/videoqna/templates/tests/test-connection.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "videoqna.fullname" . }}-test-connection" - labels: - {{- include "videoqna.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "videoqna.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/helm-charts/videoqna/templates/tests/test-pod.yaml b/helm-charts/videoqna/templates/tests/test-pod.yaml new file mode 100644 index 000000000..3611550d1 --- /dev/null +++ b/helm-charts/videoqna/templates/tests/test-pod.yaml @@ -0,0 +1,28 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "videoqna.fullname" . }}-test-connection" + labels: + {{- include "videoqna.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: curl + image: python:3.10.14 + command: ['bash', '-c'] + args: + - | + max_retry=20; + for ((i=1; i<=max_retry; i++)); do + curl http://{{ include "videoqna.fullname" . }}:{{ .Values.service.port }}/v1/videoqna -sS --fail-with-body \ + -d '{"messages": "What is the man doing?","stream": "True"}' + -H 'Content-Type: application/json' && break; + curlcode=$? + if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; + done; + if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + restartPolicy: Never diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index 89279afcb..5d91ad6d9 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -85,7 +85,6 @@ embedding-usvc: image: repository: opea/embedding-multimodal-clip pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. tag: "latest" retriever-usvc: From 418edb74add62843646b43bec52c407cb34cf592 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Thu, 17 Oct 2024 16:20:51 +0530 Subject: [PATCH 04/28] =?UTF-8?q?=E2=9C=8F=20typo=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/lvm-uservice/Chart.yaml | 2 +- helm-charts/common/vdms-vector-db/values.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/helm-charts/common/lvm-uservice/Chart.yaml b/helm-charts/common/lvm-uservice/Chart.yaml index 97492fb23..deb4d7f97 100644 --- a/helm-charts/common/lvm-uservice/Chart.yaml +++ b/helm-charts/common/lvm-uservice/Chart.yaml @@ -8,7 +8,7 @@ type: application version: 1.0.0 appVersion: "v1.0" dependencies: - - name: tgi + - name: lvm-serving version: 1.0.0 repository: file://../lvm-serving condition: autodependency.enabled diff --git a/helm-charts/common/vdms-vector-db/values.yaml b/helm-charts/common/vdms-vector-db/values.yaml index c25e14a27..c2a1f297b 100644 --- a/helm-charts/common/vdms-vector-db/values.yaml +++ b/helm-charts/common/vdms-vector-db/values.yaml @@ -40,7 +40,6 @@ service: port: 8001 targetPort: 55555 - resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little From 24b4e3ff301d5c664d3be63e10bf19775bf0e841 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Tue, 22 Oct 2024 18:10:06 +0530 Subject: [PATCH 05/28] =?UTF-8?q?=F0=9F=9B=82=20running=20vdms=20as=20root?= =?UTF-8?q?=20to=20fix=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- .../common/vdms-vector-db/templates/deployment.yaml | 2 +- helm-charts/common/vdms-vector-db/values.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helm-charts/common/vdms-vector-db/templates/deployment.yaml b/helm-charts/common/vdms-vector-db/templates/deployment.yaml index 3990d67c6..bd97549ba 100644 --- a/helm-charts/common/vdms-vector-db/templates/deployment.yaml +++ b/helm-charts/common/vdms-vector-db/templates/deployment.yaml @@ -42,7 +42,7 @@ spec: protocol: TCP startupProbe: tcpSocket: - port: {{ .Values.service.containerPort }} # Probe the Redis port + port: {{ .Values.service.containerPort }} initialDelaySeconds: 5 periodSeconds: 5 failureThreshold: 120 diff --git a/helm-charts/common/vdms-vector-db/values.yaml b/helm-charts/common/vdms-vector-db/values.yaml index c2a1f297b..9cfb552d5 100644 --- a/helm-charts/common/vdms-vector-db/values.yaml +++ b/helm-charts/common/vdms-vector-db/values.yaml @@ -28,9 +28,9 @@ securityContext: capabilities: drop: - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 + readOnlyRootFilesystem: false + runAsNonRoot: false + runAsUser: 0 allowPrivilegeEscalation: false seccompProfile: type: RuntimeDefault @@ -38,7 +38,7 @@ securityContext: service: type: ClusterIP port: 8001 - targetPort: 55555 + containerPort: 55555 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious From 880e4061543f8e8bc7dd8d3430d348d0e7eda964 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Tue, 22 Oct 2024 18:11:12 +0530 Subject: [PATCH 06/28] =?UTF-8?q?=E2=9C=85=20updated=20tests=20for=20vdms-?= =?UTF-8?q?vector-db=20|=20typo=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- .../vdms-vector-db/templates/tests/test-pod.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml b/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml index 06b6c37ff..84c117d17 100644 --- a/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml +++ b/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml @@ -11,12 +11,9 @@ metadata: "helm.sh/hook": test spec: containers: - - name: curl - image: alpine/curl - command: ['sh', '-c'] - args: - - | - curl http://{{ include "vdms-vector-db.fullname" . }}:{{ .Values.service.port }} -sS --fail-with-body \ - -X HEAD + - name: wget + image: busybox + command: ['nc'] + args: ['-vw', '20', '{{ include "vdms-vector-db.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never From 0110b850045cd96c339ce04c601e376215b1eaec Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Thu, 24 Oct 2024 06:22:39 +0530 Subject: [PATCH 07/28] =?UTF-8?q?=E2=9A=A1Updated=20and=20fixed=20several?= =?UTF-8?q?=20tests,=20values=20during=20integration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/Chart.yaml | 2 +- .../data-prep/templates/deployment.yaml | 14 +++++++ .../data-prep/templates/tests/test-pod.yaml | 2 +- helm-charts/common/data-prep/vdms-values.yaml | 8 +++- .../embedding-usvc/templates/deployment.yaml | 11 +++++ .../common/embedding-usvc/vdms-values.yaml | 7 ++++ .../lvm-serving/templates/configmap.yaml | 2 +- .../lvm-serving/templates/deployment.yaml | 41 ++++++++++++++++--- .../templates/tests/test-connection.yaml | 18 -------- .../lvm-serving/templates/tests/test-pod.yaml | 8 ++-- helm-charts/common/lvm-serving/values.yaml | 19 +++++++-- helm-charts/common/lvm-uservice/Chart.yaml | 2 +- .../lvm-uservice/templates/deployment.yaml | 11 +++-- .../templates/tests/test-connection.yaml | 18 -------- .../templates/tests/test-pod.yaml | 4 +- helm-charts/common/lvm-uservice/values.yaml | 9 ++-- .../templates/tests/test-pod.yaml | 23 +++++++++++ .../{vdms-valaues.yaml => vdms-values.yaml} | 0 helm-charts/common/retriever-usvc/Chart.yaml | 2 +- .../retriever-usvc/templates/deployment.yaml | 11 +++++ helm-charts/common/retriever-usvc/values.yaml | 1 - .../common/retriever-usvc/vdms-values.yaml | 8 +++- .../common/ui/templates/configmap.yaml | 8 ++-- helm-charts/common/ui/videoqna-values.yaml | 6 ++- helm-charts/videoqna/values.yaml | 9 ++-- 25 files changed, 166 insertions(+), 78 deletions(-) delete mode 100644 helm-charts/common/lvm-serving/templates/tests/test-connection.yaml delete mode 100644 helm-charts/common/lvm-uservice/templates/tests/test-connection.yaml rename helm-charts/common/reranking-usvc/{vdms-valaues.yaml => vdms-values.yaml} (100%) diff --git a/helm-charts/common/data-prep/Chart.yaml b/helm-charts/common/data-prep/Chart.yaml index 111fb99d0..7d10622d4 100644 --- a/helm-charts/common/data-prep/Chart.yaml +++ b/helm-charts/common/data-prep/Chart.yaml @@ -20,4 +20,4 @@ dependencies: - name: vdms-vector-db version: 1.0.0 repository: file://../vdms-vector-db - condition: autodependency.vdms + condition: vdms.enabled diff --git a/helm-charts/common/data-prep/templates/deployment.yaml b/helm-charts/common/data-prep/templates/deployment.yaml index 7744aa0a3..a187f1e7b 100644 --- a/helm-charts/common/data-prep/templates/deployment.yaml +++ b/helm-charts/common/data-prep/templates/deployment.yaml @@ -52,6 +52,14 @@ spec: containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: + {{- if .Values.global.cacheUseHostPath }} + - mountPath: /home/user/.cache/clip + name: cache-volume + subPath: clip + - mountPath: /home/user/.cache/huggingface/hub + name: cache-volume + subPath: huggingface/hub + {{- end }} - mountPath: /tmp name: tmp {{- if .Values.livenessProbe }} @@ -69,6 +77,12 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumes: + {{- if .Values.global.cacheUseHostPath }} + - name: cache-volume + hostPath: + path: {{ .Values.global.cacheUseHostPath }} + type: Directory + {{- end }} - name: tmp emptyDir: {} {{- with .Values.nodeSelector }} diff --git a/helm-charts/common/data-prep/templates/tests/test-pod.yaml b/helm-charts/common/data-prep/templates/tests/test-pod.yaml index f6902fb1a..5305774b6 100644 --- a/helm-charts/common/data-prep/templates/tests/test-pod.yaml +++ b/helm-charts/common/data-prep/templates/tests/test-pod.yaml @@ -18,7 +18,7 @@ spec: {{- if contains "dataprep-multimodal-vdms" .Values.image.repository }} args: - | - curl -LO "https://github.com/opea-project/GenAIExamples/raw/refs/heads/main/VideoQnA/docker_compose/intel/cpu/xeon/data/op_1_0320241830.mp4" + https_proxy={{ .Values.global.https_proxy }} curl -svLO "https://github.com/opea-project/GenAIExamples/raw/refs/heads/main/VideoQnA/docker_compose/intel/cpu/xeon/data/op_1_0320241830.mp4" max_retry=5 for ((i=1; i<=max_retry; i++)); do curl http://{{ include "data-prep.fullname" . }}:{{ .Values.service.port }}/v1/dataprep -sS --fail-with-body \ diff --git a/helm-charts/common/data-prep/vdms-values.yaml b/helm-charts/common/data-prep/vdms-values.yaml index a97cfa53a..32f024bc4 100644 --- a/helm-charts/common/data-prep/vdms-values.yaml +++ b/helm-charts/common/data-prep/vdms-values.yaml @@ -1,8 +1,8 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -autodependency: - vdms: false +vdms: + enabled: false image: repository: opea/dataprep-multimodal-vdms @@ -14,3 +14,7 @@ indexName: "mega-videoqna" vdmsHost: "" vdmsPort: "8001" entryCommand: ["/bin/sh"] + +# Set cacheUseHostPath to for caching encoding/embedding models and other related data +global: + cacheUseHostPath: "" diff --git a/helm-charts/common/embedding-usvc/templates/deployment.yaml b/helm-charts/common/embedding-usvc/templates/deployment.yaml index 33de4066d..a0b29650b 100644 --- a/helm-charts/common/embedding-usvc/templates/deployment.yaml +++ b/helm-charts/common/embedding-usvc/templates/deployment.yaml @@ -46,6 +46,11 @@ spec: containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: + {{- if .Values.global.cacheUseHostPath }} + - mountPath: /home/user/.cache/huggingface/hub + name: cache-volume + subPath: huggingface/hub + {{- end }} - mountPath: /tmp name: tmp {{- if .Values.livenessProbe }} @@ -63,6 +68,12 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumes: + {{- if .Values.global.cacheUseHostPath }} + - name: cache-volume + hostPath: + path: {{ .Values.global.cacheUseHostPath }} + type: Directory + {{- end }} - name: tmp emptyDir: {} {{- with .Values.nodeSelector }} diff --git a/helm-charts/common/embedding-usvc/vdms-values.yaml b/helm-charts/common/embedding-usvc/vdms-values.yaml index 8ec573a68..8cc0e985c 100644 --- a/helm-charts/common/embedding-usvc/vdms-values.yaml +++ b/helm-charts/common/embedding-usvc/vdms-values.yaml @@ -6,3 +6,10 @@ image: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "latest" + +securityContext: + readOnlyRootFilesystem: false + +# Set cacheUseHostPath to for caching encoding/embedding models and other related data +global: + cacheUseHostPath: "" diff --git a/helm-charts/common/lvm-serving/templates/configmap.yaml b/helm-charts/common/lvm-serving/templates/configmap.yaml index 186dc0697..193d0c1fa 100644 --- a/helm-charts/common/lvm-serving/templates/configmap.yaml +++ b/helm-charts/common/lvm-serving/templates/configmap.yaml @@ -8,7 +8,7 @@ metadata: labels: {{- include "lvm-serving.labels" . | nindent 4 }} data: - llm_download: {{ .Values.llmDownloadFlag }} + llm_download: {{ .Values.llmDownload | quote | title }} http_proxy: {{ .Values.global.http_proxy | quote }} https_proxy: {{ .Values.global.https_proxy | quote }} no_proxy: {{ .Values.global.no_proxy | quote }} diff --git a/helm-charts/common/lvm-serving/templates/deployment.yaml b/helm-charts/common/lvm-serving/templates/deployment.yaml index f1dba0cd4..829182fa0 100644 --- a/helm-charts/common/lvm-serving/templates/deployment.yaml +++ b/helm-charts/common/lvm-serving/templates/deployment.yaml @@ -8,9 +8,7 @@ metadata: labels: {{- include "lvm-serving.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} - {{- end }} selector: matchLabels: {{- include "lvm-serving.selectorLabels" . | nindent 6 }} @@ -30,13 +28,24 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "lvm-serving.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + envFrom: + - configMapRef: + name: {{ include "lvm-serving.fullname" . }}-config + {{- if .Values.global.extraEnvConfig }} + - configMapRef: + name: {{ .Values.global.extraEnvConfig }} + optional: true + {{- end }} securityContext: + {{- if .Values.global.modelUseHostPath }} + {} + {{- else }} {{- toYaml .Values.securityContext | nindent 12 }} + {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: @@ -44,18 +53,32 @@ spec: containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: - - mountPath: /data - name: video-llama-model + - mountPath: /home/user/model + name: model-volume + {{- if .Values.global.cacheUseHostPath }} + - mountPath: /home/user/.cache/huggingface/hub + name: cache-volume + subPath: huggingface/hub + - mountPath: /home/user/.cache/torch/hub + name: cache-volume + subPath: torch/hub + {{- end }} - mountPath: /tmp name: tmp livenessProbe: {{- toYaml .Values.livenessProbe | nindent 12 }} readinessProbe: {{- toYaml .Values.readinessProbe | nindent 12 }} + startupProbe: + {{- if .Values.llmDownload }} + {{- .Values.startupProbeWithLlmDownload | toYaml | nindent 12 }} + {{- else }} + {{- .Values.startupProbe | toYaml | nindent 12 }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumes: - - name: video-llama-model + - name: model-volume {{- if .Values.global.modelUsePVC }} persistentVolumeClaim: claimName: {{ .Values.global.modelUsePVC }} @@ -66,6 +89,12 @@ spec: {{- else }} emptyDir: {} {{- end }} + {{- if .Values.global.cacheUseHostPath }} + - name: cache-volume + hostPath: + path: {{ .Values.global.cacheUseHostPath }} + type: Directory + {{- end }} - name: tmp emptyDir: {} {{- with .Values.nodeSelector }} diff --git a/helm-charts/common/lvm-serving/templates/tests/test-connection.yaml b/helm-charts/common/lvm-serving/templates/tests/test-connection.yaml deleted file mode 100644 index 8aadfae87..000000000 --- a/helm-charts/common/lvm-serving/templates/tests/test-connection.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "lvm-serving.fullname" . }}-test-connection" - labels: - {{- include "lvm-serving.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "lvm-serving.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml b/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml index 41aaa0f84..0684b6d66 100644 --- a/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml +++ b/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "lvm-serving.fullname" . }}-test-connection" + name: "{{ include "lvm-serving.fullname" . }}-test-pod" labels: {{- include "lvm-serving.labels" . | nindent 4 }} annotations: @@ -16,11 +16,11 @@ spec: command: ['bash', '-c'] args: - | - max_retry=10 + max_retry=20 for ((i=1; i<=max_retry; i++)); do - curl http://{{ include "lvm-serving.fullname" . }}:{{ .Values.service.port }}/generate?video_url=silence_girl.mp4&start=0.0&duration=9&prompt=What%20is%20the%20person%20doing%3F&max_new_tokens=150" -sS --fail-with-body \ + curl 'http://{{ include "lvm-serving.fullname" . }}:{{ .Values.service.port }}/generate?video_url=silence_girl.mp4&start=0.0&duration=9&prompt=What%20is%20the%20person%20doing%3F&max_new_tokens=150' -sS --fail-with-body \ -X POST \ - -H "accept: */*" \ + -H 'accept: */*' \ -d '' && break; curlcode=$? if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; diff --git a/helm-charts/common/lvm-serving/values.yaml b/helm-charts/common/lvm-serving/values.yaml index c51745e67..f786172d0 100644 --- a/helm-charts/common/lvm-serving/values.yaml +++ b/helm-charts/common/lvm-serving/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 -llmDownloadFlag: "True" +llmDownload: true image: repository: opea/video-llama-lvm-server @@ -25,11 +25,11 @@ podLabels: {} podSecurityContext: {} # fsGroup: 2000 -securityContext: {} +securityContext: capabilities: drop: - ALL - readOnlyRootFilesystem: true + readOnlyRootFilesystem: false allowPrivilegeEscalation: false runAsNonRoot: true runAsUser: 1000 @@ -65,11 +65,19 @@ readinessProbe: port: http initialDelaySeconds: 5 periodSeconds: 5 +# Video-Llama Server may take upto 15 mins to startup completely. startupProbe: tcpSocket: port: http initialDelaySeconds: 5 - periodSeconds: 5 + periodSeconds: 10 + failureThreshold: 90 +# When LLM download is taking place, startup may take upto 60 mins. +startupProbeWithLlmDownload: + tcpSocket: + port: http + initialDelaySeconds: 5 + periodSeconds: 30 failureThreshold: 120 nodeSelector: {} @@ -93,3 +101,6 @@ global: # By default, both var are set to empty, the model will be downloaded and saved to a tmp volume. modelUseHostPath: "" modelUsePVC: "" + + # Set cacheUseHostPath to for caching encoding/embedding models and other data + cacheUseHostPath: "" diff --git a/helm-charts/common/lvm-uservice/Chart.yaml b/helm-charts/common/lvm-uservice/Chart.yaml index deb4d7f97..841f45997 100644 --- a/helm-charts/common/lvm-uservice/Chart.yaml +++ b/helm-charts/common/lvm-uservice/Chart.yaml @@ -11,4 +11,4 @@ dependencies: - name: lvm-serving version: 1.0.0 repository: file://../lvm-serving - condition: autodependency.enabled + condition: lvm-serving.enabled diff --git a/helm-charts/common/lvm-uservice/templates/deployment.yaml b/helm-charts/common/lvm-uservice/templates/deployment.yaml index a7747cc46..30569bd61 100644 --- a/helm-charts/common/lvm-uservice/templates/deployment.yaml +++ b/helm-charts/common/lvm-uservice/templates/deployment.yaml @@ -8,9 +8,7 @@ metadata: labels: {{- include "lvm-uservice.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} - {{- end }} selector: matchLabels: {{- include "lvm-uservice.selectorLabels" . | nindent 6 }} @@ -30,11 +28,18 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "lvm-uservice.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + envFrom: + - configMapRef: + name: {{ include "lvm-uservice.fullname" . }}-config + {{- if .Values.global.extraEnvConfig }} + - configMapRef: + name: {{ .Values.global.extraEnvConfig }} + optional: true + {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/helm-charts/common/lvm-uservice/templates/tests/test-connection.yaml b/helm-charts/common/lvm-uservice/templates/tests/test-connection.yaml deleted file mode 100644 index 21ebde314..000000000 --- a/helm-charts/common/lvm-uservice/templates/tests/test-connection.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "lvm-uservice.fullname" . }}-test-connection" - labels: - {{- include "lvm-uservice.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "lvm-uservice.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml b/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml index 565e1b952..7416574df 100644 --- a/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml +++ b/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "lvm-uservice.fullname" . }}-test-connection" + name: "{{ include "lvm-uservice.fullname" . }}-test-pod" labels: {{- include "lvm-uservice.labels" . | nindent 4 }} annotations: @@ -16,7 +16,7 @@ spec: command: ['bash', '-c'] args: - | - max_retry=10 + max_retry=20 for ((i=1; i<=max_retry; i++)); do curl http://{{ include "lvm-uservice.fullname" . }}:{{ .Values.service.port }}/v1/lvm -sS --fail-with-body \ -X POST \ diff --git a/helm-charts/common/lvm-uservice/values.yaml b/helm-charts/common/lvm-uservice/values.yaml index fe6bdcfd5..8b9c2e554 100644 --- a/helm-charts/common/lvm-uservice/values.yaml +++ b/helm-charts/common/lvm-uservice/values.yaml @@ -3,12 +3,13 @@ # Default values for lvm-uservice. -autodependency: +lvm-serving: enabled: false - -replicaCount: 1 + llmDownload: true lvmEndpoint: "" + +replicaCount: 1 image: repository: opea/lvm-video-llama # This sets the pull policy for images. @@ -27,7 +28,7 @@ podLabels: {} podSecurityContext: {} # fsGroup: 2000 -securityContext: {} +securityContext: capabilities: drop: - ALL diff --git a/helm-charts/common/reranking-usvc/templates/tests/test-pod.yaml b/helm-charts/common/reranking-usvc/templates/tests/test-pod.yaml index 4bd7ac745..16af468bd 100644 --- a/helm-charts/common/reranking-usvc/templates/tests/test-pod.yaml +++ b/helm-charts/common/reranking-usvc/templates/tests/test-pod.yaml @@ -15,6 +15,28 @@ spec: - name: curl image: python:3.10.14 command: ['bash', '-c'] + {{- if contains "reranking-videoqna" .Values.image.repository }} + args: + - | + max_retry=20; + for ((i=1; i<=max_retry; i++)); do + curl http://{{ include "reranking-usvc.fullname" . }}:{{ .Values.service.port }}/v1/reranking -sS --fail-with-body \ + -X 'POST' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "retrieved_docs": [{"doc": [{"text": "this is the retrieved text"}]}], + "initial_query": "this is the query", + "top_n": 1, + "metadata": [ + {"other_key": "value", "video":"top_video_name", "timestamp":"20"} + ] + }' && break; + curlcode=$? + if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; + done; + if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + {{- else }} args: - | max_retry=20; @@ -27,4 +49,5 @@ spec: if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; done; if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + {{- end }} restartPolicy: Never diff --git a/helm-charts/common/reranking-usvc/vdms-valaues.yaml b/helm-charts/common/reranking-usvc/vdms-values.yaml similarity index 100% rename from helm-charts/common/reranking-usvc/vdms-valaues.yaml rename to helm-charts/common/reranking-usvc/vdms-values.yaml diff --git a/helm-charts/common/retriever-usvc/Chart.yaml b/helm-charts/common/retriever-usvc/Chart.yaml index 31f0f86cf..872ec7c87 100644 --- a/helm-charts/common/retriever-usvc/Chart.yaml +++ b/helm-charts/common/retriever-usvc/Chart.yaml @@ -20,4 +20,4 @@ dependencies: - name: vdms-vector-db version: 1.0.0 repository: file://../vdms-vector-db - condition: autodependency.vdms + condition: vdms.enabled diff --git a/helm-charts/common/retriever-usvc/templates/deployment.yaml b/helm-charts/common/retriever-usvc/templates/deployment.yaml index 7e59c61ad..5139f4007 100644 --- a/helm-charts/common/retriever-usvc/templates/deployment.yaml +++ b/helm-charts/common/retriever-usvc/templates/deployment.yaml @@ -52,6 +52,11 @@ spec: containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: + {{- if .Values.global.cacheUseHostPath }} + - mountPath: /home/user/.cache/huggingface/hub + name: cache-volume + subPath: huggingface/hub + {{- end }} - mountPath: /tmp name: tmp {{- if .Values.livenessProbe }} @@ -69,6 +74,12 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumes: + {{- if .Values.global.cacheUseHostPath }} + - name: cache-volume + hostPath: + path: {{ .Values.global.cacheUseHostPath }} + type: Directory + {{- end }} - name: tmp emptyDir: {} {{- with .Values.nodeSelector }} diff --git a/helm-charts/common/retriever-usvc/values.yaml b/helm-charts/common/retriever-usvc/values.yaml index 1c5e172f6..919381cbb 100644 --- a/helm-charts/common/retriever-usvc/values.yaml +++ b/helm-charts/common/retriever-usvc/values.yaml @@ -7,7 +7,6 @@ autodependency: enabled: false - vdms: false replicaCount: 1 diff --git a/helm-charts/common/retriever-usvc/vdms-values.yaml b/helm-charts/common/retriever-usvc/vdms-values.yaml index fc8da4ba2..d5cd5b29a 100644 --- a/helm-charts/common/retriever-usvc/vdms-values.yaml +++ b/helm-charts/common/retriever-usvc/vdms-values.yaml @@ -1,8 +1,8 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -autodependency: - vdms: false +vdms: + enabled: false image: repository: opea/retriever-vdms @@ -15,3 +15,7 @@ vdmsHost: "" vdmsPort: "8001" useClip: "1" entryCommand: ["/bin/sh"] + +# Set cacheUseHostPath to for caching encoding/embedding models and other related data +global: + cacheUseHostPath: "" diff --git a/helm-charts/common/ui/templates/configmap.yaml b/helm-charts/common/ui/templates/configmap.yaml index 8eba994ed..b015aa107 100644 --- a/helm-charts/common/ui/templates/configmap.yaml +++ b/helm-charts/common/ui/templates/configmap.yaml @@ -8,11 +8,11 @@ metadata: labels: {{- include "ui.labels" . | nindent 4 }} data: - {{- if .Values.backendHealthCheckEndpoint }} - BACKEND_HEALTH_CHECK_ENDPOINT: {{ .Values.backendHealthCheckEndpoint | quote }} + {{- if .Values.videoqnaBackendHealthCheck }} + BACKEND_HEALTH_CHECK_ENDPOINT: {{ .Values.videoqnaBackendHealthCheck | quote }} {{- end }} - {{- if .Values.backendServiceEndpoint }} - BACKEND_SERVICE_ENDPOINT: {{ .Values.backendServiceEndpoint | quote }} + {{- if .Values.videoqnaBackendService }} + BACKEND_SERVICE_ENDPOINT: {{ .Values.videoqnaBackendService | quote }} {{- end }} APP_BACKEND_SERVICE_ENDPOINT: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} APP_DATA_PREP_SERVICE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }} diff --git a/helm-charts/common/ui/videoqna-values.yaml b/helm-charts/common/ui/videoqna-values.yaml index 9f3f0a117..62a6e62d8 100644 --- a/helm-charts/common/ui/videoqna-values.yaml +++ b/helm-charts/common/ui/videoqna-values.yaml @@ -6,8 +6,10 @@ image: pullPolicy: IfNotPresent tag: "latest" -backendServiceEndpoint: "/v1/videoqna" -backendHealthCheckEndpoint: "/v1/health_check" +# Endpoint for VideoQnA Backend +videoqnaBackendService: "/v1/videoqna" +# Endpoint for VideoQnA Backend Service health check +videoqnaBackendHealthCheck: "/v1/health_check" service: type: ClusterIP diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index 5d91ad6d9..b1bc6e146 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -114,7 +114,10 @@ global: https_proxy: "" no_proxy: "" HUGGINGFACEHUB_API_TOKEN: "insert-your-huggingface-token-here" - # set modelUseHostPath or modelUsePVC to use model cache. + + # Set modelUseHostPath or modelUsePVC to use model cache. modelUseHostPath: "" - # modelUseHostPath: /mnt/opea-models - # modelUsePVC: model-volume + # modelUsePVC: "" + + # Set cacheUseHostPath to for caching encoding/embedding models and other related data + cacheUseHostPath: "" From 56afc6397a26e21d251edc988d319bd6f46122b7 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Thu, 24 Oct 2024 06:51:35 +0530 Subject: [PATCH 08/28] =?UTF-8?q?=F0=9F=94=A5=20removed=20hardcoded=20extr?= =?UTF-8?q?aArgs=20for=20some=20comps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/templates/deployment.yaml | 7 +++++-- helm-charts/common/data-prep/vdms-values.yaml | 1 + helm-charts/common/lvm-serving/values.yaml | 2 +- .../common/retriever-usvc/templates/deployment.yaml | 7 +++++-- helm-charts/common/retriever-usvc/vdms-values.yaml | 1 + helm-charts/videoqna/templates/deployment.yaml | 7 +++++-- helm-charts/videoqna/values.yaml | 9 ++++++--- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/helm-charts/common/data-prep/templates/deployment.yaml b/helm-charts/common/data-prep/templates/deployment.yaml index a187f1e7b..a7b9e1e42 100644 --- a/helm-charts/common/data-prep/templates/deployment.yaml +++ b/helm-charts/common/data-prep/templates/deployment.yaml @@ -43,9 +43,12 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.entryCommand }} command: {{ .Values.entryCommand }} + {{- end }} + {{- if .Values.extraArgs }} args: - - "-c" - - "sleep 15 && python ingest_videos.py" + {{- range .Values.extraArgs }} + - {{ . | quote }} + {{- end }} {{- end }} ports: - name: data-prep diff --git a/helm-charts/common/data-prep/vdms-values.yaml b/helm-charts/common/data-prep/vdms-values.yaml index 32f024bc4..af308d59a 100644 --- a/helm-charts/common/data-prep/vdms-values.yaml +++ b/helm-charts/common/data-prep/vdms-values.yaml @@ -14,6 +14,7 @@ indexName: "mega-videoqna" vdmsHost: "" vdmsPort: "8001" entryCommand: ["/bin/sh"] +extraArgs: ["-c", "sleep 15 && python ingest_videos.py"] # Set cacheUseHostPath to for caching encoding/embedding models and other related data global: diff --git a/helm-charts/common/lvm-serving/values.yaml b/helm-charts/common/lvm-serving/values.yaml index f786172d0..b7c43a21b 100644 --- a/helm-charts/common/lvm-serving/values.yaml +++ b/helm-charts/common/lvm-serving/values.yaml @@ -102,5 +102,5 @@ global: modelUseHostPath: "" modelUsePVC: "" - # Set cacheUseHostPath to for caching encoding/embedding models and other data + # Set cacheUseHostPath to for caching encoding/embedding models and other related data cacheUseHostPath: "" diff --git a/helm-charts/common/retriever-usvc/templates/deployment.yaml b/helm-charts/common/retriever-usvc/templates/deployment.yaml index 5139f4007..f2eed6ee8 100644 --- a/helm-charts/common/retriever-usvc/templates/deployment.yaml +++ b/helm-charts/common/retriever-usvc/templates/deployment.yaml @@ -43,9 +43,12 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.entryCommand }} command: {{ .Values.entryCommand }} + {{- end }} + {{- if .Values.extraArgs }} args: - - "-c" - - "sleep 30 && python retriever_vdms.py" + {{- range .Values.extraArgs }} + - {{ . | quote }} + {{- end }} {{- end }} ports: - name: retriever-usvc diff --git a/helm-charts/common/retriever-usvc/vdms-values.yaml b/helm-charts/common/retriever-usvc/vdms-values.yaml index d5cd5b29a..9390ce77d 100644 --- a/helm-charts/common/retriever-usvc/vdms-values.yaml +++ b/helm-charts/common/retriever-usvc/vdms-values.yaml @@ -15,6 +15,7 @@ vdmsHost: "" vdmsPort: "8001" useClip: "1" entryCommand: ["/bin/sh"] +extraArgs: ["-c", "sleep 30 && python retriever_vdms.py"] # Set cacheUseHostPath to for caching encoding/embedding models and other related data global: diff --git a/helm-charts/videoqna/templates/deployment.yaml b/helm-charts/videoqna/templates/deployment.yaml index 1d9e559c4..8fd824e96 100644 --- a/helm-charts/videoqna/templates/deployment.yaml +++ b/helm-charts/videoqna/templates/deployment.yaml @@ -41,9 +41,12 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if .Values.entryCommand }} command: {{ .Values.entryCommand }} + {{- end }} + {{- if .Values.extraArgs }} args: - - "-c" - - "sleep 45 && python videoqna.py" + {{- range .Values.extraArgs }} + - {{ . | quote }} + {{- end }} {{- end }} ports: - name: http diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index b1bc6e146..36f57f26d 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -22,7 +22,7 @@ podLabels: {} podSecurityContext: {} # fsGroup: 2000 -securityContext: {} +securityContext: capabilities: drop: - ALL @@ -56,6 +56,7 @@ tolerations: [] affinity: {} entryCommand: ["/bin/sh"] +extraArgs: ["-c", "sleep 45 && python videoqna.py"] ui: image: @@ -63,8 +64,8 @@ ui: pullPolicy: IfNotPresent tag: "latest" - backendServiceEndpoint: "/v1/videoqna" - backendHealthCheckEndpoint: "/v1/health_check" + videoqnaBackendService: "/v1/videoqna" + videoqnaBackendHealthCheck: "/v1/health_check" service: type: ClusterIP @@ -80,6 +81,7 @@ data-prep: vdmsHost: "" vdmsPort: "8001" entryCommand: ["/bin/sh"] + extraArgs: ["-c", "sleep 15 && python ingest_videos.py"] embedding-usvc: image: @@ -98,6 +100,7 @@ retriever-usvc: vdmsPort: "8001" useClip: "1" entryCommand: ["/bin/sh"] + extraArgs: ["-c", "sleep 30 && python retriever_vdms.py"] reranking-usvc: image: From 1a5f762199196d2c4dd574946324d742012f9b9a Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Thu, 24 Oct 2024 06:51:35 +0530 Subject: [PATCH 09/28] =?UTF-8?q?=F0=9F=94=A5=20removed=20hardcoded=20extr?= =?UTF-8?q?aArgs=20for=20some=20comps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/values.yaml | 4 +- helm-charts/common/data-prep/vdms-values.yaml | 3 -- .../lvm-serving/templates/deployment.yaml | 2 +- .../lvm-serving/templates/tests/test-pod.yaml | 2 +- .../lvm-uservice/templates/deployment.yaml | 2 +- .../templates/tests/test-pod.yaml | 2 +- helm-charts/common/retriever-usvc/values.yaml | 3 ++ .../common/retriever-usvc/vdms-values.yaml | 3 -- helm-charts/common/ui/videoqna-values.yaml | 3 +- .../vdms-vector-db/templates/deployment.yaml | 2 +- .../templates/tests/test-pod.yaml | 2 +- helm-charts/videoqna/templates/configmap.yaml | 37 +++++++++++++++++++ .../videoqna/templates/deployment.yaml | 13 +++++-- .../videoqna/templates/tests/test-pod.yaml | 5 ++- helm-charts/videoqna/values.yaml | 16 ++++++-- 15 files changed, 75 insertions(+), 24 deletions(-) create mode 100644 helm-charts/videoqna/templates/configmap.yaml diff --git a/helm-charts/common/data-prep/values.yaml b/helm-charts/common/data-prep/values.yaml index 0aa139342..946952e3e 100644 --- a/helm-charts/common/data-prep/values.yaml +++ b/helm-charts/common/data-prep/values.yaml @@ -7,7 +7,9 @@ autodependency: enabled: false - vdms: false + +vdms: + enabled: false replicaCount: 1 diff --git a/helm-charts/common/data-prep/vdms-values.yaml b/helm-charts/common/data-prep/vdms-values.yaml index af308d59a..111bf3460 100644 --- a/helm-charts/common/data-prep/vdms-values.yaml +++ b/helm-charts/common/data-prep/vdms-values.yaml @@ -1,9 +1,6 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -vdms: - enabled: false - image: repository: opea/dataprep-multimodal-vdms pullPolicy: IfNotPresent diff --git a/helm-charts/common/lvm-serving/templates/deployment.yaml b/helm-charts/common/lvm-serving/templates/deployment.yaml index 829182fa0..a04cab129 100644 --- a/helm-charts/common/lvm-serving/templates/deployment.yaml +++ b/helm-charts/common/lvm-serving/templates/deployment.yaml @@ -31,7 +31,7 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ .Release.Name }} envFrom: - configMapRef: name: {{ include "lvm-serving.fullname" . }}-config diff --git a/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml b/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml index 0684b6d66..b5fc818ab 100644 --- a/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml +++ b/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "lvm-serving.fullname" . }}-test-pod" + name: "{{ include "lvm-serving.fullname" . }}-testpod" labels: {{- include "lvm-serving.labels" . | nindent 4 }} annotations: diff --git a/helm-charts/common/lvm-uservice/templates/deployment.yaml b/helm-charts/common/lvm-uservice/templates/deployment.yaml index 30569bd61..1484c6006 100644 --- a/helm-charts/common/lvm-uservice/templates/deployment.yaml +++ b/helm-charts/common/lvm-uservice/templates/deployment.yaml @@ -31,7 +31,7 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ .Release.Name }} envFrom: - configMapRef: name: {{ include "lvm-uservice.fullname" . }}-config diff --git a/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml b/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml index 7416574df..36287cf7e 100644 --- a/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml +++ b/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "lvm-uservice.fullname" . }}-test-pod" + name: "{{ include "lvm-uservice.fullname" . }}-testpod" labels: {{- include "lvm-uservice.labels" . | nindent 4 }} annotations: diff --git a/helm-charts/common/retriever-usvc/values.yaml b/helm-charts/common/retriever-usvc/values.yaml index 919381cbb..e30a8e154 100644 --- a/helm-charts/common/retriever-usvc/values.yaml +++ b/helm-charts/common/retriever-usvc/values.yaml @@ -8,6 +8,9 @@ autodependency: enabled: false +vdms: + enabled: false + replicaCount: 1 # Set it as a non-null string, such as true, if you want to enable logging facility, diff --git a/helm-charts/common/retriever-usvc/vdms-values.yaml b/helm-charts/common/retriever-usvc/vdms-values.yaml index 9390ce77d..024930ec6 100644 --- a/helm-charts/common/retriever-usvc/vdms-values.yaml +++ b/helm-charts/common/retriever-usvc/vdms-values.yaml @@ -1,9 +1,6 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -vdms: - enabled: false - image: repository: opea/retriever-vdms pullPolicy: IfNotPresent diff --git a/helm-charts/common/ui/videoqna-values.yaml b/helm-charts/common/ui/videoqna-values.yaml index 62a6e62d8..6ff4d0f52 100644 --- a/helm-charts/common/ui/videoqna-values.yaml +++ b/helm-charts/common/ui/videoqna-values.yaml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 image: - repository: opea/videoqna-ui:latest + repository: opea/videoqna-ui pullPolicy: IfNotPresent tag: "latest" @@ -11,6 +11,7 @@ videoqnaBackendService: "/v1/videoqna" # Endpoint for VideoQnA Backend Service health check videoqnaBackendHealthCheck: "/v1/health_check" +containerPort: 5173 service: type: ClusterIP port: 5173 diff --git a/helm-charts/common/vdms-vector-db/templates/deployment.yaml b/helm-charts/common/vdms-vector-db/templates/deployment.yaml index bd97549ba..41af73b0a 100644 --- a/helm-charts/common/vdms-vector-db/templates/deployment.yaml +++ b/helm-charts/common/vdms-vector-db/templates/deployment.yaml @@ -31,7 +31,7 @@ spec: securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ .Release.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml b/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml index 84c117d17..fb178e6f8 100644 --- a/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml +++ b/helm-charts/common/vdms-vector-db/templates/tests/test-pod.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "vdms-vector-db.fullname" . }}-test-pod" + name: "{{ include "vdms-vector-db.fullname" . }}-testpod" labels: {{- include "vdms-vector-db.labels" . | nindent 4 }} annotations: diff --git a/helm-charts/videoqna/templates/configmap.yaml b/helm-charts/videoqna/templates/configmap.yaml new file mode 100644 index 000000000..d043f4fd9 --- /dev/null +++ b/helm-charts/videoqna/templates/configmap.yaml @@ -0,0 +1,37 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "videoqna.fullname" . }}-config + labels: + {{- include "videoqna.labels" . | nindent 4 }} +data: + {{- if .Values.embeddingServiceHost }} + EMBEDDING_SERVICE_HOST_IP: {{ .Values.embeddingServiceHost | quote }} + {{- else }} + EMBEDDING_SERVICE_HOST_IP: "{{ .Release.Name }}-embedding-usvc" + {{- end }} + {{- if .Values.retrieverServiceHost }} + RETRIEVER_SERVICE_HOST_IP: {{ .Values.retrieverServiceHost | quote }} + {{- else }} + RETRIEVER_SERVICE_HOST_IP: "{{ .Release.Name }}-retriever-usvc" + {{- end }} + {{- if .Values.rerankServiceHost }} + RERANK_SERVICE_HOST_IP: {{ .Values.rerankServiceHost | quote }} + {{- else }} + RERANK_SERVICE_HOST_IP: "{{ .Release.Name }}-reranking-usvc" + {{- end }} + {{- if .Values.lvmServiceHost }} + LVM_SERVICE_HOST_IP: {{ .Values.lvmServiceHost | quote }} + {{- else }} + LVM_SERVICE_HOST_IP: "{{ .Release.Name }}-lvm-uservice" + {{- end }} + http_proxy: {{ .Values.global.http_proxy | quote }} + https_proxy: {{ .Values.global.https_proxy | quote }} + {{- if and (not .Values.lvmServiceHost) (or .Values.global.http_proxy .Values.global.https_proxy) }} + no_proxy: "{{ .Release.Name }}-embedding-usvc,{{ .Release.Name }}-retriever-usvc,{{ .Release.Name }}-lvm-uservice,{{ .Release.Name }}-reranking-usvc,{{ .Values.global.no_proxy }}" + {{- else }} + no_proxy: {{ .Values.global.no_proxy | quote }} + {{- end }} diff --git a/helm-charts/videoqna/templates/deployment.yaml b/helm-charts/videoqna/templates/deployment.yaml index 8fd824e96..4e711dd71 100644 --- a/helm-charts/videoqna/templates/deployment.yaml +++ b/helm-charts/videoqna/templates/deployment.yaml @@ -8,9 +8,7 @@ metadata: labels: {{- include "videoqna.labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} - {{- end }} selector: matchLabels: {{- include "videoqna.selectorLabels" . | nindent 6 }} @@ -30,11 +28,18 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "videoqna.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ .Release.Name }} + envFrom: + - configMapRef: + name: {{ include "videoqna.fullname" . }}-config + {{- if .Values.global.extraEnvConfig }} + - configMapRef: + name: {{ .Values.global.extraEnvConfig }} + optional: true + {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/helm-charts/videoqna/templates/tests/test-pod.yaml b/helm-charts/videoqna/templates/tests/test-pod.yaml index 3611550d1..c570d4e24 100644 --- a/helm-charts/videoqna/templates/tests/test-pod.yaml +++ b/helm-charts/videoqna/templates/tests/test-pod.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "videoqna.fullname" . }}-test-connection" + name: "{{ include "videoqna.fullname" . }}-testpod" labels: {{- include "videoqna.labels" . | nindent 4 }} annotations: @@ -19,7 +19,8 @@ spec: max_retry=20; for ((i=1; i<=max_retry; i++)); do curl http://{{ include "videoqna.fullname" . }}:{{ .Values.service.port }}/v1/videoqna -sS --fail-with-body \ - -d '{"messages": "What is the man doing?","stream": "True"}' + -X POST \ + -d '{"messages": "What is the man doing?","stream": "True"}' \ -H 'Content-Type: application/json' && break; curlcode=$? if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index 36f57f26d..cefcf70fa 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -36,7 +36,6 @@ service: port: 8888 containerPort: 8888 - resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little @@ -55,25 +54,31 @@ tolerations: [] affinity: {} +embeddingServiceHost: "" +retrieverServiceHost: "" +rerankServiceHost: "" +lvmServiceHost: "" + entryCommand: ["/bin/sh"] extraArgs: ["-c", "sleep 45 && python videoqna.py"] -ui: +videoqna-ui: image: - repository: opea/videoqna-ui:latest + repository: opea/videoqna-ui pullPolicy: IfNotPresent tag: "latest" videoqnaBackendService: "/v1/videoqna" videoqnaBackendHealthCheck: "/v1/health_check" + containerPort: 5173 service: type: ClusterIP port: 5173 data-prep: image: - repository: opea/dataprep-multimodal-vdm + repository: opea/dataprep-multimodal-vdms pullPolicy: IfNotPresent tag: "latest" @@ -89,6 +94,9 @@ embedding-usvc: pullPolicy: IfNotPresent tag: "latest" + securityContext: + readOnlyRootFilesystem: false + retriever-usvc: image: repository: opea/retriever-vdms From 3bb015d41f2bb4d60a05d974749d504ad9942662 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Mon, 28 Oct 2024 00:37:33 +0530 Subject: [PATCH 10/28] =?UTF-8?q?=F0=9F=A9=B9=20fixes=20for=20request=20go?= =?UTF-8?q?ing=20to=20nginx=20instead=20of=20videoqna?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- .../videoqna/templates/deployment.yaml | 3 +++ .../videoqna/templates/nginx-deployment.yaml | 25 ++++++------------- helm-charts/videoqna/templates/service.yaml | 1 + 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/helm-charts/videoqna/templates/deployment.yaml b/helm-charts/videoqna/templates/deployment.yaml index 4e711dd71..3f2711ae7 100644 --- a/helm-charts/videoqna/templates/deployment.yaml +++ b/helm-charts/videoqna/templates/deployment.yaml @@ -7,11 +7,13 @@ metadata: name: {{ include "videoqna.fullname" . }} labels: {{- include "videoqna.labels" . | nindent 4 }} + app: {{ include "videoqna.fullname" . }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "videoqna.selectorLabels" . | nindent 6 }} + app: {{ include "videoqna.fullname" . }} template: metadata: {{- with .Values.podAnnotations }} @@ -20,6 +22,7 @@ spec: {{- end }} labels: {{- include "videoqna.labels" . | nindent 8 }} + app: {{ include "videoqna.fullname" . }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/helm-charts/videoqna/templates/nginx-deployment.yaml b/helm-charts/videoqna/templates/nginx-deployment.yaml index f727ff080..e22ef73ee 100644 --- a/helm-charts/videoqna/templates/nginx-deployment.yaml +++ b/helm-charts/videoqna/templates/nginx-deployment.yaml @@ -15,10 +15,14 @@ data: location / { proxy_pass http://{{ include "ui.fullname" (index .Subcharts "videoqna-ui") }}:{{ index .Values "videoqna-ui" "service" "port" }}; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + proxy_cache_bypass $http_upgrade; } location /v1/videoqna { @@ -29,24 +33,8 @@ data: proxy_set_header X-Forwarded-Proto $scheme; } - location /v1/dataprep { - proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - location /v1/dataprep/get_file { - proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - - location /v1/dataprep/delete_file { - proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; + location /v1/health_check { + proxy_pass http://{{ include "videoqna.fullname" . }}:{{ .Values.service.port }}; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -111,6 +99,7 @@ spec: - port: 80 protocol: TCP targetPort: 80 + nodePort: 30881 selector: {{- include "videoqna.selectorLabels" . | nindent 4 }} app: {{ include "videoqna.fullname" . }}-nginx diff --git a/helm-charts/videoqna/templates/service.yaml b/helm-charts/videoqna/templates/service.yaml index 935e54320..0f74e52b6 100644 --- a/helm-charts/videoqna/templates/service.yaml +++ b/helm-charts/videoqna/templates/service.yaml @@ -16,3 +16,4 @@ spec: name: http selector: {{- include "videoqna.selectorLabels" . | nindent 4 }} + app: {{ include "videoqna.fullname" . }} From a29691b66d905f3164d84bb2a9f11d3fef189657 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Mon, 28 Oct 2024 05:40:40 +0530 Subject: [PATCH 11/28] =?UTF-8?q?=F0=9F=94=A8=20passed=20nginx=20proxy=20e?= =?UTF-8?q?ndpoints=20to=20UI=20using=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/ui/templates/_helpers.tpl | 7 +++++++ helm-charts/common/ui/templates/configmap.yaml | 4 ++-- helm-charts/common/ui/videoqna-values.yaml | 8 ++++---- .../videoqna/templates/nginx-deployment.yaml | 16 ++++++++-------- helm-charts/videoqna/values.yaml | 10 ++++++++-- 5 files changed, 29 insertions(+), 16 deletions(-) diff --git a/helm-charts/common/ui/templates/_helpers.tpl b/helm-charts/common/ui/templates/_helpers.tpl index 07e404849..86dd0797c 100644 --- a/helm-charts/common/ui/templates/_helpers.tpl +++ b/helm-charts/common/ui/templates/_helpers.tpl @@ -60,3 +60,10 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Define the name for nginx Chart. Nginx service is needed by Videoqna Streamlit UI. +*/}} +{{- define "nginx.fullname" -}} +{{ include "ui.fullname" . | trimSuffix "-ui" }}-nginx +{{- end }} \ No newline at end of file diff --git a/helm-charts/common/ui/templates/configmap.yaml b/helm-charts/common/ui/templates/configmap.yaml index b015aa107..664c4f7ae 100644 --- a/helm-charts/common/ui/templates/configmap.yaml +++ b/helm-charts/common/ui/templates/configmap.yaml @@ -9,10 +9,10 @@ metadata: {{- include "ui.labels" . | nindent 4 }} data: {{- if .Values.videoqnaBackendHealthCheck }} - BACKEND_HEALTH_CHECK_ENDPOINT: {{ .Values.videoqnaBackendHealthCheck | quote }} + BACKEND_HEALTH_CHECK_ENDPOINT: {{ tpl .Values.videoqnaBackendHealthCheck . | quote }} {{- end }} {{- if .Values.videoqnaBackendService }} - BACKEND_SERVICE_ENDPOINT: {{ .Values.videoqnaBackendService | quote }} + BACKEND_SERVICE_ENDPOINT: {{ tpl .Values.videoqnaBackendService . | quote }} {{- end }} APP_BACKEND_SERVICE_ENDPOINT: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} APP_DATA_PREP_SERVICE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }} diff --git a/helm-charts/common/ui/videoqna-values.yaml b/helm-charts/common/ui/videoqna-values.yaml index 6ff4d0f52..857c0f8cf 100644 --- a/helm-charts/common/ui/videoqna-values.yaml +++ b/helm-charts/common/ui/videoqna-values.yaml @@ -6,10 +6,10 @@ image: pullPolicy: IfNotPresent tag: "latest" -# Endpoint for VideoQnA Backend -videoqnaBackendService: "/v1/videoqna" -# Endpoint for VideoQnA Backend Service health check -videoqnaBackendHealthCheck: "/v1/health_check" +# Endpoint for VideoQnA Backend. Test Value - Override it with actual Backend endpoint +videoqnaBackendService: "http://localhost:8888/v1/videoqna" +# Endpoint for VideoQnA Backend Service health check. Test Value - Override it with actual Backend endpoint +videoqnaBackendHealthCheck: "http://localhost:8888/v1/health_check" containerPort: 5173 service: diff --git a/helm-charts/videoqna/templates/nginx-deployment.yaml b/helm-charts/videoqna/templates/nginx-deployment.yaml index e22ef73ee..cdb7dda0a 100644 --- a/helm-charts/videoqna/templates/nginx-deployment.yaml +++ b/helm-charts/videoqna/templates/nginx-deployment.yaml @@ -44,25 +44,25 @@ data: kind: ConfigMap metadata: - name: {{ include "videoqna.fullname" . }}-nginx-config + name: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }}-config --- apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "videoqna.fullname" . }}-nginx + name: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} labels: {{- include "videoqna.labels" . | nindent 4 }} - app: {{ include "videoqna.fullname" . }}-nginx + app: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} spec: selector: matchLabels: {{- include "videoqna.selectorLabels" . | nindent 6 }} - app: {{ include "videoqna.fullname" . }}-nginx + app: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} template: metadata: labels: {{- include "videoqna.selectorLabels" . | nindent 8 }} - app: {{ include "videoqna.fullname" . }}-nginx + app: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} spec: containers: - image: nginx:1.27.1 @@ -75,7 +75,7 @@ spec: volumes: - configMap: defaultMode: 420 - name: {{ include "videoqna.fullname" . }}-nginx-config + name: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }}-config name: nginx-config-volume {{- with .Values.nodeSelector }} nodeSelector: @@ -93,7 +93,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: {{ include "videoqna.fullname" . }}-nginx + name: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} spec: ports: - port: 80 @@ -102,5 +102,5 @@ spec: nodePort: 30881 selector: {{- include "videoqna.selectorLabels" . | nindent 4 }} - app: {{ include "videoqna.fullname" . }}-nginx + app: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} type: NodePort diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index cefcf70fa..6bb8fde0f 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -68,8 +68,14 @@ videoqna-ui: pullPolicy: IfNotPresent tag: "latest" - videoqnaBackendService: "/v1/videoqna" - videoqnaBackendHealthCheck: "/v1/health_check" + # Overriding videoqna-ui chart name to avoid repetitive videoqna in the fullname. + nameOverride: "ui" + + # Following template value will be resolved in videoqna-ui subchart's context. For this, + # nginx.fullname definition is added to videoqna-ui template (as UI subchart + # can not access the templates of parent chart). + videoqnaBackendService: http://{{ include "nginx.fullname" . }}/v1/videoqna + videoqnaBackendHealthCheck: http://{{ include "nginx.fullname" . }}/v1/health_check containerPort: 5173 service: From e8f58bbabd43354b6250a7f26c218f5f57bed6b3 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Mon, 28 Oct 2024 05:40:40 +0530 Subject: [PATCH 12/28] =?UTF-8?q?=F0=9F=94=A8=20passed=20nginx=20proxy=20e?= =?UTF-8?q?ndpoints=20to=20UI=20using=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- .../reranking-usvc/templates/configmap.yaml | 4 +-- .../common/reranking-usvc/vdms-values.yaml | 6 ++-- helm-charts/common/ui/templates/_helpers.tpl | 7 ---- helm-charts/videoqna/templates/_helpers.tpl | 7 ++++ .../videoqna/templates/nginx-deployment.yaml | 34 ++++++++++++++----- helm-charts/videoqna/values.yaml | 14 ++++---- 6 files changed, 46 insertions(+), 26 deletions(-) diff --git a/helm-charts/common/reranking-usvc/templates/configmap.yaml b/helm-charts/common/reranking-usvc/templates/configmap.yaml index 133f060b0..0b4ac2d83 100644 --- a/helm-charts/common/reranking-usvc/templates/configmap.yaml +++ b/helm-charts/common/reranking-usvc/templates/configmap.yaml @@ -12,10 +12,10 @@ data: CHUNK_DURATION: {{ .Values.chunkDuration | quote }} {{- end }} {{- if .Values.fileServerEndpoint }} - FILE_SERVER_ENDPOINT: {{ .Values.fileServerEndpoint | quote }} + FILE_SERVER_ENDPOINT: {{ tpl .Values.fileServerEndpoint . | quote }} {{- end }} {{- if .Values.getVideoListEndpoint }} - DATAPREP_GET_VIDEO_LIST_ENDPOINT: {{ .Values.getVideoListEndpoint | quote }} + DATAPREP_GET_VIDEO_LIST_ENDPOINT: {{ tpl .Values.getVideoListEndpoint . | quote }} {{- end }} {{- if .Values.TEI_RERANKING_ENDPOINT }} TEI_RERANKING_ENDPOINT: {{ .Values.TEI_RERANKING_ENDPOINT | quote }} diff --git a/helm-charts/common/reranking-usvc/vdms-values.yaml b/helm-charts/common/reranking-usvc/vdms-values.yaml index 5c6a70c3c..453e56b55 100644 --- a/helm-charts/common/reranking-usvc/vdms-values.yaml +++ b/helm-charts/common/reranking-usvc/vdms-values.yaml @@ -8,5 +8,7 @@ image: tag: "latest" chunkDuration: "" -fileServerEndpoint: "/v1/dataprep/get_file" -getVideoListEndpoint: "/v1/dataprep/get_videos" + +# Test values - Replace with actual Endpoint URLs +fileServerEndpoint: "http://localhost:6007/v1/dataprep/get_file" +getVideoListEndpoint: "http://localhost:6007/v1/dataprep/get_videos" diff --git a/helm-charts/common/ui/templates/_helpers.tpl b/helm-charts/common/ui/templates/_helpers.tpl index 86dd0797c..e8e367ff2 100644 --- a/helm-charts/common/ui/templates/_helpers.tpl +++ b/helm-charts/common/ui/templates/_helpers.tpl @@ -59,11 +59,4 @@ Create the name of the service account to use {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} -{{- end }} - -{{/* -Define the name for nginx Chart. Nginx service is needed by Videoqna Streamlit UI. -*/}} -{{- define "nginx.fullname" -}} -{{ include "ui.fullname" . | trimSuffix "-ui" }}-nginx {{- end }} \ No newline at end of file diff --git a/helm-charts/videoqna/templates/_helpers.tpl b/helm-charts/videoqna/templates/_helpers.tpl index 75b98a8f7..be4c36252 100644 --- a/helm-charts/videoqna/templates/_helpers.tpl +++ b/helm-charts/videoqna/templates/_helpers.tpl @@ -60,3 +60,10 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Define the name for nginx Chart. +*/}} +{{- define "nginx.fullname" -}} +{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx +{{- end }} diff --git a/helm-charts/videoqna/templates/nginx-deployment.yaml b/helm-charts/videoqna/templates/nginx-deployment.yaml index cdb7dda0a..0282cf6ff 100644 --- a/helm-charts/videoqna/templates/nginx-deployment.yaml +++ b/helm-charts/videoqna/templates/nginx-deployment.yaml @@ -40,29 +40,47 @@ data: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + location /v1/dataprep/get_file { + proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /v1/dataprep/get_videos { + proxy_pass http://{{ include "data-prep.fullname" (index .Subcharts "data-prep") }}:{{ index .Values "data-prep" "service" "port" }}; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + } kind: ConfigMap metadata: - name: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }}-config + name: {{ include "nginx.fullname" . }}-config --- apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} + name: {{ include "nginx.fullname" . }} labels: {{- include "videoqna.labels" . | nindent 4 }} - app: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} + app: {{ include "nginx.fullname" . }} spec: selector: matchLabels: {{- include "videoqna.selectorLabels" . | nindent 6 }} - app: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} + app: {{ include "nginx.fullname" . }} template: metadata: labels: {{- include "videoqna.selectorLabels" . | nindent 8 }} - app: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} + app: {{ include "nginx.fullname" . }} spec: containers: - image: nginx:1.27.1 @@ -75,7 +93,7 @@ spec: volumes: - configMap: defaultMode: 420 - name: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }}-config + name: {{ include "nginx.fullname" . }}-config name: nginx-config-volume {{- with .Values.nodeSelector }} nodeSelector: @@ -93,7 +111,7 @@ spec: apiVersion: v1 kind: Service metadata: - name: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} + name: {{ include "nginx.fullname" . }} spec: ports: - port: 80 @@ -102,5 +120,5 @@ spec: nodePort: 30881 selector: {{- include "videoqna.selectorLabels" . | nindent 4 }} - app: {{ include "nginx.fullname" (index .Subcharts "videoqna-ui") }} + app: {{ include "nginx.fullname" . }} type: NodePort diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index 6bb8fde0f..2e43a42f0 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -71,11 +71,9 @@ videoqna-ui: # Overriding videoqna-ui chart name to avoid repetitive videoqna in the fullname. nameOverride: "ui" - # Following template value will be resolved in videoqna-ui subchart's context. For this, - # nginx.fullname definition is added to videoqna-ui template (as UI subchart - # can not access the templates of parent chart). - videoqnaBackendService: http://{{ include "nginx.fullname" . }}/v1/videoqna - videoqnaBackendHealthCheck: http://{{ include "nginx.fullname" . }}/v1/health_check + # Following template value will be resolved in videoqna-ui ConfigMap + videoqnaBackendService: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/videoqna + videoqnaBackendHealthCheck: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/health_check containerPort: 5173 service: @@ -123,8 +121,10 @@ reranking-usvc: tag: "latest" chunkDuration: "" - fileServerEndpoint: "/v1/dataprep/get_file" - getVideoListEndpoint: "/v1/dataprep/get_videos" + + # Following template value will be resolved in rearanking-usvc ConfigMap + fileServerEndpoint: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/dataprep/get_file + getVideoListEndpoint: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/dataprep/get_videos global: http_proxy: "" From a8cbdbfbcc81041c023127730eeddace50da9547 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Mon, 28 Oct 2024 07:28:27 +0530 Subject: [PATCH 13/28] =?UTF-8?q?=F0=9F=92=9A=20added=20symbolic=20links?= =?UTF-8?q?=20to=20values=20files=20for=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/videoqna/ci-values.yaml | 1 + 1 file changed, 1 insertion(+) create mode 120000 helm-charts/videoqna/ci-values.yaml diff --git a/helm-charts/videoqna/ci-values.yaml b/helm-charts/videoqna/ci-values.yaml new file mode 120000 index 000000000..7d1010096 --- /dev/null +++ b/helm-charts/videoqna/ci-values.yaml @@ -0,0 +1 @@ +values.yaml \ No newline at end of file From 63bf7f69196e99510c9f58ac08f325ad347966e8 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Mon, 28 Oct 2024 07:29:16 +0530 Subject: [PATCH 14/28] =?UTF-8?q?=F0=9F=92=9A=20added=20symbolic=20links?= =?UTF-8?q?=20to=20values=20files=20for=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/ci-vdms-values.yaml | 1 + helm-charts/common/embedding-usvc/ci-vdms-values.yaml | 1 + helm-charts/common/lvm-serving/ci-values.yaml | 1 + helm-charts/common/lvm-uservice/ci-values.yaml | 1 + helm-charts/common/reranking-usvc/ci-vdms-values.yaml | 1 + helm-charts/common/retriever-usvc/ci-vdms-values.yaml | 1 + helm-charts/common/ui/ci-videoqna-values.yaml | 1 + helm-charts/common/vdms-vector-db/ci-values.yaml | 1 + 8 files changed, 8 insertions(+) create mode 120000 helm-charts/common/data-prep/ci-vdms-values.yaml create mode 120000 helm-charts/common/embedding-usvc/ci-vdms-values.yaml create mode 120000 helm-charts/common/lvm-serving/ci-values.yaml create mode 120000 helm-charts/common/lvm-uservice/ci-values.yaml create mode 120000 helm-charts/common/reranking-usvc/ci-vdms-values.yaml create mode 120000 helm-charts/common/retriever-usvc/ci-vdms-values.yaml create mode 120000 helm-charts/common/ui/ci-videoqna-values.yaml create mode 120000 helm-charts/common/vdms-vector-db/ci-values.yaml diff --git a/helm-charts/common/data-prep/ci-vdms-values.yaml b/helm-charts/common/data-prep/ci-vdms-values.yaml new file mode 120000 index 000000000..d1f5ba3e6 --- /dev/null +++ b/helm-charts/common/data-prep/ci-vdms-values.yaml @@ -0,0 +1 @@ +vdms-values.yaml \ No newline at end of file diff --git a/helm-charts/common/embedding-usvc/ci-vdms-values.yaml b/helm-charts/common/embedding-usvc/ci-vdms-values.yaml new file mode 120000 index 000000000..d1f5ba3e6 --- /dev/null +++ b/helm-charts/common/embedding-usvc/ci-vdms-values.yaml @@ -0,0 +1 @@ +vdms-values.yaml \ No newline at end of file diff --git a/helm-charts/common/lvm-serving/ci-values.yaml b/helm-charts/common/lvm-serving/ci-values.yaml new file mode 120000 index 000000000..7d1010096 --- /dev/null +++ b/helm-charts/common/lvm-serving/ci-values.yaml @@ -0,0 +1 @@ +values.yaml \ No newline at end of file diff --git a/helm-charts/common/lvm-uservice/ci-values.yaml b/helm-charts/common/lvm-uservice/ci-values.yaml new file mode 120000 index 000000000..7d1010096 --- /dev/null +++ b/helm-charts/common/lvm-uservice/ci-values.yaml @@ -0,0 +1 @@ +values.yaml \ No newline at end of file diff --git a/helm-charts/common/reranking-usvc/ci-vdms-values.yaml b/helm-charts/common/reranking-usvc/ci-vdms-values.yaml new file mode 120000 index 000000000..d1f5ba3e6 --- /dev/null +++ b/helm-charts/common/reranking-usvc/ci-vdms-values.yaml @@ -0,0 +1 @@ +vdms-values.yaml \ No newline at end of file diff --git a/helm-charts/common/retriever-usvc/ci-vdms-values.yaml b/helm-charts/common/retriever-usvc/ci-vdms-values.yaml new file mode 120000 index 000000000..d1f5ba3e6 --- /dev/null +++ b/helm-charts/common/retriever-usvc/ci-vdms-values.yaml @@ -0,0 +1 @@ +vdms-values.yaml \ No newline at end of file diff --git a/helm-charts/common/ui/ci-videoqna-values.yaml b/helm-charts/common/ui/ci-videoqna-values.yaml new file mode 120000 index 000000000..30aaf3d16 --- /dev/null +++ b/helm-charts/common/ui/ci-videoqna-values.yaml @@ -0,0 +1 @@ +videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/vdms-vector-db/ci-values.yaml b/helm-charts/common/vdms-vector-db/ci-values.yaml new file mode 120000 index 000000000..7d1010096 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/ci-values.yaml @@ -0,0 +1 @@ +values.yaml \ No newline at end of file From cf4360f6e2f99368c7347ed473337614adcc8749 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Mon, 28 Oct 2024 07:29:16 +0530 Subject: [PATCH 15/28] =?UTF-8?q?=F0=9F=93=9D=20Added=20readme=20files=20f?= =?UTF-8?q?or=20videoqna=20charts=20and=20subcharts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/Chart.yaml | 2 +- helm-charts/common/data-prep/README.md | 95 ++++++++++++++++--- helm-charts/common/data-prep/values.yaml | 3 +- helm-charts/common/embedding-usvc/README.md | 47 ++++++--- helm-charts/common/lvm-serving/README.md | 56 +++++++++++ helm-charts/common/lvm-uservice/README.md | 70 ++++++++++++++ helm-charts/common/reranking-usvc/Chart.yaml | 8 ++ helm-charts/common/reranking-usvc/README.md | 91 +++++++++++++++--- .../common/reranking-usvc/ci-values.yaml | 10 +- .../reranking-usvc/templates/configmap.yaml | 6 ++ helm-charts/common/reranking-usvc/values.yaml | 3 + .../common/reranking-usvc/vdms-values.yaml | 20 +++- helm-charts/common/retriever-usvc/Chart.yaml | 2 +- helm-charts/common/retriever-usvc/README.md | 76 ++++++++++++--- helm-charts/common/retriever-usvc/values.yaml | 3 +- helm-charts/common/vdms-vector-db/README.md | 32 +++++++ helm-charts/videoqna/README.md | 79 +++++++++++++++ .../videoqna/templates/nginx-deployment.yaml | 1 - 18 files changed, 537 insertions(+), 67 deletions(-) create mode 100644 helm-charts/common/lvm-serving/README.md create mode 100644 helm-charts/common/lvm-uservice/README.md mode change 100644 => 120000 helm-charts/common/reranking-usvc/ci-values.yaml create mode 100644 helm-charts/common/vdms-vector-db/README.md create mode 100644 helm-charts/videoqna/README.md diff --git a/helm-charts/common/data-prep/Chart.yaml b/helm-charts/common/data-prep/Chart.yaml index 0a4590278..454c6f747 100644 --- a/helm-charts/common/data-prep/Chart.yaml +++ b/helm-charts/common/data-prep/Chart.yaml @@ -20,7 +20,7 @@ dependencies: - name: vdms-vector-db version: 1.0.0 repository: file://../vdms-vector-db - condition: vdms.enabled + condition: vdms-vector-db.enabled - name: milvus version: 4.2.12 repository: https://zilliztech.github.io/milvus-helm/ diff --git a/helm-charts/common/data-prep/README.md b/helm-charts/common/data-prep/README.md index 4a05e2f34..b0a42d0c5 100644 --- a/helm-charts/common/data-prep/README.md +++ b/helm-charts/common/data-prep/README.md @@ -1,14 +1,18 @@ -# data-prep +# Data-Prep Microservice -Helm chart for deploying data-prep microservice. +Helm chart for deploying data-prep microservice. Data-Prep is consumed by several reference applications present in [GenAIExample](https://github.com/opea-project/GenAIExamples/tree/main). -data-prep will use redis and tei service, please specify the endpoints. +There are 2 versions of Data-Prep microservice. First version is unimodal based on redis-vector-db and TEI. It performs data preparation for textual data. An alternative multimodal version based on `vdms-values.yaml` file, performs data preparation for visual data input. Follow along to select and install the version which suites your use case. -## (Option1): Installing the chart separately +Data-Prep uses redis-vector-db and tei. The multimodal version uses vdms-vector-db service. Endpoints for these dependencies should be set properly before installing the chart. + +## Install the chart for data preparation using Redis Vector DB + +### (Option1): Installing the chart separately First, you need to install the tei and redis-vector-db chart, please refer to the [tei](../tei/README.md) and [redis-vector-db](../redis-vector-db/README.md) for more information. -After you've deployted the tei and redis-vector-db chart successfully, please run `kubectl get svc` to get the service endpoint and URL respectively, i.e. `http://tei`, `redis://redis-vector-db:6379`. +After you've deployed the tei and redis-vector-db chart successfully, please run `kubectl get svc` to get the service endpoint and URL respectively, i.e. `http://tei`, `redis://redis-vector-db:6379`. To install data-prep chart, run the following: @@ -20,7 +24,7 @@ helm dependency update helm install data-prep . --set REDIS_URL=${REDIS_URL} --set TEI_EMBEDDING_ENDPOINT=${TEI_EMBEDDING_ENDPOINT} ``` -## (Option2): Installing the chart with dependencies automatically +### (Option2): Installing the chart with dependencies automatically ```console cd GenAIInfra/helm-charts/common/data-prep @@ -29,6 +33,52 @@ helm install data-prep . --set redis-vector-db.enabled=true --set tei.enabled=tr ``` +## Install the chart for multimodal data preparation using VDMS Vector DB + +### (Option1): Installing the chart separately + +First, you need to install the `vdms-vector-db` chart. Please refer to the [vdms-vector-db](../vdms-vector-db/README.md) for more information. + +After you've deployed the `vdms-vector-db` chart successfully, please run `kubectl get svc` to get the service host and port respectively, for example: `http://vdms-vector-db:8001`. + +Next, Run the following commands to install data-prep chart: + +```bash +cd GenAIInfra/helm-charts/common/data-prep + +# Use the host and port received in previous step as VDMS_HOST and VDMS_PORT. +export VDMS_HOST="vdms-vector-db" +export VDMS_PORT="8001" +export INDEX_NAME="mega-videoqna" +export HFTOKEN= +# Set a directory to cache emdedding models +export CACHEDIR="/home/$USER/.cache" + +# Export the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install data-prep . -f ./vdms-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set vdmsHost=${VDMS_HOST} --set vdmsPort=${VDMS_PORT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +``` + +### (Option2): Installing the chart with dependencies automatically + +```bash +cd GenAIInfra/helm-charts/common/data-prep +export INDEX_NAME="mega-videoqna" +export HFTOKEN= +# Set a directory to cache emdedding models +export CACHEDIR="/home/$USER/.cache" + +# Export the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install data-prep . -f ./vdms-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +``` + ## Verify To verify the installation, run the command `kubectl get pod` to make sure all pods are running. @@ -37,21 +87,40 @@ Then run the command `kubectl port-forward svc/data-prep 6007:6007` to expose th Open another terminal and run the following command to verify the service if working: -```console +### 1. For Data-prep service using redis-vector-db: + +```bash + curl http://localhost:6007/v1/dataprep \ -X POST \ -H "Content-Type: multipart/form-data" \ -F "files=@./README.md" ``` +### 2. For multimodal data prep service using vdms-vector-db: + +```bash +# 1) Download a sample video in current dir: +curl -svLO "https://github.com/opea-project/GenAIExamples/raw/refs/heads/main/VideoQnA/docker_compose/intel/cpu/xeon/data/op_1_0320241830.mp4" + +# 2) Verify using above video +curl -X POST http://localhost:6007/v1/dataprep \ + -H "Content-Type: multipart/form-data" \ + -F "files=@./op_1_0320241830.mp4" +``` + ## Values -| Key | Type | Default | Description | -| ---------------------- | ------ | ----------------------- | ----------- | -| image.repository | string | `"opea/dataprep-redis"` | | -| service.port | string | `"6007"` | | -| REDIS_URL | string | `""` | | -| TEI_EMBEDDING_ENDPOINT | string | `""` | | +| Key | Type | Default | Description | +| ---------------------------- | ------ | --------------------------------- | ----------- | +| image.repository | string | `"opea/dataprep-redis"` | | +| service.port | string | `"6007"` | | +| REDIS_URL | string | `""` | | +| TEI_EMBEDDING_ENDPOINT | string | `""` | | +| vdms-values:image.repository | string | `"opea/dataprep-multimodal-vdms"` | | +| vdms-values:vdmsHost | string | `""` | | +| vdms-values:vdmsPort | string | `"8001"` | | +| vdms-values:indexName | string | `"mega-videoqna"` | | ## Milvus support diff --git a/helm-charts/common/data-prep/values.yaml b/helm-charts/common/data-prep/values.yaml index af4b422dd..86db8494f 100644 --- a/helm-charts/common/data-prep/values.yaml +++ b/helm-charts/common/data-prep/values.yaml @@ -11,8 +11,7 @@ milvus: enabled: false redis-vector-db: enabled: false - -vdms: +vdms-vector-db: enabled: false replicaCount: 1 diff --git a/helm-charts/common/embedding-usvc/README.md b/helm-charts/common/embedding-usvc/README.md index 75377ed11..7c7169a79 100644 --- a/helm-charts/common/embedding-usvc/README.md +++ b/helm-charts/common/embedding-usvc/README.md @@ -1,10 +1,16 @@ -# embedding-usvc +# Embedding Microservice (embedding-usvc) -Helm chart for deploying embedding microservice. +**Helm chart for deploying Embedding Microservice.** -embedding-usvc depends on TEI, set TEI_EMBEDDING_ENDPOINT. +Embedding microservice is consumed by several reference applications present in [GenAIExample](https://github.com/opea-project/GenAIExamples/tree/main). -## (Option1): Installing the chart separately +There are 2 versions of embedding microservice. First version is unimodal based on TEI creating embeddings for textual data. An alternative version based on `vdms-values.yaml` file, uses multimodal embedding models for creating embedding for visual data. Follow along to select and install the version which suites your use case. + +embedding-usvc depends on TEI, and TEI_EMBEDDING_ENDPOINT should be set properly. Multimodal version has no dependencies. + +## Install Embedding microservice chart based on TEI + +### (Option1): Installing the chart separately First, you need to install the tei chart, please refer to the [tei](../tei) chart for more information. @@ -19,7 +25,7 @@ helm dependency update helm install embedding-usvc . --set TEI_EMBEDDING_ENDPOINT=${TEI_EMBEDDING_ENDPOINT} ``` -## (Option2): Installing the chart with dependencies automatically +### (Option2): Installing the chart with dependencies automatically ```console cd GenAIInfra/helm-charts/common/embedding-usvc @@ -27,6 +33,24 @@ helm dependency update helm install embedding-usvc . --set tei.enabled=true ``` +## Install Multimodal Embedding Microservice chart + +To install the multimodal embedding-usvc chart, run the following: + +```bash +cd GenAIInfra/helm-charts/common/embedding-usvc + +# Set a directory to cache emdedding models +export CACHEDIR="/home/$USER/.cache" + +# Export the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install embedding-usvc . -f ./vdms-values.yaml --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +``` + ## Verify To verify the installation, run the command `kubectl get pod` to make sure all pods are running. @@ -35,7 +59,7 @@ Then run the command `kubectl port-forward svc/embedding-usvc 6000:6000` to expo Open another terminal and run the following command to verify the service if working: -```console +```bash curl http://localhost:6000/v1/embeddings \ -X POST \ -d '{"text":"hello"}' \ @@ -44,8 +68,9 @@ curl http://localhost:6000/v1/embeddings \ ## Values -| Key | Type | Default | Description | -| ---------------------- | ------ | ---------------------- | ----------- | -| image.repository | string | `"opea/embedding-tei"` | | -| service.port | string | `"6000"` | | -| TEI_EMBEDDING_ENDPOINT | string | `""` | | +| Key | Type | Default | Description | +| ---------------------------- | ------ | ---------------------------------- | ----------- | +| image.repository | string | `"opea/embedding-tei"` | | +| service.port | string | `"6000"` | | +| TEI_EMBEDDING_ENDPOINT | string | `""` | | +| vdms-values:image.repository | string | `"opea/embedding-multimodal-clip"` | | diff --git a/helm-charts/common/lvm-serving/README.md b/helm-charts/common/lvm-serving/README.md new file mode 100644 index 000000000..adac3fc55 --- /dev/null +++ b/helm-charts/common/lvm-serving/README.md @@ -0,0 +1,56 @@ +# LVM Serving Microservice (lvm-serving) + +Helm chart for deploying LVM-Serving microservice. + +`lvm-serving` is a microservice which provides inference from Video-Llama-2-7b. + +## Installing the Chart + +To install the chart, run the following: + +```bash +cd GenAIInfra/helm-charts/common +export HFTOKEN="insert-your-huggingface-token-here" + +# Set a dir to cache downloaded Video-Llama Model +export MODELDIR=/mnt/opea-models +# Set a directory to cache emdedding models and other related data +export CACHEDIR="/home/$USER/.cache" + +# When setting up for first time, model needs to be downloaded. Set LLM_DOWNLOAD flag to true to download models. Please note, when redeploying we should set this value to false, otherwise model download will restart. +export LLM_DOWNLOAD=true + +# Export the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm install lvm-serving lvm-serving --set global.modelUseHostPath=${MODELDIR} --set global.cacheUseHostPath=${CACHEDIR} --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set llmDownload=${LLM_DOWNLOAD} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +``` + +> \***\*NOTE:\*\*** **Model download may take up to 1.5 Hours.** When installing chart for the first time we should set `llmDownload` value to be **true**. This helps download model for the first run. Afterwards, for re-installing charts set `llmDownload` value in the chart to be **false**. If not set to **false**, model download will again start and service will again long time to be ready. + +## Verify + +To verify the installation, run the command `kubectl get pod` to make sure all pods are running. + +Then run the command `kubectl port-forward svc/lvm-serving 2080:80` to expose the lvm-serving service for access on the host machine. + +Open another terminal and run the following command to verify the service if working: + +```bash +curl -X POST \ + "http://localhost:2080/generate?video_url=silence_girl.mp4&start=0.0&duration=9&prompt=What%20is%20the%20person%20doing%3F&max_new_tokens=150" \ + -H "accept: */*" \ + -d '' +``` + +## Values + +| Key | Type | Default | Description | +| ------------------------------- | ------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | +| global.cacheUseHostPath | string | "/home/$USER/.cache" | Cache the embedding model and related data. | +| global.HUGGINGFACEHUB_API_TOKEN | string | `insert-your-huggingface-token-here` | Hugging Face API token | +| global.modelUseHostPath | string | `"/mnt/opea-models"` | Cached models directory. The host path "modelUseHostPath" will be mounted to container as /home/user/model directory. | +| image.repository | string | `"opea/video-llama-lvm-server"` | | +| image.tag | string | `"latest"` | | +| llmDownload | boolean | `true` | This value when true, makes lvm-serving download a model. Change it to false for stopping lvm-serving from re-downloading model. | diff --git a/helm-charts/common/lvm-uservice/README.md b/helm-charts/common/lvm-uservice/README.md new file mode 100644 index 000000000..80d5ba82f --- /dev/null +++ b/helm-charts/common/lvm-uservice/README.md @@ -0,0 +1,70 @@ +# LVM Microservice + +**Helm chart for deploying lvm-uservice microservice.** + +`lvm-uservice` helps communicate to `lvm-serving` microservice. It facilitates sending queries and receiving response from `lvm-serving` microservice. Hence, it depends on lvm-serving microservice and you should make sure that `lvmEndpoint` value is set properly. + +## (Option1): Installing the chart separately + +First, you need to install the `lvm-serving` chart. Please refer to the [lvm-serving](../lvm-serving) chart for more information. + +After you've deployed the `lvm-serving` chart successfully, please run `kubectl get svc` to get `lvm-serving` service host and port. The endpoint url for `lvm-serving` will be formed using the host and port. For example, default value would be `http://lvm-serving:80`. + +To install the chart, run the following: + +```bash +cd GenAIInfra/helm-charts/common/lvm-uservice +export LVM_ENDPOINT="http://lvm-serving:80" + +# Export the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install lvm-uservice . --set lvmEndpoint=${LVM_ENDPOINT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait +``` + +## (Option2): Installing the chart with dependencies automatically + +```bash +cd GenAIInfra/helm-charts/common/lvm-uservice + +export HFTOKEN="insert-your-huggingface-token-here" +# Set a dir to cache downloaded Video-Llama Model +export MODELDIR=/mnt/opea-models +# Set a directory to cache emdedding models and other related data +export CACHEDIR="/home/$USER/.cache" +# When setting up for first time, model needs to be downloaded. Set LLM_DOWNLOAD flag to true to download models. Please note, when redeploying we should set this value to false, otherwise model download will restart. +export LLM_DOWNLOAD=true + +# Set the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install lvm-uservice . --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set lvm-serving.enabled=true --set lvm-serving.llmDownload=${LLM_DOWNLOAD} --set global.modelUseHostPath=${MODELDIR} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait +``` + +## Verify + +To verify the installation, run the command `kubectl get pod` to make sure all pods are running. + +Then run the command `kubectl port-forward svc/lvm-uservice 9000:9000` to expose the lvm-uservice service for access. + +Open another terminal and run the following command to verify the service if working: + +```bash +curl http://localhost:9000/v1/lvm \ + -X POST \ + -d '{"video_url":"https://github.com/DAMO-NLP-SG/Video-LLaMA/raw/main/examples/silence_girl.mp4","chunk_start": 0,"chunk_duration": 7,"prompt":"What is the person doing?","max_new_tokens": 50}' \ + -H 'Content-Type: application/json' +``` + +## Values + +| Key | Type | Default | Description | +| ------------------------------- | ------ | ------------------------ | ------------------------------- | +| global.HUGGINGFACEHUB_API_TOKEN | string | `""` | Your own Hugging Face API token | +| image.repository | string | `"opea/lvm-video-llama"` | | +| service.port | string | `"9000"` | | +| lvmEndpoint | string | `""` | LVM Serving endpoint | diff --git a/helm-charts/common/reranking-usvc/Chart.yaml b/helm-charts/common/reranking-usvc/Chart.yaml index 06c2dd7fe..e1b3d9d9b 100644 --- a/helm-charts/common/reranking-usvc/Chart.yaml +++ b/helm-charts/common/reranking-usvc/Chart.yaml @@ -13,3 +13,11 @@ dependencies: version: 1.0.0 repository: file://../teirerank condition: teirerank.enabled + - name: data-prep + version: 1.0.0 + repository: file://../data-prep + condition: data-prep.enabled + - name: vdms-vector-db + version: 1.0.0 + repository: file://../vdms-vector-db + condition: data-prep.vdms-vector-db.enabled diff --git a/helm-charts/common/reranking-usvc/README.md b/helm-charts/common/reranking-usvc/README.md index 2c6adb141..0dc6ef9a3 100644 --- a/helm-charts/common/reranking-usvc/README.md +++ b/helm-charts/common/reranking-usvc/README.md @@ -1,10 +1,14 @@ -# reranking-usvc +# Re-ranking Microservice (reranking-usvc) -Helm chart for deploying reranking microservice. +**Helm chart for deploying reranking microservice.** -reranking-usvc depends on teirerank, set the TEI_RERANKING_ENDPOINT as teirerank endpoint. +There are two versions of Reranking microservice. First one is based on TEI model and does reranking for textual data. An alternative multimodal version based on `vdms-values.yaml` file, performs reranking for visual data. Follow along to select and install the version which suites your use case. -## (Option1): Installing the chart separately +reranking-usvc depends on teirerank. Set the TEI_RERANKING_ENDPOINT as teirerank endpoint. Multimodal version depends on data-prep and vdms-vector-db service. Endpoints for these dependencies should be set properly before installing the chart. + +## Install Re-ranking Microservice based on TEI + +### (Option1): Installing the chart separately First, you need to install the teirerank chart, please refer to the [teirerank](../teirerank) chart for more information. @@ -19,7 +23,7 @@ helm dependency update helm install reranking-usvc . --set TEI_RERANKING_ENDPOINT=${TEI_RERANKING_ENDPOINT} ``` -## (Option2): Installing the chart with dependencies automatically +### (Option2): Installing the chart with dependencies automatically ```console cd GenAIInfra/helm-charts/common/reranking-usvc @@ -27,6 +31,46 @@ helm dependency update helm install reranking-usvc . --set teirerank.enabled=true ``` +## Install Re-ranking Microservice for visual data + +### (Option1): Installing the chart separately + +First, you need to install the multimodal data-prep chart with vdms based values file and `vdms-vector-db` chart. `vdms-vector-db` is used by multimodal version of data-prep service. Please refer to the [data-prep](../data-prep) and [vdms-vector-db](../vdms-vector-db) charts guide for more information. + +After you've deployed the data-prep chart successfully, please run `kubectl get svc` to get the data-prep service endpoint and port, i.e. `http://data-prep:6007`. + +To install the reranking-usvc chart, run the following: + +```bash +cd GenAIInfra/helm-charts/common/reranking-usvc + +# Use the host and port returned in first step for setting the following environment variables. +export FILE_SERVER_ENDPOINT="http://data-prep:6007/v1/dataprep/get_file" +export GET_VIDEO_LIST_ENDPOINT="http://data-prep:6007/v1/dataprep/get_videos" + +# Export the proxy variables if you are behind a proxy. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install reranking-usvc . -f ./vdms-values.yaml --set fileServerEndpoint=${FILE_SERVER_ENDPOINT} --set getVideoListEndpoint=${GET_VIDEO_LIST_ENDPOINT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +``` + +### (Option2): Installing the chart with dependencies automatically + +Multimodal Reranking microservice depends on Multimodal Data-Prep Microservice. Multimodal Data-Prep microservice in turn depends on vdms-vector-db microservice. + +```bash +cd GenAIInfra/helm-charts/common/reranking-usvc + +# Export the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install reranking-usvc . -f ./vdms-values.yaml --set data-prep.enabled=true --set data-prep.vdms-vector-db.enabled=true --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +``` + ## Verify To verify the installation, run the command `kubectl get pod` to make sure all pods are running. @@ -35,17 +79,40 @@ Then run the command `kubectl port-forward svc/reranking-usvc 8000:8000` to expo Open another terminal and run the following command to verify the service if working: -```console +### 1. For Reranking Service based on TEI + +````bash + curl http://localhost:8000/v1/reranking \ -X POST \ -d '{"initial_query":"What is Deep Learning?", "retrieved_docs": [{"text":"Deep Learning is not..."}, {"text":"Deep learning is..."}]}' \ - -H 'Content-Type: application/json' + -```H 'Content-Type: application/json' +```` + +### 2. For visual data Reranking service + +```bash +curl http://localhost:8000/v1/reranking \ + -X 'POST' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "retrieved_docs": [{"doc": [{"text": "this is the retrieved text"}]}], + "initial_query": "this is the query", + "top_n": 1, + "metadata": [ + {"other_key": "value", "video":"top_video_name", "timestamp":"20"} + ] + }' ``` ## Values -| Key | Type | Default | Description | -| ---------------------- | ------ | ---------------------- | ----------- | -| image.repository | string | `"opea/reranking-tgi"` | | -| TEI_RERANKING_ENDPOINT | string | `""` | | -| service.port | string | `"8000"` | | +| Key | Type | Default | Description | +| -------------------------------- | ------ | --------------------------- | ----------- | +| image.repository | string | `"opea/reranking-tgi"` | | +| TEI_RERANKING_ENDPOINT | string | `""` | | +| service.port | string | `"8000"` | +| vdms-values:image.repository | string | `"opea/reranking-videoqna"` | | +| vdms-values:fileServerEndpoint | string | `""` | | +| vdms-values:getVideoListEndpoint | string | `""` | | diff --git a/helm-charts/common/reranking-usvc/ci-values.yaml b/helm-charts/common/reranking-usvc/ci-values.yaml deleted file mode 100644 index 1118483f4..000000000 --- a/helm-charts/common/reranking-usvc/ci-values.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -# Default values for reranking-usvc. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -teirerank: - enabled: true diff --git a/helm-charts/common/reranking-usvc/ci-values.yaml b/helm-charts/common/reranking-usvc/ci-values.yaml new file mode 120000 index 000000000..7d1010096 --- /dev/null +++ b/helm-charts/common/reranking-usvc/ci-values.yaml @@ -0,0 +1 @@ +values.yaml \ No newline at end of file diff --git a/helm-charts/common/reranking-usvc/templates/configmap.yaml b/helm-charts/common/reranking-usvc/templates/configmap.yaml index 0b4ac2d83..caaf286fd 100644 --- a/helm-charts/common/reranking-usvc/templates/configmap.yaml +++ b/helm-charts/common/reranking-usvc/templates/configmap.yaml @@ -14,9 +14,15 @@ data: {{- if .Values.fileServerEndpoint }} FILE_SERVER_ENDPOINT: {{ tpl .Values.fileServerEndpoint . | quote }} {{- end }} + {{- else }} + FILE_SERVER_ENDPOINT: http://{{ .Release.Name }}-data-prep:6007/v1/dataprep/get_file" + {{- end }} {{- if .Values.getVideoListEndpoint }} DATAPREP_GET_VIDEO_LIST_ENDPOINT: {{ tpl .Values.getVideoListEndpoint . | quote }} {{- end }} + {{- else }} + DATAPREP_GET_VIDEO_LIST_ENDPOINT: http://{{ .Release.Name }}-data-prep:6007/v1/dataprep/get_videos" + {{- end }} {{- if .Values.TEI_RERANKING_ENDPOINT }} TEI_RERANKING_ENDPOINT: {{ .Values.TEI_RERANKING_ENDPOINT | quote }} {{- else }} diff --git a/helm-charts/common/reranking-usvc/values.yaml b/helm-charts/common/reranking-usvc/values.yaml index 7e5f1a2ec..f9208e932 100644 --- a/helm-charts/common/reranking-usvc/values.yaml +++ b/helm-charts/common/reranking-usvc/values.yaml @@ -8,6 +8,9 @@ teirerank: enabled: false +data-prep: + enabled: false + replicaCount: 1 # Set it as a non-null string, such as true, if you want to enable logging facility, diff --git a/helm-charts/common/reranking-usvc/vdms-values.yaml b/helm-charts/common/reranking-usvc/vdms-values.yaml index 453e56b55..4e6d14641 100644 --- a/helm-charts/common/reranking-usvc/vdms-values.yaml +++ b/helm-charts/common/reranking-usvc/vdms-values.yaml @@ -9,6 +9,20 @@ image: chunkDuration: "" -# Test values - Replace with actual Endpoint URLs -fileServerEndpoint: "http://localhost:6007/v1/dataprep/get_file" -getVideoListEndpoint: "http://localhost:6007/v1/dataprep/get_videos" +# Replace with actual Endpoint URLs +fileServerEndpoint: "" +getVideoListEndpoint: "" + +# As reranking depends on Data-prep service, enable data-prep dependency and +# override the values for multimodal setup. +data-prep: + image: + repository: opea/dataprep-multimodal-vdms + pullPolicy: IfNotPresent + tag: "latest" + + indexName: "mega-videoqna" + vdmsHost: "" + vdmsPort: "8001" + entryCommand: ["/bin/sh"] + extraArgs: ["-c", "sleep 15 && python ingest_videos.py"] diff --git a/helm-charts/common/retriever-usvc/Chart.yaml b/helm-charts/common/retriever-usvc/Chart.yaml index 9b9b84ff2..76fc5d0b5 100644 --- a/helm-charts/common/retriever-usvc/Chart.yaml +++ b/helm-charts/common/retriever-usvc/Chart.yaml @@ -20,7 +20,7 @@ dependencies: - name: vdms-vector-db version: 1.0.0 repository: file://../vdms-vector-db - condition: vdms.enabled + condition: vdms-vector-db.enabled - name: milvus version: 4.2.12 repository: https://zilliztech.github.io/milvus-helm/ diff --git a/helm-charts/common/retriever-usvc/README.md b/helm-charts/common/retriever-usvc/README.md index 9a84ee9a0..ed2dbdc72 100644 --- a/helm-charts/common/retriever-usvc/README.md +++ b/helm-charts/common/retriever-usvc/README.md @@ -1,10 +1,14 @@ -# retriever-usvc +# Retriever Microservice (retriever-usvc) -Helm chart for deploying Retriever microservice. +**Helm chart for deploying Retriever microservice.** -retriever-usvc depends on redis and tei, you should set these endpoints before start. +There are two versions of Retriever microservice. First one is based on redis-vector-db and TEI. It does retrieval for textual data. An alternative multimodal version based on `vdms-values.yaml` file, performs retrieval for visual data. Follow along to select and install the version which suites your use case. -## (Option1): Installing the chart separately +retriever-usvc depends on redis-vector-db, tei. The multimodal version depends on vdms-vector-db. Endpoints for these dependencies should be set properly before installing the chart. + +## Install Retriever Microservice based on redis-vector-db and TEI + +### (Option1): Installing the chart separately First, you need to install the tei and redis-vector-db chart, refer to the [tei](../tei/README.md) and [redis-vector-db](../redis-vector-db/README.md) for more information. @@ -20,7 +24,7 @@ helm dependency update helm install retriever-usvc . --set REDIS_URL=${REDIS_URL} --set TEI_EMBEDDING_ENDPOINT=${TEI_EMBEDDING_ENDPOINT} ``` -## (Option2): Installing the chart with dependencies automatically +### (Option2): Installing the chart with dependencies automatically ```console cd GenAIInfra/helm-charts/common/retriever-usvc @@ -28,6 +32,53 @@ helm dependency update helm install retriever-usvc . --set tei.enabled=true --set redis-vector-db.enabled=true ``` +## Install Retriever microservice based on vdms-vector-db + +### (Option1): Installing the chart separately + +First, you need to install the `vdms-vector-db`. Refer to [vdms-vector-db](../vdms-vector-db) chart guide for more information. + +After you've deployed `vdms-vector-db` chart successfully, run `kubectl get svc` to get the service endpoint and port for vdms-vector-db service. + +To install retriever-usvc chart, run the following: + +```bash +cd GenAIInfra/helm-charts/common/retriever-usvc + +# Use the host and port received in previous step as VDMS_HOST and VDMS_PORT. +export VDMS_HOST="vdms-vector-db" +export VDMS_PORT="8001" +export INDEX_NAME="mega-videoqna" +export HFTOKEN= +# Set a directory to cache emdedding models +export CACHEDIR="/home/$USER/.cache" + +# Export the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install retriever-usvc . -f ./vdms-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} + +``` + +### (Option2): Installing the chart with dependencies automatically + +```bash +cd GenAIInfra/helm-charts/common/retriever-usvc +export INDEX_NAME="mega-videoqna" +export HFTOKEN= +# Set a directory to cache emdedding models +export CACHEDIR="/home/$USER/.cache" + +# Export the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm dependency update +helm install retriever-usvc . -f ./vdms-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set vdms-vector-db.enabled=true --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +``` + ## Verify To verify the installation, run the command `kubectl get pod` to make sure all pods are running. @@ -36,7 +87,7 @@ Then run the command `kubectl port-forward svc/retriever-usvc 7000:7000` to expo Open another terminal and run the following command to verify the service if working: -```console +```bash export your_embedding=$(python3 -c "import random; embedding = [random.uniform(-1, 1) for _ in range(768)]; print(embedding)") curl http://localhost:7000/v1/retrieval \ -X POST \ @@ -46,12 +97,13 @@ curl http://localhost:7000/v1/retrieval \ ## Values -| Key | Type | Default | Description | -| ---------------------- | ------ | ---------------------- | ----------- | -| image.repository | string | `"opea/retriever-tgi"` | | -| service.port | string | `"7000"` | | -| REDIS_URL | string | `""` | | -| TEI_EMBEDDING_ENDPOINT | string | `""` | | +| Key | Type | Default | Description | +| ---------------------------- | ------ | ----------------------- | ----------- | +| image.repository | string | `"opea/retriever-tgi"` | | +| service.port | string | `"7000"` | | +| REDIS_URL | string | `""` | | +| TEI_EMBEDDING_ENDPOINT | string | `""` | | +| vdms-values:image.repository | string | `"opea/retriever-vdms"` | | ## Milvus support diff --git a/helm-charts/common/retriever-usvc/values.yaml b/helm-charts/common/retriever-usvc/values.yaml index c3c1f2be2..eaf8ce20b 100644 --- a/helm-charts/common/retriever-usvc/values.yaml +++ b/helm-charts/common/retriever-usvc/values.yaml @@ -11,8 +11,7 @@ milvus: enabled: false redis-vector-db: enabled: false - -vdms: +vdms-vector-db: enabled: false replicaCount: 1 diff --git a/helm-charts/common/vdms-vector-db/README.md b/helm-charts/common/vdms-vector-db/README.md new file mode 100644 index 000000000..608c229b1 --- /dev/null +++ b/helm-charts/common/vdms-vector-db/README.md @@ -0,0 +1,32 @@ +# vdms-vector-db + +Helm chart for deploying Intel VDMS Vector DB service. + +## Install the Chart + +To install the chart, run the following: + +```bash +cd GenAIInfra/helm-charts/common +helm install vdms-vector-db vdms-vector-db +``` + +## Verify + +To verify the installation, run the command `kubectl get pod` to make sure that vdms-vector-db pod is running. + +Then run the command `kubectl port-forward svc/vdms-vector-db 8001:8001` to expose the vdms-vector-db service for access on current host. + +Next, verify whether you can reach the `vdms-vector-db` pod. As there are no http services running in `vdms-vector-db` pod, we will verify sanity by making a tcp connection request to the pod and check whether `8001` port is open. + +We will use `netcat` command utility for this. + +Try running `nc -zv vdms-vector-db 8001`. The command will succeed if vdms-vector-db can accept TCP request and the required port (8001) is open. + +## Values + +| Key | Type | Default | Description | +| ---------------- | ------ | ------------------ | ------------------------------- | +| image.repository | string | `"intellabs/vdms"` | | +| image.tag | string | `"v2.8.0"` | | +| service.port | string | `"8001"` | The vdms-vector-db service port | diff --git a/helm-charts/videoqna/README.md b/helm-charts/videoqna/README.md new file mode 100644 index 000000000..0084e2a2c --- /dev/null +++ b/helm-charts/videoqna/README.md @@ -0,0 +1,79 @@ +# VideoQnA + +Helm chart for deploying VideoQnA service. VideoQnA depends on the following other microservices: + +- [data-prep](../common/data-prep/README.md) +- [embedding-usvc](../common/embedding-usvc/README.md) +- [retriever-usvc](../common/retriever-usvc/README.md) +- [reranking-usvc](../common/reranking-usvc/README.md) +- [vdms-vector-db](../common/vdms-vector-db/README.md) +- [lvm-serving](../common/lvm-serving/README.md) +- [lvm-uservice](../common/lvm-uservice/README.md) + +## Installing the Chart + +To install the chart, run the following: + +```bash +cd GenAIInfra/helm-charts/ +./update_dependency.sh +helm dependency update videoqna + +# Set following required values for videoqna chart and various subcharts +export HFTOKEN="insert-your-huggingface-token-here" +export MODELDIR="/mnt/opea-models" +export CACHEDIR="/home/$USER/.cache" +export LLM_DOWNLOAD=true +export INDEX_NAME="mega-videoqna" + +# Set the proxy variables. Assign empty string if no proxy setup required. +export https_proxy="your_http_proxy" +export http_proxy="your_https_proxy" + +helm install videoqna videoqna --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set global.cacheUseHostPath=${CACHEDIR} --set lvm-serving.llmDownload=${LLM_DOWNLOAD} --set data-prep.indexName=${INDEX_NAME} --set retriever-usvc.indexName=${INDEX_NAME} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait +``` + +### IMPORTANT NOTE + +1. Make sure your `MODELDIR` and `CACHEDIR` exists on the node where your workload is schedueled. These dirs are used to cache the downloaded model for next time use. Otherwise, set `global.modelUseHostPath` and `global.cacheUseHostPath` to 'null' if you don't want to cache the models. + +## Verify + +To verify the installation, run the command `kubectl get pod` to make sure all pods are running. + +Curl command and UI are the two options that can be leveraged to verify the result. + +### Verify the workload through curl command + +Run the command `kubectl port-forward svc/videoqna 8888:8888` to expose the service for access. + +Open another terminal and run the following command to verify the service if working: + +```bash +curl http://localhost:8888/v1/videoqna -H "Content-Type: application/json" -d '{ + "messages": "What is the man doing?", + "stream": "True" + }' +``` + +### Verify the workload through UI + +The UI has already been installed via the Helm chart. To access it, use the external IP of one your Kubernetes node along with the NGINX port. You can find the NGINX port using the following command: + +```bash +export port=$(kubectl get service videoqna-nginx --output='jsonpath={.spec.ports[0].nodePort}') +echo $port +``` + +Open a browser and head to `http://:${port}` to use VideoQnA via a web UI. + +## Values + +| Key | Type | Default | Description | +| --------------------------------------------- | ------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| image.repository | string | `"opea/videoqna"` | | +| service.port | string | `"8888"` | | +| global.modelUseHostPath | string | `"/mnt/opea-models"` | A directory to where model dir for lvm-serving service is mounted. | +| global.cacheUseHostPath | string | `"/home/$USER/.cache"` | A directory to where cache dir for several services are mounted. | +| lvm-serving.llmDownload | boolean | `true` | This value when true, makes lvm-serving download a model. Change it to false for stopping lvm-serving from re-downloading model. | +| data-prep.indexName, retriever-usvc.indexName | string | `"mega-videoqna"` | This value when true, makes lvm-serving download a model. Change it to false for stopping lvm-serving from re-downloading model. | diff --git a/helm-charts/videoqna/templates/nginx-deployment.yaml b/helm-charts/videoqna/templates/nginx-deployment.yaml index 0282cf6ff..31667dcec 100644 --- a/helm-charts/videoqna/templates/nginx-deployment.yaml +++ b/helm-charts/videoqna/templates/nginx-deployment.yaml @@ -117,7 +117,6 @@ spec: - port: 80 protocol: TCP targetPort: 80 - nodePort: 30881 selector: {{- include "videoqna.selectorLabels" . | nindent 4 }} app: {{ include "nginx.fullname" . }} From 2d02cf900ff1251a408ff56260d5d8dcfb0fea31 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Tue, 29 Oct 2024 05:13:29 +0530 Subject: [PATCH 16/28] =?UTF-8?q?=F0=9F=92=9A=20Added=20missing=20symbolic?= =?UTF-8?q?=20links=20for=20some=20values=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/ci-values.yaml | 14 +------------- helm-charts/common/embedding-usvc/ci-values.yaml | 10 +--------- 2 files changed, 2 insertions(+), 22 deletions(-) mode change 100644 => 120000 helm-charts/common/data-prep/ci-values.yaml mode change 100644 => 120000 helm-charts/common/embedding-usvc/ci-values.yaml diff --git a/helm-charts/common/data-prep/ci-values.yaml b/helm-charts/common/data-prep/ci-values.yaml deleted file mode 100644 index 473698ec0..000000000 --- a/helm-charts/common/data-prep/ci-values.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -# Default values for data-prep. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -tei: - enabled: true -redis-vector-db: - enabled: true -milvus: - enabled: false diff --git a/helm-charts/common/data-prep/ci-values.yaml b/helm-charts/common/data-prep/ci-values.yaml new file mode 120000 index 000000000..7d1010096 --- /dev/null +++ b/helm-charts/common/data-prep/ci-values.yaml @@ -0,0 +1 @@ +values.yaml \ No newline at end of file diff --git a/helm-charts/common/embedding-usvc/ci-values.yaml b/helm-charts/common/embedding-usvc/ci-values.yaml deleted file mode 100644 index 543c69570..000000000 --- a/helm-charts/common/embedding-usvc/ci-values.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -# Default values for embedding-usvc. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -tei: - enabled: true diff --git a/helm-charts/common/embedding-usvc/ci-values.yaml b/helm-charts/common/embedding-usvc/ci-values.yaml new file mode 120000 index 000000000..7d1010096 --- /dev/null +++ b/helm-charts/common/embedding-usvc/ci-values.yaml @@ -0,0 +1 @@ +values.yaml \ No newline at end of file From 1e5eea15ed765ec032b29ecad882f3e4b694f63b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 02:18:33 +0000 Subject: [PATCH 17/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- helm-charts/common/reranking-usvc/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/helm-charts/common/reranking-usvc/README.md b/helm-charts/common/reranking-usvc/README.md index fee23df65..47a033ddd 100644 --- a/helm-charts/common/reranking-usvc/README.md +++ b/helm-charts/common/reranking-usvc/README.md @@ -117,4 +117,3 @@ curl http://localhost:8000/v1/reranking \ | vdms-values:image.repository | string | `"opea/reranking-videoqna"` | | | vdms-values:fileServerEndpoint | string | `""` | | | vdms-values:getVideoListEndpoint | string | `""` | | - From 6e832ea984d566cb9f55d067fbcdeb22cca19fc9 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Tue, 29 Oct 2024 08:16:17 +0530 Subject: [PATCH 18/28] =?UTF-8?q?=F0=9F=92=9A=20added=20variant=20prefix?= =?UTF-8?q?=20to=20all=20videoqna=20values=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/ci-vdms-values.yaml | 1 - .../common/data-prep/ci-videoqna-values.yaml | 1 + ...ms-values.yaml => variant_videoqna-values.yaml} | 0 .../common/embedding-usvc/ci-vdms-values.yaml | 1 - .../common/embedding-usvc/ci-videoqna-values.yaml | 1 + ...ms-values.yaml => variant_videoqna-values.yaml} | 0 .../common/reranking-usvc/ci-vdms-values.yaml | 1 - .../common/reranking-usvc/ci-videoqna-values.yaml | 1 + ...ms-values.yaml => variant_videoqna-values.yaml} | 0 helm-charts/common/retriever-usvc/ci-values.yaml | 14 +------------- .../common/retriever-usvc/ci-vdms-values.yaml | 1 - .../common/retriever-usvc/ci-videoqna-values.yaml | 1 + ...ms-values.yaml => variant_videoqna-values.yaml} | 0 helm-charts/common/ui/ci-videoqna-values.yaml | 2 +- ...na-values.yaml => variant_videoqna-values.yaml} | 0 15 files changed, 6 insertions(+), 18 deletions(-) delete mode 120000 helm-charts/common/data-prep/ci-vdms-values.yaml create mode 120000 helm-charts/common/data-prep/ci-videoqna-values.yaml rename helm-charts/common/data-prep/{vdms-values.yaml => variant_videoqna-values.yaml} (100%) delete mode 120000 helm-charts/common/embedding-usvc/ci-vdms-values.yaml create mode 120000 helm-charts/common/embedding-usvc/ci-videoqna-values.yaml rename helm-charts/common/embedding-usvc/{vdms-values.yaml => variant_videoqna-values.yaml} (100%) delete mode 120000 helm-charts/common/reranking-usvc/ci-vdms-values.yaml create mode 120000 helm-charts/common/reranking-usvc/ci-videoqna-values.yaml rename helm-charts/common/reranking-usvc/{vdms-values.yaml => variant_videoqna-values.yaml} (100%) mode change 100644 => 120000 helm-charts/common/retriever-usvc/ci-values.yaml delete mode 120000 helm-charts/common/retriever-usvc/ci-vdms-values.yaml create mode 120000 helm-charts/common/retriever-usvc/ci-videoqna-values.yaml rename helm-charts/common/retriever-usvc/{vdms-values.yaml => variant_videoqna-values.yaml} (100%) rename helm-charts/common/ui/{videoqna-values.yaml => variant_videoqna-values.yaml} (100%) diff --git a/helm-charts/common/data-prep/ci-vdms-values.yaml b/helm-charts/common/data-prep/ci-vdms-values.yaml deleted file mode 120000 index d1f5ba3e6..000000000 --- a/helm-charts/common/data-prep/ci-vdms-values.yaml +++ /dev/null @@ -1 +0,0 @@ -vdms-values.yaml \ No newline at end of file diff --git a/helm-charts/common/data-prep/ci-videoqna-values.yaml b/helm-charts/common/data-prep/ci-videoqna-values.yaml new file mode 120000 index 000000000..313991379 --- /dev/null +++ b/helm-charts/common/data-prep/ci-videoqna-values.yaml @@ -0,0 +1 @@ +variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/data-prep/vdms-values.yaml b/helm-charts/common/data-prep/variant_videoqna-values.yaml similarity index 100% rename from helm-charts/common/data-prep/vdms-values.yaml rename to helm-charts/common/data-prep/variant_videoqna-values.yaml diff --git a/helm-charts/common/embedding-usvc/ci-vdms-values.yaml b/helm-charts/common/embedding-usvc/ci-vdms-values.yaml deleted file mode 120000 index d1f5ba3e6..000000000 --- a/helm-charts/common/embedding-usvc/ci-vdms-values.yaml +++ /dev/null @@ -1 +0,0 @@ -vdms-values.yaml \ No newline at end of file diff --git a/helm-charts/common/embedding-usvc/ci-videoqna-values.yaml b/helm-charts/common/embedding-usvc/ci-videoqna-values.yaml new file mode 120000 index 000000000..313991379 --- /dev/null +++ b/helm-charts/common/embedding-usvc/ci-videoqna-values.yaml @@ -0,0 +1 @@ +variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/embedding-usvc/vdms-values.yaml b/helm-charts/common/embedding-usvc/variant_videoqna-values.yaml similarity index 100% rename from helm-charts/common/embedding-usvc/vdms-values.yaml rename to helm-charts/common/embedding-usvc/variant_videoqna-values.yaml diff --git a/helm-charts/common/reranking-usvc/ci-vdms-values.yaml b/helm-charts/common/reranking-usvc/ci-vdms-values.yaml deleted file mode 120000 index d1f5ba3e6..000000000 --- a/helm-charts/common/reranking-usvc/ci-vdms-values.yaml +++ /dev/null @@ -1 +0,0 @@ -vdms-values.yaml \ No newline at end of file diff --git a/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml new file mode 120000 index 000000000..313991379 --- /dev/null +++ b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml @@ -0,0 +1 @@ +variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/reranking-usvc/vdms-values.yaml b/helm-charts/common/reranking-usvc/variant_videoqna-values.yaml similarity index 100% rename from helm-charts/common/reranking-usvc/vdms-values.yaml rename to helm-charts/common/reranking-usvc/variant_videoqna-values.yaml diff --git a/helm-charts/common/retriever-usvc/ci-values.yaml b/helm-charts/common/retriever-usvc/ci-values.yaml deleted file mode 100644 index cbc29c7ee..000000000 --- a/helm-charts/common/retriever-usvc/ci-values.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -# Default values for retriever-usvc. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -tei: - enabled: true -redis-vector-db: - enabled: true -milvus: - enabled: false diff --git a/helm-charts/common/retriever-usvc/ci-values.yaml b/helm-charts/common/retriever-usvc/ci-values.yaml new file mode 120000 index 000000000..7d1010096 --- /dev/null +++ b/helm-charts/common/retriever-usvc/ci-values.yaml @@ -0,0 +1 @@ +values.yaml \ No newline at end of file diff --git a/helm-charts/common/retriever-usvc/ci-vdms-values.yaml b/helm-charts/common/retriever-usvc/ci-vdms-values.yaml deleted file mode 120000 index d1f5ba3e6..000000000 --- a/helm-charts/common/retriever-usvc/ci-vdms-values.yaml +++ /dev/null @@ -1 +0,0 @@ -vdms-values.yaml \ No newline at end of file diff --git a/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml b/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml new file mode 120000 index 000000000..313991379 --- /dev/null +++ b/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml @@ -0,0 +1 @@ +variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/retriever-usvc/vdms-values.yaml b/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml similarity index 100% rename from helm-charts/common/retriever-usvc/vdms-values.yaml rename to helm-charts/common/retriever-usvc/variant_videoqna-values.yaml diff --git a/helm-charts/common/ui/ci-videoqna-values.yaml b/helm-charts/common/ui/ci-videoqna-values.yaml index 30aaf3d16..313991379 120000 --- a/helm-charts/common/ui/ci-videoqna-values.yaml +++ b/helm-charts/common/ui/ci-videoqna-values.yaml @@ -1 +1 @@ -videoqna-values.yaml \ No newline at end of file +variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/ui/videoqna-values.yaml b/helm-charts/common/ui/variant_videoqna-values.yaml similarity index 100% rename from helm-charts/common/ui/videoqna-values.yaml rename to helm-charts/common/ui/variant_videoqna-values.yaml From fc17e30d90be6e0c4af5d3adbb7b7e7881dabe62 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Wed, 30 Oct 2024 16:50:48 +0530 Subject: [PATCH 19/28] =?UTF-8?q?=F0=9F=92=9A=20Added=20several=20CI=20fix?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- .github/workflows/_helm-e2e.yaml | 2 +- helm-charts/common/data-prep/README.md | 4 +-- helm-charts/common/data-prep/ci-values.yaml | 14 +++++++- .../common/data-prep/ci-videoqna-values.yaml | 22 +++++++++++- .../common/embedding-usvc/ci-values.yaml | 10 +++++- .../common/lvm-uservice/ci-values.yaml | 8 ++++- helm-charts/common/reranking-usvc/README.md | 4 +-- .../common/reranking-usvc/ci-values.yaml | 10 +++++- .../reranking-usvc/ci-videoqna-values.yaml | 35 ++++++++++++++++++- .../reranking-usvc/templates/configmap.yaml | 2 -- helm-charts/common/retriever-usvc/README.md | 4 +-- .../common/retriever-usvc/ci-values.yaml | 14 +++++++- .../retriever-usvc/ci-videoqna-values.yaml | 23 +++++++++++- 13 files changed, 135 insertions(+), 17 deletions(-) mode change 120000 => 100644 helm-charts/common/data-prep/ci-values.yaml mode change 120000 => 100644 helm-charts/common/data-prep/ci-videoqna-values.yaml mode change 120000 => 100644 helm-charts/common/embedding-usvc/ci-values.yaml mode change 120000 => 100644 helm-charts/common/lvm-uservice/ci-values.yaml mode change 120000 => 100644 helm-charts/common/reranking-usvc/ci-values.yaml mode change 120000 => 100644 helm-charts/common/reranking-usvc/ci-videoqna-values.yaml mode change 120000 => 100644 helm-charts/common/retriever-usvc/ci-values.yaml mode change 120000 => 100644 helm-charts/common/retriever-usvc/ci-videoqna-values.yaml diff --git a/.github/workflows/_helm-e2e.yaml b/.github/workflows/_helm-e2e.yaml index 0062127b0..9deff4af6 100644 --- a/.github/workflows/_helm-e2e.yaml +++ b/.github/workflows/_helm-e2e.yaml @@ -65,7 +65,7 @@ jobs: echo "CHART_NAME=$CHART_NAME" >> $GITHUB_ENV echo "RELEASE_NAME=${CHART_NAME}$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV echo "NAMESPACE=${CHART_NAME}-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV - echo "ROLLOUT_TIMEOUT_SECONDS=600s" >> $GITHUB_ENV + echo "ROLLOUT_TIMEOUT_SECONDS=1200s" >> $GITHUB_ENV echo "TEST_TIMEOUT_SECONDS=600s" >> $GITHUB_ENV echo "KUBECTL_TIMEOUT_SECONDS=60s" >> $GITHUB_ENV echo "should_cleanup=false" >> $GITHUB_ENV diff --git a/helm-charts/common/data-prep/README.md b/helm-charts/common/data-prep/README.md index b0a42d0c5..c2b3a7cc9 100644 --- a/helm-charts/common/data-prep/README.md +++ b/helm-charts/common/data-prep/README.md @@ -59,7 +59,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install data-prep . -f ./vdms-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set vdmsHost=${VDMS_HOST} --set vdmsPort=${VDMS_PORT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install data-prep . -f ../variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set vdmsHost=${VDMS_HOST} --set vdmsPort=${VDMS_PORT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ### (Option2): Installing the chart with dependencies automatically @@ -76,7 +76,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install data-prep . -f ./vdms-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install data-prep . -f ./variant_videoqna-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ## Verify diff --git a/helm-charts/common/data-prep/ci-values.yaml b/helm-charts/common/data-prep/ci-values.yaml deleted file mode 120000 index 7d1010096..000000000 --- a/helm-charts/common/data-prep/ci-values.yaml +++ /dev/null @@ -1 +0,0 @@ -values.yaml \ No newline at end of file diff --git a/helm-charts/common/data-prep/ci-values.yaml b/helm-charts/common/data-prep/ci-values.yaml new file mode 100644 index 000000000..473698ec0 --- /dev/null +++ b/helm-charts/common/data-prep/ci-values.yaml @@ -0,0 +1,13 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for data-prep. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +tei: + enabled: true +redis-vector-db: + enabled: true +milvus: + enabled: false diff --git a/helm-charts/common/data-prep/ci-videoqna-values.yaml b/helm-charts/common/data-prep/ci-videoqna-values.yaml deleted file mode 120000 index 313991379..000000000 --- a/helm-charts/common/data-prep/ci-videoqna-values.yaml +++ /dev/null @@ -1 +0,0 @@ -variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/data-prep/ci-videoqna-values.yaml b/helm-charts/common/data-prep/ci-videoqna-values.yaml new file mode 100644 index 000000000..3bdb0764a --- /dev/null +++ b/helm-charts/common/data-prep/ci-videoqna-values.yaml @@ -0,0 +1,21 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +vdms-vector-db: + enabled: true + +image: + repository: opea/dataprep-multimodal-vdms + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +indexName: "mega-videoqna" +vdmsHost: "" +vdmsPort: "8001" +entryCommand: ["/bin/sh"] +extraArgs: ["-c", "sleep 15 && python ingest_videos.py"] + +# Set cacheUseHostPath to for caching encoding/embedding models and other related data +global: + cacheUseHostPath: "" diff --git a/helm-charts/common/embedding-usvc/ci-values.yaml b/helm-charts/common/embedding-usvc/ci-values.yaml deleted file mode 120000 index 7d1010096..000000000 --- a/helm-charts/common/embedding-usvc/ci-values.yaml +++ /dev/null @@ -1 +0,0 @@ -values.yaml \ No newline at end of file diff --git a/helm-charts/common/embedding-usvc/ci-values.yaml b/helm-charts/common/embedding-usvc/ci-values.yaml new file mode 100644 index 000000000..543c69570 --- /dev/null +++ b/helm-charts/common/embedding-usvc/ci-values.yaml @@ -0,0 +1,9 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for embedding-usvc. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +tei: + enabled: true diff --git a/helm-charts/common/lvm-uservice/ci-values.yaml b/helm-charts/common/lvm-uservice/ci-values.yaml deleted file mode 120000 index 7d1010096..000000000 --- a/helm-charts/common/lvm-uservice/ci-values.yaml +++ /dev/null @@ -1 +0,0 @@ -values.yaml \ No newline at end of file diff --git a/helm-charts/common/lvm-uservice/ci-values.yaml b/helm-charts/common/lvm-uservice/ci-values.yaml new file mode 100644 index 000000000..2502e3bac --- /dev/null +++ b/helm-charts/common/lvm-uservice/ci-values.yaml @@ -0,0 +1,7 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for lvm-uservice. + +lvm-serving: + enabled: true diff --git a/helm-charts/common/reranking-usvc/README.md b/helm-charts/common/reranking-usvc/README.md index 47a033ddd..237b0e41d 100644 --- a/helm-charts/common/reranking-usvc/README.md +++ b/helm-charts/common/reranking-usvc/README.md @@ -53,7 +53,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install reranking-usvc . -f ./vdms-values.yaml --set fileServerEndpoint=${FILE_SERVER_ENDPOINT} --set getVideoListEndpoint=${GET_VIDEO_LIST_ENDPOINT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install reranking-usvc . -f ./variant_videoqna-values.yaml --set fileServerEndpoint=${FILE_SERVER_ENDPOINT} --set getVideoListEndpoint=${GET_VIDEO_LIST_ENDPOINT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ### (Option2): Installing the chart with dependencies automatically @@ -68,7 +68,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install reranking-usvc . -f ./vdms-values.yaml --set data-prep.enabled=true --set data-prep.vdms-vector-db.enabled=true --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install reranking-usvc . -f ./variant_videoqna-values.yaml --set data-prep.enabled=true --set data-prep.vdms-vector-db.enabled=true --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ## Verify diff --git a/helm-charts/common/reranking-usvc/ci-values.yaml b/helm-charts/common/reranking-usvc/ci-values.yaml deleted file mode 120000 index 7d1010096..000000000 --- a/helm-charts/common/reranking-usvc/ci-values.yaml +++ /dev/null @@ -1 +0,0 @@ -values.yaml \ No newline at end of file diff --git a/helm-charts/common/reranking-usvc/ci-values.yaml b/helm-charts/common/reranking-usvc/ci-values.yaml new file mode 100644 index 000000000..1118483f4 --- /dev/null +++ b/helm-charts/common/reranking-usvc/ci-values.yaml @@ -0,0 +1,9 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for reranking-usvc. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +teirerank: + enabled: true diff --git a/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml deleted file mode 120000 index 313991379..000000000 --- a/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml +++ /dev/null @@ -1 +0,0 @@ -variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml new file mode 100644 index 000000000..22befc8ab --- /dev/null +++ b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml @@ -0,0 +1,34 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +image: + repository: opea/reranking-videoqna + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +chunkDuration: "" + +# Replace with actual Endpoint URLs +fileServerEndpoint: "" +getVideoListEndpoint: "" + +# As reranking depends on Data-prep service, enable data-prep dependency and +# override the values for multimodal setup. + +data-prep: + enabled: true + + vdms-vector-db: + enabled: true + + image: + repository: opea/dataprep-multimodal-vdms + pullPolicy: IfNotPresent + tag: "latest" + + indexName: "mega-videoqna" + vdmsHost: "" + vdmsPort: "8001" + entryCommand: ["/bin/sh"] + extraArgs: ["-c", "sleep 15 && python ingest_videos.py"] diff --git a/helm-charts/common/reranking-usvc/templates/configmap.yaml b/helm-charts/common/reranking-usvc/templates/configmap.yaml index caaf286fd..70ecd5a54 100644 --- a/helm-charts/common/reranking-usvc/templates/configmap.yaml +++ b/helm-charts/common/reranking-usvc/templates/configmap.yaml @@ -13,13 +13,11 @@ data: {{- end }} {{- if .Values.fileServerEndpoint }} FILE_SERVER_ENDPOINT: {{ tpl .Values.fileServerEndpoint . | quote }} - {{- end }} {{- else }} FILE_SERVER_ENDPOINT: http://{{ .Release.Name }}-data-prep:6007/v1/dataprep/get_file" {{- end }} {{- if .Values.getVideoListEndpoint }} DATAPREP_GET_VIDEO_LIST_ENDPOINT: {{ tpl .Values.getVideoListEndpoint . | quote }} - {{- end }} {{- else }} DATAPREP_GET_VIDEO_LIST_ENDPOINT: http://{{ .Release.Name }}-data-prep:6007/v1/dataprep/get_videos" {{- end }} diff --git a/helm-charts/common/retriever-usvc/README.md b/helm-charts/common/retriever-usvc/README.md index aeaa63dbc..c0557f062 100644 --- a/helm-charts/common/retriever-usvc/README.md +++ b/helm-charts/common/retriever-usvc/README.md @@ -58,7 +58,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install retriever-usvc . -f ./vdms-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install retriever-usvc . -f ./variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` @@ -76,7 +76,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install retriever-usvc . -f ./vdms-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set vdms-vector-db.enabled=true --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install retriever-usvc . -f ./variant_videoqna-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ## Verify diff --git a/helm-charts/common/retriever-usvc/ci-values.yaml b/helm-charts/common/retriever-usvc/ci-values.yaml deleted file mode 120000 index 7d1010096..000000000 --- a/helm-charts/common/retriever-usvc/ci-values.yaml +++ /dev/null @@ -1 +0,0 @@ -values.yaml \ No newline at end of file diff --git a/helm-charts/common/retriever-usvc/ci-values.yaml b/helm-charts/common/retriever-usvc/ci-values.yaml new file mode 100644 index 000000000..bda05801e --- /dev/null +++ b/helm-charts/common/retriever-usvc/ci-values.yaml @@ -0,0 +1,13 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Default values for retriever-usvc. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +tei: + enabled: true +milvus: + enabled: false +redis-vector-db: + enabled: true diff --git a/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml b/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml deleted file mode 120000 index 313991379..000000000 --- a/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml +++ /dev/null @@ -1 +0,0 @@ -variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml b/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml new file mode 100644 index 000000000..f4b496bdf --- /dev/null +++ b/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml @@ -0,0 +1,22 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +vdms-vector-db: + enabled: true + +image: + repository: opea/retriever-vdms + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +indexName: "mega-videoqna" +vdmsHost: "" +vdmsPort: "8001" +useClip: "1" +entryCommand: ["/bin/sh"] +extraArgs: ["-c", "sleep 30 && python retriever_vdms.py"] + +# Set cacheUseHostPath to for caching encoding/embedding models and other related data +global: + cacheUseHostPath: "" From 5ee3dc0058d2e833662dd2c902eb13fd6f2748f1 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Wed, 30 Oct 2024 17:09:18 +0530 Subject: [PATCH 20/28] updated videoqna-ui vars and configmap Signed-off-by: Krishna Murti --- .../common/ui/templates/configmap.yaml | 41 +++++++++++++------ .../common/ui/variant_videoqna-values.yaml | 4 +- helm-charts/videoqna/values.yaml | 4 +- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/helm-charts/common/ui/templates/configmap.yaml b/helm-charts/common/ui/templates/configmap.yaml index 664c4f7ae..2379302e8 100644 --- a/helm-charts/common/ui/templates/configmap.yaml +++ b/helm-charts/common/ui/templates/configmap.yaml @@ -8,20 +8,35 @@ metadata: labels: {{- include "ui.labels" . | nindent 4 }} data: - {{- if .Values.videoqnaBackendHealthCheck }} - BACKEND_HEALTH_CHECK_ENDPOINT: {{ tpl .Values.videoqnaBackendHealthCheck . | quote }} - {{- end }} - {{- if .Values.videoqnaBackendService }} - BACKEND_SERVICE_ENDPOINT: {{ tpl .Values.videoqnaBackendService . | quote }} - {{- end }} - APP_BACKEND_SERVICE_ENDPOINT: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} - APP_DATA_PREP_SERVICE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }} + {{- if contains "codegen-react-ui" .Values.image.repository }} + VITE_CODE_GEN_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if contains "codegen-ui" .Values.image.repository }} + BASIC_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if contains "codetrans-ui" .Values.image.repository }} + BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if or (contains "docsum-ui" .Values.image.repository) (contains "faqgen-ui" .Values.image.repository) }} + DOC_BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if (contains "docsum-react-ui" .Values.image.repository) }} + VITE_DOC_SUM_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if contains "chatqna-ui" .Values.image.repository }} CHAT_BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} UPLOAD_FILE_BASE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }} GET_FILE: {{ .Values.DATAPREP_GET_FILE_ENDPOINT | quote }} DELETE_FILE: {{ .Values.DATAPREP_DELETE_FILE_ENDPOINT | quote }} - BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} - DOC_BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} - BASIC_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} - VITE_CODE_GEN_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} - VITE_DOC_SUM_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if contains "chatqna-conversation-ui" .Values.image.repository}} + APP_BACKEND_SERVICE_ENDPOINT: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + APP_DATA_PREP_SERVICE_URL: {{ .Values.DATAPREP_SERVICE_ENDPOINT | quote }} + APP_DATA_PREP_GET_FILE_URL: {{ .Values.DATAPREP_GET_FILE_ENDPOINT | quote }} + APP_DATA_PREP_DELETE_FILE_URL: {{ .Values.DATAPREP_DELETE_FILE_ENDPOINT | quote }} + {{- else if contains "visualqna-ui" .Values.image.repository }} + BACKEND_BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if contains "audioqna-ui" .Values.image.repository }} + CHAT_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if contains "faqgen-react-ui" .Values.image.repository }} + VITE_FAQ_GEN_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} + {{- else if contains "videoqna-ui" .Values.image.repository }} + BACKEND_SERVICE_ENDPOINT: {{ tpl .Values.BACKEND_SERVICE_ENDPOINT . | quote }} + BACKEND_HEALTH_CHECK_ENDPOINT: {{ tpl .Values.BACKEND_HEALTH_CHECK_ENDPOINT . | quote }} + {{- else }} + {{- fail "Unsupported ui image: " .Values.image.repository }} + {{- end }} diff --git a/helm-charts/common/ui/variant_videoqna-values.yaml b/helm-charts/common/ui/variant_videoqna-values.yaml index 857c0f8cf..c853f634b 100644 --- a/helm-charts/common/ui/variant_videoqna-values.yaml +++ b/helm-charts/common/ui/variant_videoqna-values.yaml @@ -7,9 +7,9 @@ image: tag: "latest" # Endpoint for VideoQnA Backend. Test Value - Override it with actual Backend endpoint -videoqnaBackendService: "http://localhost:8888/v1/videoqna" +BACKEND_SERVICE_ENDPOINT: "http://localhost:8888/v1/videoqna" # Endpoint for VideoQnA Backend Service health check. Test Value - Override it with actual Backend endpoint -videoqnaBackendHealthCheck: "http://localhost:8888/v1/health_check" +BACKEND_HEALTH_CHECK_ENDPOINT: "http://localhost:8888/v1/health_check" containerPort: 5173 service: diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index 2e43a42f0..a5b6ea247 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -72,8 +72,8 @@ videoqna-ui: nameOverride: "ui" # Following template value will be resolved in videoqna-ui ConfigMap - videoqnaBackendService: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/videoqna - videoqnaBackendHealthCheck: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/health_check + BACKEND_SERVICE_ENDPOINT: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/videoqna + BACKEND_HEALTH_CHECK_ENDPOINT: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/health_check containerPort: 5173 service: From ef695c85377147087c90f5050282d8c7e45674c6 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Fri, 1 Nov 2024 00:37:31 +0530 Subject: [PATCH 21/28] =?UTF-8?q?=F0=9F=A9=B9=20Fixes=20in=20reranking=20v?= =?UTF-8?q?alues=20for=20enabling=20data-prep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/reranking-usvc/Chart.yaml | 2 +- helm-charts/common/reranking-usvc/README.md | 2 +- helm-charts/common/reranking-usvc/ci-videoqna-values.yaml | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/helm-charts/common/reranking-usvc/Chart.yaml b/helm-charts/common/reranking-usvc/Chart.yaml index e1b3d9d9b..8b8b5e8be 100644 --- a/helm-charts/common/reranking-usvc/Chart.yaml +++ b/helm-charts/common/reranking-usvc/Chart.yaml @@ -20,4 +20,4 @@ dependencies: - name: vdms-vector-db version: 1.0.0 repository: file://../vdms-vector-db - condition: data-prep.vdms-vector-db.enabled + condition: data-prep.enabled diff --git a/helm-charts/common/reranking-usvc/README.md b/helm-charts/common/reranking-usvc/README.md index 237b0e41d..79671aaf6 100644 --- a/helm-charts/common/reranking-usvc/README.md +++ b/helm-charts/common/reranking-usvc/README.md @@ -68,7 +68,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install reranking-usvc . -f ./variant_videoqna-values.yaml --set data-prep.enabled=true --set data-prep.vdms-vector-db.enabled=true --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install reranking-usvc . -f ./variant_videoqna-values.yaml --set data-prep.enabled=true --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ## Verify diff --git a/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml index 22befc8ab..1ee963545 100644 --- a/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml +++ b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml @@ -19,9 +19,6 @@ getVideoListEndpoint: "" data-prep: enabled: true - vdms-vector-db: - enabled: true - image: repository: opea/dataprep-multimodal-vdms pullPolicy: IfNotPresent From 7be67a1393662d219bd98a9ed7209cedf6f416ed Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Fri, 1 Nov 2024 12:45:05 +0530 Subject: [PATCH 22/28] =?UTF-8?q?=F0=9F=A9=B9=20fixes=20in=20chart.yaml=20?= =?UTF-8?q?|=20updates=20in=20UI=20configmap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/ui/templates/configmap.yaml | 2 +- helm-charts/videoqna/Chart.yaml | 2 -- helm-charts/videoqna/values.yaml | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/helm-charts/common/ui/templates/configmap.yaml b/helm-charts/common/ui/templates/configmap.yaml index 2379302e8..291c91c24 100644 --- a/helm-charts/common/ui/templates/configmap.yaml +++ b/helm-charts/common/ui/templates/configmap.yaml @@ -36,7 +36,7 @@ data: VITE_FAQ_GEN_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} {{- else if contains "videoqna-ui" .Values.image.repository }} BACKEND_SERVICE_ENDPOINT: {{ tpl .Values.BACKEND_SERVICE_ENDPOINT . | quote }} - BACKEND_HEALTH_CHECK_ENDPOINT: {{ tpl .Values.BACKEND_HEALTH_CHECK_ENDPOINT . | quote }} + BACKEND_HEALTH_CHECK_ENDPOINT: {{ tpl .Values.BACKEND_SERVICE_ENDPOINT . | replace "videoqna" "health_check" | quote }} {{- else }} {{- fail "Unsupported ui image: " .Values.image.repository }} {{- end }} diff --git a/helm-charts/videoqna/Chart.yaml b/helm-charts/videoqna/Chart.yaml index e33a0ce3b..045ed2843 100644 --- a/helm-charts/videoqna/Chart.yaml +++ b/helm-charts/videoqna/Chart.yaml @@ -5,8 +5,6 @@ apiVersion: v2 name: videoqna description: A Helm chart to deploy VideoQnA Application Suite type: application -version: 1.0.0 -appVersion: "1.0" dependencies: - name: data-prep version: 1.0.0 diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index a5b6ea247..78c2f395f 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -73,7 +73,6 @@ videoqna-ui: # Following template value will be resolved in videoqna-ui ConfigMap BACKEND_SERVICE_ENDPOINT: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/videoqna - BACKEND_HEALTH_CHECK_ENDPOINT: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/health_check containerPort: 5173 service: From 3cf4f2969c43a0defe93f7f5655cffe4136e0817 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Fri, 1 Nov 2024 13:16:27 +0530 Subject: [PATCH 23/28] updated videoqna-ui values filename Signed-off-by: Krishna Murti --- helm-charts/common/ui/ci-variant_videoqna_streamlit-values.yaml | 1 + helm-charts/common/ui/ci-videoqna-values.yaml | 1 - ...eoqna-values.yaml => variant_videoqna_streamlit-values.yaml} | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) create mode 120000 helm-charts/common/ui/ci-variant_videoqna_streamlit-values.yaml delete mode 120000 helm-charts/common/ui/ci-videoqna-values.yaml rename helm-charts/common/ui/{variant_videoqna-values.yaml => variant_videoqna_streamlit-values.yaml} (67%) diff --git a/helm-charts/common/ui/ci-variant_videoqna_streamlit-values.yaml b/helm-charts/common/ui/ci-variant_videoqna_streamlit-values.yaml new file mode 120000 index 000000000..5a6e67ecd --- /dev/null +++ b/helm-charts/common/ui/ci-variant_videoqna_streamlit-values.yaml @@ -0,0 +1 @@ +variant_videoqna_streamlit-values.yaml \ No newline at end of file diff --git a/helm-charts/common/ui/ci-videoqna-values.yaml b/helm-charts/common/ui/ci-videoqna-values.yaml deleted file mode 120000 index 313991379..000000000 --- a/helm-charts/common/ui/ci-videoqna-values.yaml +++ /dev/null @@ -1 +0,0 @@ -variant_videoqna-values.yaml \ No newline at end of file diff --git a/helm-charts/common/ui/variant_videoqna-values.yaml b/helm-charts/common/ui/variant_videoqna_streamlit-values.yaml similarity index 67% rename from helm-charts/common/ui/variant_videoqna-values.yaml rename to helm-charts/common/ui/variant_videoqna_streamlit-values.yaml index c853f634b..759c1bd20 100644 --- a/helm-charts/common/ui/variant_videoqna-values.yaml +++ b/helm-charts/common/ui/variant_videoqna_streamlit-values.yaml @@ -8,8 +8,6 @@ image: # Endpoint for VideoQnA Backend. Test Value - Override it with actual Backend endpoint BACKEND_SERVICE_ENDPOINT: "http://localhost:8888/v1/videoqna" -# Endpoint for VideoQnA Backend Service health check. Test Value - Override it with actual Backend endpoint -BACKEND_HEALTH_CHECK_ENDPOINT: "http://localhost:8888/v1/health_check" containerPort: 5173 service: From d13bdcbb4b670b8aa829cd1bce3366e0dfdae490 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Tue, 5 Nov 2024 00:45:43 +0530 Subject: [PATCH 24/28] =?UTF-8?q?=F0=9F=94=A5=20Updates=20based=20on=20lvm?= =?UTF-8?q?-uservice=20from=20visualqna?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/common/lvm-uservice/README.md | 8 +- .../lvm-uservice/ci-videoqna-values.yaml | 18 ++++ .../lvm-uservice/templates/configmap.yaml | 8 +- .../templates/tests/test-pod.yaml | 15 ++++ helm-charts/common/lvm-uservice/values.yaml | 90 ------------------- .../lvm-uservice/variant_videoqna-values.yaml | 19 ++++ helm-charts/videoqna/values.yaml | 6 +- 7 files changed, 65 insertions(+), 99 deletions(-) create mode 100644 helm-charts/common/lvm-uservice/ci-videoqna-values.yaml create mode 100644 helm-charts/common/lvm-uservice/variant_videoqna-values.yaml diff --git a/helm-charts/common/lvm-uservice/README.md b/helm-charts/common/lvm-uservice/README.md index 80d5ba82f..b76ccb68d 100644 --- a/helm-charts/common/lvm-uservice/README.md +++ b/helm-charts/common/lvm-uservice/README.md @@ -2,9 +2,11 @@ **Helm chart for deploying lvm-uservice microservice.** -`lvm-uservice` helps communicate to `lvm-serving` microservice. It facilitates sending queries and receiving response from `lvm-serving` microservice. Hence, it depends on lvm-serving microservice and you should make sure that `lvmEndpoint` value is set properly. +## 2. Installing lvm-uservice to be used with lvm-serving microservice (serving VideoLlama-7B) -## (Option1): Installing the chart separately +This setup of `lvm-uservice` is utilized in some of the examples like [VideoQnA](https://github.com/opea-project/GenAIExamples/tree/main/VideoQnA). Here, `lvm-uservice` helps communicate to `lvm-serving` microservice. It facilitates sending queries and receiving response from `lvm-serving` microservice. Hence, it depends on lvm-serving microservice and you should make sure that `lvmEndpoint` value is set properly. + +### (Option1): Installing the chart separately First, you need to install the `lvm-serving` chart. Please refer to the [lvm-serving](../lvm-serving) chart for more information. @@ -24,7 +26,7 @@ helm dependency update helm install lvm-uservice . --set lvmEndpoint=${LVM_ENDPOINT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait ``` -## (Option2): Installing the chart with dependencies automatically +### (Option2): Installing the chart with dependencies automatically (lvm-serving dependency) ```bash cd GenAIInfra/helm-charts/common/lvm-uservice diff --git a/helm-charts/common/lvm-uservice/ci-videoqna-values.yaml b/helm-charts/common/lvm-uservice/ci-videoqna-values.yaml new file mode 100644 index 000000000..1cd38edfc --- /dev/null +++ b/helm-charts/common/lvm-uservice/ci-videoqna-values.yaml @@ -0,0 +1,18 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +lvm-serving: + enabled: true + llmDownload: true + +image: + repository: opea/lvm-video-llama + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +service: + type: ClusterIP + port: 9000 + containerPort: 9000 diff --git a/helm-charts/common/lvm-uservice/templates/configmap.yaml b/helm-charts/common/lvm-uservice/templates/configmap.yaml index e04fd428b..44f612ec5 100644 --- a/helm-charts/common/lvm-uservice/templates/configmap.yaml +++ b/helm-charts/common/lvm-uservice/templates/configmap.yaml @@ -8,9 +8,11 @@ metadata: labels: {{- include "lvm-uservice.labels" . | nindent 4 }} data: - {{- if .Values.lvmEndpoint }} - LVM_ENDPOINT: {{ .Values.lvmEndpoint }} - {{- else }} + {{- if .Values.LVM_ENDPOINT }} + LVM_ENDPOINT: {{ .Values.LVM_ENDPOINT }} + {{- else if contains "lvm-tgi" .Values.image.repository }} + LVM_ENDPOINT: "http://{{ .Release.Name }}-tgi" + {{- else if contains "lvm-video-llama" .Values.image.repository }} LVM_ENDPOINT: "http://{{ .Release.Name }}-lvm-serving" {{- end }} http_proxy: {{ .Values.global.http_proxy | quote }} diff --git a/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml b/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml index 36287cf7e..9f5eed949 100644 --- a/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml +++ b/helm-charts/common/lvm-uservice/templates/tests/test-pod.yaml @@ -14,6 +14,7 @@ spec: - name: curl image: python:3.10.14 command: ['bash', '-c'] + {{- if contains "lvm-video-llama" .Values.image.repository }} args: - | max_retry=20 @@ -26,4 +27,18 @@ spec: if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; done; if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + {{- else if contains "lvm-tgi" .Values.image.repository }} + args: + - | + max_retry=20; + for ((i=1; i<=max_retry; i++)); do + curl http://{{ include "lvm-uservice.fullname" . }}:{{ .Values.service.port }}/v1/lvm -sS --fail-with-body \ + -X POST \ + -d '{"image":"iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mP8/5+hnoEIwDiqkL4KAcT9GO0U4BxoAAAAAElFTkSuQmCC","prompt":"What is this?"}' \ + -H 'Content-Type: application/json' && break; + curlcode=$? + if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi; + done; + if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi + {{- end }} restartPolicy: Never diff --git a/helm-charts/common/lvm-uservice/values.yaml b/helm-charts/common/lvm-uservice/values.yaml index 8b9c2e554..e3c44f78c 100644 --- a/helm-charts/common/lvm-uservice/values.yaml +++ b/helm-charts/common/lvm-uservice/values.yaml @@ -5,93 +5,3 @@ lvm-serving: enabled: false - llmDownload: true - -lvmEndpoint: "" - -replicaCount: 1 -image: - repository: opea/lvm-video-llama - # This sets the pull policy for images. - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "latest" - -imagePullSecrets: [] -# This is to override the chart name. -nameOverride: "" -fullnameOverride: "" - -podAnnotations: {} -podLabels: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - allowPrivilegeEscalation: false - runAsNonRoot: true - runAsUser: 1000 - seccompProfile: - type: RuntimeDefault - -service: - type: ClusterIP - port: 9000 - containerPort: 9000 - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -livenessProbe: - tcpSocket: - port: http - initialDelaySeconds: 5 - periodSeconds: 5 - failureThreshold: 24 -readinessProbe: - tcpSocket: - port: http - initialDelaySeconds: 5 - periodSeconds: 5 -startupProbe: - tcpSocket: - port: http - initialDelaySeconds: 5 - periodSeconds: 5 - failureThreshold: 120 - -nodeSelector: {} - -tolerations: [] - -affinity: {} - -global: - http_proxy: "" - https_proxy: "" - no_proxy: "" - HUGGINGFACEHUB_API_TOKEN: "insert-your-huggingface-token-here" - - # Choose where to save your downloaded models - # 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/lvm-uservice/variant_videoqna-values.yaml b/helm-charts/common/lvm-uservice/variant_videoqna-values.yaml new file mode 100644 index 000000000..b19977476 --- /dev/null +++ b/helm-charts/common/lvm-uservice/variant_videoqna-values.yaml @@ -0,0 +1,19 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +# Values file for VideoQnA Application for lvm-uservice + +lvm-serving: + llmDownload: true + +image: + repository: opea/lvm-video-llama + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + +service: + type: ClusterIP + port: 9000 + containerPort: 9000 diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index 78c2f395f..b2f16d22b 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -72,7 +72,7 @@ videoqna-ui: nameOverride: "ui" # Following template value will be resolved in videoqna-ui ConfigMap - BACKEND_SERVICE_ENDPOINT: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/videoqna + BACKEND_SERVICE_ENDPOINT: http://{{ printf "%s-nginx" .Release.Name | trunc 63 | trimSuffix "-" }}/v1/videoqna containerPort: 5173 service: @@ -122,8 +122,8 @@ reranking-usvc: chunkDuration: "" # Following template value will be resolved in rearanking-usvc ConfigMap - fileServerEndpoint: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/dataprep/get_file - getVideoListEndpoint: http://{{ .Release.Name | trunc 57 | trimSuffix "-" }}-nginx/v1/dataprep/get_videos + fileServerEndpoint: http://{{ printf "%s-nginx" .Release.Name | trunc 63 | trimSuffix "-" }}/v1/dataprep/get_file + getVideoListEndpoint: http://{{ printf "%s-nginx" .Release.Name | trunc 63 | trimSuffix "-" }}/v1/dataprep/get_videos global: http_proxy: "" From a993f1afe4b8e1e65635e560a2813a6a2debf012 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:36:47 +0000 Subject: [PATCH 25/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- helm-charts/common/lvm-uservice/README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/helm-charts/common/lvm-uservice/README.md b/helm-charts/common/lvm-uservice/README.md index 588ce2d61..2b180291d 100644 --- a/helm-charts/common/lvm-uservice/README.md +++ b/helm-charts/common/lvm-uservice/README.md @@ -83,11 +83,12 @@ helm install lvm-uservice . -f ./variant_videoqna-values.yaml --set global.HUGGI To verify the installation, run the command `kubectl get pod` to make sure all pods are running. ### For TGI based lvm-uservice + Run the command `kubectl port-forward svc/lvm-uservice 9399:9399` to expose the lvm-uservice service for access. ### For lvm-serving based lvm-uservice -Run the command `kubectl port-forward svc/lvm-uservice 9000:9000` to expose the lvm-uservice service for access. +Run the command `kubectl port-forward svc/lvm-uservice 9000:9000` to expose the lvm-uservice service for access. Open another terminal and run the following command to verify the service if working: @@ -111,11 +112,11 @@ curl http://localhost:9399/v1/chat/completions \ ## Values -| Key | Type | Default | Description | -| ------------------------------- | ------ | ---------------- | ------------------------------- | -| global.HUGGINGFACEHUB_API_TOKEN | string | `""` | Your own Hugging Face API token | -| image.repository | string | `"opea/lvm-tgi"` | | -| videoqna: image.repository | string | `"opea/lvm-video-llama"` | | -| service.port | string | `"9000"` | | -| LVM_ENDPOINT | string | `""` | LVM endpoint | -| global.monitoring | bop; | false | Service usage metrics | +| Key | Type | Default | Description | +| ------------------------------- | ------ | ------------------------ | ------------------------------- | +| global.HUGGINGFACEHUB_API_TOKEN | string | `""` | Your own Hugging Face API token | +| image.repository | string | `"opea/lvm-tgi"` | | +| videoqna: image.repository | string | `"opea/lvm-video-llama"` | | +| service.port | string | `"9000"` | | +| LVM_ENDPOINT | string | `""` | LVM endpoint | +| global.monitoring | bop; | false | Service usage metrics | From 773922ec58c3b1b00860dfc07b39c84d0e3c919e Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Tue, 5 Nov 2024 02:21:15 +0530 Subject: [PATCH 26/28] =?UTF-8?q?=F0=9F=A9=B9=20fix=20videoqna=20new=20dep?= =?UTF-8?q?endency=20values=20for=20lvm-uservice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Krishna Murti --- helm-charts/videoqna/values.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index b2f16d22b..023aaef94 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -125,6 +125,20 @@ reranking-usvc: fileServerEndpoint: http://{{ printf "%s-nginx" .Release.Name | trunc 63 | trimSuffix "-" }}/v1/dataprep/get_file getVideoListEndpoint: http://{{ printf "%s-nginx" .Release.Name | trunc 63 | trimSuffix "-" }}/v1/dataprep/get_videos +lvm-uservice: + image: + repository: opea/lvm-video-llama + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "latest" + + service: + type: ClusterIP + port: 9000 + containerPort: 9000 + + global: http_proxy: "" https_proxy: "" From 4bd8b040995ae05895992cf53edc945644d14cf9 Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Wed, 6 Nov 2024 10:32:36 +0530 Subject: [PATCH 27/28] lvm-serving rename | replaced cachedir with modeldir Signed-off-by: Krishna Murti --- .github/workflows/_helm-e2e.yaml | 2 +- .vscode/settings.json | 4 +++ helm-charts/common/data-prep/README.md | 8 ++--- .../data-prep/templates/deployment.yaml | 16 ++++++---- .../data-prep/variant_videoqna-values.yaml | 3 +- helm-charts/common/embedding-usvc/README.md | 4 +-- .../embedding-usvc/templates/deployment.yaml | 14 +++++---- .../variant_videoqna-values.yaml | 3 +- helm-charts/common/lvm-uservice/Chart.yaml | 6 ++-- helm-charts/common/lvm-uservice/README.md | 26 ++++++++-------- .../lvm-uservice/ci-videoqna-values.yaml | 2 +- .../lvm-uservice/templates/configmap.yaml | 4 +-- helm-charts/common/lvm-uservice/values.yaml | 2 +- .../lvm-uservice/variant_videoqna-values.yaml | 2 +- helm-charts/common/retriever-usvc/README.md | 8 ++--- .../retriever-usvc/templates/deployment.yaml | 14 +++++---- .../variant_videoqna-values.yaml | 3 +- .../.helmignore | 0 .../Chart.yaml | 2 +- .../README.md | 30 +++++++++---------- .../ci-values.yaml | 0 .../templates/_helpers.tpl | 20 ++++++------- .../templates/configmap.yaml | 4 +-- .../templates/deployment.yaml | 22 +++++--------- .../templates/service.yaml | 6 ++-- .../templates/tests/test-pod.yaml | 6 ++-- .../values.yaml | 5 +--- helm-charts/videoqna/Chart.yaml | 4 +-- helm-charts/videoqna/README.md | 22 +++++++------- helm-charts/videoqna/values.yaml | 5 +--- 30 files changed, 124 insertions(+), 123 deletions(-) create mode 100644 .vscode/settings.json rename helm-charts/common/{lvm-serving => video-llama-lvm}/.helmignore (100%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/Chart.yaml (89%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/README.md (72%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/ci-values.yaml (100%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/templates/_helpers.tpl (72%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/templates/configmap.yaml (75%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/templates/deployment.yaml (82%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/templates/service.yaml (64%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/templates/tests/test-pod.yaml (61%) rename helm-charts/common/{lvm-serving => video-llama-lvm}/values.yaml (94%) diff --git a/.github/workflows/_helm-e2e.yaml b/.github/workflows/_helm-e2e.yaml index 9deff4af6..0062127b0 100644 --- a/.github/workflows/_helm-e2e.yaml +++ b/.github/workflows/_helm-e2e.yaml @@ -65,7 +65,7 @@ jobs: echo "CHART_NAME=$CHART_NAME" >> $GITHUB_ENV echo "RELEASE_NAME=${CHART_NAME}$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV echo "NAMESPACE=${CHART_NAME}-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV - echo "ROLLOUT_TIMEOUT_SECONDS=1200s" >> $GITHUB_ENV + echo "ROLLOUT_TIMEOUT_SECONDS=600s" >> $GITHUB_ENV echo "TEST_TIMEOUT_SECONDS=600s" >> $GITHUB_ENV echo "KUBECTL_TIMEOUT_SECONDS=60s" >> $GITHUB_ENV echo "should_cleanup=false" >> $GITHUB_ENV diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..c6c344432 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "spellright.language": ["en"], + "spellright.documentTypes": ["markdown", "latex", "plaintext", "yaml"] +} diff --git a/helm-charts/common/data-prep/README.md b/helm-charts/common/data-prep/README.md index c2b3a7cc9..40af1d7d9 100644 --- a/helm-charts/common/data-prep/README.md +++ b/helm-charts/common/data-prep/README.md @@ -52,14 +52,14 @@ export VDMS_PORT="8001" export INDEX_NAME="mega-videoqna" export HFTOKEN= # Set a directory to cache emdedding models -export CACHEDIR="/home/$USER/.cache" +export MODELDIR=/mnt/opea-models # Export the proxy variables. Assign empty string if no proxy setup required. export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install data-prep . -f ../variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set vdmsHost=${VDMS_HOST} --set vdmsPort=${VDMS_PORT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install data-prep . -f ../variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.modelUseHostPath=${MODELDIR} --set vdmsHost=${VDMS_HOST} --set vdmsPort=${VDMS_PORT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ### (Option2): Installing the chart with dependencies automatically @@ -69,14 +69,14 @@ cd GenAIInfra/helm-charts/common/data-prep export INDEX_NAME="mega-videoqna" export HFTOKEN= # Set a directory to cache emdedding models -export CACHEDIR="/home/$USER/.cache" +export MODELDIR=/mnt/opea-models # Export the proxy variables. Assign empty string if no proxy setup required. export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install data-prep . -f ./variant_videoqna-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install data-prep . -f ./variant_videoqna-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.modelUseHostPath=${MODELDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ## Verify diff --git a/helm-charts/common/data-prep/templates/deployment.yaml b/helm-charts/common/data-prep/templates/deployment.yaml index a7b9e1e42..32b453580 100644 --- a/helm-charts/common/data-prep/templates/deployment.yaml +++ b/helm-charts/common/data-prep/templates/deployment.yaml @@ -55,12 +55,12 @@ spec: containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: - {{- if .Values.global.cacheUseHostPath }} + {{- if .Values.global.modelUseHostPath }} - mountPath: /home/user/.cache/clip - name: cache-volume + name: model-volume subPath: clip - mountPath: /home/user/.cache/huggingface/hub - name: cache-volume + name: model-volume subPath: huggingface/hub {{- end }} - mountPath: /tmp @@ -80,11 +80,15 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumes: - {{- if .Values.global.cacheUseHostPath }} - - name: cache-volume + {{- if .Values.global.modelUseHostPath }} + - name: model-volume hostPath: - path: {{ .Values.global.cacheUseHostPath }} + path: {{ .Values.global.modelUseHostPath }} type: Directory + {{- else if .Values.global.modelUsePVC }} + - name: model-volume + persistentVolumeClaim: + claimName: {{ .Values.global.modelUsePVC }} {{- end }} - name: tmp emptyDir: {} diff --git a/helm-charts/common/data-prep/variant_videoqna-values.yaml b/helm-charts/common/data-prep/variant_videoqna-values.yaml index 111bf3460..3a9895aae 100644 --- a/helm-charts/common/data-prep/variant_videoqna-values.yaml +++ b/helm-charts/common/data-prep/variant_videoqna-values.yaml @@ -15,4 +15,5 @@ extraArgs: ["-c", "sleep 15 && python ingest_videos.py"] # Set cacheUseHostPath to for caching encoding/embedding models and other related data global: - cacheUseHostPath: "" + modelUseHostPath: "" + modelUsePVC: "" diff --git a/helm-charts/common/embedding-usvc/README.md b/helm-charts/common/embedding-usvc/README.md index dd200c21c..bfd8e7c2f 100644 --- a/helm-charts/common/embedding-usvc/README.md +++ b/helm-charts/common/embedding-usvc/README.md @@ -41,14 +41,14 @@ To install the multimodal embedding-usvc chart, run the following: cd GenAIInfra/helm-charts/common/embedding-usvc # Set a directory to cache emdedding models -export CACHEDIR="/home/$USER/.cache" +export MODELDIR=/mnt/opea-models # Export the proxy variables. Assign empty string if no proxy setup required. export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install embedding-usvc . -f ./vdms-values.yaml --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install embedding-usvc . -f ./variant_videoqna-values.yaml --set global.modelUseHostPath=${MODELDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ## Verify diff --git a/helm-charts/common/embedding-usvc/templates/deployment.yaml b/helm-charts/common/embedding-usvc/templates/deployment.yaml index a0b29650b..1cacbd863 100644 --- a/helm-charts/common/embedding-usvc/templates/deployment.yaml +++ b/helm-charts/common/embedding-usvc/templates/deployment.yaml @@ -46,9 +46,9 @@ spec: containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: - {{- if .Values.global.cacheUseHostPath }} + {{- if .Values.global.modelUseHostPath }} - mountPath: /home/user/.cache/huggingface/hub - name: cache-volume + name: model-volume subPath: huggingface/hub {{- end }} - mountPath: /tmp @@ -68,11 +68,15 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumes: - {{- if .Values.global.cacheUseHostPath }} - - name: cache-volume + {{- if .Values.global.modelUseHostPath }} + - name: model-volume hostPath: - path: {{ .Values.global.cacheUseHostPath }} + path: {{ .Values.global.modelUseHostPath }} type: Directory + {{- else if .Values.global.modelUsePVC }} + - name: model-volume + persistentVolumeClaim: + claimName: {{ .Values.global.modelUsePVC }} {{- end }} - name: tmp emptyDir: {} diff --git a/helm-charts/common/embedding-usvc/variant_videoqna-values.yaml b/helm-charts/common/embedding-usvc/variant_videoqna-values.yaml index 8cc0e985c..68091ccf2 100644 --- a/helm-charts/common/embedding-usvc/variant_videoqna-values.yaml +++ b/helm-charts/common/embedding-usvc/variant_videoqna-values.yaml @@ -12,4 +12,5 @@ securityContext: # Set cacheUseHostPath to for caching encoding/embedding models and other related data global: - cacheUseHostPath: "" + modelUseHostPath: "" + modelUsePVC: "" diff --git a/helm-charts/common/lvm-uservice/Chart.yaml b/helm-charts/common/lvm-uservice/Chart.yaml index baad816b6..43cfdb5e2 100644 --- a/helm-charts/common/lvm-uservice/Chart.yaml +++ b/helm-charts/common/lvm-uservice/Chart.yaml @@ -13,7 +13,7 @@ dependencies: version: 1.0.0 repository: file://../tgi condition: tgi.enabled - - name: lvm-serving + - name: video-llama-lvm version: 1.0.0 - repository: file://../lvm-serving - condition: lvm-serving.enabled + repository: file://../video-llama-lvm + condition: video-llama-lvm.enabled diff --git a/helm-charts/common/lvm-uservice/README.md b/helm-charts/common/lvm-uservice/README.md index 2b180291d..83a2d9ec4 100644 --- a/helm-charts/common/lvm-uservice/README.md +++ b/helm-charts/common/lvm-uservice/README.md @@ -2,7 +2,7 @@ **Helm chart for deploying lvm-uservice microservice.** -There are two versions of `lvm-uservice`. First version runs with `tgi` service and another one runs with `lvm-serving` service. We will try to learn both setups in following sections. +There are two versions of `lvm-uservice`. First version runs with `tgi` service and another one runs with `video-llama-lvm` service. We will try to learn both setups in following sections. ## 1. Installing lvm-uservice to be used with tgi microservice @@ -12,7 +12,7 @@ In this setup, lvm-uservice depends on TGI, you should set LVM_ENDPOINT as tgi e First, you need to install the tgi chart, please refer to the [tgi](../tgi) chart for more information. -After you've deployted the tgi chart successfully, please run `kubectl get svc` to get the tgi service endpoint, i.e. `http://tgi`. +After you've deployed the tgi chart successfully, please run `kubectl get svc` to get the tgi service endpoint, i.e. `http://tgi`. To install the chart, run the following: @@ -33,21 +33,21 @@ helm dependency update helm install lvm-uservice . --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set tgi.enabled=true --wait ``` -## 2. Installing lvm-uservice to be used with lvm-serving microservice (serving VideoLlama-7B) +## 2. Installing lvm-uservice to be used with video-llama-lvm microservice (serving VideoLlama-7B) -This setup of `lvm-uservice` is utilized in some of the examples like [VideoQnA](https://github.com/opea-project/GenAIExamples/tree/main/VideoQnA). Here, `lvm-uservice` helps communicate to `lvm-serving` microservice. It facilitates sending queries and receiving response from `lvm-serving` microservice. Hence, it depends on lvm-serving microservice and you should make sure that `lvmEndpoint` value is set properly. +This setup of `lvm-uservice` is utilized in some of the examples like [VideoQnA](https://github.com/opea-project/GenAIExamples/tree/main/VideoQnA). Here, `lvm-uservice` helps communicate to `video-llama-lvm` microservice. It facilitates sending queries and receiving response from `video-llama-lvm` microservice. Hence, it depends on video-llama-lvm microservice and you should make sure that `lvmEndpoint` value is set properly. ### (Option1): Installing the chart separately -First, you need to install the `lvm-serving` chart. Please refer to the [lvm-serving](../lvm-serving) chart for more information. +First, you need to install the `video-llama-lvm` chart. Please refer to the [video-llama-lvm](../video-llama-lvm) chart for more information. -After you've deployed the `lvm-serving` chart successfully, please run `kubectl get svc` to get `lvm-serving` service host and port. The endpoint url for `lvm-serving` will be formed using the host and port. For example, default value would be `http://lvm-serving:80`. +After you've deployed the `video-llama-lvm` chart successfully, please run `kubectl get svc` to get `video-llama-lvm` service host and port. The endpoint url for `video-llama-lvm` will be formed using the host and port. For example, default value would be `http://video-llama-lvm:80`. To install the chart, run the following: ```bash cd GenAIInfra/helm-charts/common/lvm-uservice -export LVM_ENDPOINT="http://lvm-serving:80" +export LVM_ENDPOINT="http://video-llama-lvm:80" # Export the proxy variables. Assign empty string if no proxy setup required. export https_proxy="your_http_proxy" @@ -57,16 +57,14 @@ helm dependency update helm install lvm-uservice . -f ./variant_videoqna-values.yaml --set lvmEndpoint=${LVM_ENDPOINT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait ``` -### (Option2): Installing the chart with dependencies automatically (with auto-installing lvm-serving dependency) +### (Option2): Installing the chart with dependencies automatically (with auto-installing video-llama-lvm dependency) ```bash cd GenAIInfra/helm-charts/common/lvm-uservice export HFTOKEN="insert-your-huggingface-token-here" -# Set a dir to cache downloaded Video-Llama Model +# Set a dir to cache downloaded Video-Llama Model, other embedding models and clips export MODELDIR=/mnt/opea-models -# Set a directory to cache emdedding models and other related data -export CACHEDIR="/home/$USER/.cache" # When setting up for first time, model needs to be downloaded. Set LLM_DOWNLOAD flag to true to download models. Please note, when redeploying we should set this value to false, otherwise model download will restart. export LLM_DOWNLOAD=true @@ -75,7 +73,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install lvm-uservice . -f ./variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set lvm-serving.enabled=true --set lvm-serving.llmDownload=${LLM_DOWNLOAD} --set global.modelUseHostPath=${MODELDIR} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait +helm install lvm-uservice . -f ./variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set video-llama-lvm.enabled=true --set video-llama-lvm.llmDownload=${LLM_DOWNLOAD} --set global.modelUseHostPath=${MODELDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait ``` ## Verify @@ -86,13 +84,13 @@ To verify the installation, run the command `kubectl get pod` to make sure all p Run the command `kubectl port-forward svc/lvm-uservice 9399:9399` to expose the lvm-uservice service for access. -### For lvm-serving based lvm-uservice +### For video-llama-lvm based lvm-uservice Run the command `kubectl port-forward svc/lvm-uservice 9000:9000` to expose the lvm-uservice service for access. Open another terminal and run the following command to verify the service if working: -### Verify lvm-uservice running with lvm-serving (Video-Llama 7B) service +### Verify lvm-uservice running with video-llama-lvm (Video-Llama 7B) service ```bash curl http://localhost:9000/v1/lvm \ diff --git a/helm-charts/common/lvm-uservice/ci-videoqna-values.yaml b/helm-charts/common/lvm-uservice/ci-videoqna-values.yaml index 1cd38edfc..698cbe5c9 100644 --- a/helm-charts/common/lvm-uservice/ci-videoqna-values.yaml +++ b/helm-charts/common/lvm-uservice/ci-videoqna-values.yaml @@ -1,7 +1,7 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -lvm-serving: +video-llama-lvm: enabled: true llmDownload: true diff --git a/helm-charts/common/lvm-uservice/templates/configmap.yaml b/helm-charts/common/lvm-uservice/templates/configmap.yaml index a84a53237..00eec23a4 100644 --- a/helm-charts/common/lvm-uservice/templates/configmap.yaml +++ b/helm-charts/common/lvm-uservice/templates/configmap.yaml @@ -13,7 +13,7 @@ data: {{- else if contains "lvm-tgi" .Values.image.repository }} LVM_ENDPOINT: "http://{{ .Release.Name }}-tgi" {{- else if contains "lvm-video-llama" .Values.image.repository }} - LVM_ENDPOINT: "http://{{ .Release.Name }}-lvm-serving" + LVM_ENDPOINT: "http://{{ .Release.Name }}-video-llama-lvm" {{- end }} HUGGINGFACEHUB_API_TOKEN: {{ .Values.global.HUGGINGFACEHUB_API_TOKEN | quote}} HF_HOME: "/tmp/.cache/huggingface" @@ -23,7 +23,7 @@ data: http_proxy: {{ .Values.global.http_proxy | quote }} https_proxy: {{ .Values.global.https_proxy | quote }} {{- if and (not .Values.LVM_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy) }} - no_proxy: "{{ .Release.Name }}-tgi,{{ .Release.Name }}-lvm-serving,{{ .Values.global.no_proxy }}" + no_proxy: "{{ .Release.Name }}-tgi,{{ .Release.Name }}-video-llama-lvm,{{ .Values.global.no_proxy }}" {{- else }} no_proxy: {{ .Values.global.no_proxy | quote }} {{- end }} diff --git a/helm-charts/common/lvm-uservice/values.yaml b/helm-charts/common/lvm-uservice/values.yaml index 8ce3d93f2..c523534cf 100644 --- a/helm-charts/common/lvm-uservice/values.yaml +++ b/helm-charts/common/lvm-uservice/values.yaml @@ -10,7 +10,7 @@ tgi: LLM_MODEL_ID: llava-hf/llava-v1.6-mistral-7b-hf MAX_INPUT_LENGTH: "4096" MAX_TOTAL_TOKENS: "8192" -lvm-serving: +video-llama-lvm: enabled: false llmDownload: true diff --git a/helm-charts/common/lvm-uservice/variant_videoqna-values.yaml b/helm-charts/common/lvm-uservice/variant_videoqna-values.yaml index b19977476..3268202dd 100644 --- a/helm-charts/common/lvm-uservice/variant_videoqna-values.yaml +++ b/helm-charts/common/lvm-uservice/variant_videoqna-values.yaml @@ -3,7 +3,7 @@ # Values file for VideoQnA Application for lvm-uservice -lvm-serving: +video-llama-lvm: llmDownload: true image: diff --git a/helm-charts/common/retriever-usvc/README.md b/helm-charts/common/retriever-usvc/README.md index c0557f062..9cd01ceb1 100644 --- a/helm-charts/common/retriever-usvc/README.md +++ b/helm-charts/common/retriever-usvc/README.md @@ -51,14 +51,14 @@ export VDMS_PORT="8001" export INDEX_NAME="mega-videoqna" export HFTOKEN= # Set a directory to cache emdedding models -export CACHEDIR="/home/$USER/.cache" +export MODELDIR=/mnt/opea-models # Export the proxy variables. Assign empty string if no proxy setup required. export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install retriever-usvc . -f ./variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install retriever-usvc . -f ./variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.modelUseHostPath=${MODELDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` @@ -69,14 +69,14 @@ cd GenAIInfra/helm-charts/common/retriever-usvc export INDEX_NAME="mega-videoqna" export HFTOKEN= # Set a directory to cache emdedding models -export CACHEDIR="/home/$USER/.cache" +export MODELDIR=/mnt/opea-models # Export the proxy variables. Assign empty string if no proxy setup required. export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install retriever-usvc . -f ./variant_videoqna-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.cacheUseHostPath=${CACHEDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install retriever-usvc . -f ./variant_videoqna-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.modelUseHostPath=${MODELDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ## Verify diff --git a/helm-charts/common/retriever-usvc/templates/deployment.yaml b/helm-charts/common/retriever-usvc/templates/deployment.yaml index f2eed6ee8..bbe3bf997 100644 --- a/helm-charts/common/retriever-usvc/templates/deployment.yaml +++ b/helm-charts/common/retriever-usvc/templates/deployment.yaml @@ -55,9 +55,9 @@ spec: containerPort: {{ .Values.service.containerPort }} protocol: TCP volumeMounts: - {{- if .Values.global.cacheUseHostPath }} + {{- if .Values.global.modelUseHostPath }} - mountPath: /home/user/.cache/huggingface/hub - name: cache-volume + name: model-volume subPath: huggingface/hub {{- end }} - mountPath: /tmp @@ -77,11 +77,15 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumes: - {{- if .Values.global.cacheUseHostPath }} - - name: cache-volume + {{- if .Values.global.modelUseHostPath }} + - name: model-volume hostPath: - path: {{ .Values.global.cacheUseHostPath }} + path: {{ .Values.global.modelUseHostPath }} type: Directory + {{- else if .Values.global.modelUsePVC }} + - name: model-volume + persistentVolumeClaim: + claimName: {{ .Values.global.modelUsePVC }} {{- end }} - name: tmp emptyDir: {} diff --git a/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml b/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml index 024930ec6..a8616ec81 100644 --- a/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml +++ b/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml @@ -16,4 +16,5 @@ extraArgs: ["-c", "sleep 30 && python retriever_vdms.py"] # Set cacheUseHostPath to for caching encoding/embedding models and other related data global: - cacheUseHostPath: "" + modelUseHostPath: "" + modelUsePVC: "" diff --git a/helm-charts/common/lvm-serving/.helmignore b/helm-charts/common/video-llama-lvm/.helmignore similarity index 100% rename from helm-charts/common/lvm-serving/.helmignore rename to helm-charts/common/video-llama-lvm/.helmignore diff --git a/helm-charts/common/lvm-serving/Chart.yaml b/helm-charts/common/video-llama-lvm/Chart.yaml similarity index 89% rename from helm-charts/common/lvm-serving/Chart.yaml rename to helm-charts/common/video-llama-lvm/Chart.yaml index 50d32a3e0..ac8dd8bec 100644 --- a/helm-charts/common/lvm-serving/Chart.yaml +++ b/helm-charts/common/video-llama-lvm/Chart.yaml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 apiVersion: v2 -name: lvm-serving +name: video-llama-lvm description: A Helm chart for serving LVM type: application version: 1.0.0 diff --git a/helm-charts/common/lvm-serving/README.md b/helm-charts/common/video-llama-lvm/README.md similarity index 72% rename from helm-charts/common/lvm-serving/README.md rename to helm-charts/common/video-llama-lvm/README.md index adac3fc55..7253ec7b1 100644 --- a/helm-charts/common/lvm-serving/README.md +++ b/helm-charts/common/video-llama-lvm/README.md @@ -1,8 +1,8 @@ -# LVM Serving Microservice (lvm-serving) +# LVM Serving Microservice (video-llama-lvm) -Helm chart for deploying LVM-Serving microservice. +Helm chart for deploying video-llama-lvm microservice. -`lvm-serving` is a microservice which provides inference from Video-Llama-2-7b. +`video-llama-lvm` is a microservice which provides inference from Video-Llama-2-7b. ## Installing the Chart @@ -12,10 +12,8 @@ To install the chart, run the following: cd GenAIInfra/helm-charts/common export HFTOKEN="insert-your-huggingface-token-here" -# Set a dir to cache downloaded Video-Llama Model +# Set a dir to cache downloaded Models and clips export MODELDIR=/mnt/opea-models -# Set a directory to cache emdedding models and other related data -export CACHEDIR="/home/$USER/.cache" # When setting up for first time, model needs to be downloaded. Set LLM_DOWNLOAD flag to true to download models. Please note, when redeploying we should set this value to false, otherwise model download will restart. export LLM_DOWNLOAD=true @@ -24,7 +22,7 @@ export LLM_DOWNLOAD=true export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" -helm install lvm-serving lvm-serving --set global.modelUseHostPath=${MODELDIR} --set global.cacheUseHostPath=${CACHEDIR} --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set llmDownload=${LLM_DOWNLOAD} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install video-llama-lvm video-llama-lvm --set global.modelUseHostPath=${MODELDIR} --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set llmDownload=${LLM_DOWNLOAD} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` > \***\*NOTE:\*\*** **Model download may take up to 1.5 Hours.** When installing chart for the first time we should set `llmDownload` value to be **true**. This helps download model for the first run. Afterwards, for re-installing charts set `llmDownload` value in the chart to be **false**. If not set to **false**, model download will again start and service will again long time to be ready. @@ -33,7 +31,7 @@ helm install lvm-serving lvm-serving --set global.modelUseHostPath=${MODELDIR} - To verify the installation, run the command `kubectl get pod` to make sure all pods are running. -Then run the command `kubectl port-forward svc/lvm-serving 2080:80` to expose the lvm-serving service for access on the host machine. +Then run the command `kubectl port-forward svc/video-llama-lvm 2080:80` to expose the video-llama-lvm service for access on the host machine. Open another terminal and run the following command to verify the service if working: @@ -46,11 +44,11 @@ curl -X POST \ ## Values -| Key | Type | Default | Description | -| ------------------------------- | ------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | -| global.cacheUseHostPath | string | "/home/$USER/.cache" | Cache the embedding model and related data. | -| global.HUGGINGFACEHUB_API_TOKEN | string | `insert-your-huggingface-token-here` | Hugging Face API token | -| global.modelUseHostPath | string | `"/mnt/opea-models"` | Cached models directory. The host path "modelUseHostPath" will be mounted to container as /home/user/model directory. | -| image.repository | string | `"opea/video-llama-lvm-server"` | | -| image.tag | string | `"latest"` | | -| llmDownload | boolean | `true` | This value when true, makes lvm-serving download a model. Change it to false for stopping lvm-serving from re-downloading model. | +| Key | Type | Default | Description | +| ------------------------------- | ------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | +| global.cacheUseHostPath | string | "/home/$USER/.cache" | Cache the embedding model and related data. | +| global.HUGGINGFACEHUB_API_TOKEN | string | `insert-your-huggingface-token-here` | Hugging Face API token | +| global.modelUseHostPath | string | `"/mnt/opea-models"` | Cached models directory. The host path "modelUseHostPath" will be mounted to container as /home/user/model directory. | +| image.repository | string | `"opea/video-llama-lvm-server"` | | +| image.tag | string | `"latest"` | | +| llmDownload | boolean | `true` | This value when true, makes video-llama-lvm download a model. Change it to false for stopping video-llama-lvm from re-downloading model. | diff --git a/helm-charts/common/lvm-serving/ci-values.yaml b/helm-charts/common/video-llama-lvm/ci-values.yaml similarity index 100% rename from helm-charts/common/lvm-serving/ci-values.yaml rename to helm-charts/common/video-llama-lvm/ci-values.yaml diff --git a/helm-charts/common/lvm-serving/templates/_helpers.tpl b/helm-charts/common/video-llama-lvm/templates/_helpers.tpl similarity index 72% rename from helm-charts/common/lvm-serving/templates/_helpers.tpl rename to helm-charts/common/video-llama-lvm/templates/_helpers.tpl index 0c17e2c66..316304428 100644 --- a/helm-charts/common/lvm-serving/templates/_helpers.tpl +++ b/helm-charts/common/video-llama-lvm/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "lvm-serving.name" -}} +{{- define "video-llama-lvm.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "lvm-serving.fullname" -}} +{{- define "video-llama-lvm.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "lvm-serving.chart" -}} +{{- define "video-llama-lvm.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "lvm-serving.labels" -}} -helm.sh/chart: {{ include "lvm-serving.chart" . }} -{{ include "lvm-serving.selectorLabels" . }} +{{- define "video-llama-lvm.labels" -}} +helm.sh/chart: {{ include "video-llama-lvm.chart" . }} +{{ include "video-llama-lvm.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "lvm-serving.selectorLabels" -}} -app.kubernetes.io/name: {{ include "lvm-serving.name" . }} +{{- define "video-llama-lvm.selectorLabels" -}} +app.kubernetes.io/name: {{ include "video-llama-lvm.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "lvm-serving.serviceAccountName" -}} +{{- define "video-llama-lvm.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "lvm-serving.fullname" .) .Values.serviceAccount.name }} +{{- default (include "video-llama-lvm.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/helm-charts/common/lvm-serving/templates/configmap.yaml b/helm-charts/common/video-llama-lvm/templates/configmap.yaml similarity index 75% rename from helm-charts/common/lvm-serving/templates/configmap.yaml rename to helm-charts/common/video-llama-lvm/templates/configmap.yaml index 193d0c1fa..9e7d1e618 100644 --- a/helm-charts/common/lvm-serving/templates/configmap.yaml +++ b/helm-charts/common/video-llama-lvm/templates/configmap.yaml @@ -4,9 +4,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "lvm-serving.fullname" . }}-config + name: {{ include "video-llama-lvm.fullname" . }}-config labels: - {{- include "lvm-serving.labels" . | nindent 4 }} + {{- include "video-llama-lvm.labels" . | nindent 4 }} data: llm_download: {{ .Values.llmDownload | quote | title }} http_proxy: {{ .Values.global.http_proxy | quote }} diff --git a/helm-charts/common/lvm-serving/templates/deployment.yaml b/helm-charts/common/video-llama-lvm/templates/deployment.yaml similarity index 82% rename from helm-charts/common/lvm-serving/templates/deployment.yaml rename to helm-charts/common/video-llama-lvm/templates/deployment.yaml index a04cab129..3fd3a50bb 100644 --- a/helm-charts/common/lvm-serving/templates/deployment.yaml +++ b/helm-charts/common/video-llama-lvm/templates/deployment.yaml @@ -4,14 +4,14 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "lvm-serving.fullname" . }} + name: {{ include "video-llama-lvm.fullname" . }} labels: - {{- include "lvm-serving.labels" . | nindent 4 }} + {{- include "video-llama-lvm.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: - {{- include "lvm-serving.selectorLabels" . | nindent 6 }} + {{- include "video-llama-lvm.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -19,7 +19,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "lvm-serving.labels" . | nindent 8 }} + {{- include "video-llama-lvm.labels" . | nindent 8 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} @@ -34,7 +34,7 @@ spec: - name: {{ .Release.Name }} envFrom: - configMapRef: - name: {{ include "lvm-serving.fullname" . }}-config + name: {{ include "video-llama-lvm.fullname" . }}-config {{- if .Values.global.extraEnvConfig }} - configMapRef: name: {{ .Values.global.extraEnvConfig }} @@ -55,14 +55,12 @@ spec: volumeMounts: - mountPath: /home/user/model name: model-volume - {{- if .Values.global.cacheUseHostPath }} - mountPath: /home/user/.cache/huggingface/hub - name: cache-volume + name: model-volume subPath: huggingface/hub - mountPath: /home/user/.cache/torch/hub - name: cache-volume + name: model-volume subPath: torch/hub - {{- end }} - mountPath: /tmp name: tmp livenessProbe: @@ -89,12 +87,6 @@ spec: {{- else }} emptyDir: {} {{- end }} - {{- if .Values.global.cacheUseHostPath }} - - name: cache-volume - hostPath: - path: {{ .Values.global.cacheUseHostPath }} - type: Directory - {{- end }} - name: tmp emptyDir: {} {{- with .Values.nodeSelector }} diff --git a/helm-charts/common/lvm-serving/templates/service.yaml b/helm-charts/common/video-llama-lvm/templates/service.yaml similarity index 64% rename from helm-charts/common/lvm-serving/templates/service.yaml rename to helm-charts/common/video-llama-lvm/templates/service.yaml index 79900e7da..01b9e01bb 100644 --- a/helm-charts/common/lvm-serving/templates/service.yaml +++ b/helm-charts/common/video-llama-lvm/templates/service.yaml @@ -4,9 +4,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "lvm-serving.fullname" . }} + name: {{ include "video-llama-lvm.fullname" . }} labels: - {{- include "lvm-serving.labels" . | nindent 4 }} + {{- include "video-llama-lvm.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: @@ -15,4 +15,4 @@ spec: protocol: TCP name: http selector: - {{- include "lvm-serving.selectorLabels" . | nindent 4 }} + {{- include "video-llama-lvm.selectorLabels" . | nindent 4 }} diff --git a/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml b/helm-charts/common/video-llama-lvm/templates/tests/test-pod.yaml similarity index 61% rename from helm-charts/common/lvm-serving/templates/tests/test-pod.yaml rename to helm-charts/common/video-llama-lvm/templates/tests/test-pod.yaml index b5fc818ab..c7bb2d927 100644 --- a/helm-charts/common/lvm-serving/templates/tests/test-pod.yaml +++ b/helm-charts/common/video-llama-lvm/templates/tests/test-pod.yaml @@ -4,9 +4,9 @@ apiVersion: v1 kind: Pod metadata: - name: "{{ include "lvm-serving.fullname" . }}-testpod" + name: "{{ include "video-llama-lvm.fullname" . }}-testpod" labels: - {{- include "lvm-serving.labels" . | nindent 4 }} + {{- include "video-llama-lvm.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: @@ -18,7 +18,7 @@ spec: - | max_retry=20 for ((i=1; i<=max_retry; i++)); do - curl 'http://{{ include "lvm-serving.fullname" . }}:{{ .Values.service.port }}/generate?video_url=silence_girl.mp4&start=0.0&duration=9&prompt=What%20is%20the%20person%20doing%3F&max_new_tokens=150' -sS --fail-with-body \ + curl -v 'http://{{ include "video-llama-lvm.fullname" . }}:{{ .Values.service.port }}/generate?video_url=https%3A%2F%2Fgithub.com%2FDAMO-NLP-SG%2FVideo-LLaMA%2Fraw%2Fmain%2Fexamples%2Fsilence_girl.mp4&start=0.0&duration=9&prompt=What%20is%20the%20person%20doing%3F&max_new_tokens=150' -sS --fail-with-body \ -X POST \ -H 'accept: */*' \ -d '' && break; diff --git a/helm-charts/common/lvm-serving/values.yaml b/helm-charts/common/video-llama-lvm/values.yaml similarity index 94% rename from helm-charts/common/lvm-serving/values.yaml rename to helm-charts/common/video-llama-lvm/values.yaml index b7c43a21b..242005b95 100644 --- a/helm-charts/common/lvm-serving/values.yaml +++ b/helm-charts/common/video-llama-lvm/values.yaml @@ -1,7 +1,7 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -# Default values for lvm-serving. +# Default values for video-llama-lvm. replicaCount: 1 @@ -101,6 +101,3 @@ global: # By default, both var are set to empty, the model will be downloaded and saved to a tmp volume. modelUseHostPath: "" modelUsePVC: "" - - # Set cacheUseHostPath to for caching encoding/embedding models and other related data - cacheUseHostPath: "" diff --git a/helm-charts/videoqna/Chart.yaml b/helm-charts/videoqna/Chart.yaml index 045ed2843..fb033383d 100644 --- a/helm-charts/videoqna/Chart.yaml +++ b/helm-charts/videoqna/Chart.yaml @@ -21,9 +21,9 @@ dependencies: - name: vdms-vector-db version: 1.0.0 repository: "file://../common/vdms-vector-db" - - name: lvm-serving + - name: video-llama-lvm version: 1.0.0 - repository: "file://../common/lvm-serving" + repository: "file://../common/video-llama-lvm" - name: lvm-uservice version: 1.0.0 repository: "file://../common/lvm-uservice" diff --git a/helm-charts/videoqna/README.md b/helm-charts/videoqna/README.md index 0084e2a2c..e9f10a8d5 100644 --- a/helm-charts/videoqna/README.md +++ b/helm-charts/videoqna/README.md @@ -7,7 +7,7 @@ Helm chart for deploying VideoQnA service. VideoQnA depends on the following oth - [retriever-usvc](../common/retriever-usvc/README.md) - [reranking-usvc](../common/reranking-usvc/README.md) - [vdms-vector-db](../common/vdms-vector-db/README.md) -- [lvm-serving](../common/lvm-serving/README.md) +- [video-llama-lvm](../common/video-llama-lvm/README.md) - [lvm-uservice](../common/lvm-uservice/README.md) ## Installing the Chart @@ -30,12 +30,12 @@ export INDEX_NAME="mega-videoqna" export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" -helm install videoqna videoqna --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set global.cacheUseHostPath=${CACHEDIR} --set lvm-serving.llmDownload=${LLM_DOWNLOAD} --set data-prep.indexName=${INDEX_NAME} --set retriever-usvc.indexName=${INDEX_NAME} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait +helm install videoqna videoqna --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set global.modelUseHostPath=${MODELDIR} --set global.cacheUseHostPath=${CACHEDIR} --set video-llama-lvm.llmDownload=${LLM_DOWNLOAD} --set data-prep.indexName=${INDEX_NAME} --set retriever-usvc.indexName=${INDEX_NAME} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} --wait ``` ### IMPORTANT NOTE -1. Make sure your `MODELDIR` and `CACHEDIR` exists on the node where your workload is schedueled. These dirs are used to cache the downloaded model for next time use. Otherwise, set `global.modelUseHostPath` and `global.cacheUseHostPath` to 'null' if you don't want to cache the models. +1. Make sure your `MODELDIR` and `CACHEDIR` exists on the node where your workload is scheduled. These directories are used to cache the downloaded model for next time use. Otherwise, set `global.modelUseHostPath` and `global.cacheUseHostPath` to 'null' if you don't want to cache the models. ## Verify @@ -69,11 +69,11 @@ Open a browser and head to `http://:${port}` to use VideoQn ## Values -| Key | Type | Default | Description | -| --------------------------------------------- | ------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| image.repository | string | `"opea/videoqna"` | | -| service.port | string | `"8888"` | | -| global.modelUseHostPath | string | `"/mnt/opea-models"` | A directory to where model dir for lvm-serving service is mounted. | -| global.cacheUseHostPath | string | `"/home/$USER/.cache"` | A directory to where cache dir for several services are mounted. | -| lvm-serving.llmDownload | boolean | `true` | This value when true, makes lvm-serving download a model. Change it to false for stopping lvm-serving from re-downloading model. | -| data-prep.indexName, retriever-usvc.indexName | string | `"mega-videoqna"` | This value when true, makes lvm-serving download a model. Change it to false for stopping lvm-serving from re-downloading model. | +| Key | Type | Default | Description | +| --------------------------------------------- | ------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| image.repository | string | `"opea/videoqna"` | | +| service.port | string | `"8888"` | | +| global.modelUseHostPath | string | `"/mnt/opea-models"` | A directory to where model dir for video-llama-lvm service is mounted. | +| global.cacheUseHostPath | string | `"/home/$USER/.cache"` | A directory to where cache dir for several services are mounted. | +| video-llama-lvm.llmDownload | boolean | `true` | This value when true, makes video-llama-lvm download a model. Change it to false for stopping video-llama-lvm from re-downloading model. | +| data-prep.indexName, retriever-usvc.indexName | string | `"mega-videoqna"` | This value when true, makes video-llama-lvm download a model. Change it to false for stopping video-llama-lvm from re-downloading model. | diff --git a/helm-charts/videoqna/values.yaml b/helm-charts/videoqna/values.yaml index 023aaef94..d8e847c27 100644 --- a/helm-charts/videoqna/values.yaml +++ b/helm-charts/videoqna/values.yaml @@ -147,7 +147,4 @@ global: # Set modelUseHostPath or modelUsePVC to use model cache. modelUseHostPath: "" - # modelUsePVC: "" - - # Set cacheUseHostPath to for caching encoding/embedding models and other related data - cacheUseHostPath: "" + modelUsePVC: "" From 91f96ec7686abbd4e1672508a2a540cb534621ae Mon Sep 17 00:00:00 2001 From: Krishna Murti Date: Wed, 6 Nov 2024 12:13:28 +0530 Subject: [PATCH 28/28] reverted to INDEX_NAME key Signed-off-by: Krishna Murti --- helm-charts/common/data-prep/README.md | 26 +++++++++---------- .../common/data-prep/ci-videoqna-values.yaml | 2 +- .../common/data-prep/templates/configmap.yaml | 2 +- helm-charts/common/data-prep/values.yaml | 2 +- .../data-prep/variant_videoqna-values.yaml | 2 +- .../reranking-usvc/ci-videoqna-values.yaml | 2 +- .../variant_videoqna-values.yaml | 2 +- .../retriever-usvc/ci-videoqna-values.yaml | 2 +- .../retriever-usvc/templates/configmap.yaml | 2 +- helm-charts/common/retriever-usvc/values.yaml | 2 +- .../variant_videoqna-values.yaml | 2 +- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/helm-charts/common/data-prep/README.md b/helm-charts/common/data-prep/README.md index 40af1d7d9..50c6a9fbc 100644 --- a/helm-charts/common/data-prep/README.md +++ b/helm-charts/common/data-prep/README.md @@ -2,7 +2,7 @@ Helm chart for deploying data-prep microservice. Data-Prep is consumed by several reference applications present in [GenAIExample](https://github.com/opea-project/GenAIExamples/tree/main). -There are 2 versions of Data-Prep microservice. First version is unimodal based on redis-vector-db and TEI. It performs data preparation for textual data. An alternative multimodal version based on `vdms-values.yaml` file, performs data preparation for visual data input. Follow along to select and install the version which suites your use case. +There are 2 versions of Data-Prep microservice. First version is unimodal based on redis-vector-db and TEI. It performs data preparation for textual data. An alternative multimodal version based on `videoqna-values.yaml` file, performs data preparation for visual data input. Follow along to select and install the version which suites your use case. Data-Prep uses redis-vector-db and tei. The multimodal version uses vdms-vector-db service. Endpoints for these dependencies should be set properly before installing the chart. @@ -59,7 +59,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install data-prep . -f ../variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.modelUseHostPath=${MODELDIR} --set vdmsHost=${VDMS_HOST} --set vdmsPort=${VDMS_PORT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install data-prep . -f ../variant_videoqna-values.yaml --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set INDEX_NAME=${INDEX_NAME} --set global.modelUseHostPath=${MODELDIR} --set vdmsHost=${VDMS_HOST} --set vdmsPort=${VDMS_PORT} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ### (Option2): Installing the chart with dependencies automatically @@ -76,7 +76,7 @@ export https_proxy="your_http_proxy" export http_proxy="your_https_proxy" helm dependency update -helm install data-prep . -f ./variant_videoqna-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set indexName=${INDEX_NAME} --set global.modelUseHostPath=${MODELDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} +helm install data-prep . -f ./variant_videoqna-values.yaml --set vdms-vector-db.enabled=true --set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} --set INDEX_NAME=${INDEX_NAME} --set global.modelUseHostPath=${MODELDIR} --set global.https_proxy=${https_proxy} --set global.http_proxy=${http_proxy} ``` ## Verify @@ -111,16 +111,16 @@ curl -X POST http://localhost:6007/v1/dataprep \ ## Values -| Key | Type | Default | Description | -| ---------------------------- | ------ | --------------------------------- | ----------- | -| image.repository | string | `"opea/dataprep-redis"` | | -| service.port | string | `"6007"` | | -| REDIS_URL | string | `""` | | -| TEI_EMBEDDING_ENDPOINT | string | `""` | | -| vdms-values:image.repository | string | `"opea/dataprep-multimodal-vdms"` | | -| vdms-values:vdmsHost | string | `""` | | -| vdms-values:vdmsPort | string | `"8001"` | | -| vdms-values:indexName | string | `"mega-videoqna"` | | +| Key | Type | Default | Description | +| -------------------------------- | ------ | --------------------------------- | ----------- | +| image.repository | string | `"opea/dataprep-redis"` | | +| service.port | string | `"6007"` | | +| REDIS_URL | string | `""` | | +| TEI_EMBEDDING_ENDPOINT | string | `""` | | +| videoqna-values:image.repository | string | `"opea/dataprep-multimodal-vdms"` | | +| videoqna-values:vdmsHost | string | `""` | | +| videoqna-values:vdmsPort | string | `"8001"` | | +| videoqna-values:INDEX_NAME | string | `"mega-videoqna"` | | ## Milvus support diff --git a/helm-charts/common/data-prep/ci-videoqna-values.yaml b/helm-charts/common/data-prep/ci-videoqna-values.yaml index 3bdb0764a..7b2620937 100644 --- a/helm-charts/common/data-prep/ci-videoqna-values.yaml +++ b/helm-charts/common/data-prep/ci-videoqna-values.yaml @@ -10,7 +10,7 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "latest" -indexName: "mega-videoqna" +INDEX_NAME: "mega-videoqna" vdmsHost: "" vdmsPort: "8001" entryCommand: ["/bin/sh"] diff --git a/helm-charts/common/data-prep/templates/configmap.yaml b/helm-charts/common/data-prep/templates/configmap.yaml index 94ce15c9a..299d3b54a 100644 --- a/helm-charts/common/data-prep/templates/configmap.yaml +++ b/helm-charts/common/data-prep/templates/configmap.yaml @@ -34,7 +34,7 @@ data: {{- else }} REDIS_URL: "redis://{{ .Release.Name }}-redis-vector-db:6379" {{- end }} - INDEX_NAME: {{ .Values.indexName | quote }} + INDEX_NAME: {{ .Values.INDEX_NAME | quote }} KEY_INDEX_NAME: {{ .Values.KEY_INDEX_NAME | quote }} SEARCH_BATCH_SIZE: {{ .Values.SEARCH_BATCH_SIZE | quote }} {{- if .Values.MILVUS_HOST }} diff --git a/helm-charts/common/data-prep/values.yaml b/helm-charts/common/data-prep/values.yaml index 86db8494f..56ad6788c 100644 --- a/helm-charts/common/data-prep/values.yaml +++ b/helm-charts/common/data-prep/values.yaml @@ -99,7 +99,7 @@ LOCAL_EMBEDDING_MODEL: "" # redis DB service URL, e.g. redis://: REDIS_URL: "" -indexName: "rag-redis" +INDEX_NAME: "rag-redis" KEY_INDEX_NAME: "file-keys" SEARCH_BATCH_SIZE: 10 diff --git a/helm-charts/common/data-prep/variant_videoqna-values.yaml b/helm-charts/common/data-prep/variant_videoqna-values.yaml index 3a9895aae..b25e159f8 100644 --- a/helm-charts/common/data-prep/variant_videoqna-values.yaml +++ b/helm-charts/common/data-prep/variant_videoqna-values.yaml @@ -7,7 +7,7 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "latest" -indexName: "mega-videoqna" +INDEX_NAME: "mega-videoqna" vdmsHost: "" vdmsPort: "8001" entryCommand: ["/bin/sh"] diff --git a/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml index 1ee963545..32d9a760e 100644 --- a/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml +++ b/helm-charts/common/reranking-usvc/ci-videoqna-values.yaml @@ -24,7 +24,7 @@ data-prep: pullPolicy: IfNotPresent tag: "latest" - indexName: "mega-videoqna" + INDEX_NAME: "mega-videoqna" vdmsHost: "" vdmsPort: "8001" entryCommand: ["/bin/sh"] diff --git a/helm-charts/common/reranking-usvc/variant_videoqna-values.yaml b/helm-charts/common/reranking-usvc/variant_videoqna-values.yaml index 4e6d14641..7d0f6ad0e 100644 --- a/helm-charts/common/reranking-usvc/variant_videoqna-values.yaml +++ b/helm-charts/common/reranking-usvc/variant_videoqna-values.yaml @@ -21,7 +21,7 @@ data-prep: pullPolicy: IfNotPresent tag: "latest" - indexName: "mega-videoqna" + INDEX_NAME: "mega-videoqna" vdmsHost: "" vdmsPort: "8001" entryCommand: ["/bin/sh"] diff --git a/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml b/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml index f4b496bdf..561009cf8 100644 --- a/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml +++ b/helm-charts/common/retriever-usvc/ci-videoqna-values.yaml @@ -10,7 +10,7 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "latest" -indexName: "mega-videoqna" +INDEX_NAME: "mega-videoqna" vdmsHost: "" vdmsPort: "8001" useClip: "1" diff --git a/helm-charts/common/retriever-usvc/templates/configmap.yaml b/helm-charts/common/retriever-usvc/templates/configmap.yaml index 54237afbe..15521db82 100644 --- a/helm-charts/common/retriever-usvc/templates/configmap.yaml +++ b/helm-charts/common/retriever-usvc/templates/configmap.yaml @@ -36,7 +36,7 @@ data: {{- else }} REDIS_URL: "redis://{{ .Release.Name }}-redis-vector-db:6379" {{- end }} - INDEX_NAME: {{ .Values.indexName | quote }} + INDEX_NAME: {{ .Values.INDEX_NAME | quote }} {{- if .Values.MILVUS_HOST }} MILVUS_HOST: {{ .Values.MILVUS_HOST | quote }} {{- else }} diff --git a/helm-charts/common/retriever-usvc/values.yaml b/helm-charts/common/retriever-usvc/values.yaml index a46392b8c..5dde5ab37 100644 --- a/helm-charts/common/retriever-usvc/values.yaml +++ b/helm-charts/common/retriever-usvc/values.yaml @@ -24,7 +24,7 @@ TEI_EMBEDDING_ENDPOINT: "" LOCAL_EMBEDDING_MODEL: "" REDIS_URL: "" -indexName: "rag-redis" +INDEX_NAME: "rag-redis" image: repository: opea/retriever-redis diff --git a/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml b/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml index a8616ec81..770427eeb 100644 --- a/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml +++ b/helm-charts/common/retriever-usvc/variant_videoqna-values.yaml @@ -7,7 +7,7 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "latest" -indexName: "mega-videoqna" +INDEX_NAME: "mega-videoqna" vdmsHost: "" vdmsPort: "8001" useClip: "1"