Skip to content

Commit e71aba0

Browse files
authored
Fix ChatQnA Qdrant CI issues (opea-project#569)
Signed-off-by: letonghan <letong.han@intel.com>
1 parent cfcac3f commit e71aba0

File tree

3 files changed

+116
-127
lines changed

3 files changed

+116
-127
lines changed

ChatQnA/docker/xeon/README_qdrant.md

Lines changed: 39 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,41 @@ qdrant-vector-db
2020
Port 6333 - Open to 0.0.0.0/0
2121
Port 6334 - Open to 0.0.0.0/0
2222
23+
dataprep-qdrant-server
24+
======================
25+
Port 6043 - Open to 0.0.0.0/0
26+
2327
tei_embedding_service
2428
=====================
25-
Port 6006 - Open to 0.0.0.0/0
29+
Port 6040 - Open to 0.0.0.0/0
2630
2731
embedding
2832
=========
29-
Port 6000 - Open to 0.0.0.0/0
33+
Port 6044 - Open to 0.0.0.0/0
3034
3135
retriever
3236
=========
33-
Port 7000 - Open to 0.0.0.0/0
37+
Port 6045 - Open to 0.0.0.0/0
3438
35-
tei_xeon_service
39+
tei_reranking_service
3640
================
37-
Port 8808 - Open to 0.0.0.0/0
41+
Port 6041 - Open to 0.0.0.0/0
3842
3943
reranking
4044
=========
41-
Port 8000 - Open to 0.0.0.0/0
45+
Port 6046 - Open to 0.0.0.0/0
4246
4347
tgi-service
4448
===========
45-
Port 9009 - Open to 0.0.0.0/0
49+
Port 6042 - Open to 0.0.0.0/0
4650
4751
llm
4852
===
49-
Port 9000 - Open to 0.0.0.0/0
53+
Port 6047 - Open to 0.0.0.0/0
5054
5155
chaqna-xeon-backend-server
5256
==========================
53-
Port 8888 - Open to 0.0.0.0/0
57+
Port 8912 - Open to 0.0.0.0/0
5458
5559
chaqna-xeon-ui-server
5660
=====================
@@ -126,10 +130,9 @@ Build frontend Docker image that enables Conversational experience with ChatQnA
126130

127131
```bash
128132
cd GenAIExamples/ChatQnA/docker/ui/
129-
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/chatqna"
130-
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep"
131-
export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:6008/v1/dataprep/get_file"
132-
docker build --no-cache -t opea/chatqna-conversation-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy --build-arg BACKEND_SERVICE_ENDPOINT=$BACKEND_SERVICE_ENDPOINT --build-arg DATAPREP_SERVICE_ENDPOINT=$DATAPREP_SERVICE_ENDPOINT --build-arg DATAPREP_GET_FILE_ENDPOINT=$DATAPREP_GET_FILE_ENDPOINT -f ./docker/Dockerfile.react .
133+
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8912/v1/chatqna"
134+
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6043/v1/dataprep"
135+
docker build --no-cache -t opea/chatqna-conversation-ui:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy --build-arg BACKEND_SERVICE_ENDPOINT=$BACKEND_SERVICE_ENDPOINT --build-arg DATAPREP_SERVICE_ENDPOINT=$DATAPREP_SERVICE_ENDPOINT -f ./docker/Dockerfile.react .
133136
cd ../../../..
134137
```
135138

@@ -178,9 +181,9 @@ export https_proxy=${your_http_proxy}
178181
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
179182
export RERANK_MODEL_ID="BAAI/bge-reranker-base"
180183
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
181-
export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:6006"
182-
export TEI_RERANKING_ENDPOINT="http://${host_ip}:8808"
183-
export TGI_LLM_ENDPOINT="http://${host_ip}:9009"
184+
export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:6040"
185+
export TEI_RERANKING_ENDPOINT="http://${host_ip}:6041"
186+
export TGI_LLM_ENDPOINT="http://${host_ip}:6042"
184187
export QDRANT_HOST=${host_ip}
185188
export QDRANT_PORT=6333
186189
export INDEX_NAME="rag-qdrant"
@@ -190,10 +193,8 @@ export EMBEDDING_SERVICE_HOST_IP=${host_ip}
190193
export RETRIEVER_SERVICE_HOST_IP=${host_ip}
191194
export RERANK_SERVICE_HOST_IP=${host_ip}
192195
export LLM_SERVICE_HOST_IP=${host_ip}
193-
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/chatqna"
194-
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6007/v1/dataprep"
195-
export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:6008/v1/dataprep/get_file"
196-
export DATAPREP_DELETE_FILE_ENDPOINT="http://${host_ip}:6009/v1/dataprep/delete_file"
196+
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8912/v1/chatqna"
197+
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6043/v1/dataprep"
197198
```
198199

199200
Note: Please replace with `host_ip` with you external IP address, do not use localhost.
@@ -204,15 +205,15 @@ Note: Please replace with `host_ip` with you external IP address, do not use loc
204205
205206
```bash
206207
cd GenAIExamples/ChatQnA/docker/xeon/
207-
docker compose up -d
208+
docker compose -f compose_qdrant.yaml up -d
208209
```
209210

210211
### Validate Microservices
211212

212213
1. TEI Embedding Service
213214

214215
```bash
215-
curl ${host_ip}:6006/embed \
216+
curl ${host_ip}:6040/embed \
216217
-X POST \
217218
-d '{"inputs":"What is Deep Learning?"}' \
218219
-H 'Content-Type: application/json'
@@ -221,25 +222,23 @@ curl ${host_ip}:6006/embed \
221222
2. Embedding Microservice
222223

223224
```bash
224-
curl http://${host_ip}:6000/v1/embeddings\
225+
curl http://${host_ip}:6044/v1/embeddings\
225226
-X POST \
226227
-d '{"text":"hello"}' \
227228
-H 'Content-Type: application/json'
228229
```
229230

230-
3. Retriever Microservice
231-
To validate the retriever microservice, you need to generate a mock embedding vector of length 768 in Python script:
231+
3. Retriever Microservice
232232

233-
```Python
234-
import random
235-
embedding = [random.uniform(-1, 1) for _ in range(768)]
236-
print(embedding)
237-
```
233+
To consume the retriever microservice, you need to generate a mock embedding vector by Python script. The length of embedding vector
234+
is determined by the embedding model.
235+
Here we use the model `EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"`, which vector size is 768.
238236

239-
Then substitute your mock embedding vector for the `${your_embedding}` in the following cURL command:
237+
Check the vecotor dimension of your embedding model, set `your_embedding` dimension equals to it.
240238

241239
```bash
242-
curl http://${host_ip}:7000/v1/retrieval \
240+
export your_embedding=$(python3 -c "import random; embedding = [random.uniform(-1, 1) for _ in range(768)]; print(embedding)")
241+
curl http://${host_ip}:6045/v1/retrieval \
243242
-X POST \
244243
-d '{"text":"What is the revenue of Nike in 2023?","embedding":"'"${your_embedding}"'"}' \
245244
-H 'Content-Type: application/json'
@@ -248,7 +247,7 @@ curl http://${host_ip}:7000/v1/retrieval \
248247
4. TEI Reranking Service
249248

250249
```bash
251-
curl http://${host_ip}:8808/rerank \
250+
curl http://${host_ip}:6041/rerank \
252251
-X POST \
253252
-d '{"query":"What is Deep Learning?", "texts": ["Deep Learning is not...", "Deep learning is..."]}' \
254253
-H 'Content-Type: application/json'
@@ -257,7 +256,7 @@ curl http://${host_ip}:8808/rerank \
257256
5. Reranking Microservice
258257

259258
```bash
260-
curl http://${host_ip}:8000/v1/reranking\
259+
curl http://${host_ip}:6046/v1/reranking\
261260
-X POST \
262261
-d '{"initial_query":"What is Deep Learning?", "retrieved_docs": [{"text":"Deep Learning is not..."}, {"text":"Deep learning is..."}]}' \
263262
-H 'Content-Type: application/json'
@@ -266,7 +265,7 @@ curl http://${host_ip}:8000/v1/reranking\
266265
6. TGI Service
267266

268267
```bash
269-
curl http://${host_ip}:9009/generate \
268+
curl http://${host_ip}:6042/generate \
270269
-X POST \
271270
-d '{"inputs":"What is Deep Learning?","parameters":{"max_new_tokens":17, "do_sample": true}}' \
272271
-H 'Content-Type: application/json'
@@ -275,7 +274,7 @@ curl http://${host_ip}:9009/generate \
275274
7. LLM Microservice
276275

277276
```bash
278-
curl http://${host_ip}:9000/v1/chat/completions\
277+
curl http://${host_ip}:6047/v1/chat/completions\
279278
-X POST \
280279
-d '{"query":"What is Deep Learning?","max_new_tokens":17,"top_k":10,"top_p":0.95,"typical_p":0.95,"temperature":0.01,"repetition_penalty":1.03,"streaming":true}' \
281280
-H 'Content-Type: application/json'
@@ -284,7 +283,7 @@ curl http://${host_ip}:9000/v1/chat/completions\
284283
8. MegaService
285284

286285
```bash
287-
curl http://${host_ip}:8888/v1/chatqna -H "Content-Type: application/json" -d '{
286+
curl http://${host_ip}:8912/v1/chatqna -H "Content-Type: application/json" -d '{
288287
"messages": "What is the revenue of Nike in 2023?"
289288
}'
290289
```
@@ -296,49 +295,21 @@ If you want to update the default knowledge base, you can use the following comm
296295
Update Knowledge Base via Local File Upload:
297296

298297
```bash
299-
curl -X POST "http://${host_ip}:6007/v1/dataprep" \
298+
curl -X POST "http://${host_ip}:6043/v1/dataprep" \
300299
-H "Content-Type: multipart/form-data" \
301-
-F "files=@./nke-10k-2023.pdf"
300+
-F "files=@./your_file.pdf"
302301
```
303302

304303
This command updates a knowledge base by uploading a local file for processing. Update the file path according to your environment.
305304

306305
Add Knowledge Base via HTTP Links:
307306

308307
```bash
309-
curl -X POST "http://${host_ip}:6007/v1/dataprep" \
308+
curl -X POST "http://${host_ip}:6043/v1/dataprep" \
310309
-H "Content-Type: multipart/form-data" \
311310
-F 'link_list=["https://opea.dev"]'
312311
```
313312

314-
This command updates a knowledge base by submitting a list of HTTP links for processing.
315-
316-
Also, you are able to get the file list that you uploaded:
317-
318-
```bash
319-
curl -X POST "http://${host_ip}:6008/v1/dataprep/get_file" \
320-
-H "Content-Type: application/json"
321-
```
322-
323-
To delete the file/link you uploaded:
324-
325-
```bash
326-
# delete link
327-
curl -X POST "http://${host_ip}:6009/v1/dataprep/delete_file" \
328-
-d '{"file_path": "https://opea.dev"}' \
329-
-H "Content-Type: application/json"
330-
331-
# delete file
332-
curl -X POST "http://${host_ip}:6009/v1/dataprep/delete_file" \
333-
-d '{"file_path": "nke-10k-2023.pdf"}' \
334-
-H "Content-Type: application/json"
335-
336-
# delete all uploaded files and links
337-
curl -X POST "http://${host_ip}:6009/v1/dataprep/delete_file" \
338-
-d '{"file_path": "all"}' \
339-
-H "Content-Type: application/json"
340-
```
341-
342313
## 🚀 Launch the UI
343314

344315
To access the frontend, open the following URL in your browser: http://{host_ip}:5173. By default, the UI runs on port 5173 internally. If you prefer to use a different host port to access the frontend, you can modify the port mapping in the `compose.yaml` file as shown below:

ChatQnA/docker/xeon/compose_qdrant.yaml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ services:
1818
- qdrant-vector-db
1919
- tei-embedding-service
2020
ports:
21-
- "6000:6000"
21+
- "6043:6007"
2222
environment:
2323
no_proxy: ${no_proxy}
2424
http_proxy: ${http_proxy}
2525
https_proxy: ${https_proxy}
26-
QDRANT: ${host_ip}
26+
QDRANT_HOST: ${QDRANT_HOST}
2727
QDRANT_PORT: 6333
2828
COLLECTION_NAME: ${INDEX_NAME}
2929
TEI_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
3030
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
3131
tei-embedding-service:
32-
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.2
32+
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
3333
container_name: tei-embedding-server
3434
ports:
35-
- "6006:80"
35+
- "6040:80"
3636
volumes:
3737
- "./data:/data"
3838
shm_size: 1g
@@ -47,39 +47,35 @@ services:
4747
depends_on:
4848
- tei-embedding-service
4949
ports:
50-
- "6000:6000"
50+
- "6044:6000"
5151
ipc: host
5252
environment:
5353
no_proxy: ${no_proxy}
5454
http_proxy: ${http_proxy}
5555
https_proxy: ${https_proxy}
5656
TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
57-
LANGCHAIN_API_KEY: ${LANGCHAIN_API_KEY}
58-
LANGCHAIN_TRACING_V2: ${LANGCHAIN_TRACING_V2}
59-
LANGCHAIN_PROJECT: "opea-embedding-service"
6057
restart: unless-stopped
6158
retriever:
6259
image: opea/retriever-qdrant:latest
6360
container_name: retriever-qdrant-server
6461
depends_on:
6562
- qdrant-vector-db
6663
ports:
67-
- "7000:7000"
64+
- "6045:7000"
6865
ipc: host
6966
environment:
7067
no_proxy: ${no_proxy}
7168
http_proxy: ${http_proxy}
7269
https_proxy: ${https_proxy}
73-
QDRANT_HOST: ${host_ip}
70+
QDRANT_HOST: ${QDRANT_HOST}
7471
QDRANT_PORT: 6333
7572
INDEX_NAME: ${INDEX_NAME}
76-
TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
7773
restart: unless-stopped
7874
tei-reranking-service:
7975
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.2
8076
container_name: tei-reranking-server
8177
ports:
82-
- "8808:80"
78+
- "6041:80"
8379
volumes:
8480
- "./data:/data"
8581
shm_size: 1g
@@ -97,7 +93,7 @@ services:
9793
depends_on:
9894
- tei-reranking-service
9995
ports:
100-
- "8000:8000"
96+
- "6046:8000"
10197
ipc: host
10298
environment:
10399
no_proxy: ${no_proxy}
@@ -107,15 +103,12 @@ services:
107103
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
108104
HF_HUB_DISABLE_PROGRESS_BARS: 1
109105
HF_HUB_ENABLE_HF_TRANSFER: 0
110-
LANGCHAIN_API_KEY: ${LANGCHAIN_API_KEY}
111-
LANGCHAIN_TRACING_V2: ${LANGCHAIN_TRACING_V2}
112-
LANGCHAIN_PROJECT: "opea-reranking-service"
113106
restart: unless-stopped
114107
tgi-service:
115108
image: ghcr.io/huggingface/text-generation-inference:2.1.0
116109
container_name: tgi-service
117110
ports:
118-
- "9009:80"
111+
- "6042:80"
119112
volumes:
120113
- "./data:/data"
121114
shm_size: 1g
@@ -133,7 +126,7 @@ services:
133126
depends_on:
134127
- tgi-service
135128
ports:
136-
- "9000:9000"
129+
- "6047:9000"
137130
ipc: host
138131
environment:
139132
no_proxy: ${no_proxy}
@@ -143,9 +136,6 @@ services:
143136
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
144137
HF_HUB_DISABLE_PROGRESS_BARS: 1
145138
HF_HUB_ENABLE_HF_TRANSFER: 0
146-
LANGCHAIN_API_KEY: ${LANGCHAIN_API_KEY}
147-
LANGCHAIN_TRACING_V2: ${LANGCHAIN_TRACING_V2}
148-
LANGCHAIN_PROJECT: "opea-llm-service"
149139
restart: unless-stopped
150140
chaqna-xeon-backend-server:
151141
image: opea/chatqna:latest
@@ -160,16 +150,20 @@ services:
160150
- tgi-service
161151
- llm
162152
ports:
163-
- "8888:8888"
153+
- "8912:8888"
164154
environment:
165155
- no_proxy=${no_proxy}
166156
- https_proxy=${https_proxy}
167157
- http_proxy=${http_proxy}
168158
- MEGA_SERVICE_HOST_IP=${MEGA_SERVICE_HOST_IP}
169159
- EMBEDDING_SERVICE_HOST_IP=${EMBEDDING_SERVICE_HOST_IP}
160+
- EMBEDDING_SERVICE_PORT=${EMBEDDING_SERVICE_PORT}
170161
- RETRIEVER_SERVICE_HOST_IP=${RETRIEVER_SERVICE_HOST_IP}
162+
- RETRIEVER_SERVICE_PORT=${RETRIEVER_SERVICE_PORT}
171163
- RERANK_SERVICE_HOST_IP=${RERANK_SERVICE_HOST_IP}
164+
- RERANK_SERVICE_PORT=${RERANK_SERVICE_PORT}
172165
- LLM_SERVICE_HOST_IP=${LLM_SERVICE_HOST_IP}
166+
- LLM_SERVICE_PORT=${LLM_SERVICE_PORT}
173167
ipc: host
174168
restart: always
175169
chaqna-xeon-ui-server:

0 commit comments

Comments
 (0)