[CICD enhance] DBQnA run CI with latest base image, group logs in GHA outputs. (#1931)

Signed-off-by: chensuyue <suyue.chen@intel.com>
This commit is contained in:
chen, suyue
2025-05-14 17:12:09 +08:00
committed by GitHub
parent 9f80a18cb5
commit 8eac02e58b
3 changed files with 51 additions and 14 deletions

View File

@@ -7,6 +7,8 @@ services:
context: GenAIComps context: GenAIComps
dockerfile: comps/text2sql/src/Dockerfile dockerfile: comps/text2sql/src/Dockerfile
args: args:
IMAGE_REPO: ${REGISTRY:-opea}
BASE_TAG: ${TAG:-latest}
http_proxy: ${http_proxy} http_proxy: ${http_proxy}
https_proxy: ${https_proxy} https_proxy: ${https_proxy}
no_proxy: ${no_proxy} no_proxy: ${no_proxy}
@@ -16,8 +18,6 @@ services:
context: ../ui context: ../ui
dockerfile: ./docker/Dockerfile.react dockerfile: ./docker/Dockerfile.react
args: args:
http_proxy: ${http_proxy}
https_proxy: ${https_proxy}
no_proxy: ${no_proxy}
texttosql_url: ${build_texttosql_url} texttosql_url: ${build_texttosql_url}
extends: text2sql
image: ${REGISTRY:-opea}/text2sql-react-ui:${TAG:-latest} image: ${REGISTRY:-opea}/text2sql-react-ui:${TAG:-latest}

View File

@@ -4,6 +4,13 @@
set -xe 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") WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests" LOG_PATH="$WORKPATH/tests"
ip_address=$(hostname -I | awk '{print $1}') ip_address=$(hostname -I | awk '{print $1}')
@@ -25,7 +32,7 @@ function build_docker_images() {
docker images && sleep 1s docker images && sleep 1s
} }
function start_service() { function start_services() {
cd "$WORKPATH"/docker_compose/amd/gpu/rocm cd "$WORKPATH"/docker_compose/amd/gpu/rocm
# Start Docker Containers # Start Docker Containers
docker compose up -d > "${LOG_PATH}"/start_services_with_compose.log docker compose up -d > "${LOG_PATH}"/start_services_with_compose.log
@@ -95,16 +102,31 @@ function stop_docker() {
function main() { function main() {
echo "::group::stop_docker"
stop_docker stop_docker
echo "::endgroup::"
build_docker_images echo "::group::build_docker_images"
start_service if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
sleep 10s echo "::endgroup::"
echo "::group::start_services"
start_services
echo "::endgroup::"
echo "::group::validate_microservice"
validate_microservice validate_microservice
validate_frontend echo "::endgroup::"
echo "::group::validate_frontend"
validate_frontend
echo "::endgroup::"
echo "::group::stop_docker"
stop_docker stop_docker
echo y | docker system prune echo "::endgroup::"
docker system prune -f
} }

View File

@@ -27,7 +27,7 @@ function build_docker_images() {
docker images && sleep 1s docker images && sleep 1s
} }
function start_service() { function start_services() {
cd $WORKPATH/docker_compose/intel/cpu/xeon cd $WORKPATH/docker_compose/intel/cpu/xeon
source ./set_env.sh source ./set_env.sh
@@ -101,16 +101,31 @@ function stop_docker() {
function main() { function main() {
echo "::group::stop_docker"
stop_docker stop_docker
echo "::endgroup::"
build_docker_images echo "::group::build_docker_images"
start_service 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_microservice
validate_frontend echo "::endgroup::"
echo "::group::validate_frontend"
validate_frontend
echo "::endgroup::"
echo "::group::stop_docker"
stop_docker stop_docker
echo y | docker system prune echo "::endgroup::"
docker system prune -f
} }