From d1b5113ce0fa5f06fdf8d221051021664c7bbf51 Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 23 Apr 2025 15:52:35 +0800 Subject: [PATCH 1/6] Integrate CodeGen set_env to ut scripts. Add README.md for CodeGen UT scripts. Optimization test check. Signed-off-by: ZePan110 --- .../docker_compose/amd/gpu/rocm/set_env.sh | 6 +-- .../amd/gpu/rocm/set_env_vllm.sh | 8 ++-- CodeGen/tests/README.md | 33 +++++++++++++++++ CodeGen/tests/test_compose_on_gaudi.sh | 37 ++----------------- CodeGen/tests/test_compose_on_rocm.sh | 13 +------ CodeGen/tests/test_compose_on_xeon.sh | 34 ++--------------- CodeGen/tests/test_compose_vllm_on_rocm.sh | 13 +------ 7 files changed, 50 insertions(+), 94 deletions(-) create mode 100644 CodeGen/tests/README.md diff --git a/CodeGen/docker_compose/amd/gpu/rocm/set_env.sh b/CodeGen/docker_compose/amd/gpu/rocm/set_env.sh index 117f81667f..4f2c7a8b8f 100644 --- a/CodeGen/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeGen/docker_compose/amd/gpu/rocm/set_env.sh @@ -5,8 +5,8 @@ # SPDX-License-Identifier: Apache-2.0 ### The IP address or domain name of the server on which the application is running -export HOST_IP='' -export EXTERNAL_HOST_IP='' +export HOST_IP=${ip_address} +export EXTERNAL_HOST_IP=${ip_address} ### The port of the TGI service. On this port, the TGI service will accept connections export CODEGEN_TGI_SERVICE_PORT=8028 @@ -36,4 +36,4 @@ export CODEGEN_BACKEND_SERVICE_URL="http://${EXTERNAL_HOST_IP}:${CODEGEN_BACKEND export CODEGEN_LLM_SERVICE_HOST_IP=${HOST_IP} ### The CodeGen service UI port -export CODEGEN_UI_SERVICE_PORT=18151 +export CODEGEN_UI_SERVICE_PORT=5173 diff --git a/CodeGen/docker_compose/amd/gpu/rocm/set_env_vllm.sh b/CodeGen/docker_compose/amd/gpu/rocm/set_env_vllm.sh index 52d69da19e..475191539a 100644 --- a/CodeGen/docker_compose/amd/gpu/rocm/set_env_vllm.sh +++ b/CodeGen/docker_compose/amd/gpu/rocm/set_env_vllm.sh @@ -5,8 +5,8 @@ # SPDX-License-Identifier: Apache-2.0 ### The IP address or domain name of the server on which the application is running -export HOST_IP='' -export EXTERNAL_HOST_IP='' +export HOST_IP=${ip_address} +export EXTERNAL_HOST_IP=${ip_address} ### The port of the vLLM service. On this port, the TGI service will accept connections export CODEGEN_VLLM_SERVICE_PORT=8028 @@ -25,7 +25,7 @@ export CODEGEN_LLM_SERVICE_PORT=9000 export CODEGEN_MEGA_SERVICE_HOST_IP=${HOST_IP} ### The port for CodeGen backend service -export CODEGEN_BACKEND_SERVICE_PORT=18150 +export CODEGEN_BACKEND_SERVICE_PORT=7778 ### The URL of CodeGen backend service, used by the frontend service export CODEGEN_BACKEND_SERVICE_URL="http://${EXTERNAL_HOST_IP}:${CODEGEN_BACKEND_SERVICE_PORT}/v1/codegen" @@ -34,4 +34,4 @@ export CODEGEN_BACKEND_SERVICE_URL="http://${EXTERNAL_HOST_IP}:${CODEGEN_BACKEND export CODEGEN_LLM_SERVICE_HOST_IP=${HOST_IP} ### The CodeGen service UI port -export CODEGEN_UI_SERVICE_PORT=18151 +export CODEGEN_UI_SERVICE_PORT=5173 diff --git a/CodeGen/tests/README.md b/CodeGen/tests/README.md new file mode 100644 index 0000000000..4909899be7 --- /dev/null +++ b/CodeGen/tests/README.md @@ -0,0 +1,33 @@ +# CodeGen 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/CodeGen/tests/test_compose_on_gaudi.sh b/CodeGen/tests/test_compose_on_gaudi.sh index fda73cd165..493cd0507f 100644 --- a/CodeGen/tests/test_compose_on_gaudi.sh +++ b/CodeGen/tests/test_compose_on_gaudi.sh @@ -10,21 +10,11 @@ echo "TAG=IMAGE_TAG=${IMAGE_TAG}" export REGISTRY=${IMAGE_REPO} export TAG=${IMAGE_TAG} export MODEL_CACHE=${model_cache:-"./data"} -export REDIS_DB_PORT=6379 -export REDIS_INSIGHTS_PORT=8001 -export REDIS_RETRIEVER_PORT=7000 -export EMBEDDER_PORT=6000 -export TEI_EMBEDDER_PORT=8090 -export DATAPREP_REDIS_PORT=6007 WORKPATH=$(dirname "$PWD") LOG_PATH="$WORKPATH/tests" ip_address=$(hostname -I | awk '{print $1}') -export http_proxy=${http_proxy} -export https_proxy=${https_proxy} -export no_proxy=${no_proxy},${ip_address} - function build_docker_images() { opea_branch=${opea_branch:-"main"} # If the opea_branch isn't main, replace the git clone branch in Dockerfile. @@ -58,29 +48,10 @@ function start_services() { local compose_profile="$1" local llm_container_name="$2" - cd $WORKPATH/docker_compose/intel/hpu/gaudi - - export LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" - export LLM_ENDPOINT="http://${ip_address}:8028" + cd $WORKPATH/docker_compose export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export MEGA_SERVICE_PORT=7778 - export MEGA_SERVICE_HOST_IP=${ip_address} - export LLM_SERVICE_HOST_IP=${ip_address} - export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:${MEGA_SERVICE_PORT}/v1/codegen" - export NUM_CARDS=1 - export host_ip=${ip_address} - - export REDIS_URL="redis://${host_ip}:${REDIS_DB_PORT}" - export RETRIEVAL_SERVICE_HOST_IP=${host_ip} - export RETRIEVER_COMPONENT_NAME="OPEA_RETRIEVER_REDIS" - export INDEX_NAME="CodeGen" - - export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5" - export TEI_EMBEDDING_HOST_IP=${host_ip} - export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}" - export DATAPREP_ENDPOINT="http://${host_ip}:${DATAPREP_REDIS_PORT}/v1/dataprep" - - export INDEX_NAME="CodeGen" + source set_env.sh + cd intel/hpu/gaudi # Start Docker Containers docker compose --profile ${compose_profile} up -d | tee ${LOG_PATH}/start_services_with_compose.log @@ -176,7 +147,7 @@ function validate_megaservice() { # Curl the Mega Service with index_name and agents_flag validate_services \ "${ip_address}:7778/v1/codegen" \ - "" \ + "fingerprint" \ "mega-codegen" \ "codegen-gaudi-backend-server" \ '{ "index_name": "test_redis", "agents_flag": "True", "messages": "def print_hello_world():", "max_tokens": 256}' diff --git a/CodeGen/tests/test_compose_on_rocm.sh b/CodeGen/tests/test_compose_on_rocm.sh index d1a6f57309..5f2ee20ded 100644 --- a/CodeGen/tests/test_compose_on_rocm.sh +++ b/CodeGen/tests/test_compose_on_rocm.sh @@ -41,18 +41,7 @@ function build_docker_images() { function start_services() { cd $WORKPATH/docker_compose/amd/gpu/rocm/ - - export CODEGEN_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" - export CODEGEN_TGI_SERVICE_PORT=8028 - export CODEGEN_TGI_LLM_ENDPOINT="http://${ip_address}:${CODEGEN_TGI_SERVICE_PORT}" - export CODEGEN_LLM_SERVICE_PORT=9000 - export CODEGEN_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export CODEGEN_MEGA_SERVICE_HOST_IP=${ip_address} - export CODEGEN_LLM_SERVICE_HOST_IP=${ip_address} - export CODEGEN_BACKEND_SERVICE_PORT=7778 - export CODEGEN_BACKEND_SERVICE_URL="http://${ip_address}:${CODEGEN_BACKEND_SERVICE_PORT}/v1/codegen" - export CODEGEN_UI_SERVICE_PORT=5173 - export HOST_IP=${ip_address} + source set_env.sh sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env diff --git a/CodeGen/tests/test_compose_on_xeon.sh b/CodeGen/tests/test_compose_on_xeon.sh index 249f735c8a..597521a122 100644 --- a/CodeGen/tests/test_compose_on_xeon.sh +++ b/CodeGen/tests/test_compose_on_xeon.sh @@ -10,21 +10,11 @@ echo "TAG=IMAGE_TAG=${IMAGE_TAG}" export REGISTRY=${IMAGE_REPO} export TAG=${IMAGE_TAG} export MODEL_CACHE=${model_cache:-"./data"} -export REDIS_DB_PORT=6379 -export REDIS_INSIGHTS_PORT=8001 -export REDIS_RETRIEVER_PORT=7000 -export EMBEDDER_PORT=6000 -export TEI_EMBEDDER_PORT=8090 -export DATAPREP_REDIS_PORT=6007 WORKPATH=$(dirname "$PWD") LOG_PATH="$WORKPATH/tests" ip_address=$(hostname -I | awk '{print $1}') -export http_proxy=${http_proxy} -export https_proxy=${https_proxy} -export no_proxy=${no_proxy},${ip_address} - function build_docker_images() { opea_branch=${opea_branch:-"main"} # If the opea_branch isn't main, replace the git clone branch in Dockerfile. @@ -60,26 +50,10 @@ function start_services() { local compose_profile="$1" local llm_container_name="$2" - cd $WORKPATH/docker_compose/intel/cpu/xeon/ - - export LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" - export LLM_ENDPOINT="http://${ip_address}:8028" + cd $WORKPATH/docker_compose export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export MEGA_SERVICE_PORT=7778 - export MEGA_SERVICE_HOST_IP=${ip_address} - export LLM_SERVICE_HOST_IP=${ip_address} - export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:${MEGA_SERVICE_PORT}/v1/codegen" - export host_ip=${ip_address} - - export REDIS_URL="redis://${host_ip}:${REDIS_DB_PORT}" - export RETRIEVAL_SERVICE_HOST_IP=${host_ip} - export RETRIEVER_COMPONENT_NAME="OPEA_RETRIEVER_REDIS" - export INDEX_NAME="CodeGen" - - export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5" - export TEI_EMBEDDING_HOST_IP=${host_ip} - export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}" - export DATAPREP_ENDPOINT="http://${host_ip}:${DATAPREP_REDIS_PORT}/v1/dataprep" + source set_env.sh + cd intel/cpu/xeon/ # Start Docker Containers docker compose --profile ${compose_profile} up -d > ${LOG_PATH}/start_services_with_compose.log @@ -175,7 +149,7 @@ function validate_megaservice() { # Curl the Mega Service with index_name and agents_flag validate_services \ "${ip_address}:7778/v1/codegen" \ - "" \ + "fingerprint" \ "mega-codegen" \ "codegen-xeon-backend-server" \ '{ "index_name": "test_redis", "agents_flag": "True", "messages": "def print_hello_world():", "max_tokens": 256}' diff --git a/CodeGen/tests/test_compose_vllm_on_rocm.sh b/CodeGen/tests/test_compose_vllm_on_rocm.sh index bb75bdafa8..d0f41c93a8 100644 --- a/CodeGen/tests/test_compose_vllm_on_rocm.sh +++ b/CodeGen/tests/test_compose_vllm_on_rocm.sh @@ -40,18 +40,7 @@ function build_docker_images() { function start_services() { cd $WORKPATH/docker_compose/amd/gpu/rocm/ - - export CODEGEN_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" - export CODEGEN_VLLM_SERVICE_PORT=8028 - export CODEGEN_VLLM_ENDPOINT="http://${ip_address}:${CODEGEN_VLLM_SERVICE_PORT}" - export CODEGEN_LLM_SERVICE_PORT=9000 - export CODEGEN_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export CODEGEN_MEGA_SERVICE_HOST_IP=${ip_address} - export CODEGEN_LLM_SERVICE_HOST_IP=${ip_address} - export CODEGEN_BACKEND_SERVICE_PORT=7778 - export CODEGEN_BACKEND_SERVICE_URL="http://${ip_address}:${CODEGEN_BACKEND_SERVICE_PORT}/v1/codegen" - export CODEGEN_UI_SERVICE_PORT=5173 - export HOST_IP=${ip_address} + source set_env.sh sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env From 6287f7945ac681e63143b7050327709d5a14bbbd Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 23 Apr 2025 16:41:57 +0800 Subject: [PATCH 2/6] Fix issue Signed-off-by: ZePan110 --- CodeGen/tests/test_compose_on_gaudi.sh | 5 +++-- CodeGen/tests/test_compose_on_xeon.sh | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CodeGen/tests/test_compose_on_gaudi.sh b/CodeGen/tests/test_compose_on_gaudi.sh index 493cd0507f..8ed2916f31 100644 --- a/CodeGen/tests/test_compose_on_gaudi.sh +++ b/CodeGen/tests/test_compose_on_gaudi.sh @@ -196,8 +196,9 @@ function validate_gradio() { function stop_docker() { local docker_profile="$1" - - cd $WORKPATH/docker_compose/intel/hpu/gaudi + cd $WORKPATH/docker_compose + source set_env.sh + cd intel/hpu/gaudi docker compose --profile ${docker_profile} down } diff --git a/CodeGen/tests/test_compose_on_xeon.sh b/CodeGen/tests/test_compose_on_xeon.sh index 597521a122..850bb68710 100644 --- a/CodeGen/tests/test_compose_on_xeon.sh +++ b/CodeGen/tests/test_compose_on_xeon.sh @@ -199,7 +199,9 @@ function validate_gradio() { function stop_docker() { local docker_profile="$1" - cd $WORKPATH/docker_compose/intel/cpu/xeon/ + cd $WORKPATH/docker_compose + source set_env.sh + cd intel/cpu/xeon/ docker compose --profile ${docker_profile} down } From aebb69cd75241c5572063f747143080aa615fe69 Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 23 Apr 2025 15:52:35 +0800 Subject: [PATCH 3/6] Integrate CodeGen set_env to ut scripts. Add README.md for CodeGen UT scripts. Optimization test check. Signed-off-by: ZePan110 --- .../docker_compose/amd/gpu/rocm/set_env.sh | 6 +-- .../amd/gpu/rocm/set_env_vllm.sh | 8 ++-- CodeGen/tests/README.md | 33 +++++++++++++++++ CodeGen/tests/test_compose_on_gaudi.sh | 37 ++----------------- CodeGen/tests/test_compose_on_rocm.sh | 13 +------ CodeGen/tests/test_compose_on_xeon.sh | 34 ++--------------- CodeGen/tests/test_compose_vllm_on_rocm.sh | 13 +------ 7 files changed, 50 insertions(+), 94 deletions(-) create mode 100644 CodeGen/tests/README.md diff --git a/CodeGen/docker_compose/amd/gpu/rocm/set_env.sh b/CodeGen/docker_compose/amd/gpu/rocm/set_env.sh index 117f81667f..4f2c7a8b8f 100644 --- a/CodeGen/docker_compose/amd/gpu/rocm/set_env.sh +++ b/CodeGen/docker_compose/amd/gpu/rocm/set_env.sh @@ -5,8 +5,8 @@ # SPDX-License-Identifier: Apache-2.0 ### The IP address or domain name of the server on which the application is running -export HOST_IP='' -export EXTERNAL_HOST_IP='' +export HOST_IP=${ip_address} +export EXTERNAL_HOST_IP=${ip_address} ### The port of the TGI service. On this port, the TGI service will accept connections export CODEGEN_TGI_SERVICE_PORT=8028 @@ -36,4 +36,4 @@ export CODEGEN_BACKEND_SERVICE_URL="http://${EXTERNAL_HOST_IP}:${CODEGEN_BACKEND export CODEGEN_LLM_SERVICE_HOST_IP=${HOST_IP} ### The CodeGen service UI port -export CODEGEN_UI_SERVICE_PORT=18151 +export CODEGEN_UI_SERVICE_PORT=5173 diff --git a/CodeGen/docker_compose/amd/gpu/rocm/set_env_vllm.sh b/CodeGen/docker_compose/amd/gpu/rocm/set_env_vllm.sh index 52d69da19e..475191539a 100644 --- a/CodeGen/docker_compose/amd/gpu/rocm/set_env_vllm.sh +++ b/CodeGen/docker_compose/amd/gpu/rocm/set_env_vllm.sh @@ -5,8 +5,8 @@ # SPDX-License-Identifier: Apache-2.0 ### The IP address or domain name of the server on which the application is running -export HOST_IP='' -export EXTERNAL_HOST_IP='' +export HOST_IP=${ip_address} +export EXTERNAL_HOST_IP=${ip_address} ### The port of the vLLM service. On this port, the TGI service will accept connections export CODEGEN_VLLM_SERVICE_PORT=8028 @@ -25,7 +25,7 @@ export CODEGEN_LLM_SERVICE_PORT=9000 export CODEGEN_MEGA_SERVICE_HOST_IP=${HOST_IP} ### The port for CodeGen backend service -export CODEGEN_BACKEND_SERVICE_PORT=18150 +export CODEGEN_BACKEND_SERVICE_PORT=7778 ### The URL of CodeGen backend service, used by the frontend service export CODEGEN_BACKEND_SERVICE_URL="http://${EXTERNAL_HOST_IP}:${CODEGEN_BACKEND_SERVICE_PORT}/v1/codegen" @@ -34,4 +34,4 @@ export CODEGEN_BACKEND_SERVICE_URL="http://${EXTERNAL_HOST_IP}:${CODEGEN_BACKEND export CODEGEN_LLM_SERVICE_HOST_IP=${HOST_IP} ### The CodeGen service UI port -export CODEGEN_UI_SERVICE_PORT=18151 +export CODEGEN_UI_SERVICE_PORT=5173 diff --git a/CodeGen/tests/README.md b/CodeGen/tests/README.md new file mode 100644 index 0000000000..4909899be7 --- /dev/null +++ b/CodeGen/tests/README.md @@ -0,0 +1,33 @@ +# CodeGen 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/CodeGen/tests/test_compose_on_gaudi.sh b/CodeGen/tests/test_compose_on_gaudi.sh index fda73cd165..493cd0507f 100644 --- a/CodeGen/tests/test_compose_on_gaudi.sh +++ b/CodeGen/tests/test_compose_on_gaudi.sh @@ -10,21 +10,11 @@ echo "TAG=IMAGE_TAG=${IMAGE_TAG}" export REGISTRY=${IMAGE_REPO} export TAG=${IMAGE_TAG} export MODEL_CACHE=${model_cache:-"./data"} -export REDIS_DB_PORT=6379 -export REDIS_INSIGHTS_PORT=8001 -export REDIS_RETRIEVER_PORT=7000 -export EMBEDDER_PORT=6000 -export TEI_EMBEDDER_PORT=8090 -export DATAPREP_REDIS_PORT=6007 WORKPATH=$(dirname "$PWD") LOG_PATH="$WORKPATH/tests" ip_address=$(hostname -I | awk '{print $1}') -export http_proxy=${http_proxy} -export https_proxy=${https_proxy} -export no_proxy=${no_proxy},${ip_address} - function build_docker_images() { opea_branch=${opea_branch:-"main"} # If the opea_branch isn't main, replace the git clone branch in Dockerfile. @@ -58,29 +48,10 @@ function start_services() { local compose_profile="$1" local llm_container_name="$2" - cd $WORKPATH/docker_compose/intel/hpu/gaudi - - export LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" - export LLM_ENDPOINT="http://${ip_address}:8028" + cd $WORKPATH/docker_compose export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export MEGA_SERVICE_PORT=7778 - export MEGA_SERVICE_HOST_IP=${ip_address} - export LLM_SERVICE_HOST_IP=${ip_address} - export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:${MEGA_SERVICE_PORT}/v1/codegen" - export NUM_CARDS=1 - export host_ip=${ip_address} - - export REDIS_URL="redis://${host_ip}:${REDIS_DB_PORT}" - export RETRIEVAL_SERVICE_HOST_IP=${host_ip} - export RETRIEVER_COMPONENT_NAME="OPEA_RETRIEVER_REDIS" - export INDEX_NAME="CodeGen" - - export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5" - export TEI_EMBEDDING_HOST_IP=${host_ip} - export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}" - export DATAPREP_ENDPOINT="http://${host_ip}:${DATAPREP_REDIS_PORT}/v1/dataprep" - - export INDEX_NAME="CodeGen" + source set_env.sh + cd intel/hpu/gaudi # Start Docker Containers docker compose --profile ${compose_profile} up -d | tee ${LOG_PATH}/start_services_with_compose.log @@ -176,7 +147,7 @@ function validate_megaservice() { # Curl the Mega Service with index_name and agents_flag validate_services \ "${ip_address}:7778/v1/codegen" \ - "" \ + "fingerprint" \ "mega-codegen" \ "codegen-gaudi-backend-server" \ '{ "index_name": "test_redis", "agents_flag": "True", "messages": "def print_hello_world():", "max_tokens": 256}' diff --git a/CodeGen/tests/test_compose_on_rocm.sh b/CodeGen/tests/test_compose_on_rocm.sh index d1a6f57309..5f2ee20ded 100644 --- a/CodeGen/tests/test_compose_on_rocm.sh +++ b/CodeGen/tests/test_compose_on_rocm.sh @@ -41,18 +41,7 @@ function build_docker_images() { function start_services() { cd $WORKPATH/docker_compose/amd/gpu/rocm/ - - export CODEGEN_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" - export CODEGEN_TGI_SERVICE_PORT=8028 - export CODEGEN_TGI_LLM_ENDPOINT="http://${ip_address}:${CODEGEN_TGI_SERVICE_PORT}" - export CODEGEN_LLM_SERVICE_PORT=9000 - export CODEGEN_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export CODEGEN_MEGA_SERVICE_HOST_IP=${ip_address} - export CODEGEN_LLM_SERVICE_HOST_IP=${ip_address} - export CODEGEN_BACKEND_SERVICE_PORT=7778 - export CODEGEN_BACKEND_SERVICE_URL="http://${ip_address}:${CODEGEN_BACKEND_SERVICE_PORT}/v1/codegen" - export CODEGEN_UI_SERVICE_PORT=5173 - export HOST_IP=${ip_address} + source set_env.sh sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env diff --git a/CodeGen/tests/test_compose_on_xeon.sh b/CodeGen/tests/test_compose_on_xeon.sh index 249f735c8a..597521a122 100644 --- a/CodeGen/tests/test_compose_on_xeon.sh +++ b/CodeGen/tests/test_compose_on_xeon.sh @@ -10,21 +10,11 @@ echo "TAG=IMAGE_TAG=${IMAGE_TAG}" export REGISTRY=${IMAGE_REPO} export TAG=${IMAGE_TAG} export MODEL_CACHE=${model_cache:-"./data"} -export REDIS_DB_PORT=6379 -export REDIS_INSIGHTS_PORT=8001 -export REDIS_RETRIEVER_PORT=7000 -export EMBEDDER_PORT=6000 -export TEI_EMBEDDER_PORT=8090 -export DATAPREP_REDIS_PORT=6007 WORKPATH=$(dirname "$PWD") LOG_PATH="$WORKPATH/tests" ip_address=$(hostname -I | awk '{print $1}') -export http_proxy=${http_proxy} -export https_proxy=${https_proxy} -export no_proxy=${no_proxy},${ip_address} - function build_docker_images() { opea_branch=${opea_branch:-"main"} # If the opea_branch isn't main, replace the git clone branch in Dockerfile. @@ -60,26 +50,10 @@ function start_services() { local compose_profile="$1" local llm_container_name="$2" - cd $WORKPATH/docker_compose/intel/cpu/xeon/ - - export LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" - export LLM_ENDPOINT="http://${ip_address}:8028" + cd $WORKPATH/docker_compose export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export MEGA_SERVICE_PORT=7778 - export MEGA_SERVICE_HOST_IP=${ip_address} - export LLM_SERVICE_HOST_IP=${ip_address} - export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:${MEGA_SERVICE_PORT}/v1/codegen" - export host_ip=${ip_address} - - export REDIS_URL="redis://${host_ip}:${REDIS_DB_PORT}" - export RETRIEVAL_SERVICE_HOST_IP=${host_ip} - export RETRIEVER_COMPONENT_NAME="OPEA_RETRIEVER_REDIS" - export INDEX_NAME="CodeGen" - - export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5" - export TEI_EMBEDDING_HOST_IP=${host_ip} - export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}" - export DATAPREP_ENDPOINT="http://${host_ip}:${DATAPREP_REDIS_PORT}/v1/dataprep" + source set_env.sh + cd intel/cpu/xeon/ # Start Docker Containers docker compose --profile ${compose_profile} up -d > ${LOG_PATH}/start_services_with_compose.log @@ -175,7 +149,7 @@ function validate_megaservice() { # Curl the Mega Service with index_name and agents_flag validate_services \ "${ip_address}:7778/v1/codegen" \ - "" \ + "fingerprint" \ "mega-codegen" \ "codegen-xeon-backend-server" \ '{ "index_name": "test_redis", "agents_flag": "True", "messages": "def print_hello_world():", "max_tokens": 256}' diff --git a/CodeGen/tests/test_compose_vllm_on_rocm.sh b/CodeGen/tests/test_compose_vllm_on_rocm.sh index bb75bdafa8..d0f41c93a8 100644 --- a/CodeGen/tests/test_compose_vllm_on_rocm.sh +++ b/CodeGen/tests/test_compose_vllm_on_rocm.sh @@ -40,18 +40,7 @@ function build_docker_images() { function start_services() { cd $WORKPATH/docker_compose/amd/gpu/rocm/ - - export CODEGEN_LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" - export CODEGEN_VLLM_SERVICE_PORT=8028 - export CODEGEN_VLLM_ENDPOINT="http://${ip_address}:${CODEGEN_VLLM_SERVICE_PORT}" - export CODEGEN_LLM_SERVICE_PORT=9000 - export CODEGEN_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} - export CODEGEN_MEGA_SERVICE_HOST_IP=${ip_address} - export CODEGEN_LLM_SERVICE_HOST_IP=${ip_address} - export CODEGEN_BACKEND_SERVICE_PORT=7778 - export CODEGEN_BACKEND_SERVICE_URL="http://${ip_address}:${CODEGEN_BACKEND_SERVICE_PORT}/v1/codegen" - export CODEGEN_UI_SERVICE_PORT=5173 - export HOST_IP=${ip_address} + source set_env.sh sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env From 15c62bfb7a31c3ad7d5032b2fa49f4911cc6ce7b Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 23 Apr 2025 16:41:57 +0800 Subject: [PATCH 4/6] Fix issue Signed-off-by: ZePan110 --- CodeGen/tests/test_compose_on_gaudi.sh | 5 +++-- CodeGen/tests/test_compose_on_xeon.sh | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CodeGen/tests/test_compose_on_gaudi.sh b/CodeGen/tests/test_compose_on_gaudi.sh index 493cd0507f..8ed2916f31 100644 --- a/CodeGen/tests/test_compose_on_gaudi.sh +++ b/CodeGen/tests/test_compose_on_gaudi.sh @@ -196,8 +196,9 @@ function validate_gradio() { function stop_docker() { local docker_profile="$1" - - cd $WORKPATH/docker_compose/intel/hpu/gaudi + cd $WORKPATH/docker_compose + source set_env.sh + cd intel/hpu/gaudi docker compose --profile ${docker_profile} down } diff --git a/CodeGen/tests/test_compose_on_xeon.sh b/CodeGen/tests/test_compose_on_xeon.sh index 597521a122..850bb68710 100644 --- a/CodeGen/tests/test_compose_on_xeon.sh +++ b/CodeGen/tests/test_compose_on_xeon.sh @@ -199,7 +199,9 @@ function validate_gradio() { function stop_docker() { local docker_profile="$1" - cd $WORKPATH/docker_compose/intel/cpu/xeon/ + cd $WORKPATH/docker_compose + source set_env.sh + cd intel/cpu/xeon/ docker compose --profile ${docker_profile} down } From dd232736e5b707ef3beb50222960dac9add6b812 Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Thu, 24 Apr 2025 16:40:44 +0800 Subject: [PATCH 5/6] test Signed-off-by: ZePan110 --- CodeGen/tests/test_compose_on_gaudi.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/CodeGen/tests/test_compose_on_gaudi.sh b/CodeGen/tests/test_compose_on_gaudi.sh index 8ed2916f31..18bee78c5e 100644 --- a/CodeGen/tests/test_compose_on_gaudi.sh +++ b/CodeGen/tests/test_compose_on_gaudi.sh @@ -50,6 +50,7 @@ function start_services() { cd $WORKPATH/docker_compose export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} + export host_ip=${ip_address} source set_env.sh cd intel/hpu/gaudi From b02db2ad40e61e0b054d2f29717452cd8a7cd64b Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 7 May 2025 16:51:45 +0800 Subject: [PATCH 6/6] Fix issue Signed-off-by: ZePan110 --- CodeGen/tests/test_compose_on_gaudi.sh | 1 + CodeGen/tests/test_compose_on_xeon.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/CodeGen/tests/test_compose_on_gaudi.sh b/CodeGen/tests/test_compose_on_gaudi.sh index 18bee78c5e..bb539c088b 100644 --- a/CodeGen/tests/test_compose_on_gaudi.sh +++ b/CodeGen/tests/test_compose_on_gaudi.sh @@ -49,6 +49,7 @@ function start_services() { local llm_container_name="$2" cd $WORKPATH/docker_compose + export LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} export host_ip=${ip_address} source set_env.sh diff --git a/CodeGen/tests/test_compose_on_xeon.sh b/CodeGen/tests/test_compose_on_xeon.sh index 850bb68710..4f25081b33 100644 --- a/CodeGen/tests/test_compose_on_xeon.sh +++ b/CodeGen/tests/test_compose_on_xeon.sh @@ -51,6 +51,7 @@ function start_services() { local llm_container_name="$2" cd $WORKPATH/docker_compose + export LLM_MODEL_ID="Qwen/Qwen2.5-Coder-7B-Instruct" export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN} source set_env.sh cd intel/cpu/xeon/