From 90536d1a4f84061b2ba4f6403e4990ce156268c8 Mon Sep 17 00:00:00 2001 From: chensuyue Date: Mon, 12 May 2025 11:01:10 +0800 Subject: [PATCH 1/2] Group log lines in GHA outputs for better readable logs. Signed-off-by: chensuyue --- AvatarChatbot/Dockerfile | 3 +- AvatarChatbot/docker_image_build/build.yaml | 2 ++ AvatarChatbot/tests/test_compose_on_gaudi.sh | 36 +++++++++++--------- AvatarChatbot/tests/test_compose_on_rocm.sh | 31 +++++++++++------ AvatarChatbot/tests/test_compose_on_xeon.sh | 36 ++++++++++++-------- 5 files changed, 66 insertions(+), 42 deletions(-) diff --git a/AvatarChatbot/Dockerfile b/AvatarChatbot/Dockerfile index 86e5a9bc6c..a9ec9a2cb7 100644 --- a/AvatarChatbot/Dockerfile +++ b/AvatarChatbot/Dockerfile @@ -1,8 +1,9 @@ # Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +ARG IMAGE_REPO=opea ARG BASE_TAG=latest -FROM opea/comps-base:$BASE_TAG +FROM $IMAGE_REPO/comps-base:$BASE_TAG COPY ./avatarchatbot.py $HOME/avatarchatbot.py diff --git a/AvatarChatbot/docker_image_build/build.yaml b/AvatarChatbot/docker_image_build/build.yaml index 23d102a508..9d99a52a9d 100644 --- a/AvatarChatbot/docker_image_build/build.yaml +++ b/AvatarChatbot/docker_image_build/build.yaml @@ -5,6 +5,8 @@ services: avatarchatbot: build: args: + IMAGE_REPO: ${REGISTRY:-opea} + BASE_TAG: ${TAG:-latest} http_proxy: ${http_proxy} https_proxy: ${https_proxy} no_proxy: ${no_proxy} diff --git a/AvatarChatbot/tests/test_compose_on_gaudi.sh b/AvatarChatbot/tests/test_compose_on_gaudi.sh index 6c167c4467..faf156907d 100755 --- a/AvatarChatbot/tests/test_compose_on_gaudi.sh +++ b/AvatarChatbot/tests/test_compose_on_gaudi.sh @@ -24,19 +24,13 @@ ip_address=$(hostname -I | awk '{print $1}') function build_docker_images() { opea_branch=${opea_branch:-"main"} - # If the opea_branch isn't main, replace the git clone branch in Dockerfile. - if [[ "${opea_branch}" != "main" ]]; then - cd $WORKPATH - OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git" - NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git" - find . -type f -name "Dockerfile*" | while read -r file; do - echo "Processing file: $file" - sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file" - done - fi cd $WORKPATH/docker_image_build git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git + pushd GenAIComps + echo "GenAIComps test commit is $(git rev-parse HEAD)" + docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile . + popd && sleep 1s echo "Build all the images with --no-cache, check docker_image_build.log for details..." service_list="avatarchatbot whisper-gaudi speecht5-gaudi wav2lip-gaudi animation" @@ -128,19 +122,29 @@ function stop_docker() { function main() { + echo "::group::stop_docker" stop_docker - echo y | docker builder prune --all - echo y | docker image prune + echo "::endgroup::" + docker builder prune --all -f + docker image prune -f + echo "::group::build_docker_images" if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi + echo "::endgroup::" + + echo "::group::start_services" start_services - # validate_microservices + echo "::endgroup::" + + echo "::group::validate_megaservice" validate_megaservice - # validate_frontend + echo "::endgroup::" + echo "::group::stop_docker" stop_docker - echo y | docker builder prune --all - echo y | docker image prune + echo "::endgroup::" + docker builder prune --all -f + docker image prune -f } diff --git a/AvatarChatbot/tests/test_compose_on_rocm.sh b/AvatarChatbot/tests/test_compose_on_rocm.sh index f0069ef913..b796e2f735 100644 --- a/AvatarChatbot/tests/test_compose_on_rocm.sh +++ b/AvatarChatbot/tests/test_compose_on_rocm.sh @@ -25,6 +25,10 @@ ip_address=$(hostname -I | awk '{print $1}') function build_docker_images() { cd $WORKPATH/docker_image_build git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../ + pushd GenAIComps + echo "GenAIComps test commit is $(git rev-parse HEAD)" + docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile . + popd && sleep 1s echo "Build all the images with --no-cache, check docker_image_build.log for details..." service_list="avatarchatbot whisper asr speecht5 tts wav2lip animation" @@ -138,11 +142,6 @@ function validate_megaservice() { } -#function validate_frontend() { - -#} - - function stop_docker() { cd $WORKPATH/docker_compose/amd/gpu/rocm docker compose down && docker compose rm -f @@ -151,19 +150,29 @@ function stop_docker() { function main() { - echo $OPENAI_API_KEY - echo $OPENAI_KEY - + echo "::group::stop_docker" stop_docker + echo "::endgroup::" + + echo "::group::build_docker_images" if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi + echo "::endgroup::" + + echo "::group::start_services" start_services - # validate_microservices + echo "::endgroup::" + sleep 30 + + echo "::group::validate_megaservice" validate_megaservice - # validate_frontend + echo "::endgroup::" + + echo "::group::stop_docker" stop_docker + echo "::endgroup::" - echo y | docker system prune + docker system prune -f } diff --git a/AvatarChatbot/tests/test_compose_on_xeon.sh b/AvatarChatbot/tests/test_compose_on_xeon.sh index ed7bc15699..cc1fc7d292 100755 --- a/AvatarChatbot/tests/test_compose_on_xeon.sh +++ b/AvatarChatbot/tests/test_compose_on_xeon.sh @@ -24,19 +24,13 @@ ip_address=$(hostname -I | awk '{print $1}') function build_docker_images() { opea_branch=${opea_branch:-"main"} - # If the opea_branch isn't main, replace the git clone branch in Dockerfile. - if [[ "${opea_branch}" != "main" ]]; then - cd $WORKPATH - OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git" - NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git" - find . -type f -name "Dockerfile*" | while read -r file; do - echo "Processing file: $file" - sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file" - done - fi cd $WORKPATH/docker_image_build git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git + pushd GenAIComps + echo "GenAIComps test commit is $(git rev-parse HEAD)" + docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile . + popd && sleep 1s echo "Build all the images with --no-cache, check docker_image_build.log for details..." service_list="avatarchatbot whisper speecht5 wav2lip animation" @@ -127,16 +121,30 @@ function stop_docker() { function main() { + + echo "::group::stop_docker" stop_docker + echo "::endgroup::" + + echo "::group::build_docker_images" if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi + echo "::endgroup::" + + echo "::group::start_services" start_services - # validate_microservices + echo "::endgroup::" + + sleep 30 + + echo "::group::validate_megaservice" validate_megaservice - # validate_frontend + echo "::endgroup::" + + echo "::group::stop_docker" stop_docker + echo "::endgroup::" - echo y | docker builder prune --all - echo y | docker image prune + docker system prune -f } From b62ffcdc315ccb8876d8786acd406a795d774f2a Mon Sep 17 00:00:00 2001 From: chensuyue Date: Wed, 14 May 2025 11:14:17 +0800 Subject: [PATCH 2/2] remove sleep Signed-off-by: chensuyue --- AvatarChatbot/tests/test_compose_on_rocm.sh | 2 -- AvatarChatbot/tests/test_compose_on_xeon.sh | 2 -- 2 files changed, 4 deletions(-) diff --git a/AvatarChatbot/tests/test_compose_on_rocm.sh b/AvatarChatbot/tests/test_compose_on_rocm.sh index b796e2f735..514921f6e2 100644 --- a/AvatarChatbot/tests/test_compose_on_rocm.sh +++ b/AvatarChatbot/tests/test_compose_on_rocm.sh @@ -162,8 +162,6 @@ function main() { start_services echo "::endgroup::" - sleep 30 - echo "::group::validate_megaservice" validate_megaservice echo "::endgroup::" diff --git a/AvatarChatbot/tests/test_compose_on_xeon.sh b/AvatarChatbot/tests/test_compose_on_xeon.sh index cc1fc7d292..8e9a04535b 100755 --- a/AvatarChatbot/tests/test_compose_on_xeon.sh +++ b/AvatarChatbot/tests/test_compose_on_xeon.sh @@ -134,8 +134,6 @@ function main() { start_services echo "::endgroup::" - sleep 30 - echo "::group::validate_megaservice" validate_megaservice echo "::endgroup::"