Skip to content

Commit

Permalink
docsum: Use docsum-gradio-ui by default
Browse files Browse the repository at this point in the history
Signed-off-by: Lianhao Lu <[email protected]>
  • Loading branch information
lianhao committed Jan 3, 2025
1 parent 68e7d06 commit 85a98da
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 25 deletions.
2 changes: 0 additions & 2 deletions helm-charts/common/ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 3 additions & 0 deletions helm-charts/common/ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions helm-charts/docsum/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ dependencies:
- name: nginx
version: 0-latest
repository: "file://../common/nginx"
condition: nginx.enabled
version: 0-latest
appVersion: "v1.0"
9 changes: 6 additions & 3 deletions helm-charts/docsum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<k8s-node-ip-address>:${port}` to play with the ChatQnA workload.
Open a browser to access `http://<k8s-node-ip-address>:${port}` to play with the DocSum workload.

## Values

Expand Down
15 changes: 0 additions & 15 deletions helm-charts/docsum/templates/nginx.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions helm-charts/docsum/templates/ui-nginx.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
24 changes: 19 additions & 5 deletions helm-charts/docsum/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down

0 comments on commit 85a98da

Please sign in to comment.