Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm chart: Allow users to set extra env by external configmap #170

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions helm-charts/chatqna/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ description: The Helm chart to deploy ChatQnA
type: application
dependencies:
- name: tgi
version: "0.1.0"
version: 0.8.0
repository: "file://../common/tgi"
- name: llm-uservice
version: "0.1.0"
version: 0.8.0
repository: "file://../common/llm-uservice"
- name: tei
version: "0.1.0"
version: 0.8.0
repository: "file://../common/tei"
- name: embedding-usvc
version: "0.1.0"
version: 0.8.0
repository: "file://../common/embedding-usvc"
- name: teirerank
version: "0.1.0"
version: 0.8.0
repository: "file://../common/teirerank"
- name: reranking-usvc
version: "0.1.0"
version: 0.8.0
repository: "file://../common/reranking-usvc"
- name: redis-vector-db
version: "0.1.0"
version: 0.8.0
repository: "file://../common/redis-vector-db"
- name: retriever-usvc
version: "0.1.0"
version: 0.8.0
repository: "file://../common/retriever-usvc"
- name: data-prep
version: "0.1.0"
version: 0.8.0
repository: "file://../common/data-prep"
version: 0.1.0
version: 0.8.0
appVersion: "1.0.0"
6 changes: 3 additions & 3 deletions helm-charts/codegen/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ description: The Helm chart to deploy CodeGen
type: application
dependencies:
- name: tgi
version: "0.1.0"
version: 0.8.0
repository: "file://../common/tgi"
- name: llm-uservice
version: "0.1.0"
version: 0.8.0
repository: "file://../common/llm-uservice"
version: 0.1.0
version: 0.8.0
appVersion: "1.0.0"
2 changes: 1 addition & 1 deletion helm-charts/common/data-prep/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ apiVersion: v2
name: data-prep
description: The Helm chart for deploying data prep as microservice
type: application
version: 0.1.0
version: 0.8.0
# The data prep microservice server version
appVersion: "1.0.0"
29 changes: 29 additions & 0 deletions helm-charts/common/data-prep/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "data-prep.fullname" . }}-config
labels:
{{- include "data-prep.labels" . | nindent 4 }}
data:
{{- if .Values.TEI_EMBEDDING_ENDPOINT }}
TEI_ENDPOINT: {{ .Values.TEI_EMBEDDING_ENDPOINT | quote}}
{{- else }}
TEI_ENDPOINT: "http://{{ .Release.Name }}-tei"
{{- end }}
{{- if .Values.REDIS_URL }}
REDIS_URL: {{ .Values.REDIS_URL | quote}}
{{- else }}
REDIS_URL: "redis://{{ .Release.Name }}-redis-vector-db:6379"
{{- end }}
INDEX_NAME: "rag-redis"
HUGGINGFACEHUB_API_TOKEN: {{ .Values.global.HUGGINGFACEHUB_API_TOKEN | quote}}
HF_HOME: "/tmp/.cache/huggingface"
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
no_proxy: {{ .Values.global.no_proxy | quote }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY | quote }}
LANGCHAIN_PROJECT: "opea-dataprep-service"
39 changes: 8 additions & 31 deletions helm-charts/common/data-prep/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,14 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
env:
- name: TEI_ENDPOINT
{{- if .Values.TEI_EMBEDDING_ENDPOINT }}
value: {{ .Values.TEI_EMBEDDING_ENDPOINT | quote}}
{{- else }}
value: "http://{{ .Release.Name }}-tei"
{{- end }}
- name: REDIS_URL
{{- if .Values.REDIS_URL }}
value: {{ .Values.REDIS_URL | quote}}
{{- else }}
value: "redis://{{ .Release.Name }}-redis-vector-db:6379"
{{- end }}
- name: INDEX_NAME
value: "rag-redis"
- name: HUGGINGFACEHUB_API_TOKEN
value: {{ .Values.global.HUGGINGFACEHUB_API_TOKEN | quote}}
- name: HF_HOME
value: "/tmp/.cache/huggingface"
- name: http_proxy
value: {{ .Values.global.http_proxy }}
- name: https_proxy
value: {{ .Values.global.https_proxy }}
- name: no_proxy
value: {{ .Values.global.no_proxy }}
- name: LANGCHAIN_TRACING_V2
value: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
- name: LANGCHAIN_API_KEY
value: {{ .Values.global.LANGCHAIN_API_KEY }}
- name: LANGCHAIN_PROJECT
value: "opea-dataprep-service"
envFrom:
- configMapRef:
name: {{ include "data-prep.fullname" . }}-config
{{- if .Values.global.extraEnvConfig }}
- configMapRef:
name: {{ .Values.global.extraEnvConfig }}
optional: true
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}"
Expand Down
6 changes: 6 additions & 0 deletions helm-charts/common/data-prep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ tolerations: []

affinity: {}

# text embedding inference service URL, e.g. http://<service-name>:<port>
TEI_EMBEDDING_ENDPOINT: ""

# redis DB service URL, e.g. redis://<service-name>:<port>
REDIS_URL: ""

global:
http_proxy:
https_proxy:
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/embedding-usvc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ apiVersion: v2
name: embedding-usvc
description: The Helm chart for deploying embedding as microservice
type: application
version: 0.1.0
version: 0.8.0
# The embedding microservice server version
appVersion: "1.0.0"
21 changes: 21 additions & 0 deletions helm-charts/common/embedding-usvc/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "embedding-usvc.fullname" . }}-config
labels:
{{- include "embedding-usvc.labels" . | nindent 4 }}
data:
{{- if .Values.TEI_EMBEDDING_ENDPOINT }}
TEI_EMBEDDING_ENDPOINT: {{ .Values.TEI_EMBEDDING_ENDPOINT | quote }}
{{- else }}
TEI_EMBEDDING_ENDPOINT: "http://{{ .Release.Name }}-tei"
{{- end }}
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
no_proxy: {{ .Values.global.no_proxy | quote }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY }}
LANGCHAIN_PROJECT: "opea-embedding-service"
27 changes: 8 additions & 19 deletions helm-charts/common/embedding-usvc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,14 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
env:
- name: TEI_EMBEDDING_ENDPOINT
{{- if .Values.TEI_EMBEDDING_ENDPOINT }}
value: {{ .Values.TEI_EMBEDDING_ENDPOINT | quote}}
{{- else }}
value: "http://{{ .Release.Name }}-tei"
{{- end }}
- name: http_proxy
value: {{ .Values.global.http_proxy }}
- name: https_proxy
value: {{ .Values.global.https_proxy }}
- name: no_proxy
value: {{ .Values.global.no_proxy }}
- name: LANGCHAIN_TRACING_V2
value: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
- name: LANGCHAIN_API_KEY
value: {{ .Values.global.LANGCHAIN_API_KEY }}
- name: LANGCHAIN_PROJECT
value: "opea-embedding-service"
envFrom:
- configMapRef:
name: {{ include "embedding-usvc.fullname" . }}-config
{{- if .Values.global.extraEnvConfig }}
- configMapRef:
name: {{ .Values.global.extraEnvConfig }}
optional: true
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}"
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/llm-uservice/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ apiVersion: v2
name: llm-uservice
description: The Helm chart for deploying llm as microservice
type: application
version: 0.1.0
version: 0.8.0
# The llm microservice server version
appVersion: "1.0.0"
23 changes: 23 additions & 0 deletions helm-charts/common/llm-uservice/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "llm-uservice.fullname" . }}-config
labels:
{{- include "llm-uservice.labels" . | nindent 4 }}
data:
{{- if .Values.TGI_LLM_ENDPOINT }}
TGI_LLM_ENDPOINT: {{ .Values.TGI_LLM_ENDPOINT | quote}}
{{- else }}
TGI_LLM_ENDPOINT: "http://{{ .Release.Name }}-tgi"
{{- end }}
HUGGINGFACEHUB_API_TOKEN: {{ .Values.global.HUGGINGFACEHUB_API_TOKEN | quote}}
HF_HOME: "/tmp/.cache/huggingface"
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
no_proxy: {{ .Values.global.no_proxy | quote }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY }}
LANGCHAIN_PROJECT: "opea-llm-uservice"
31 changes: 8 additions & 23 deletions helm-charts/common/llm-uservice/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,14 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
env:
- name: TGI_LLM_ENDPOINT
{{- if .Values.TGI_LLM_ENDPOINT }}
value: {{ .Values.TGI_LLM_ENDPOINT | quote}}
{{- else }}
value: "http://{{ .Release.Name }}-tgi"
{{- end }}
- name: HUGGINGFACEHUB_API_TOKEN
value: {{ .Values.global.HUGGINGFACEHUB_API_TOKEN | quote}}
- name: HF_HOME
value: "/tmp/.cache/huggingface"
- name: http_proxy
value: {{ .Values.global.http_proxy }}
- name: https_proxy
value: {{ .Values.global.https_proxy }}
- name: no_proxy
value: {{ .Values.global.no_proxy }}
- name: LANGCHAIN_TRACING_V2
value: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
- name: LANGCHAIN_API_KEY
value: {{ .Values.global.LANGCHAIN_API_KEY }}
- name: LANGCHAIN_PROJECT
value: "opea-llm-service"
envFrom:
- configMapRef:
name: {{ include "llm-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 }}"
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/llm-uservice/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ podSecurityContext: {}
# fsGroup: 2000

securityContext:
readOnlyRootFilesystem: true
readOnlyRootFilesystem: false
yongfengdu marked this conversation as resolved.
Show resolved Hide resolved
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1000
Expand Down
5 changes: 2 additions & 3 deletions helm-charts/common/redis-vector-db/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ apiVersion: v2
name: redis-vector-db
description: The Helm chart for Redis Vector DB
type: application
version: 0.1.0
# The HF TEI version
appVersion: "1.0"
version: 0.8.0
appVersion: "7.2.0-v9"
2 changes: 1 addition & 1 deletion helm-charts/common/reranking-usvc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ apiVersion: v2
name: reranking-usvc
description: The Helm chart for deploying reranking as microservice
type: application
version: 0.1.0
version: 0.8.0
# The reranking microservice server version
appVersion: "1.0.0"
21 changes: 21 additions & 0 deletions helm-charts/common/reranking-usvc/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "reranking-usvc.fullname" . }}-config
labels:
{{- include "reranking-usvc.labels" . | nindent 4 }}
data:
{{- if .Values.TEI_RERANKING_ENDPOINT }}
TEI_RERANKING_ENDPOINT: {{ .Values.TEI_RERANKING_ENDPOINT | quote }}
{{- else }}
TEI_RERANKING_ENDPOINT: "http://{{ .Release.Name }}-teirerank"
{{- end }}
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
no_proxy: {{ .Values.global.no_proxy | quote }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY | quote }}
LANGCHAIN_PROJECT: "opea-reranking-service"
27 changes: 8 additions & 19 deletions helm-charts/common/reranking-usvc/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,14 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
env:
- name: TEI_RERANKING_ENDPOINT
{{- if .Values.TEI_RERANKING_ENDPOINT }}
value: {{ .Values.TEI_RERANKING_ENDPOINT | quote}}
{{- else }}
value: "http://{{ .Release.Name }}-teirerank"
{{- end }}
- name: http_proxy
value: {{ .Values.global.http_proxy }}
- name: https_proxy
value: {{ .Values.global.https_proxy }}
- name: no_proxy
value: {{ .Values.global.no_proxy }}
- name: LANGCHAIN_TRACING_V2
value: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
- name: LANGCHAIN_API_KEY
value: {{ .Values.global.LANGCHAIN_API_KEY }}
- name: LANGCHAIN_PROJECT
value: "opea-reranking-service"
envFrom:
- configMapRef:
name: {{ include "reranking-usvc.fullname" . }}-config
{{- if .Values.global.extraEnvConfig }}
- configMapRef:
name: {{ .Values.global.extraEnvConfig }}
optional: true
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}"
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/common/retriever-usvc/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ apiVersion: v2
name: retriever-usvc
description: The Helm chart for deploying retriever as microservice
type: application
version: 0.1.0
version: 0.8.0
# The retriever microservice server version
appVersion: "1.0.0"
Loading