diff --git a/helm-charts/common/ui/templates/configmap.yaml b/helm-charts/common/ui/templates/configmap.yaml index af6cf6fd..61f6272a 100644 --- a/helm-charts/common/ui/templates/configmap.yaml +++ b/helm-charts/common/ui/templates/configmap.yaml @@ -37,6 +37,4 @@ data: VITE_FAQ_GEN_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} {{- else if contains "faqgen-ui" .Values.image.repository }} FAQ_BASE_URL: {{ .Values.BACKEND_SERVICE_ENDPOINT | quote }} - {{- else }} - {{- fail "Unsupported ui image: " .Values.image.repository }} {{- end }} diff --git a/helm-charts/common/ui/templates/deployment.yaml b/helm-charts/common/ui/templates/deployment.yaml index 44a3299f..637c7a48 100644 --- a/helm-charts/common/ui/templates/deployment.yaml +++ b/helm-charts/common/ui/templates/deployment.yaml @@ -33,6 +33,9 @@ spec: envFrom: - configMapRef: name: {{ include "ui.fullname" . }}-config + - configMapRef: + name: {{ .Release.Name }}-opea-ui-config + optional: true {{- if .Values.global.extraEnvConfig }} - configMapRef: name: {{ .Values.global.extraEnvConfig }} diff --git a/helm-charts/docsum/Chart.yaml b/helm-charts/docsum/Chart.yaml index ce30da83..d7cac44c 100644 --- a/helm-charts/docsum/Chart.yaml +++ b/helm-charts/docsum/Chart.yaml @@ -22,5 +22,6 @@ dependencies: - name: nginx version: 0-latest repository: "file://../common/nginx" + condition: nginx.enabled version: 0-latest appVersion: "v1.0" diff --git a/helm-charts/docsum/README.md b/helm-charts/docsum/README.md index d9f4035a..957c55c2 100644 --- a/helm-charts/docsum/README.md +++ b/helm-charts/docsum/README.md @@ -42,14 +42,17 @@ curl http://localhost:8888/v1/docsum \ ### 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: +The UI has already been installed via the Helm chart. To access it, use the external IP of one your Kubernetes node along with docsum-ui service nodePort(If using the default docsum gradio UI) or along with the NGINX service nodePort. You can find the corresponding port using the following command: ```bash -export port=$(kubectl get service docsum-nginx --output='jsonpath={.spec.ports[0].nodePort}') +# For docsum gradio UI +export port=$(kubectl get service docsum-docsum-ui --output='jsonpath={.spec.ports[0].nodePort}') +# For other docsum UI +# export port=$(kubectl get service docsum-nginx --output='jsonpath={.spec.ports[0].nodePort}') echo $port ``` -Open a browser to access `http://:${port}` to play with the ChatQnA workload. +Open a browser to access `http://:${port}` to play with the DocSum workload. ## Values diff --git a/helm-charts/docsum/templates/nginx.yaml b/helm-charts/docsum/templates/nginx.yaml deleted file mode 100644 index 8f154524..00000000 --- a/helm-charts/docsum/templates/nginx.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }}-nginx-config - labels: - {{- include "docsum.labels" . | nindent 4 }} -data: - FRONTEND_SERVICE_IP: {{ include "ui.fullname" (index .Subcharts "docsum-ui") | quote }} - FRONTEND_SERVICE_PORT: {{ index .Values "docsum-ui" "service" "port" | quote }} - BACKEND_SERVICE_NAME: docsum - BACKEND_SERVICE_IP: {{ include "docsum.fullname" . | quote }} - BACKEND_SERVICE_PORT: {{ .Values.service.port | quote }} diff --git a/helm-charts/docsum/templates/ui-nginx.yaml b/helm-charts/docsum/templates/ui-nginx.yaml new file mode 100644 index 00000000..6ea311b7 --- /dev/null +++ b/helm-charts/docsum/templates/ui-nginx.yaml @@ -0,0 +1,33 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +{{- if .Values.nginx.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-nginx-config + labels: + {{- include "docsum.labels" . | nindent 4 }} +data: + FRONTEND_SERVICE_IP: {{ include "ui.fullname" (index .Subcharts "docsum-ui") | quote }} + FRONTEND_SERVICE_PORT: {{ index .Values "docsum-ui" "service" "port" | quote }} + BACKEND_SERVICE_NAME: docsum + BACKEND_SERVICE_IP: {{ include "docsum.fullname" . | quote }} + BACKEND_SERVICE_PORT: {{ .Values.service.port | quote }} +{{- else }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-opea-ui-config + labels: + {{- include "docsum.labels" . | nindent 4 }} +data: + BACKEND_SERVICE_ENDPOINT: {{ (printf "http://%s:%s/v1/docsum" (include "docsum.fullname" .) (toString .Values.service.port)) | quote }} + http_proxy: {{ .Values.global.http_proxy | quote }} + https_proxy: {{ .Values.global.https_proxy | quote }} + {{- if or .Values.global.http_proxy .Values.global.https_proxy }} + no_proxy: {{ (printf "%s,%s" (include "docsum.fullname" .) .Values.global.no_proxy) | quote }} + {{- else }} + no_proxy: {{ .Values.global.no_proxy | quote }} + {{- end }} +{{- end }} diff --git a/helm-charts/docsum/values.yaml b/helm-charts/docsum/values.yaml index 1bb5a95d..7cb5330c 100644 --- a/helm-charts/docsum/values.yaml +++ b/helm-charts/docsum/values.yaml @@ -70,16 +70,30 @@ tgi: MAX_INPUT_LENGTH: "1024" MAX_TOTAL_TOKENS: "2048" +# Use docsum gradio UI nginx: - service: - type: NodePort - + enabled: false docsum-ui: image: - repository: opea/docsum-ui + repository: opea/docsum-gradio-ui tag: "latest" - BACKEND_SERVICE_ENDPOINT: "/v1/docsum" containerPort: 5173 + service: + type: NodePort + +# NOTE: uncomment the following settings to use other docsum UI +# nginx: +# enabled: true +# service: +# type: NodePort +# docsum-ui: +# image: +# repository: opea/docsum-ui +# tag: "latest" +# BACKEND_SERVICE_ENDPOINT: "/v1/docsum" +# containerPort: 5173 +# service: +# type: ClusterIP global: http_proxy: ""