Skip to content

Commit 410df80

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

File tree

5 files changed

+63
-43
lines changed

5 files changed

+63
-43
lines changed

AvatarChatbot/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Copyright (C) 2024 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4+
ARG IMAGE_REPO=opea
45
ARG BASE_TAG=latest
5-
FROM opea/comps-base:$BASE_TAG
6+
FROM $IMAGE_REPO/comps-base:$BASE_TAG
67

78
COPY ./avatarchatbot.py $HOME/avatarchatbot.py
89

AvatarChatbot/docker_image_build/build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
avatarchatbot:
66
build:
77
args:
8+
IMAGE_REPO: ${REGISTRY:-opea}
9+
BASE_TAG: ${TAG:-latest}
810
http_proxy: ${http_proxy}
911
https_proxy: ${https_proxy}
1012
no_proxy: ${no_proxy}

AvatarChatbot/tests/test_compose_on_gaudi.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,13 @@ ip_address=$(hostname -I | awk '{print $1}')
2424

2525
function build_docker_images() {
2626
opea_branch=${opea_branch:-"main"}
27-
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
28-
if [[ "${opea_branch}" != "main" ]]; then
29-
cd $WORKPATH
30-
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
31-
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
32-
find . -type f -name "Dockerfile*" | while read -r file; do
33-
echo "Processing file: $file"
34-
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
35-
done
36-
fi
3727

3828
cd $WORKPATH/docker_image_build
3929
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
30+
pushd GenAIComps
31+
echo "GenAIComps test commit is $(git rev-parse HEAD)"
32+
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
33+
popd && sleep 1s
4034

4135
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
4236
service_list="avatarchatbot whisper-gaudi speecht5-gaudi wav2lip-gaudi animation"
@@ -128,19 +122,29 @@ function stop_docker() {
128122

129123

130124
function main() {
125+
echo "::group::stop_docker"
131126
stop_docker
132-
echo y | docker builder prune --all
133-
echo y | docker image prune
127+
echo "::endgroup::"
128+
docker builder prune --all -f
129+
docker image prune -f
134130

131+
echo "::group::build_docker_images"
135132
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
133+
echo "::endgroup::"
134+
135+
echo "::group::start_services"
136136
start_services
137-
# validate_microservices
137+
echo "::endgroup::"
138+
139+
echo "::group::validate_megaservice"
138140
validate_megaservice
139-
# validate_frontend
141+
echo "::endgroup::"
140142

143+
echo "::group::stop_docker"
141144
stop_docker
142-
echo y | docker builder prune --all
143-
echo y | docker image prune
145+
echo "::endgroup::"
146+
docker builder prune --all -f
147+
docker image prune -f
144148

145149
}
146150

AvatarChatbot/tests/test_compose_on_rocm.sh

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ ip_address=$(hostname -I | awk '{print $1}')
2525
function build_docker_images() {
2626
cd $WORKPATH/docker_image_build
2727
git clone https://github.com/opea-project/GenAIComps.git && cd GenAIComps && git checkout "${opea_branch:-"main"}" && cd ../
28+
pushd GenAIComps
29+
echo "GenAIComps test commit is $(git rev-parse HEAD)"
30+
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
31+
popd && sleep 1s
2832

2933
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
3034
service_list="avatarchatbot whisper asr speecht5 tts wav2lip animation"
@@ -138,11 +142,6 @@ function validate_megaservice() {
138142
}
139143

140144

141-
#function validate_frontend() {
142-
143-
#}
144-
145-
146145
function stop_docker() {
147146
cd $WORKPATH/docker_compose/amd/gpu/rocm
148147
docker compose down && docker compose rm -f
@@ -151,19 +150,27 @@ function stop_docker() {
151150

152151
function main() {
153152

154-
echo $OPENAI_API_KEY
155-
echo $OPENAI_KEY
156-
153+
echo "::group::stop_docker"
157154
stop_docker
155+
echo "::endgroup::"
156+
157+
echo "::group::build_docker_images"
158158
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
159+
echo "::endgroup::"
160+
161+
echo "::group::start_services"
159162
start_services
160-
# validate_microservices
161-
sleep 30
163+
echo "::endgroup::"
164+
165+
echo "::group::validate_megaservice"
162166
validate_megaservice
163-
# validate_frontend
167+
echo "::endgroup::"
168+
169+
echo "::group::stop_docker"
164170
stop_docker
171+
echo "::endgroup::"
165172

166-
echo y | docker system prune
173+
docker system prune -f
167174

168175
}
169176

AvatarChatbot/tests/test_compose_on_xeon.sh

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,13 @@ ip_address=$(hostname -I | awk '{print $1}')
2424

2525
function build_docker_images() {
2626
opea_branch=${opea_branch:-"main"}
27-
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
28-
if [[ "${opea_branch}" != "main" ]]; then
29-
cd $WORKPATH
30-
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
31-
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
32-
find . -type f -name "Dockerfile*" | while read -r file; do
33-
echo "Processing file: $file"
34-
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
35-
done
36-
fi
3727

3828
cd $WORKPATH/docker_image_build
3929
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
30+
pushd GenAIComps
31+
echo "GenAIComps test commit is $(git rev-parse HEAD)"
32+
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
33+
popd && sleep 1s
4034

4135
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
4236
service_list="avatarchatbot whisper speecht5 wav2lip animation"
@@ -127,16 +121,28 @@ function stop_docker() {
127121

128122

129123
function main() {
124+
125+
echo "::group::stop_docker"
130126
stop_docker
127+
echo "::endgroup::"
128+
129+
echo "::group::build_docker_images"
131130
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
131+
echo "::endgroup::"
132+
133+
echo "::group::start_services"
132134
start_services
133-
# validate_microservices
135+
echo "::endgroup::"
136+
137+
echo "::group::validate_megaservice"
134138
validate_megaservice
135-
# validate_frontend
139+
echo "::endgroup::"
140+
141+
echo "::group::stop_docker"
136142
stop_docker
143+
echo "::endgroup::"
137144

138-
echo y | docker builder prune --all
139-
echo y | docker image prune
145+
docker system prune -f
140146

141147
}
142148

0 commit comments

Comments
 (0)