Skip to content

Commit

Permalink
ui: support variants for multiple examples (#464)
Browse files Browse the repository at this point in the history
* ui: support variants for multiple examples
* use the single helm chart to support multiple variants of UI
* add probes for ui pod

Signed-off-by: Ruoyu Ying <[email protected]>
  • Loading branch information
Ruoyu-y authored Oct 30, 2024
1 parent a5c96ab commit 96af2ad
Show file tree
Hide file tree
Showing 21 changed files with 149 additions and 7 deletions.
1 change: 1 addition & 0 deletions helm-charts/common/ui/ci-variant_codegen_react-values.yaml
1 change: 1 addition & 0 deletions helm-charts/common/ui/ci-variant_docsum_react-values.yaml
1 change: 1 addition & 0 deletions helm-charts/common/ui/ci-variant_docsum_svelte-values.yaml
1 change: 1 addition & 0 deletions helm-charts/common/ui/ci-variant_faqgen_react-values.yaml
1 change: 1 addition & 0 deletions helm-charts/common/ui/ci-variant_faqgen_svelte-values.yaml
32 changes: 25 additions & 7 deletions helm-charts/common/ui/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,32 @@ metadata:
labels:
{{- include "ui.labels" . | nindent 4 }}
data:
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 }}
{{- fail "Unsupported ui image: " .Values.image.repository }}
{{- end }}
12 changes: 12 additions & 0 deletions helm-charts/common/ui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ spec:
- name: ui
containerPort: {{ .Values.containerPort }}
protocol: TCP
{{- if .Values.livenessProbe }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
{{- end }}
{{- if .Values.readinessProbe }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
{{- end }}
{{- if .Values.startupProbe }}
startupProbe:
{{- toYaml .Values.startupProbe | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
Expand Down
21 changes: 21 additions & 0 deletions helm-charts/common/ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,27 @@ service:
type: ClusterIP
port: 5174

livenessProbe:
httpGet:
path: /
port: ui
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 24
readinessProbe:
httpGet:
path: /
port: ui
initialDelaySeconds: 5
periodSeconds: 5
startupProbe:
httpGet:
path: /
port: ui
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 120

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
Expand Down
8 changes: 8 additions & 0 deletions helm-charts/common/ui/variant_chatqna_svelte-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/chatqna-ui
tag: "latest"

containerPort: 5173
8 changes: 8 additions & 0 deletions helm-charts/common/ui/variant_codegen_react-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/codegen-react-ui
tag: "latest"

BACKEND_SERVICE_ENDPOINT: "/v1/codegen"
10 changes: 10 additions & 0 deletions helm-charts/common/ui/variant_codegen_svelte-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/codegen-ui
tag: "latest"

containerPort: 5173

BACKEND_SERVICE_ENDPOINT: "/v1/codegen"
10 changes: 10 additions & 0 deletions helm-charts/common/ui/variant_codetrans_svelte-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/codetrans-ui
tag: "latest"

containerPort: 5173

BACKEND_SERVICE_ENDPOINT: "/v1/codetrans"
8 changes: 8 additions & 0 deletions helm-charts/common/ui/variant_docsum_react-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/docsum-react-ui
tag: "latest"

BACKEND_SERVICE_ENDPOINT: "/v1/docsum"
10 changes: 10 additions & 0 deletions helm-charts/common/ui/variant_docsum_svelte-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/docsum-ui
tag: "latest"

containerPort: 5173

BACKEND_SERVICE_ENDPOINT: "/v1/docsum"
8 changes: 8 additions & 0 deletions helm-charts/common/ui/variant_faqgen_react-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/faqgen-react-ui
tag: "latest"

BACKEND_SERVICE_ENDPOINT: "/v1/faqgen"
10 changes: 10 additions & 0 deletions helm-charts/common/ui/variant_faqgen_svelte-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/faqgen-ui
tag: "latest"

containerPort: 5173

BACKEND_SERVICE_ENDPOINT: "/v1/faqgen"
10 changes: 10 additions & 0 deletions helm-charts/common/ui/variant_visualqna_svelte-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

image:
repository: opea/visualqna-ui
tag: "latest"

containerPort: 5173

BACKEND_SERVICE_ENDPOINT: "/v1/visualqna"

0 comments on commit 96af2ad

Please sign in to comment.