Skip to content

Commit 8eac02e

Browse files
authored
[CICD enhance] DBQnA run CI with latest base image, group logs in GHA outputs. (#1931)
Signed-off-by: chensuyue <suyue.chen@intel.com>
1 parent 9f80a18 commit 8eac02e

File tree

3 files changed

+49
-12
lines changed

3 files changed

+49
-12
lines changed

DBQnA/docker_image_build/build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
context: GenAIComps
88
dockerfile: comps/text2sql/src/Dockerfile
99
args:
10+
IMAGE_REPO: ${REGISTRY:-opea}
11+
BASE_TAG: ${TAG:-latest}
1012
http_proxy: ${http_proxy}
1113
https_proxy: ${https_proxy}
1214
no_proxy: ${no_proxy}
@@ -16,8 +18,6 @@ services:
1618
context: ../ui
1719
dockerfile: ./docker/Dockerfile.react
1820
args:
19-
http_proxy: ${http_proxy}
20-
https_proxy: ${https_proxy}
21-
no_proxy: ${no_proxy}
2221
texttosql_url: ${build_texttosql_url}
22+
extends: text2sql
2323
image: ${REGISTRY:-opea}/text2sql-react-ui:${TAG:-latest}

DBQnA/tests/test_compose_on_rocm.sh

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
set -xe
66

7+
IMAGE_REPO=${IMAGE_REPO:-"opea"}
8+
IMAGE_TAG=${IMAGE_TAG:-"latest"}
9+
echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
10+
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
11+
export REGISTRY=${IMAGE_REPO}
12+
export TAG=${IMAGE_TAG}
13+
714
WORKPATH=$(dirname "$PWD")
815
LOG_PATH="$WORKPATH/tests"
916
ip_address=$(hostname -I | awk '{print $1}')
@@ -25,7 +32,7 @@ function build_docker_images() {
2532
docker images && sleep 1s
2633
}
2734

28-
function start_service() {
35+
function start_services() {
2936
cd "$WORKPATH"/docker_compose/amd/gpu/rocm
3037
# Start Docker Containers
3138
docker compose up -d > "${LOG_PATH}"/start_services_with_compose.log
@@ -95,16 +102,31 @@ function stop_docker() {
95102

96103
function main() {
97104

105+
echo "::group::stop_docker"
98106
stop_docker
107+
echo "::endgroup::"
108+
109+
echo "::group::build_docker_images"
110+
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
111+
echo "::endgroup::"
112+
113+
echo "::group::start_services"
114+
start_services
115+
echo "::endgroup::"
99116

100-
build_docker_images
101-
start_service
102-
sleep 10s
117+
echo "::group::validate_microservice"
103118
validate_microservice
119+
echo "::endgroup::"
120+
121+
echo "::group::validate_frontend"
104122
validate_frontend
123+
echo "::endgroup::"
105124

125+
echo "::group::stop_docker"
106126
stop_docker
107-
echo y | docker system prune
127+
echo "::endgroup::"
128+
129+
docker system prune -f
108130

109131
}
110132

DBQnA/tests/test_compose_on_xeon.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function build_docker_images() {
2727
docker images && sleep 1s
2828
}
2929

30-
function start_service() {
30+
function start_services() {
3131
cd $WORKPATH/docker_compose/intel/cpu/xeon
3232
source ./set_env.sh
3333

@@ -101,16 +101,31 @@ function stop_docker() {
101101

102102
function main() {
103103

104+
echo "::group::stop_docker"
104105
stop_docker
106+
echo "::endgroup::"
105107

106-
build_docker_images
107-
start_service
108+
echo "::group::build_docker_images"
109+
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
110+
echo "::endgroup::"
108111

112+
echo "::group::start_services"
113+
start_services
114+
echo "::endgroup::"
115+
116+
echo "::group::validate_microservice"
109117
validate_microservice
118+
echo "::endgroup::"
119+
120+
echo "::group::validate_frontend"
110121
validate_frontend
122+
echo "::endgroup::"
111123

124+
echo "::group::stop_docker"
112125
stop_docker
113-
echo y | docker system prune
126+
echo "::endgroup::"
127+
128+
docker system prune -f
114129

115130
}
116131

0 commit comments

Comments
 (0)