Skip to content

Commit

Permalink
helm-chart: Make nginx service type configurable (#506)
Browse files Browse the repository at this point in the history
* helm-chart: Make nginx service type configurable

Fixed issue #501.

* Adapt docsum and ui test-pod for latest changes

Signed-off-by: Lianhao Lu <[email protected]>
  • Loading branch information
lianhao authored Oct 29, 2024
1 parent c6a9c90 commit a5c96ab
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 11 deletions.
2 changes: 1 addition & 1 deletion helm-charts/chatqna/templates/nginx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ spec:
selector:
{{- include "chatqna.selectorLabels" . | nindent 4 }}
app: {{ include "chatqna.fullname" . }}-nginx
type: NodePort
type: {{ .Values.nginx.service.type }}
4 changes: 4 additions & 0 deletions helm-charts/chatqna/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ service:
type: ClusterIP
port: 8888

nginx:
service:
type: NodePort

securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/codegen/templates/nginx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ spec:
selector:
{{- include "codegen.selectorLabels" . | nindent 4 }}
app: {{ include "codegen.fullname" . }}-nginx
type: NodePort
type: {{ .Values.nginx.service.type }}
4 changes: 4 additions & 0 deletions helm-charts/codegen/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ service:
type: ClusterIP
port: 7778

nginx:
service:
type: NodePort

securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/codetrans/templates/nginx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ spec:
selector:
{{- include "codetrans.selectorLabels" . | nindent 4 }}
app: {{ include "codetrans.fullname" . }}-nginx
type: NodePort
type: {{ .Values.nginx.service.type }}
4 changes: 4 additions & 0 deletions helm-charts/codetrans/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ service:
type: ClusterIP
port: 7777

nginx:
service:
type: NodePort

securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
Expand Down
14 changes: 9 additions & 5 deletions helm-charts/common/ui/templates/tests/test-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ metadata:
spec:
containers:
- name: curl
image: alpine/curl
#image: python:3.10.14
command: ['sh', '-c']
image: python:3.10.14
command: ['bash', '-c']
args:
- |
curl http://{{ include "ui.fullname" . }}:{{ .Values.service.port }} -sS --fail-with-body \
-X GET
max_retry=20;
for ((i=1; i<=max_retry; i++)); do
curl http://{{ include "ui.fullname" . }}:{{ .Values.service.port }} -sS --fail-with-body -X GET && break;
curlcode=$?
if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi;
done;
if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi
restartPolicy: Never
2 changes: 1 addition & 1 deletion helm-charts/docsum/templates/nginx-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ spec:
selector:
{{- include "docsum.selectorLabels" . | nindent 4 }}
app: {{ include "docsum.fullname" . }}-nginx
type: NodePort
type: {{ .Values.nginx.service.type }}
5 changes: 3 additions & 2 deletions helm-charts/docsum/templates/tests/test-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ spec:
max_retry=20;
for ((i=1; i<=max_retry; i++)); do
curl http://{{ include "docsum.fullname" . }}:{{ .Values.service.port }}/v1/docsum -sS --fail-with-body \
-H 'Content-Type: application/json' \
-d '{"messages": "Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."}' && break;
-H 'Content-Type: multipart/form-data' \
-F "messages=Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5." \
-F "max_tokens=32" && break;
curlcode=$?
if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi;
done;
Expand Down
4 changes: 4 additions & 0 deletions helm-charts/docsum/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ service:
type: ClusterIP
port: 8888

nginx:
service:
type: NodePort

securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
Expand Down

0 comments on commit a5c96ab

Please sign in to comment.