Skip to content

Commit 8d421b7

Browse files
ZePan110chensuyue
andauthored
[Translation] Integrate set_env.sh into test scripts. (opea-project#1785)
Signed-off-by: ZePan110 <[email protected]> Co-authored-by: chen, suyue <[email protected]>
1 parent e9cafb3 commit 8d421b7

File tree

10 files changed

+56
-71
lines changed

10 files changed

+56
-71
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ services:
9090
- translation-backend-server
9191
- translation-ui-server
9292
ports:
93-
- "${TRANSLATION_NGINX_PORT:-80}:8080"
93+
- "${TRANSLATION_NGINX_PORT:-80}:80"
9494
environment:
9595
- no_proxy=${no_proxy}
9696
- https_proxy=${https_proxy}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ services:
9090
- translation-backend-server
9191
- translation-ui-server
9292
ports:
93-
- "${TRANSLATION_NGINX_PORT:-80}:8080"
93+
- "${TRANSLATION_NGINX_PORT:-80}:80"
9494
environment:
9595
no_proxy: ${no_proxy}
9696
https_proxy: ${https_proxy}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55

66
# SPDX-License-Identifier: Apache-2.0
77

8-
export TRANSLATION_HOST_IP=''
9-
export TRANSLATION_EXTERNAL_HOST_IP=''
8+
export TRANSLATION_HOST_IP=${host_ip}
9+
export TRANSLATION_EXTERNAL_HOST_IP=${host_ip}
1010
export TRANSLATION_LLM_MODEL_ID="haoranxu/ALMA-13B"
1111
export TRANSLATION_TGI_LLM_ENDPOINT="http://${TRANSLATION_HOST_IP}:8008"
12-
export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=''
12+
export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
1313
export TRANSLATION_MEGA_SERVICE_HOST_IP=${TRANSLATION_HOST_IP}
1414
export TRANSLATION_LLM_SERVICE_HOST_IP=${TRANSLATION_HOST_IP}
1515
export TRANSLATION_FRONTEND_SERVICE_IP=${TRANSLATION_HOST_IP}
16-
export TRANSLATION_FRONTEND_SERVICE_PORT=18122
16+
export TRANSLATION_FRONTEND_SERVICE_PORT=5173
1717
export TRANSLATION_BACKEND_SERVICE_NAME=translation
1818
export TRANSLATION_BACKEND_SERVICE_IP=${TRANSLATION_HOST_IP}
19-
export TRANSLATION_BACKEND_SERVICE_PORT=18121
19+
export TRANSLATION_BACKEND_SERVICE_PORT=8888
2020
export TRANSLATION_BACKEND_SERVICE_ENDPOINT="http://${TRANSLATION_EXTERNAL_HOST_IP}:${TRANSLATION_BACKEND_SERVICE_PORT}/v1/translation"
21-
export TRANSLATION_NGINX_PORT=18123
21+
export TRANSLATION_NGINX_PORT=8084

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

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

66
# SPDX-License-Identifier: Apache-2.0
77

8-
export HOST_IP=''
9-
export EXTERNAL_HOST_IP=''
8+
export HOST_IP=${host_ip}
9+
export EXTERNAL_HOST_IP=${host_ip}
1010
export TRANSLATION_LLM_MODEL_ID="haoranxu/ALMA-13B"
1111
export TRANSLATION_VLLM_SERVICE_PORT=8088
1212
export TRANSLATION_LLM_ENDPOINT="http://${HOST_IP}:${TRANSLATION_VLLM_SERVICE_PORT}"
@@ -15,9 +15,9 @@ export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
1515
export TRANSLATION_MEGA_SERVICE_HOST_IP=${HOST_IP}
1616
export TRANSLATION_LLM_SERVICE_HOST_IP=${HOST_IP}
1717
export TRANSLATION_FRONTEND_SERVICE_IP=${HOST_IP}
18-
export TRANSLATION_FRONTEND_SERVICE_PORT=18122
18+
export TRANSLATION_FRONTEND_SERVICE_PORT=5173
1919
export TRANSLATION_BACKEND_SERVICE_NAME=translation
2020
export TRANSLATION_BACKEND_SERVICE_IP=${HOST_IP}
21-
export TRANSLATION_BACKEND_SERVICE_PORT=18121
21+
export TRANSLATION_BACKEND_SERVICE_PORT=8089
2222
export TRANSLATION_BACKEND_SERVICE_ENDPOINT="http://${EXTERNAL_HOST_IP}:${TRANSLATION_BACKEND_SERVICE_PORT}/v1/translation"
23-
export TRANSLATION_NGINX_PORT=18123
23+
export TRANSLATION_NGINX_PORT=8090

Translation/docker_compose/set_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ popd > /dev/null
99

1010
export LLM_MODEL_ID="haoranxu/ALMA-13B"
1111
export TGI_LLM_ENDPOINT="http://${host_ip}:8008"
12-
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
12+
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
1313
export MEGA_SERVICE_HOST_IP=${host_ip}
1414
export LLM_SERVICE_HOST_IP=${host_ip}
1515
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/translation"

Translation/tests/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Translation 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+
```

Translation/tests/test_compose_on_gaudi.sh

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,10 @@ function build_docker_images() {
4040
}
4141

4242
function start_services() {
43-
cd $WORKPATH/docker_compose/intel/hpu/gaudi
44-
45-
export LLM_MODEL_ID="haoranxu/ALMA-13B"
46-
export TGI_LLM_ENDPOINT="http://${ip_address}:8008"
47-
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
48-
export MEGA_SERVICE_HOST_IP=${ip_address}
49-
export LLM_SERVICE_HOST_IP=${ip_address}
50-
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:8888/v1/translation"
51-
export NGINX_PORT=80
52-
export FRONTEND_SERVICE_IP=${ip_address}
53-
export FRONTEND_SERVICE_PORT=5173
54-
export BACKEND_SERVICE_NAME=translation
55-
export BACKEND_SERVICE_IP=${ip_address}
56-
export BACKEND_SERVICE_PORT=8888
43+
cd $WORKPATH/docker_compose
5744
export host_ip=${ip_address}
45+
source set_env.sh
46+
cd intel/hpu/gaudi
5847

5948
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
6049

Translation/tests/test_compose_on_rocm.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,8 @@ function build_docker_images() {
4242
function start_services() {
4343
cd $WORKPATH/docker_compose/amd/gpu/rocm/
4444

45-
export TRANSLATION_HOST_IP=${ip_address}
46-
export TRANSLATION_LLM_MODEL_ID="haoranxu/ALMA-13B"
47-
export TRANSLATION_TGI_LLM_ENDPOINT="http://${TRANSLATION_HOST_IP}:8008"
48-
export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
49-
export TRANSLATION_MEGA_SERVICE_HOST_IP=${TRANSLATION_HOST_IP}
50-
export TRANSLATION_LLM_SERVICE_HOST_IP=${TRANSLATION_HOST_IP}
51-
export TRANSLATION_FRONTEND_SERVICE_IP=${TRANSLATION_HOST_IP}
52-
export TRANSLATION_FRONTEND_SERVICE_PORT=5173
53-
export TRANSLATION_BACKEND_SERVICE_NAME=translation
54-
export TRANSLATION_BACKEND_SERVICE_IP=${TRANSLATION_HOST_IP}
55-
export TRANSLATION_BACKEND_SERVICE_PORT=8888
56-
export TRANSLATION_BACKEND_SERVICE_ENDPOINT="http://${TRANSLATION_HOST_IP}:${TRANSLATION_BACKEND_SERVICE_PORT}/v1/translation"
57-
export TRANSLATION_NGINX_PORT=8084
5845
export host_ip=${ip_address}
46+
source set_env.sh
5947

6048
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
6149

Translation/tests/test_compose_on_xeon.sh

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,10 @@ function build_docker_images() {
4040
}
4141

4242
function start_services() {
43-
cd $WORKPATH/docker_compose/intel/cpu/xeon/
44-
45-
export LLM_MODEL_ID="haoranxu/ALMA-13B"
46-
export TGI_LLM_ENDPOINT="http://${ip_address}:8008"
47-
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
48-
export MEGA_SERVICE_HOST_IP=${ip_address}
49-
export LLM_SERVICE_HOST_IP=${ip_address}
50-
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:8888/v1/translation"
51-
export NGINX_PORT=80
52-
export FRONTEND_SERVICE_IP=${ip_address}
53-
export FRONTEND_SERVICE_PORT=5173
54-
export BACKEND_SERVICE_NAME=translation
55-
export BACKEND_SERVICE_IP=${ip_address}
56-
export BACKEND_SERVICE_PORT=8888
43+
cd $WORKPATH/docker_compose
5744
export host_ip=${ip_address}
45+
source set_env.sh
46+
cd intel/cpu/xeon
5847

5948
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
6049

Translation/tests/test_compose_vllm_on_rocm.sh

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,8 @@ function build_docker_images() {
3939
function start_services() {
4040
cd $WORKPATH/docker_compose/amd/gpu/rocm/
4141

42-
export HOST_IP=${ip_address}
43-
export EXTERNAL_HOST_IP=${ip_address}
44-
export TRANSLATION_LLM_MODEL_ID="haoranxu/ALMA-13B"
45-
export TRANSLATION_VLLM_SERVICE_PORT=8088
46-
export TRANSLATION_LLM_ENDPOINT="http://${HOST_IP}:${TRANSLATION_VLLM_SERVICE_PORT}"
47-
export TRANSLATION_LLM_PORT=9088
48-
export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
49-
export TRANSLATION_MEGA_SERVICE_HOST_IP=${HOST_IP}
50-
export TRANSLATION_LLM_SERVICE_HOST_IP=${HOST_IP}
51-
export TRANSLATION_FRONTEND_SERVICE_IP=${HOST_IP}
52-
export TRANSLATION_FRONTEND_SERVICE_PORT=5173
53-
export TRANSLATION_BACKEND_SERVICE_NAME=translation
54-
export TRANSLATION_BACKEND_SERVICE_IP=${HOST_IP}
55-
export TRANSLATION_BACKEND_SERVICE_PORT=8089
56-
export TRANSLATION_BACKEND_SERVICE_ENDPOINT="http://${EXTERNAL_HOST_IP}:${TRANSLATION_BACKEND_SERVICE_PORT}/v1/translation"
57-
export TRANSLATION_NGINX_PORT=8090
42+
export host_ip=${ip_address}
43+
source set_env_vllm.sh
5844

5945
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
6046

0 commit comments

Comments
 (0)