Skip to content

Commit

Permalink
Apdat rerank/web-retriever to latest changes
Browse files Browse the repository at this point in the history
Signed-off-by: Lianhao Lu <[email protected]>
  • Loading branch information
lianhao committed Jan 9, 2025
1 parent d9e5ed0 commit 5f3de8f
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 48 deletions.
2 changes: 2 additions & 0 deletions helm-charts/common/reranking-usvc/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.idea/
*.tmproj
.vscode/
# CI values
ci*-values.yaml
13 changes: 7 additions & 6 deletions helm-charts/common/reranking-usvc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ curl http://localhost:8000/v1/reranking \

## Values

| Key | Type | Default | Description |
| ---------------------- | ------ | ---------------------- | ----------- |
| image.repository | string | `"opea/reranking-tgi"` | |
| TEI_RERANKING_ENDPOINT | string | `""` | |
| service.port | string | `"8000"` | |
| global.monitoring | bool | `false` | |
| Key | Type | Default | Description |
| ---------------------- | ------ | ---------------------- | -------------------------- |
| image.repository | string | `"opea/reranking-tgi"` | |
| RERANK_COMPONENT_NAME | string | `"OPEA_TEI_RERANKING"` | backend service to talk to |
| TEI_RERANKING_ENDPOINT | string | `""` | |
| service.port | string | `"8000"` | |
| global.monitoring | bool | `false` | |
6 changes: 6 additions & 0 deletions helm-charts/common/reranking-usvc/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ metadata:
labels:
{{- include "reranking-usvc.labels" . | nindent 4 }}
data:
RERANK_COMPONENT_NAME: {{ .Values.RERANK_COMPONENT_NAME | quote }}
{{- if eq .Values.RERANK_COMPONENT_NAME "OPEA_TEI_RERANKING" }}
{{- if .Values.TEI_RERANKING_ENDPOINT }}
TEI_RERANKING_ENDPOINT: {{ .Values.TEI_RERANKING_ENDPOINT | quote }}
{{- else }}
TEI_RERANKING_ENDPOINT: "http://{{ .Release.Name }}-teirerank"
{{- end }}
{{- else if eq .Values.RERANK_COMPONENT_NAME "OPEA_VIDEO_RERANKING" }}
CHUNK_DURATION: {{ .Values.CHUNK_DURATION | quote }}
FILE_SERVER_ENDPOINT: {{ .Values.FILE_SERVER_ENDPOINT | quote }}
{{- 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) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ spec:
for ((i=1; i<=max_retry; i++)); do
curl http://{{ include "reranking-usvc.fullname" . }}:{{ .Values.service.port }}/v1/reranking -sS --fail-with-body \
-X POST \
{{- if eq .Values.RERANK_COMPONENT_NAME "OPEA_TEI_RERANKING" }}
-d '{"initial_query":"What is Deep Learning?", "retrieved_docs": [{"text":"Deep Learning is not..."}, {"text":"Deep learning is..."}]}' \
{{- else }}
-d '{"retrieved_docs":[{"doc": [{"text": "this is the retrieved text"}]}], "initial_query": "this is the query", "top_n": 1, "metadata":[{"other_key": "value", "video":"top_video_name", "timestamp":"20"},{"other_key": "value", "video":"second_video_name", "timestamp":"40"}]}' \
{{- end }}
-H 'Content-Type: application/json' && break;
curlcode=$?
if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi;
Expand Down
40 changes: 19 additions & 21 deletions helm-charts/common/reranking-usvc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

teirerank:
enabled: false

replicaCount: 1

# Set it as a non-null string, such as true, if you want to enable logging facility,
# otherwise, keep it as "" to disable it.
# Set it as a non-null string, such as true, if you want to enable logging facility.
LOGFLAG: ""

# rerank need to talk to different backend services: teirerank
# Default is to use teirerank
RERANK_COMPONENT_NAME: "OPEA_TEI_RERANKING"
TEI_RERANKING_ENDPOINT: ""

# Uncomment and set the following settings to use videorerank
# RERANK_COMPONENT_NAME: "OPEA_VIDEO_RERANKING"
# CHUNK_DURATION: 10
# FILE_SERVER_ENDPOINT: ""

image:
repository: opea/reranking-tei
repository: opea/reranking
# Uncomment the following line to set desired image pull policy if needed, as one of Always, IfNotPresent, Never.
# pullPolicy: ""
# Overrides the image tag whose default is the chart appVersion.
Expand Down Expand Up @@ -58,25 +63,14 @@ service:
# The default port for reranking service is 9000
port: 8000

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
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

livenessProbe:
httpGet:
path: v1/health_check
port: reranking-usvc
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 24
readinessProbe:
httpGet:
path: v1/health_check
Expand Down Expand Up @@ -111,3 +105,7 @@ global:

# Prometheus Helm install release name for serviceMonitor
prometheusRelease: prometheus-stack

# Only related to CI tests
teirerank:
enabled: false
2 changes: 2 additions & 0 deletions helm-charts/common/web-retriever/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.idea/
*.tmproj
.vscode/
# CI values
ci*-values.yaml
31 changes: 10 additions & 21 deletions helm-charts/common/web-retriever/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

tei:
enabled: false

replicaCount: 1

# Set it as a non-null string, such as true, if you want to enable logging facility,
# otherwise, keep it as "" to disable it.
# Set it as a non-null string, such as true, if you want to enable logging.
LOGFLAG: ""

TEI_EMBEDDING_ENDPOINT: ""
GOOGLE_API_KEY: ""
GOOGLE_CSE_ID: ""

image:
repository: opea/web-retriever-chroma
repository: opea/web-retriever
# Uncomment the following line to set desired image pull policy if needed, as one of Always, IfNotPresent, Never.
# pullPolicy: ""
# Overrides the image tag whose default is the chart appVersion.
Expand Down Expand Up @@ -61,25 +57,14 @@ service:
# The default port for retriever service is 7000
port: 7077

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
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
resources:
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

livenessProbe:
httpGet:
path: v1/health_check
port: web-retriever
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 24
readinessProbe:
httpGet:
path: v1/health_check
Expand Down Expand Up @@ -108,3 +93,7 @@ global:
# If set, it will overwrite serviceAccount.name.
# If set, and serviceAccount.create is false, it will assume this service account is already created by others.
sharedSAName: ""

# For CI tests only
tei:
enabled: false

0 comments on commit 5f3de8f

Please sign in to comment.