Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DocSum/docker_compose/amd/gpu/rocm/set_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (C) 2024 Advanced Micro Devices, Inc.
# SPDX-License-Identifier: Apache-2.0

export HOST_IP=''
export HOST_IP=${ip_address}
export DOCSUM_MAX_INPUT_TOKENS="2048"
export DOCSUM_MAX_TOTAL_TOKENS="4096"
export DOCSUM_LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
Expand Down
2 changes: 1 addition & 1 deletion DocSum/docker_compose/amd/gpu/rocm/set_env_vllm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright (C) 2024 Advanced Micro Devices, Inc.
# SPDX-License-Identifier: Apache-2.0

export HOST_IP=''
export HOST_IP=${ip_address}
export DOCSUM_HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export DOCSUM_MAX_INPUT_TOKENS=2048
export DOCSUM_MAX_TOTAL_TOKENS=4096
Expand Down
6 changes: 4 additions & 2 deletions DocSum/docker_compose/set_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export no_proxy="${no_proxy},${host_ip}" # Example: no_proxy="localhost, 127.0.0
export http_proxy=$http_proxy
export https_proxy=$https_proxy
export host_ip=$(hostname -I | awk '{print $1}') # Example: host_ip="192.168.1.1"
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}

export LLM_ENDPOINT_PORT=8008
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
Expand All @@ -20,10 +20,12 @@ export MAX_TOTAL_TOKENS=2048
export LLM_PORT=9000
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
export DocSum_COMPONENT_NAME="OpeaDocSumvLLM" # OpeaDocSumTgi

export FRONTEND_SERVICE_PORT=5173
export MEGA_SERVICE_HOST_IP=${host_ip}
export LLM_SERVICE_HOST_IP=${host_ip}
export ASR_SERVICE_HOST_IP=${host_ip}

export BACKEND_SERVICE_PORT=8888
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"

export LOGFLAG=True
45 changes: 45 additions & 0 deletions DocSum/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# DocSum E2E test scripts

## Set the required environment variable

```bash
export HUGGINGFACEHUB_API_TOKEN="Your_Huggingface_API_Token"
```

## Run test

On Intel Xeon with vLLM:

```bash
bash test_compose_on_xeon.sh
```

On Intel Xeon with TGI:

```bash
bash test_compose_tgi_on_xeon.sh
```

On Intel Gaudi with vLLM:

```bash
bash test_compose_on_gaudi.sh
```

On Intel Gaudi with TGI:

```bash
bash test_compose_tgi_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
```
25 changes: 6 additions & 19 deletions DocSum/tests/test_compose_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,22 @@ export http_proxy=$http_proxy
export https_proxy=$https_proxy
export host_ip=$(hostname -I | awk '{print $1}')

WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
export no_proxy="${no_proxy},${host_ip}"
export MODEL_CACHE=${model_cache:-"./data"}
export REGISTRY=${IMAGE_REPO}
export TAG=${IMAGE_TAG}
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export LLM_ENDPOINT_PORT=8008
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
source $WORKPATH/docker_compose/set_env.sh

export MODEL_CACHE=${model_cache:-"./data"}

export NUM_CARDS=1
export BLOCK_SIZE=128
export MAX_NUM_SEQS=256
export MAX_SEQ_LEN_TO_CAPTURE=2048
export MAX_INPUT_TOKENS=2048
export MAX_TOTAL_TOKENS=4096
export LLM_PORT=9000
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
export DocSum_COMPONENT_NAME="OpeaDocSumvLLM"
export MEGA_SERVICE_HOST_IP=${host_ip}
export LLM_SERVICE_HOST_IP=${host_ip}
export ASR_SERVICE_HOST_IP=${host_ip}
export FRONTEND_SERVICE_PORT=5173
export BACKEND_SERVICE_PORT=8888
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
export LOGFLAG=True

WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"


# Get the root folder of the current script
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
Expand Down
29 changes: 8 additions & 21 deletions DocSum/tests/test_compose_on_rocm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,8 @@ export MODEL_CACHE=${model_cache:-"./data"}
WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"
ip_address=$(hostname -I | awk '{print $1}')

export HOST_IP=${ip_address}
export host_ip=${ip_address}
export DOCSUM_MAX_INPUT_TOKENS="2048"
export DOCSUM_MAX_TOTAL_TOKENS="4096"
export DOCSUM_LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"
export DOCSUM_TGI_SERVICE_PORT="8008"
export DOCSUM_TGI_LLM_ENDPOINT="http://${HOST_IP}:${DOCSUM_TGI_SERVICE_PORT}"
export DOCSUM_HUGGINGFACEHUB_API_TOKEN=''
export DOCSUM_WHISPER_PORT="7066"
export ASR_SERVICE_HOST_IP="${HOST_IP}"
export DOCSUM_LLM_SERVER_PORT="9000"
export DOCSUM_BACKEND_SERVER_PORT="18072"
export DOCSUM_FRONTEND_PORT="18073"
export BACKEND_SERVICE_ENDPOINT="http://${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
source $WORKPATH/docker_compose/amd/gpu/rocm/set_env.sh

function build_docker_images() {
opea_branch=${opea_branch:-"main"}
Expand Down Expand Up @@ -129,23 +116,23 @@ function validate_microservices() {
# whisper microservice
ulimit -s 65536
validate_services \
"${host_ip}:${DOCSUM_WHISPER_PORT}/v1/asr" \
"${HOST_IP}:${DOCSUM_WHISPER_PORT}/v1/asr" \
'{"asr_result":"well"}' \
"whisper-service" \
"whisper-service" \
"{\"audio\": \"$(input_data_for_test "audio")\"}"

# tgi for llm service
validate_services \
"${host_ip}:${DOCSUM_TGI_SERVICE_PORT}/generate" \
"${HOST_IP}:${DOCSUM_TGI_SERVICE_PORT}/generate" \
"generated_text" \
"docsum-tgi-service" \
"docsum-tgi-service" \
'{"inputs":"What is Deep Learning?","parameters":{"max_new_tokens":17, "do_sample": true}}'

# llm microservice
validate_services \
"${host_ip}:${DOCSUM_LLM_SERVER_PORT}/v1/docsum" \
"${HOST_IP}:${DOCSUM_LLM_SERVER_PORT}/v1/docsum" \
"text" \
"docsum-llm-server" \
"docsum-llm-server" \
Expand All @@ -158,7 +145,7 @@ function validate_megaservice() {
local DOCKER_NAME="docsum-backend-server"
local EXPECTED_RESULT="[DONE]"
local INPUT_DATA="messages=Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."
local URL="${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
local URL="${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum"
local DATA_TYPE="type=text"

local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -F "$DATA_TYPE" -F "$INPUT_DATA" -H 'Content-Type: multipart/form-data' "$URL")
Expand Down Expand Up @@ -188,23 +175,23 @@ function validate_megaservice_json() {
echo ""
echo ">>> Checking text data with Content-Type: application/json"
validate_services \
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
"[DONE]" \
"docsum-backend-server" \
"docsum-backend-server" \
'{"type": "text", "messages": "Text Embeddings Inference (TEI) is a toolkit for deploying and serving open source text embeddings and sequence classification models. TEI enables high-performance extraction for the most popular models, including FlagEmbedding, Ember, GTE and E5."}'

echo ">>> Checking audio data"
validate_services \
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
"[DONE]" \
"docsum-backend-server" \
"docsum-backend-server" \
"{\"type\": \"audio\", \"messages\": \"$(input_data_for_test "audio")\"}"

echo ">>> Checking video data"
validate_services \
"${host_ip}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
"${HOST_IP}:${DOCSUM_BACKEND_SERVER_PORT}/v1/docsum" \
"[DONE]" \
"docsum-backend-server" \
"docsum-backend-server" \
Expand Down
24 changes: 6 additions & 18 deletions DocSum/tests/test_compose_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,18 @@ export http_proxy=$http_proxy
export https_proxy=$https_proxy
export host_ip=$(hostname -I | awk '{print $1}')

WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
export no_proxy="${no_proxy},${host_ip}"
export MODEL_CACHE=${model_cache:-"./data"}
export REGISTRY=${IMAGE_REPO}
export TAG=${IMAGE_TAG}
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export LLM_ENDPOINT_PORT=8008
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"

source $WORKPATH/docker_compose/set_env.sh
export MODEL_CACHE=${model_cache:-"./data"}

export MAX_INPUT_TOKENS=2048
export MAX_TOTAL_TOKENS=4096
export LLM_PORT=9000
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
export DocSum_COMPONENT_NAME="OpeaDocSumvLLM"
export MEGA_SERVICE_HOST_IP=${host_ip}
export LLM_SERVICE_HOST_IP=${host_ip}
export ASR_SERVICE_HOST_IP=${host_ip}
export FRONTEND_SERVICE_PORT=5173
export BACKEND_SERVICE_PORT=8888
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
export LOGFLAG=True

WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"

# Get the root folder of the current script
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
Expand Down
26 changes: 7 additions & 19 deletions DocSum/tests/test_compose_tgi_on_gaudi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,20 @@ IMAGE_TAG=${IMAGE_TAG:-"latest"}
export http_proxy=$http_proxy
export https_proxy=$https_proxy
export host_ip=$(hostname -I | awk '{print $1}')

WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
export no_proxy="${no_proxy},${host_ip}"
export MODEL_CACHE=${model_cache:-"./data"}
export REGISTRY=${IMAGE_REPO}
export TAG=${IMAGE_TAG}
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export LLM_ENDPOINT_PORT=8008
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"

source $WORKPATH/docker_compose/set_env.sh
export MODEL_CACHE=${model_cache:-"./data"}

export MAX_INPUT_TOKENS=2048
export MAX_TOTAL_TOKENS=4096
export LLM_PORT=9000
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
export MEGA_SERVICE_HOST_IP=${host_ip}
export LLM_SERVICE_HOST_IP=${host_ip}
export ASR_SERVICE_HOST_IP=${host_ip}
export FRONTEND_SERVICE_PORT=5173
export BACKEND_SERVICE_PORT=8888
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
export LOGFLAG=True

WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"

export DocSum_COMPONENT_NAME="OpeaDocSumTgi"

# Get the root folder of the current script
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
Expand Down
25 changes: 7 additions & 18 deletions DocSum/tests/test_compose_tgi_on_xeon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,20 @@ IMAGE_TAG=${IMAGE_TAG:-"latest"}
export http_proxy=$http_proxy
export https_proxy=$https_proxy
export host_ip=$(hostname -I | awk '{print $1}')

WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
export no_proxy="${no_proxy},${host_ip}"
export MODEL_CACHE=${model_cache:-"./data"}
export REGISTRY=${IMAGE_REPO}
export TAG=${IMAGE_TAG}
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export LLM_ENDPOINT_PORT=8008
export LLM_MODEL_ID="Intel/neural-chat-7b-v3-3"

source $WORKPATH/docker_compose/set_env.sh
export MODEL_CACHE=${model_cache:-"./data"}

export MAX_INPUT_TOKENS=2048
export MAX_TOTAL_TOKENS=4096
export LLM_PORT=9000
export LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"
export MEGA_SERVICE_HOST_IP=${host_ip}
export LLM_SERVICE_HOST_IP=${host_ip}
export ASR_SERVICE_HOST_IP=${host_ip}
export FRONTEND_SERVICE_PORT=5173
export BACKEND_SERVICE_PORT=8888
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_SERVICE_PORT}/v1/docsum"
export LOGFLAG=True

WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"
export DocSum_COMPONENT_NAME="OpeaDocSumTgi"

# Get the root folder of the current script
ROOT_FOLDER=$(dirname "$(readlink -f "$0")")
Expand Down
Loading