From 615f0d25470624534c541161c6e647f78b448af1 Mon Sep 17 00:00:00 2001 From: "chen, suyue" Date: Wed, 17 Jul 2024 23:07:08 +0800 Subject: [PATCH] update audioqna image name (#408) Signed-off-by: chensuyue --- AudioQnA/docker/gaudi/README.md | 8 ++-- AudioQnA/docker/gaudi/docker_compose.yaml | 4 +- AudioQnA/tests/test_audioqna_on_gaudi.sh | 47 +++++++++++------------ AudioQnA/tests/test_audioqna_on_xeon.sh | 41 ++++++++++---------- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/AudioQnA/docker/gaudi/README.md b/AudioQnA/docker/gaudi/README.md index bc72c9dc2..d896dba1c 100644 --- a/AudioQnA/docker/gaudi/README.md +++ b/AudioQnA/docker/gaudi/README.md @@ -14,7 +14,7 @@ cd GenAIComps ### 2. Build ASR Image ```bash -docker build -t opea/whisper:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/asr/whisper/Dockerfile_hpu . +docker build -t opea/whisper-gaudi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/asr/whisper/Dockerfile_hpu . docker build -t opea/asr:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/asr/Dockerfile . @@ -29,7 +29,7 @@ docker build --no-cache -t opea/llm-tgi:latest --build-arg https_proxy=$https_pr ### 4. Build TTS Image ```bash -docker build -t opea/speecht5:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/tts/speecht5/Dockerfile_hpu . +docker build -t opea/speecht5-gaudi:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/tts/speecht5/Dockerfile_hpu . docker build -t opea/tts:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/tts/Dockerfile . ``` @@ -46,10 +46,10 @@ docker build --no-cache -t opea/audioqna:latest --build-arg https_proxy=$https_p Then run the command `docker images`, you will have following images ready: -1. `opea/whisper:latest` +1. `opea/whisper-gaudi:latest` 2. `opea/asr:latest` 3. `opea/llm-tgi:latest` -4. `opea/speecht5:latest` +4. `opea/speecht5-gaudi:latest` 5. `opea/tts:latest` 6. `opea/audioqna:latest` diff --git a/AudioQnA/docker/gaudi/docker_compose.yaml b/AudioQnA/docker/gaudi/docker_compose.yaml index 9d19cf89d..5d8b34a6b 100644 --- a/AudioQnA/docker/gaudi/docker_compose.yaml +++ b/AudioQnA/docker/gaudi/docker_compose.yaml @@ -6,7 +6,7 @@ version: "3.8" services: whisper-service: - image: opea/whisper:latest + image: opea/whisper-gaudi:latest container_name: whisper-service ports: - "7066:7066" @@ -30,7 +30,7 @@ services: environment: ASR_ENDPOINT: ${ASR_ENDPOINT} speecht5-service: - image: opea/speecht5:latest + image: opea/speecht5-gaudi:latest container_name: speecht5-service ports: - "7055:7055" diff --git a/AudioQnA/tests/test_audioqna_on_gaudi.sh b/AudioQnA/tests/test_audioqna_on_gaudi.sh index de99d1460..13991d1f2 100644 --- a/AudioQnA/tests/test_audioqna_on_gaudi.sh +++ b/AudioQnA/tests/test_audioqna_on_gaudi.sh @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 set -e +echo "IMAGE_REPO=${IMAGE_REPO}" WORKPATH=$(dirname "$PWD") LOG_PATH="$WORKPATH/tests" @@ -13,11 +14,11 @@ function build_docker_images() { git clone https://github.com/opea-project/GenAIComps.git cd GenAIComps - docker build -t opea/whisper:latest -f comps/asr/whisper/Dockerfile_hpu . + docker build -t opea/whisper-gaudi:latest -f comps/asr/whisper/Dockerfile_hpu . docker build -t opea/asr:latest -f comps/asr/Dockerfile . docker build -t opea/llm-tgi:latest -f comps/llms/text-generation/tgi/Dockerfile . - docker build -t opea/speecht5:latest -f comps/tts/speecht5/Dockerfile_hpu . + docker build -t opea/speecht5-gaudi:latest -f comps/tts/speecht5/Dockerfile_hpu . docker build -t opea/tts:latest -f comps/tts/Dockerfile . docker pull ghcr.io/huggingface/tgi-gaudi:2.0.1 @@ -54,23 +55,27 @@ function start_services() { # sed -i "s/backend_address/$ip_address/g" $WORKPATH/docker/ui/svelte/.env - # Replace the container name with a test-specific name - # echo "using image repository $IMAGE_REPO and image tag $IMAGE_TAG" - # sed -i "s#image: opea/chatqna:latest#image: opea/chatqna:${IMAGE_TAG}#g" docker_compose.yaml - # sed -i "s#image: opea/chatqna-ui:latest#image: opea/chatqna-ui:${IMAGE_TAG}#g" docker_compose.yaml - # sed -i "s#image: opea/*#image: ${IMAGE_REPO}opea/#g" docker_compose.yaml + if [[ "$IMAGE_REPO" != "" ]]; then + # Replace the container name with a test-specific name + echo "using image repository $IMAGE_REPO and image tag $IMAGE_TAG" + sed -i "s#image: opea/audioqna:latest#image: opea/audioqna:${IMAGE_TAG}#g" docker_compose.yaml + sed -i "s#image: opea/audioqna-ui:latest#image: opea/audioqna-ui:${IMAGE_TAG}#g" docker_compose.yaml + sed -i "s#image: opea/*#image: ${IMAGE_REPO}opea/#g" docker_compose.yaml + echo "cat docker_compose.yaml" + cat docker_compose.yaml + fi + # Start Docker Containers docker compose -f docker_compose.yaml up -d - # n=0 - # until [[ "$n" -ge 200 ]]; do - # docker logs tgi-gaudi-server > tgi_service_start.log - # if grep -q Connected tgi_service_start.log; then - # break - # fi - # sleep 1s - # n=$((n+1)) - # done - sleep 8m + n=0 + until [[ "$n" -ge 500 ]]; do + docker logs tgi-gaudi-server > $LOG_PATH/tgi_service_start.log + if grep -q Connected $LOG_PATH/tgi_service_start.log; then + break + fi + sleep 1s + n=$((n+1)) + done } @@ -130,14 +135,8 @@ function stop_docker() { function main() { stop_docker - # begin_time=$(date +%s) - build_docker_images - # start_time=$(date +%s) + if [[ "$IMAGE_REPO" == "" ]]; then build_docker_images; fi start_services - # end_time=$(date +%s) - # minimal_duration=$((end_time-start_time)) - # maximal_duration=$((end_time-begin_time)) - # echo "Mega service start duration is "$maximal_duration"s" # validate_microservices validate_megaservice diff --git a/AudioQnA/tests/test_audioqna_on_xeon.sh b/AudioQnA/tests/test_audioqna_on_xeon.sh index f3dbf4f04..d80c6ded1 100644 --- a/AudioQnA/tests/test_audioqna_on_xeon.sh +++ b/AudioQnA/tests/test_audioqna_on_xeon.sh @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 set -e +echo "IMAGE_REPO=${IMAGE_REPO}" WORKPATH=$(dirname "$PWD") LOG_PATH="$WORKPATH/tests" @@ -50,23 +51,27 @@ function start_services() { # sed -i "s/backend_address/$ip_address/g" $WORKPATH/docker/ui/svelte/.env - # Replace the container name with a test-specific name - # echo "using image repository $IMAGE_REPO and image tag $IMAGE_TAG" - # sed -i "s#image: opea/chatqna:latest#image: opea/chatqna:${IMAGE_TAG}#g" docker_compose.yaml - # sed -i "s#image: opea/chatqna-ui:latest#image: opea/chatqna-ui:${IMAGE_TAG}#g" docker_compose.yaml - # sed -i "s#image: opea/*#image: ${IMAGE_REPO}opea/#g" docker_compose.yaml + if [[ "$IMAGE_REPO" != "" ]]; then + # Replace the container name with a test-specific name + echo "using image repository $IMAGE_REPO and image tag $IMAGE_TAG" + sed -i "s#image: opea/audioqna:latest#image: opea/audioqna:${IMAGE_TAG}#g" docker_compose.yaml + sed -i "s#image: opea/audioqna-ui:latest#image: opea/audioqna-ui:${IMAGE_TAG}#g" docker_compose.yaml + sed -i "s#image: opea/*#image: ${IMAGE_REPO}opea/#g" docker_compose.yaml + echo "cat docker_compose.yaml" + cat docker_compose.yaml + fi + # Start Docker Containers docker compose -f docker_compose.yaml up -d - sleep 3m - # n=0 - # until [[ "$n" -ge 200 ]]; do - # docker logs tgi-service > tgi_service_start.log - # if grep -q Connected tgi_service_start.log; then - # break - # fi - # sleep 1s - # n=$((n+1)) - # done + n=0 + until [[ "$n" -ge 200 ]]; do + docker logs tgi-service > $LOG_PATH/tgi_service_start.log + if grep -q Connected $LOG_PATH/tgi_service_start.log; then + break + fi + sleep 1s + n=$((n+1)) + done } @@ -118,12 +123,8 @@ function stop_docker() { function main() { stop_docker - build_docker_images - # begin_time=$(date +%s) + if [[ "$IMAGE_REPO" == "" ]]; then build_docker_images; fi start_services - # end_time=$(date +%s) - # maximal_duration=$((end_time-begin_time)) - # echo "Mega service start duration is "$maximal_duration"s" && sleep 1s validate_megaservice # validate_frontend