From 8eac02e58bfbcda79b3848f5758801e93da37ea4 Mon Sep 17 00:00:00 2001 From: "chen, suyue" Date: Wed, 14 May 2025 17:12:09 +0800 Subject: [PATCH] [CICD enhance] DBQnA run CI with latest base image, group logs in GHA outputs. (#1931) Signed-off-by: chensuyue --- DBQnA/docker_image_build/build.yaml | 6 ++--- DBQnA/tests/test_compose_on_rocm.sh | 34 ++++++++++++++++++++++++----- DBQnA/tests/test_compose_on_xeon.sh | 25 ++++++++++++++++----- 3 files changed, 51 insertions(+), 14 deletions(-) diff --git a/DBQnA/docker_image_build/build.yaml b/DBQnA/docker_image_build/build.yaml index 4c4cc9e3f..11d7f518b 100644 --- a/DBQnA/docker_image_build/build.yaml +++ b/DBQnA/docker_image_build/build.yaml @@ -7,6 +7,8 @@ services: context: GenAIComps dockerfile: comps/text2sql/src/Dockerfile args: + IMAGE_REPO: ${REGISTRY:-opea} + BASE_TAG: ${TAG:-latest} http_proxy: ${http_proxy} https_proxy: ${https_proxy} no_proxy: ${no_proxy} @@ -16,8 +18,6 @@ services: context: ../ui dockerfile: ./docker/Dockerfile.react args: - http_proxy: ${http_proxy} - https_proxy: ${https_proxy} - no_proxy: ${no_proxy} texttosql_url: ${build_texttosql_url} + extends: text2sql image: ${REGISTRY:-opea}/text2sql-react-ui:${TAG:-latest} diff --git a/DBQnA/tests/test_compose_on_rocm.sh b/DBQnA/tests/test_compose_on_rocm.sh index df83d4fbe..e2dc0b81d 100644 --- a/DBQnA/tests/test_compose_on_rocm.sh +++ b/DBQnA/tests/test_compose_on_rocm.sh @@ -4,6 +4,13 @@ set -xe +IMAGE_REPO=${IMAGE_REPO:-"opea"} +IMAGE_TAG=${IMAGE_TAG:-"latest"} +echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}" +echo "TAG=IMAGE_TAG=${IMAGE_TAG}" +export REGISTRY=${IMAGE_REPO} +export TAG=${IMAGE_TAG} + WORKPATH=$(dirname "$PWD") LOG_PATH="$WORKPATH/tests" ip_address=$(hostname -I | awk '{print $1}') @@ -25,7 +32,7 @@ function build_docker_images() { docker images && sleep 1s } -function start_service() { +function start_services() { cd "$WORKPATH"/docker_compose/amd/gpu/rocm # Start Docker Containers docker compose up -d > "${LOG_PATH}"/start_services_with_compose.log @@ -95,16 +102,31 @@ function stop_docker() { function main() { + echo "::group::stop_docker" stop_docker + echo "::endgroup::" - build_docker_images - start_service - sleep 10s + 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_microservice" validate_microservice - validate_frontend + 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/DBQnA/tests/test_compose_on_xeon.sh b/DBQnA/tests/test_compose_on_xeon.sh index 751d3ac24..c410cc48f 100755 --- a/DBQnA/tests/test_compose_on_xeon.sh +++ b/DBQnA/tests/test_compose_on_xeon.sh @@ -27,7 +27,7 @@ function build_docker_images() { docker images && sleep 1s } -function start_service() { +function start_services() { cd $WORKPATH/docker_compose/intel/cpu/xeon source ./set_env.sh @@ -101,16 +101,31 @@ function stop_docker() { function main() { + echo "::group::stop_docker" stop_docker + echo "::endgroup::" - build_docker_images - start_service + 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_microservice" validate_microservice - validate_frontend + 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 }