Skip to content

Commit 7f55b5a

Browse files
authored
Specify image build list for VisualQnA (opea-project#1967)
Signed-off-by: chensuyue <suyue.chen@intel.com>
1 parent bb9ec6e commit 7f55b5a

10 files changed

Lines changed: 176 additions & 82 deletions

.github/workflows/_run-docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ jobs:
204204
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid && sleep 1s; fi
205205
206206
echo "Cleaning up images ..."
207+
df -h
208+
sleep 1
209+
docker system df
210+
sleep 1
207211
if [[ "${{ inputs.hardware }}" == "xeon"* ]]; then
208212
docker system prune -a -f
209213
else
@@ -213,7 +217,13 @@ jobs:
213217
docker images --filter reference="opea/comps-base" -q | xargs -r docker rmi && sleep 1s
214218
docker system prune -f
215219
fi
220+
sleep 5
216221
docker images
222+
sleep 1
223+
df -h
224+
sleep 1
225+
docker system df
226+
sleep 1
217227
218228
- name: Publish pipeline artifact
219229
if: ${{ !cancelled() }}

ChatQnA/tests/test_compose_mariadb_on_xeon.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function validate_megaservice() {
140140

141141
function stop_docker() {
142142
cd $WORKPATH/docker_compose/intel/cpu/xeon
143-
docker compose down
143+
docker compose -f compose_mariadb.yaml down
144144
}
145145

146146
function main() {

VisualQnA/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 ./visualqna.py $HOME/visualqna.py
89

VisualQnA/docker_image_build/build.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
visualqna:
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}
@@ -33,4 +35,17 @@ services:
3335
build:
3436
context: GenAIComps
3537
dockerfile: comps/third_parties/vllm/src/Dockerfile.amd_gpu
38+
extends: visualqna
3639
image: ${REGISTRY:-opea}/vllm-rocm:${TAG:-latest}
40+
vllm:
41+
build:
42+
context: vllm
43+
dockerfile: docker/Dockerfile.cpu
44+
extends: visualqna
45+
image: ${REGISTRY:-opea}/vllm:${TAG:-latest}
46+
vllm-gaudi:
47+
build:
48+
context: vllm-fork
49+
dockerfile: Dockerfile.hpu
50+
extends: visualqna
51+
image: ${REGISTRY:-opea}/vllm-gaudi:${TAG:-latest}

VisualQnA/tests/test_compose_on_gaudi.sh

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@ LOG_PATH="$WORKPATH/tests"
1818
ip_address=$(hostname -I | awk '{print $1}')
1919

2020
function build_docker_images() {
21+
opea_branch=${opea_branch:-"main"}
2122
cd $WORKPATH/docker_image_build
22-
git clone --depth 1 --branch main https://github.com/opea-project/GenAIComps.git
23-
docker compose -f build.yaml build --no-cache > ${LOG_PATH}/docker_image_build.log
23+
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
24+
pushd GenAIComps
25+
echo "GenAIComps test commit is $(git rev-parse HEAD)"
26+
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
27+
popd && sleep 1s
2428

25-
git clone https://github.com/HabanaAI/vllm-fork.git
26-
cd ./vllm-fork/
27-
docker build -f Dockerfile.hpu -t opea/vllm-gaudi:${TAG} --shm-size=128g . --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy
28-
cd ..
29-
rm -rf vllm-fork
29+
git clone https://github.com/HabanaAI/vllm-fork.git && cd vllm-fork
30+
VLLM_FORK_VER=v0.6.6.post1+Gaudi-1.20.0
31+
git checkout ${VLLM_FORK_VER} &> /dev/null && cd ../
32+
33+
service_list="visualqna visualqna-ui lvm nginx vllm-gaudi"
34+
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
3035

3136
docker images && sleep 1s
3237
}
@@ -186,17 +191,31 @@ function stop_docker() {
186191

187192
function main() {
188193

194+
echo "::group::stop_docker"
189195
stop_docker
196+
echo "::endgroup::"
190197

198+
echo "::group::build_docker_images"
191199
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
200+
echo "::endgroup::"
201+
202+
echo "::group::start_services"
192203
start_services
204+
echo "::endgroup::"
193205

206+
echo "::group::validate_microservices"
194207
validate_microservices
208+
echo "::endgroup::"
209+
210+
echo "::group::validate_megaservice"
195211
validate_megaservice
196-
#validate_frontend
212+
echo "::endgroup::"
197213

214+
echo "::group::stop_docker"
198215
stop_docker
199-
echo y | docker system prune
216+
echo "::endgroup::"
217+
218+
docker system prune -f
200219

201220
}
202221

VisualQnA/tests/test_compose_on_rocm.sh

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,17 @@ export MODEL_CACHE=${model_cache:-"/var/opea/multimodalqna-service/data"}
3838

3939
function build_docker_images() {
4040
opea_branch=${opea_branch:-"main"}
41-
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
42-
if [[ "${opea_branch}" != "main" ]]; then
43-
cd $WORKPATH
44-
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
45-
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
46-
find . -type f -name "Dockerfile*" | while read -r file; do
47-
echo "Processing file: $file"
48-
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
49-
done
50-
fi
51-
5241
cd $WORKPATH/docker_image_build
5342
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
43+
pushd GenAIComps
44+
echo "GenAIComps test commit is $(git rev-parse HEAD)"
45+
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
46+
popd && sleep 1s
5447

5548
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
56-
docker compose -f build.yaml build --no-cache > ${LOG_PATH}/docker_image_build.log
49+
service_list="visualqna visualqna-ui lvm nginx"
50+
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
5751

58-
docker pull ghcr.io/huggingface/text-generation-inference:2.4.1-rocm
5952
docker images && sleep 1s
6053
}
6154

@@ -209,17 +202,31 @@ function stop_docker() {
209202

210203
function main() {
211204

205+
echo "::group::stop_docker"
212206
stop_docker
207+
echo "::endgroup::"
213208

209+
echo "::group::build_docker_images"
214210
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
211+
echo "::endgroup::"
212+
213+
echo "::group::start_services"
215214
start_services
215+
echo "::endgroup::"
216216

217+
echo "::group::validate_microservices"
217218
validate_microservices
219+
echo "::endgroup::"
220+
221+
echo "::group::validate_megaservice"
218222
validate_megaservice
219-
#validate_frontend
223+
echo "::endgroup::"
220224

225+
echo "::group::stop_docker"
221226
stop_docker
222-
echo y | docker system prune
227+
echo "::endgroup::"
228+
229+
docker system prune -f
223230

224231
}
225232

VisualQnA/tests/test_compose_on_xeon.sh

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,28 @@ LOG_PATH="$WORKPATH/tests"
1717
ip_address=$(hostname -I | awk '{print $1}')
1818

1919
function build_docker_images() {
20+
opea_branch=${opea_branch:-"main"}
2021
cd $WORKPATH/docker_image_build
21-
git clone --depth 1 --branch main https://github.com/opea-project/GenAIComps.git
22-
docker compose -f build.yaml build --no-cache > ${LOG_PATH}/docker_image_build.log
23-
24-
docker pull opea/vllm:latest
25-
docker tag opea/vllm:latest opea/vllm:${TAG}
22+
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
23+
pushd GenAIComps
24+
echo "GenAIComps test commit is $(git rev-parse HEAD)"
25+
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
26+
popd && sleep 1s
27+
git clone https://github.com/vllm-project/vllm.git && cd vllm
28+
VLLM_VER="v0.8.3"
29+
echo "Check out vLLM tag ${VLLM_VER}"
30+
git checkout ${VLLM_VER} &> /dev/null
31+
cd ../
32+
33+
service_list="visualqna visualqna-ui lvm nginx vllm"
34+
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
2635
docker images && sleep 1s
2736
}
2837

2938
function start_services() {
3039
cd $WORKPATH/docker_compose/intel/cpu/xeon/
31-
3240
source ./set_env.sh
33-
3441
sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
35-
3642
# Start Docker Containers
3743
docker compose up -d > ${LOG_PATH}/start_services_with_compose.log
3844

@@ -179,17 +185,31 @@ function stop_docker() {
179185

180186
function main() {
181187

188+
echo "::group::stop_docker"
182189
stop_docker
190+
echo "::endgroup::"
183191

192+
echo "::group::build_docker_images"
184193
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
194+
echo "::endgroup::"
195+
196+
echo "::group::start_services"
185197
start_services
198+
echo "::endgroup::"
186199

200+
echo "::group::validate_microservices"
187201
validate_microservices
202+
echo "::endgroup::"
203+
204+
echo "::group::validate_megaservice"
188205
validate_megaservice
189-
#validate_frontend
206+
echo "::endgroup::"
190207

208+
echo "::group::stop_docker"
191209
stop_docker
192-
echo y | docker system prune
210+
echo "::endgroup::"
211+
212+
docker system prune -f
193213

194214
}
195215

VisualQnA/tests/test_compose_tgi_on_gaudi.sh

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

1818
function build_docker_images() {
1919
opea_branch=${opea_branch:-"main"}
20-
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
21-
if [[ "${opea_branch}" != "main" ]]; then
22-
cd $WORKPATH
23-
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
24-
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
25-
find . -type f -name "Dockerfile*" | while read -r file; do
26-
echo "Processing file: $file"
27-
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
28-
done
29-
fi
30-
3120
cd $WORKPATH/docker_image_build
3221
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
22+
pushd GenAIComps
23+
echo "GenAIComps test commit is $(git rev-parse HEAD)"
24+
docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile .
25+
popd && sleep 1s
3326

3427
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
35-
docker compose -f build.yaml build --no-cache > ${LOG_PATH}/docker_image_build.log
28+
service_list="visualqna visualqna-ui lvm nginx"
29+
docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
3630

37-
docker pull ghcr.io/huggingface/tgi-gaudi:2.0.6
3831
docker images && sleep 1s
3932
}
4033

@@ -200,22 +193,36 @@ function validate_frontend() {
200193

201194
function stop_docker() {
202195
cd $WORKPATH/docker_compose/intel/hpu/gaudi
203-
docker compose stop && docker compose rm -f
196+
docker compose -f compose_tgi.yaml down
204197
}
205198

206199
function main() {
207200

201+
echo "::group::stop_docker"
208202
stop_docker
203+
echo "::endgroup::"
209204

205+
echo "::group::build_docker_images"
210206
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
207+
echo "::endgroup::"
208+
209+
echo "::group::start_services"
211210
start_services
211+
echo "::endgroup::"
212212

213+
echo "::group::validate_microservices"
213214
validate_microservices
215+
echo "::endgroup::"
216+
217+
echo "::group::validate_megaservice"
214218
validate_megaservice
215-
# validate_frontend
219+
echo "::endgroup::"
216220

221+
echo "::group::stop_docker"
217222
stop_docker
218-
echo y | docker system prune
223+
echo "::endgroup::"
224+
225+
docker system prune -f
219226

220227
}
221228

0 commit comments

Comments
 (0)