From d9984c27ba8f9494cbd94021b2756d9019c787fa Mon Sep 17 00:00:00 2001 From: chensuyue Date: Mon, 12 May 2025 10:50:09 +0800 Subject: [PATCH] Group log lines in GHA outputs for better readable logs. Signed-off-by: chensuyue --- CodeTrans/Dockerfile | 3 +- CodeTrans/docker_image_build/build.yaml | 3 ++ CodeTrans/tests/test_compose_on_gaudi.sh | 35 ++++++++++++++------ CodeTrans/tests/test_compose_on_rocm.sh | 34 +++++++++++++------ CodeTrans/tests/test_compose_on_xeon.sh | 35 ++++++++++++++------ CodeTrans/tests/test_compose_tgi_on_gaudi.sh | 34 +++++++++++++------ CodeTrans/tests/test_compose_tgi_on_xeon.sh | 34 +++++++++++++------ CodeTrans/tests/test_compose_vllm_on_rocm.sh | 34 +++++++++++++------ 8 files changed, 145 insertions(+), 67 deletions(-) diff --git a/CodeTrans/Dockerfile b/CodeTrans/Dockerfile index 786cbcd243..21f9b1633c 100644 --- a/CodeTrans/Dockerfile +++ b/CodeTrans/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 ./code_translation.py $HOME/code_translation.py diff --git a/CodeTrans/docker_image_build/build.yaml b/CodeTrans/docker_image_build/build.yaml index 2ff45e3812..b230d1d4ec 100644 --- a/CodeTrans/docker_image_build/build.yaml +++ b/CodeTrans/docker_image_build/build.yaml @@ -5,6 +5,8 @@ services: codetrans: build: args: + IMAGE_REPO: ${REGISTRY:-opea} + BASE_TAG: ${TAG:-latest} http_proxy: ${http_proxy} https_proxy: ${https_proxy} no_proxy: ${no_proxy} @@ -45,4 +47,5 @@ services: build: context: GenAIComps dockerfile: comps/third_parties/vllm/src/Dockerfile.amd_gpu + extends: codetrans image: ${REGISTRY:-opea}/vllm-rocm:${TAG:-latest} diff --git a/CodeTrans/tests/test_compose_on_gaudi.sh b/CodeTrans/tests/test_compose_on_gaudi.sh index 41472244ac..7b0baa6602 100644 --- a/CodeTrans/tests/test_compose_on_gaudi.sh +++ b/CodeTrans/tests/test_compose_on_gaudi.sh @@ -17,19 +17,14 @@ 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 + git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork VLLM_FORK_VER=v0.6.6.post1+Gaudi-1.20.0 git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../ @@ -160,17 +155,35 @@ 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 + echo "::endgroup::" + echo "::group::validate_microservices" validate_microservices + echo "::endgroup::" + + echo "::group::validate_megaservice" validate_megaservice + echo "::endgroup::" + + echo "::group::validate_frontend" validate_frontend + echo "::endgroup::" + echo "::group::stop_docker" stop_docker - echo y | docker system prune + echo "::endgroup::" + + docker system prune -f } diff --git a/CodeTrans/tests/test_compose_on_rocm.sh b/CodeTrans/tests/test_compose_on_rocm.sh index ef429636ba..ecc6a4fdfc 100644 --- a/CodeTrans/tests/test_compose_on_rocm.sh +++ b/CodeTrans/tests/test_compose_on_rocm.sh @@ -18,19 +18,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="codetrans codetrans-ui llm-textgen nginx" @@ -161,17 +155,35 @@ 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 + echo "::endgroup::" + echo "::group::validate_microservices" validate_microservices + echo "::endgroup::" + + echo "::group::validate_megaservice" validate_megaservice + echo "::endgroup::" + + echo "::group::validate_frontend" validate_frontend + echo "::endgroup::" + echo "::group::stop_docker" stop_docker - echo y | docker system prune + echo "::endgroup::" + + docker system prune -f } diff --git a/CodeTrans/tests/test_compose_on_xeon.sh b/CodeTrans/tests/test_compose_on_xeon.sh index 4deb89fe00..54ae5ee0ca 100644 --- a/CodeTrans/tests/test_compose_on_xeon.sh +++ b/CodeTrans/tests/test_compose_on_xeon.sh @@ -17,19 +17,14 @@ 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 + git clone https://github.com/vllm-project/vllm.git && cd vllm VLLM_VER="v0.8.3" echo "Check out vLLM tag ${VLLM_VER}" @@ -163,17 +158,35 @@ 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 + echo "::endgroup::" + echo "::group::validate_microservices" validate_microservices + echo "::endgroup::" + + echo "::group::validate_megaservice" validate_megaservice + echo "::endgroup::" + + echo "::group::validate_frontend" validate_frontend + echo "::endgroup::" + echo "::group::stop_docker" stop_docker - echo y | docker system prune + echo "::endgroup::" + + docker system prune -f } diff --git a/CodeTrans/tests/test_compose_tgi_on_gaudi.sh b/CodeTrans/tests/test_compose_tgi_on_gaudi.sh index cb4bb53659..5914dc29ce 100644 --- a/CodeTrans/tests/test_compose_tgi_on_gaudi.sh +++ b/CodeTrans/tests/test_compose_tgi_on_gaudi.sh @@ -17,19 +17,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="codetrans codetrans-ui llm-textgen nginx" @@ -167,17 +161,35 @@ 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 + echo "::endgroup::" + echo "::group::validate_microservices" validate_microservices + echo "::endgroup::" + + echo "::group::validate_megaservice" validate_megaservice + echo "::endgroup::" + + echo "::group::validate_frontend" validate_frontend + echo "::endgroup::" + echo "::group::stop_docker" stop_docker - echo y | docker system prune + echo "::endgroup::" + + docker system prune -f } diff --git a/CodeTrans/tests/test_compose_tgi_on_xeon.sh b/CodeTrans/tests/test_compose_tgi_on_xeon.sh index 57bd46348f..99a4f6a7d0 100644 --- a/CodeTrans/tests/test_compose_tgi_on_xeon.sh +++ b/CodeTrans/tests/test_compose_tgi_on_xeon.sh @@ -17,19 +17,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="codetrans codetrans-ui llm-textgen nginx" @@ -167,17 +161,35 @@ 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 + echo "::endgroup::" + echo "::group::validate_microservices" validate_microservices + echo "::endgroup::" + + echo "::group::validate_megaservice" validate_megaservice + echo "::endgroup::" + + echo "::group::validate_frontend" validate_frontend + echo "::endgroup::" + echo "::group::stop_docker" stop_docker - echo y | docker system prune + echo "::endgroup::" + + docker system prune -f } diff --git a/CodeTrans/tests/test_compose_vllm_on_rocm.sh b/CodeTrans/tests/test_compose_vllm_on_rocm.sh index 558a3a02ad..2ef8709607 100644 --- a/CodeTrans/tests/test_compose_vllm_on_rocm.sh +++ b/CodeTrans/tests/test_compose_vllm_on_rocm.sh @@ -17,19 +17,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="vllm-rocm llm-textgen codetrans codetrans-ui nginx" @@ -160,17 +154,35 @@ 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 + echo "::endgroup::" + echo "::group::validate_microservices" validate_microservices + echo "::endgroup::" + + echo "::group::validate_megaservice" validate_megaservice + echo "::endgroup::" + + echo "::group::validate_frontend" validate_frontend + echo "::endgroup::" + echo "::group::stop_docker" stop_docker - echo y | docker system prune + echo "::endgroup::" + + docker system prune -f }