Skip to content

Commit

Permalink
helm: automatically populate default endpoints into no_proxy
Browse files Browse the repository at this point in the history
Automatically popluate the default endpoint into no_proxy if proxy is
set.

If users specify the endpoints with their own value, it won't be
populated into no_proxy, because we can't assume the user specified
endpoints should be accessed through proxy.

Fix issue #225.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
  • Loading branch information
lianhao committed Aug 7, 2024
1 parent f1defed commit b5da32a
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helm-charts/common/asr/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ data:
{{- end }}
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
{{- if and (not .Values.ASR_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy) }}
no_proxy: "{{ .Release.Name }}-whisper,{{ .Values.global.no_proxy }}"
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
4 changes: 4 additions & 0 deletions helm-charts/common/data-prep/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ data:
HF_HOME: "/tmp/.cache/huggingface"
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 }}"
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY | quote }}
LANGCHAIN_PROJECT: "opea-dataprep-service"
4 changes: 4 additions & 0 deletions helm-charts/common/embedding-usvc/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ data:
{{- end }}
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
{{- if and (not .Values.TEI_EMBEDDING_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy) }}
no_proxy: "{{ .Release.Name }}-tei,{{ .Values.global.no_proxy }}"
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY }}
LANGCHAIN_PROJECT: "opea-embedding-service"
4 changes: 4 additions & 0 deletions helm-charts/common/llm-uservice/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ data:
HF_HOME: "/tmp/.cache/huggingface"
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,{{ .Values.global.no_proxy }}"
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY }}
LANGCHAIN_PROJECT: "opea-llm-uservice"
4 changes: 4 additions & 0 deletions helm-charts/common/reranking-usvc/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ data:
{{- end }}
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
{{- if and (not .Values.TEI_RERANKING_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy) }}
no_proxy: "{{ .Release.Name }}-teirerank,{{ .Values.global.no_proxy }}"
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY | quote }}
LANGCHAIN_PROJECT: "opea-reranking-service"
4 changes: 4 additions & 0 deletions helm-charts/common/retriever-usvc/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ data:
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 }}"
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
LANGCHAIN_TRACING_V2: {{ .Values.global.LANGCHAIN_TRACING_V2 | quote }}
LANGCHAIN_API_KEY: {{ .Values.global.LANGCHAIN_API_KEY | quote }}
LANGCHAIN_PROJECT: "opea-retriever-service"
Expand Down
4 changes: 4 additions & 0 deletions helm-charts/common/tts/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ data:
{{- end }}
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
{{- if and (not .Values.TTS_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy) }}
no_proxy: "{{ .Release.Name }}-speecht5,{{ .Values.global.no_proxy }}"
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
4 changes: 4 additions & 0 deletions helm-charts/common/web-retriever/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ data:
EASYOCR_MODULE_PATH: "/tmp/.EasyOCR"
http_proxy: {{ .Values.global.http_proxy | quote }}
https_proxy: {{ .Values.global.https_proxy | quote }}
{{- if and (not .Values.TEI_EMBEDDING_ENDPOINT) (or .Values.global.http_proxy .Values.global.https_proxy) }}
no_proxy: "{{ .Release.Name }}-tei,{{ .Values.global.no_proxy }}"
{{- else }}
no_proxy: {{ .Values.global.no_proxy | quote }}
{{- end }}
HF_HOME: "/tmp/.cache/huggingface"

0 comments on commit b5da32a

Please sign in to comment.