diff --git a/Translation/docker_compose/amd/gpu/rocm/compose.yaml b/Translation/docker_compose/amd/gpu/rocm/compose.yaml index b7e988318f..d33e746b82 100644 --- a/Translation/docker_compose/amd/gpu/rocm/compose.yaml +++ b/Translation/docker_compose/amd/gpu/rocm/compose.yaml @@ -90,7 +90,7 @@ services: - translation-backend-server - translation-ui-server ports: - - "${TRANSLATION_NGINX_PORT:-80}:8080" + - "${TRANSLATION_NGINX_PORT:-80}:80" environment: - no_proxy=${no_proxy} - https_proxy=${https_proxy} diff --git a/Translation/docker_compose/amd/gpu/rocm/compose_vllm.yaml b/Translation/docker_compose/amd/gpu/rocm/compose_vllm.yaml index 4e22076576..ae30a981fb 100644 --- a/Translation/docker_compose/amd/gpu/rocm/compose_vllm.yaml +++ b/Translation/docker_compose/amd/gpu/rocm/compose_vllm.yaml @@ -90,7 +90,7 @@ services: - translation-backend-server - translation-ui-server ports: - - "${TRANSLATION_NGINX_PORT:-80}:8080" + - "${TRANSLATION_NGINX_PORT:-80}:80" environment: no_proxy: ${no_proxy} https_proxy: ${https_proxy} diff --git a/Translation/docker_compose/amd/gpu/rocm/set_env.sh b/Translation/docker_compose/amd/gpu/rocm/set_env.sh index 9efa6f3ee3..dc7dbe85ac 100644 --- a/Translation/docker_compose/amd/gpu/rocm/set_env.sh +++ b/Translation/docker_compose/amd/gpu/rocm/set_env.sh @@ -5,17 +5,17 @@ # SPDX-License-Identifier: Apache-2.0 -export TRANSLATION_HOST_IP='' -export TRANSLATION_EXTERNAL_HOST_IP='' +export TRANSLATION_HOST_IP=${host_ip} +export TRANSLATION_EXTERNAL_HOST_IP=${host_ip} export TRANSLATION_LLM_MODEL_ID="haoranxu/ALMA-13B" export TRANSLATION_TGI_LLM_ENDPOINT="http://${TRANSLATION_HOST_IP}:8008" -export TRANSLATION_HUGGINGFACEHUB_API_TOKEN='' +export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} export TRANSLATION_MEGA_SERVICE_HOST_IP=${TRANSLATION_HOST_IP} export TRANSLATION_LLM_SERVICE_HOST_IP=${TRANSLATION_HOST_IP} export TRANSLATION_FRONTEND_SERVICE_IP=${TRANSLATION_HOST_IP} -export TRANSLATION_FRONTEND_SERVICE_PORT=18122 +export TRANSLATION_FRONTEND_SERVICE_PORT=5173 export TRANSLATION_BACKEND_SERVICE_NAME=translation export TRANSLATION_BACKEND_SERVICE_IP=${TRANSLATION_HOST_IP} -export TRANSLATION_BACKEND_SERVICE_PORT=18121 +export TRANSLATION_BACKEND_SERVICE_PORT=8888 export TRANSLATION_BACKEND_SERVICE_ENDPOINT="http://${TRANSLATION_EXTERNAL_HOST_IP}:${TRANSLATION_BACKEND_SERVICE_PORT}/v1/translation" -export TRANSLATION_NGINX_PORT=18123 +export TRANSLATION_NGINX_PORT=8084 diff --git a/Translation/docker_compose/amd/gpu/rocm/set_env_vllm.sh b/Translation/docker_compose/amd/gpu/rocm/set_env_vllm.sh index 0f3d89c53e..4ebd939baa 100644 --- a/Translation/docker_compose/amd/gpu/rocm/set_env_vllm.sh +++ b/Translation/docker_compose/amd/gpu/rocm/set_env_vllm.sh @@ -5,8 +5,8 @@ # SPDX-License-Identifier: Apache-2.0 -export HOST_IP='' -export EXTERNAL_HOST_IP='' +export HOST_IP=${host_ip} +export EXTERNAL_HOST_IP=${host_ip} export TRANSLATION_LLM_MODEL_ID="haoranxu/ALMA-13B" export TRANSLATION_VLLM_SERVICE_PORT=8088 export TRANSLATION_LLM_ENDPOINT="http://${HOST_IP}:${TRANSLATION_VLLM_SERVICE_PORT}" @@ -15,9 +15,9 @@ export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} export TRANSLATION_MEGA_SERVICE_HOST_IP=${HOST_IP} export TRANSLATION_LLM_SERVICE_HOST_IP=${HOST_IP} export TRANSLATION_FRONTEND_SERVICE_IP=${HOST_IP} -export TRANSLATION_FRONTEND_SERVICE_PORT=18122 +export TRANSLATION_FRONTEND_SERVICE_PORT=5173 export TRANSLATION_BACKEND_SERVICE_NAME=translation export TRANSLATION_BACKEND_SERVICE_IP=${HOST_IP} -export TRANSLATION_BACKEND_SERVICE_PORT=18121 +export TRANSLATION_BACKEND_SERVICE_PORT=8089 export TRANSLATION_BACKEND_SERVICE_ENDPOINT="http://${EXTERNAL_HOST_IP}:${TRANSLATION_BACKEND_SERVICE_PORT}/v1/translation" -export TRANSLATION_NGINX_PORT=18123 +export TRANSLATION_NGINX_PORT=8090 diff --git a/Translation/docker_compose/set_env.sh b/Translation/docker_compose/set_env.sh index aa4b428f6e..25edfd4022 100644 --- a/Translation/docker_compose/set_env.sh +++ b/Translation/docker_compose/set_env.sh @@ -9,7 +9,7 @@ popd > /dev/null export LLM_MODEL_ID="haoranxu/ALMA-13B" export TGI_LLM_ENDPOINT="http://${host_ip}:8008" -export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token} +export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} export MEGA_SERVICE_HOST_IP=${host_ip} export LLM_SERVICE_HOST_IP=${host_ip} export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:8888/v1/translation" diff --git a/Translation/tests/README.md b/Translation/tests/README.md new file mode 100644 index 0000000000..ece64cf149 --- /dev/null +++ b/Translation/tests/README.md @@ -0,0 +1,33 @@ +# Translation E2E test scripts + +## Set the required environment variable + +```bash +export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token" +``` + +## Run test + +On Intel Xeon with TGI: + +```bash +bash test_compose_on_xeon.sh +``` + +On Intel Gaudi with TGI: + +```bash +bash test_compose_on_gaudi.sh +``` + +On AMD ROCm with TGI: + +```bash +bash test_compose_on_rocm.sh +``` + +On AMD ROCm with vLLM: + +```bash +bash test_compose_vllm_on_rocm.sh +``` diff --git a/Translation/tests/test_compose_on_gaudi.sh b/Translation/tests/test_compose_on_gaudi.sh index 63167b6e74..2f39c36282 100644 --- a/Translation/tests/test_compose_on_gaudi.sh +++ b/Translation/tests/test_compose_on_gaudi.sh @@ -40,21 +40,10 @@ function build_docker_images() { } function start_services() { - cd $WORKPATH/docker_compose/intel/hpu/gaudi - - export LLM_MODEL_ID="haoranxu/ALMA-13B" - export TGI_LLM_ENDPOINT="http://${ip_address}:8008" - export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export MEGA_SERVICE_HOST_IP=${ip_address} - export LLM_SERVICE_HOST_IP=${ip_address} - export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:8888/v1/translation" - export NGINX_PORT=80 - export FRONTEND_SERVICE_IP=${ip_address} - export FRONTEND_SERVICE_PORT=5173 - export BACKEND_SERVICE_NAME=translation - export BACKEND_SERVICE_IP=${ip_address} - export BACKEND_SERVICE_PORT=8888 + cd $WORKPATH/docker_compose export host_ip=${ip_address} + source set_env.sh + cd intel/hpu/gaudi sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env diff --git a/Translation/tests/test_compose_on_rocm.sh b/Translation/tests/test_compose_on_rocm.sh index 1e587cc03c..dacac87bb1 100644 --- a/Translation/tests/test_compose_on_rocm.sh +++ b/Translation/tests/test_compose_on_rocm.sh @@ -42,20 +42,8 @@ function build_docker_images() { function start_services() { cd $WORKPATH/docker_compose/amd/gpu/rocm/ - export TRANSLATION_HOST_IP=${ip_address} - export TRANSLATION_LLM_MODEL_ID="haoranxu/ALMA-13B" - export TRANSLATION_TGI_LLM_ENDPOINT="http://${TRANSLATION_HOST_IP}:8008" - export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export TRANSLATION_MEGA_SERVICE_HOST_IP=${TRANSLATION_HOST_IP} - export TRANSLATION_LLM_SERVICE_HOST_IP=${TRANSLATION_HOST_IP} - export TRANSLATION_FRONTEND_SERVICE_IP=${TRANSLATION_HOST_IP} - export TRANSLATION_FRONTEND_SERVICE_PORT=5173 - export TRANSLATION_BACKEND_SERVICE_NAME=translation - export TRANSLATION_BACKEND_SERVICE_IP=${TRANSLATION_HOST_IP} - export TRANSLATION_BACKEND_SERVICE_PORT=8888 - export TRANSLATION_BACKEND_SERVICE_ENDPOINT="http://${TRANSLATION_HOST_IP}:${TRANSLATION_BACKEND_SERVICE_PORT}/v1/translation" - export TRANSLATION_NGINX_PORT=8084 export host_ip=${ip_address} + source set_env.sh sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env diff --git a/Translation/tests/test_compose_on_xeon.sh b/Translation/tests/test_compose_on_xeon.sh index 9e2ac58cb7..6b06eacdba 100644 --- a/Translation/tests/test_compose_on_xeon.sh +++ b/Translation/tests/test_compose_on_xeon.sh @@ -40,21 +40,10 @@ function build_docker_images() { } function start_services() { - cd $WORKPATH/docker_compose/intel/cpu/xeon/ - - export LLM_MODEL_ID="haoranxu/ALMA-13B" - export TGI_LLM_ENDPOINT="http://${ip_address}:8008" - export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export MEGA_SERVICE_HOST_IP=${ip_address} - export LLM_SERVICE_HOST_IP=${ip_address} - export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:8888/v1/translation" - export NGINX_PORT=80 - export FRONTEND_SERVICE_IP=${ip_address} - export FRONTEND_SERVICE_PORT=5173 - export BACKEND_SERVICE_NAME=translation - export BACKEND_SERVICE_IP=${ip_address} - export BACKEND_SERVICE_PORT=8888 + cd $WORKPATH/docker_compose export host_ip=${ip_address} + source set_env.sh + cd intel/cpu/xeon sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env diff --git a/Translation/tests/test_compose_vllm_on_rocm.sh b/Translation/tests/test_compose_vllm_on_rocm.sh index e7db52010f..3584e061f3 100644 --- a/Translation/tests/test_compose_vllm_on_rocm.sh +++ b/Translation/tests/test_compose_vllm_on_rocm.sh @@ -39,22 +39,8 @@ function build_docker_images() { function start_services() { cd $WORKPATH/docker_compose/amd/gpu/rocm/ - export HOST_IP=${ip_address} - export EXTERNAL_HOST_IP=${ip_address} - export TRANSLATION_LLM_MODEL_ID="haoranxu/ALMA-13B" - export TRANSLATION_VLLM_SERVICE_PORT=8088 - export TRANSLATION_LLM_ENDPOINT="http://${HOST_IP}:${TRANSLATION_VLLM_SERVICE_PORT}" - export TRANSLATION_LLM_PORT=9088 - export TRANSLATION_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export TRANSLATION_MEGA_SERVICE_HOST_IP=${HOST_IP} - export TRANSLATION_LLM_SERVICE_HOST_IP=${HOST_IP} - export TRANSLATION_FRONTEND_SERVICE_IP=${HOST_IP} - export TRANSLATION_FRONTEND_SERVICE_PORT=5173 - export TRANSLATION_BACKEND_SERVICE_NAME=translation - export TRANSLATION_BACKEND_SERVICE_IP=${HOST_IP} - export TRANSLATION_BACKEND_SERVICE_PORT=8089 - export TRANSLATION_BACKEND_SERVICE_ENDPOINT="http://${EXTERNAL_HOST_IP}:${TRANSLATION_BACKEND_SERVICE_PORT}/v1/translation" - export TRANSLATION_NGINX_PORT=8090 + export host_ip=${ip_address} + source set_env_vllm.sh sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env