Skip to content

Commit 11b04b3

Browse files
authored
Integrate SearchQnA set_env to ut scripts. (opea-project#1950)
Integrate SearchQnA set_env to ut scripts. Add README.md for UT scripts. Signed-off-by: ZePan110 <ze.pan@intel.com>
1 parent 7f55b5a commit 11b04b3

8 files changed

Lines changed: 55 additions & 119 deletions

File tree

SearchQnA/docker_compose/amd/gpu/rocm/set_env.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Copyright (C) 2025 Advanced Micro Devices, Inc.
44

5-
export HOST_IP=''
6-
export EXTERNAL_HOST_IP=''
5+
export HOST_IP=${ip_address}
6+
export EXTERNAL_HOST_IP=${ip_address}
77

88
export SEARCH_EMBEDDING_MODEL_ID='BAAI/bge-base-en-v1.5'
99
export SEARCH_GOOGLE_API_KEY=${GOOGLE_API_KEY}
@@ -12,9 +12,9 @@ export SEARCH_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
1212
export SEARCH_LLM_MODEL_ID='Intel/neural-chat-7b-v3-3'
1313
export SEARCH_RERANK_MODEL_ID='BAAI/bge-reranker-base'
1414

15-
export SEARCH_BACKEND_SERVICE_PORT=18142
15+
export SEARCH_BACKEND_SERVICE_PORT=3008
1616
export SEARCH_EMBEDDING_SERVICE_PORT=3002
17-
export SEARCH_FRONTEND_SERVICE_PORT=18143
17+
export SEARCH_FRONTEND_SERVICE_PORT=5173
1818
export SEARCH_LLM_SERVICE_PORT=3007
1919
export SEARCH_RERANK_SERVICE_PORT=3005
2020
export SEARCH_TEI_EMBEDDING_PORT=3001

SearchQnA/docker_compose/amd/gpu/rocm/set_env_vllm.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Copyright (C) 2025 Advanced Micro Devices, Inc.
44

5-
export HOST_IP=''
6-
export EXTERNAL_HOST_IP=''
5+
export HOST_IP=${ip_address}
6+
export EXTERNAL_HOST_IP=${ip_address}
77

88
export SEARCH_EMBEDDING_MODEL_ID='BAAI/bge-base-en-v1.5'
99
export SEARCH_GOOGLE_API_KEY=${GOOGLE_API_KEY}
@@ -12,11 +12,11 @@ export SEARCH_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
1212
export SEARCH_LLM_MODEL_ID='Intel/neural-chat-7b-v3-3'
1313
export SEARCH_RERANK_MODEL_ID='BAAI/bge-reranker-base'
1414

15-
export MODEL_PATH="./data"
15+
export MODEL_CACHE="./data"
1616

17-
export SEARCH_BACKEND_SERVICE_PORT=18142
17+
export SEARCH_BACKEND_SERVICE_PORT=3008
1818
export SEARCH_EMBEDDING_SERVICE_PORT=3002
19-
export SEARCH_FRONTEND_SERVICE_PORT=18143
19+
export SEARCH_FRONTEND_SERVICE_PORT=5173
2020
export SEARCH_LLM_SERVICE_PORT=3007
2121
export SEARCH_RERANK_SERVICE_PORT=3005
2222
export SEARCH_TEI_EMBEDDING_PORT=3001
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
# Copyright (C) 2024 Intel Corporation
44
# SPDX-License-Identifier: Apache-2.0
5-
pushd "../../" > /dev/null
5+
pushd "../../../" > /dev/null
66
source .set_env.sh
77
popd > /dev/null
88

9-
9+
export GOOGLE_CSE_ID=$GOOGLE_CSE_ID
10+
export GOOGLE_API_KEY=$GOOGLE_API_KEY
11+
export HUGGINGFACEHUB_API_TOKEN=$HUGGINGFACEHUB_API_TOKEN
1012
export EMBEDDING_MODEL_ID=BAAI/bge-base-en-v1.5
1113
export TEI_EMBEDDING_ENDPOINT=http://${host_ip}:3001
1214
export RERANK_MODEL_ID=BAAI/bge-reranker-base

SearchQnA/tests/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# SearchQnA E2E test scripts
2+
3+
## Set the required environment variable
4+
5+
```bash
6+
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
7+
```
8+
9+
## Run test
10+
11+
On Intel Xeon with TGI:
12+
13+
```bash
14+
bash test_compose_on_xeon.sh
15+
```
16+
17+
On Intel Gaudi with TGI:
18+
19+
```bash
20+
bash test_compose_on_gaudi.sh
21+
```
22+
23+
On AMD ROCm with TGI:
24+
25+
```bash
26+
bash test_compose_on_rocm.sh
27+
```
28+
29+
On AMD ROCm with vLLM:
30+
31+
```bash
32+
bash test_compose_vllm_on_rocm.sh
33+
```

SearchQnA/tests/test_compose_on_gaudi.sh

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,13 @@ function build_docker_images() {
4343

4444
function start_services() {
4545

46-
cd $WORKPATH/docker_compose/intel/hpu/gaudi
47-
export GOOGLE_CSE_ID=$GOOGLE_CSE_ID
48-
export GOOGLE_API_KEY=$GOOGLE_API_KEY
49-
export HUGGINGFACEHUB_API_TOKEN=$HUGGINGFACEHUB_API_TOKEN
50-
51-
export EMBEDDING_MODEL_ID=BAAI/bge-base-en-v1.5
52-
export TEI_EMBEDDING_ENDPOINT=http://$ip_address:3001
53-
export RERANK_MODEL_ID=BAAI/bge-reranker-base
46+
cd $WORKPATH/docker_compose/intel/
5447
export RERANK_TYPE="tei"
55-
export TEI_RERANKING_ENDPOINT=http://$ip_address:3004
56-
57-
export TGI_LLM_ENDPOINT=http://$ip_address:3006
58-
export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3
59-
60-
export MEGA_SERVICE_HOST_IP=${ip_address}
61-
export EMBEDDING_SERVICE_HOST_IP=${ip_address}
62-
export WEB_RETRIEVER_SERVICE_HOST_IP=${ip_address}
63-
export RERANK_SERVICE_HOST_IP=${ip_address}
64-
export LLM_SERVICE_HOST_IP=${ip_address}
65-
66-
export EMBEDDING_SERVICE_PORT=3002
67-
export WEB_RETRIEVER_SERVICE_PORT=3003
68-
export RERANK_SERVICE_PORT=3005
69-
export LLM_SERVICE_PORT=3007
7048
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:3008/v1/searchqna"
7149
export host_ip=${ip_address}
7250
export LOGFLAG=true
73-
51+
source ./set_env.sh
52+
cd hpu/gaudi
7453

7554
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
7655

SearchQnA/tests/test_compose_on_rocm.sh

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,7 @@ function build_docker_images() {
3030

3131
function start_services() {
3232
cd $WORKPATH/docker_compose/amd/gpu/rocm/
33-
34-
export HOST_IP=${ip_address}
35-
export EXTERNAL_HOST_IP=${ip_address}
36-
37-
export SEARCH_EMBEDDING_MODEL_ID='BAAI/bge-base-en-v1.5'
38-
export SEARCH_GOOGLE_API_KEY=${GOOGLE_API_KEY}
39-
export SEARCH_GOOGLE_CSE_ID=${GOOGLE_CSE_ID}
40-
export SEARCH_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
41-
export SEARCH_LLM_MODEL_ID='Intel/neural-chat-7b-v3-3'
42-
export SEARCH_RERANK_MODEL_ID='BAAI/bge-reranker-base'
43-
44-
export SEARCH_BACKEND_SERVICE_PORT=3008
45-
export SEARCH_EMBEDDING_SERVICE_PORT=3002
46-
export SEARCH_FRONTEND_SERVICE_PORT=5173
47-
export SEARCH_LLM_SERVICE_PORT=3007
48-
export SEARCH_RERANK_SERVICE_PORT=3005
49-
export SEARCH_TEI_EMBEDDING_PORT=3001
50-
export SEARCH_TEI_RERANKING_PORT=3004
51-
export SEARCH_TGI_SERVICE_PORT=3006
52-
export SEARCH_WEB_RETRIEVER_SERVICE_PORT=3003
53-
54-
export SEARCH_BACKEND_SERVICE_ENDPOINT=http://${EXTERNAL_HOST_IP}:${SEARCH_BACKEND_SERVICE_PORT}/v1/searchqna
55-
export SEARCH_EMBEDDING_SERVICE_HOST_IP=${HOST_IP}
56-
export SEARCH_LLM_SERVICE_HOST_IP=${HOST_IP}
57-
export SEARCH_MEGA_SERVICE_HOST_IP=${HOST_IP}
58-
export SEARCH_RERANK_SERVICE_HOST_IP=${HOST_IP}
59-
export SEARCH_TEI_EMBEDDING_ENDPOINT=http://${HOST_IP}:${SEARCH_TEI_EMBEDDING_PORT}
60-
export SEARCH_TEI_RERANKING_ENDPOINT=http://${HOST_IP}:${SEARCH_TEI_RERANKING_PORT}
61-
export SEARCH_TGI_LLM_ENDPOINT=http://${HOST_IP}:${SEARCH_TGI_SERVICE_PORT}
62-
export SEARCH_WEB_RETRIEVER_SERVICE_HOST_IP=${HOST_IP}
33+
source ./set_env.sh
6334

6435
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
6536

SearchQnA/tests/test_compose_on_xeon.sh

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,13 @@ function build_docker_images() {
4141
}
4242

4343
function start_services() {
44-
cd $WORKPATH/docker_compose/intel/cpu/xeon/
45-
export GOOGLE_CSE_ID=$GOOGLE_CSE_ID
46-
export GOOGLE_API_KEY=$GOOGLE_API_KEY
47-
export HUGGINGFACEHUB_API_TOKEN=$HUGGINGFACEHUB_API_TOKEN
48-
49-
export EMBEDDING_MODEL_ID=BAAI/bge-base-en-v1.5
50-
export TEI_EMBEDDING_ENDPOINT=http://$ip_address:3001
51-
export RERANK_MODEL_ID=BAAI/bge-reranker-base
44+
cd $WORKPATH/docker_compose/intel/
5245
export RERANK_TYPE="tei"
53-
export TEI_RERANKING_ENDPOINT=http://$ip_address:3004
54-
55-
export TGI_LLM_ENDPOINT=http://$ip_address:3006
56-
export LLM_MODEL_ID=Intel/neural-chat-7b-v3-3
57-
58-
export MEGA_SERVICE_HOST_IP=${ip_address}
59-
export EMBEDDING_SERVICE_HOST_IP=${ip_address}
60-
export WEB_RETRIEVER_SERVICE_HOST_IP=${ip_address}
61-
export RERANK_SERVICE_HOST_IP=${ip_address}
62-
export LLM_SERVICE_HOST_IP=${ip_address}
63-
64-
export EMBEDDING_SERVICE_PORT=3002
65-
export WEB_RETRIEVER_SERVICE_PORT=3003
66-
export RERANK_SERVICE_PORT=3005
67-
export LLM_SERVICE_PORT=3007
6846
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:3008/v1/searchqna"
6947
export host_ip=${ip_address}
7048
export LOGFLAG=true
71-
49+
source ./set_env.sh
50+
cd cpu/xeon
7251

7352
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
7453

SearchQnA/tests/test_compose_vllm_on_rocm.sh

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,8 @@ function start_services() {
3131
cd $WORKPATH/docker_compose/amd/gpu/rocm/
3232

3333
export HOST_IP=${ip_address}
34-
export EXTERNAL_HOST_IP=${ip_address}
35-
36-
export SEARCH_EMBEDDING_MODEL_ID='BAAI/bge-base-en-v1.5'
37-
export SEARCH_GOOGLE_API_KEY=${GOOGLE_API_KEY}
38-
export SEARCH_GOOGLE_CSE_ID=${GOOGLE_CSE_ID}
39-
export SEARCH_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
40-
export SEARCH_LLM_MODEL_ID='Intel/neural-chat-7b-v3-3'
41-
export SEARCH_RERANK_MODEL_ID='BAAI/bge-reranker-base'
42-
43-
export MODEL_CACHE="./data"
44-
45-
export SEARCH_BACKEND_SERVICE_PORT=3008
46-
export SEARCH_EMBEDDING_SERVICE_PORT=3002
47-
export SEARCH_FRONTEND_SERVICE_PORT=5173
48-
export SEARCH_LLM_SERVICE_PORT=3007
49-
export SEARCH_RERANK_SERVICE_PORT=3005
50-
export SEARCH_TEI_EMBEDDING_PORT=3001
51-
export SEARCH_TEI_RERANKING_PORT=3004
52-
export SEARCH_VLLM_SERVICE_PORT=3080
53-
export SEARCH_WEB_RETRIEVER_SERVICE_PORT=3003
54-
55-
export SEARCH_BACKEND_SERVICE_ENDPOINT=http://${EXTERNAL_HOST_IP}:${SEARCH_BACKEND_SERVICE_PORT}/v1/searchqna
56-
export SEARCH_EMBEDDING_SERVICE_HOST_IP=${HOST_IP}
57-
export SEARCH_LLM_ENDPOINT=http://${HOST_IP}:${SEARCH_VLLM_SERVICE_PORT}
58-
export SEARCH_LLM_SERVICE_HOST_IP=${HOST_IP}
59-
export SEARCH_MEGA_SERVICE_HOST_IP=${HOST_IP}
60-
export SEARCH_RERANK_SERVICE_HOST_IP=${HOST_IP}
61-
export SEARCH_TEI_EMBEDDING_ENDPOINT=http://${HOST_IP}:${SEARCH_TEI_EMBEDDING_PORT}
62-
export SEARCH_TEI_RERANKING_ENDPOINT=http://${HOST_IP}:${SEARCH_TEI_RERANKING_PORT}
63-
export SEARCH_WEB_RETRIEVER_SERVICE_HOST_IP=${HOST_IP}
34+
# export SEARCH_BACKEND_SERVICE_PORT=3008
35+
source ./set_env_vllm.sh
6436

6537
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
6638

0 commit comments

Comments
 (0)