Skip to content

Commit e9153b8

Browse files
authored
Updated SearchQnA to use nginx like ChatQnA (#1769)
Signed-off-by: Ed Lee <[email protected]>
1 parent 0890e94 commit e9153b8

File tree

12 files changed

+123
-75
lines changed

12 files changed

+123
-75
lines changed

SearchQnA/README.md

Lines changed: 35 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -30,66 +30,38 @@ The architecture of the SearchQnA Application is illustrated below:
3030
The SearchQnA example is implemented using the component-level microservices defined in [GenAIComps](https://github.com/opea-project/GenAIComps). The flow chart below shows the information flow between different microservices for this example.
3131

3232
```mermaid
33-
---
34-
config:
35-
flowchart:
36-
nodeSpacing: 400
37-
rankSpacing: 100
38-
curve: linear
39-
themeVariables:
40-
fontSize: 50px
41-
---
33+
%% Orange are microservices from third parties that are 'wrapped' as OPEA components.
4234
flowchart LR
43-
%% Colors %%
44-
classDef blue fill:#ADD8E6,stroke:#ADD8E6,stroke-width:2px,fill-opacity:0.5
45-
classDef orange fill:#FBAA60,stroke:#ADD8E6,stroke-width:2px,fill-opacity:0.5
46-
classDef orchid fill:#C26DBC,stroke:#ADD8E6,stroke-width:2px,fill-opacity:0.5
47-
classDef invisible fill:transparent,stroke:transparent;
48-
style SearchQnA-MegaService stroke:#000000
49-
50-
%% Subgraphs %%
51-
subgraph SearchQnA-MegaService["SearchQnA MegaService "]
52-
direction LR
53-
EM([Embedding MicroService]):::blue
54-
RET([Web Retrieval MicroService]):::blue
55-
RER([Rerank MicroService]):::blue
56-
LLM([LLM MicroService]):::blue
57-
end
58-
subgraph UserInterface[" User Interface "]
59-
direction LR
60-
a([User Input Query]):::orchid
61-
UI([UI server<br>]):::orchid
62-
end
63-
64-
65-
66-
TEI_RER{{Reranking service<br>}}
67-
TEI_EM{{Embedding service <br>}}
68-
VDB{{Vector DB<br><br>}}
69-
R_RET{{Web Retriever service <br>}}
70-
LLM_gen{{LLM Service <br>}}
71-
GW([SearchQnA GateWay<br>]):::orange
72-
73-
%% Questions interaction
74-
direction LR
75-
a[User Input Query] --> UI
76-
UI --> GW
77-
GW <==> SearchQnA-MegaService
78-
EM ==> RET
79-
RET ==> RER
80-
RER ==> LLM
81-
82-
%% Embedding service flow
83-
direction LR
84-
EM <-.-> TEI_EM
85-
RET <-.-> R_RET
86-
RER <-.-> TEI_RER
87-
LLM <-.-> LLM_gen
88-
35+
User["User"] --> Nginx["Nginx<br>searchqna-nginx-server"]
36+
Nginx --> UI["UI<br>searchqna-ui-server"] & Gateway & User
37+
UI --> Nginx
38+
Gateway --> Nginx & Embedding
39+
Embedding --> Retriever
40+
Retriever --> Reranker
41+
Reranker --> LLM
42+
LLM --> Gateway
43+
LLM <-.-> TGI_Service["LLM<br>tgi-service"]
44+
Embedding <-.-> TEI_Embedding["TEI Embedding<br>tei-embedding-server"]
45+
Reranker <-.-> TEI_Reranker["TEI Reranker<br>tei-reranking-server"]
46+
47+
TEI_Embedding:::ext
48+
TEI_Reranker:::ext
49+
TGI_Service:::ext
50+
51+
subgraph MegaService["MegaService"]
52+
LLM["LLM<br>llm-textgen-server"]
53+
Reranker["Reranker<br>reranking-tei-server"]
54+
Retriever["Retriever<br>web-retriever-server"]
55+
Embedding["Embedding<br>embedding-server"]
56+
end
57+
subgraph Backend["searchqna-backend-server"]
8958
direction TB
90-
%% Vector DB interaction
91-
R_RET <-.-> VDB
92-
59+
MegaService
60+
Gateway["Backend Endpoint"]
61+
end
62+
classDef default fill:#fff,stroke:#000,color:#000
63+
classDef ext fill:#f9cb9c,stroke:#000,color:#000
64+
style MegaService margin-top:20px,margin-bottom:20px
9365
```
9466

9567
This SearchQnA use case performs Search-augmented Question Answering across multiple platforms. Currently, we provide the example for Intel® Gaudi® 2 and Intel® Xeon® Scalable Processors, and we invite contributions from other hardware vendors to expand OPEA ecosystem.
@@ -98,8 +70,8 @@ This SearchQnA use case performs Search-augmented Question Answering across mult
9870

9971
The table below lists the available deployment options and their implementation details for different hardware platforms.
10072

101-
| Category | Deployment Option | Description |
102-
| ---------------------- | ---------------------- | -------------------------------------------------------------- |
103-
| On-premise Deployments | Docker Compose (Xeon) | [DocSum deployment on Xeon](./docker_compose/intel/cpu/xeon) |
104-
| | Docker Compose (Gaudi) | [DocSum deployment on Gaudi](./docker_compose/intel/hpu/gaudi) |
105-
| | Docker Compose (ROCm) | [DocSum deployment on AMD ROCm](./docker_compose/amd/gpu/rocm) |
73+
| Category | Deployment Option | Description |
74+
| ---------------------- | ---------------------- | --------------------------------------------------------------------------- |
75+
| On-premise Deployments | Docker Compose (Xeon) | [SearchQnA deployment on Xeon](./docker_compose/intel/cpu/xeon/README.md) |
76+
| | Docker Compose (Gaudi) | [SearchQnA deployment on Gaudi](./docker_compose/intel/hpu/gaudi/README.md) |
77+
| | Docker Compose (ROCm) | [SearchQnA deployment on AMD ROCm](./docker_compose/amd/gpu/rocm/README.md) |

SearchQnA/docker_compose/amd/gpu/rocm/compose.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,25 @@ services:
170170
no_proxy: ${no_proxy}
171171
https_proxy: ${https_proxy}
172172
http_proxy: ${http_proxy}
173-
BACKEND_BASE_URL: ${SEARCH_BACKEND_SERVICE_ENDPOINT}
173+
ipc: host
174+
restart: always
175+
search-nginx-server:
176+
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
177+
container_name: search-nginx-server
178+
depends_on:
179+
- search-backend-server
180+
- search-ui-server
181+
ports:
182+
- "${NGINX_PORT:-80}:80"
183+
environment:
184+
- no_proxy=${no_proxy}
185+
- https_proxy=${https_proxy}
186+
- http_proxy=${http_proxy}
187+
- FRONTEND_SERVICE_IP=search-ui-server
188+
- FRONTEND_SERVICE_PORT=5173
189+
- BACKEND_SERVICE_NAME=search
190+
- BACKEND_SERVICE_IP=search-backend-server
191+
- BACKEND_SERVICE_PORT=8888
174192
ipc: host
175193
restart: always
176194

SearchQnA/docker_compose/amd/gpu/rocm/compose_vllm.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,27 @@ services:
176176
no_proxy: ${no_proxy}
177177
https_proxy: ${https_proxy}
178178
http_proxy: ${http_proxy}
179-
BACKEND_BASE_URL: ${SEARCH_BACKEND_SERVICE_ENDPOINT}
180179
ipc: host
181180
restart: always
182-
181+
search-nginx-server:
182+
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
183+
container_name: search-nginx-server
184+
depends_on:
185+
- search-backend-server
186+
- search-ui-server
187+
ports:
188+
- "${NGINX_PORT:-80}:80"
189+
environment:
190+
- no_proxy=${no_proxy}
191+
- https_proxy=${https_proxy}
192+
- http_proxy=${http_proxy}
193+
- FRONTEND_SERVICE_IP=search-ui-server
194+
- FRONTEND_SERVICE_PORT=5173
195+
- BACKEND_SERVICE_NAME=search
196+
- BACKEND_SERVICE_IP=search-backend-server
197+
- BACKEND_SERVICE_PORT=8888
198+
ipc: host
199+
restart: always
183200
networks:
184201
default:
185202
driver: bridge

SearchQnA/docker_compose/intel/cpu/xeon/compose.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,27 @@ services:
168168
- no_proxy=${no_proxy}
169169
- https_proxy=${https_proxy}
170170
- http_proxy=${http_proxy}
171-
- BACKEND_BASE_URL=${BACKEND_SERVICE_ENDPOINT}
172171
ipc: host
173172
restart: always
174-
173+
searchqna-xeon-nginx-server:
174+
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
175+
container_name: searchqna-xeon-nginx-server
176+
depends_on:
177+
- searchqna-xeon-backend-server
178+
- searchqna-xeon-ui-server
179+
ports:
180+
- "${NGINX_PORT:-80}:80"
181+
environment:
182+
- no_proxy=${no_proxy}
183+
- https_proxy=${https_proxy}
184+
- http_proxy=${http_proxy}
185+
- FRONTEND_SERVICE_IP=searchqna-xeon-ui-server
186+
- FRONTEND_SERVICE_PORT=5173
187+
- BACKEND_SERVICE_NAME=searchqna
188+
- BACKEND_SERVICE_IP=searchqna-xeon-backend-server
189+
- BACKEND_SERVICE_PORT=8888
190+
ipc: host
191+
restart: always
175192

176193
networks:
177194
default:

SearchQnA/docker_compose/intel/hpu/gaudi/compose.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,25 @@ services:
187187
- no_proxy=${no_proxy}
188188
- https_proxy=${https_proxy}
189189
- http_proxy=${http_proxy}
190-
- BACKEND_BASE_URL=${BACKEND_SERVICE_ENDPOINT}
190+
ipc: host
191+
restart: always
192+
searchqna-gaudi-nginx-server:
193+
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}
194+
container_name: searchqna-gaudi-nginx-server
195+
depends_on:
196+
- searchqna-gaudi-backend-server
197+
- searchqna-gaudi-ui-server
198+
ports:
199+
- "${NGINX_PORT:-80}:80"
200+
environment:
201+
- no_proxy=${no_proxy}
202+
- https_proxy=${https_proxy}
203+
- http_proxy=${http_proxy}
204+
- FRONTEND_SERVICE_IP=searchqna-gaudi-ui-server
205+
- FRONTEND_SERVICE_PORT=5173
206+
- BACKEND_SERVICE_NAME=searchqna
207+
- BACKEND_SERVICE_IP=searchqna-gaudi-backend-server
208+
- BACKEND_SERVICE_PORT=8888
191209
ipc: host
192210
restart: always
193211

SearchQnA/docker_image_build/build.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ services:
4646
context: GenAIComps
4747
dockerfile: comps/third_parties/vllm/src/Dockerfile.amd_gpu
4848
image: ${REGISTRY:-opea}/vllm-rocm:${TAG:-latest}
49+
nginx:
50+
build:
51+
context: GenAIComps
52+
dockerfile: comps/third_parties/nginx/src/Dockerfile
53+
extends: searchqna
54+
image: ${REGISTRY:-opea}/nginx:${TAG:-latest}

SearchQnA/tests/test_compose_on_gaudi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function build_docker_images() {
3232
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
3333

3434
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
35-
service_list="searchqna searchqna-ui embedding web-retriever reranking llm-textgen"
35+
service_list="searchqna searchqna-ui embedding web-retriever reranking llm-textgen nginx"
3636
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
3737

3838
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.6

SearchQnA/tests/test_compose_on_rocm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function build_docker_images() {
2020
git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
2121

2222
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
23-
service_list="searchqna searchqna-ui embedding web-retriever reranking llm-textgen"
23+
service_list="searchqna searchqna-ui embedding web-retriever reranking llm-textgen nginx"
2424
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
2525

2626
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.6

SearchQnA/tests/test_compose_on_xeon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function build_docker_images() {
3232
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
3333

3434
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
35-
service_list="searchqna searchqna-ui embedding web-retriever reranking llm-textgen"
35+
service_list="searchqna searchqna-ui embedding web-retriever reranking llm-textgen nginx"
3636
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
3737

3838
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.6

SearchQnA/tests/test_compose_vllm_on_rocm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function build_docker_images() {
2020
git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
2121

2222
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
23-
service_list="searchqna searchqna-ui embedding web-retriever reranking llm-textgen vllm-rocm"
23+
service_list="searchqna searchqna-ui embedding web-retriever reranking llm-textgen vllm-rocm nginx"
2424
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
2525

2626
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5

0 commit comments

Comments
 (0)