Skip to content

Commit 8d75f0a

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

4 files changed

Lines changed: 29 additions & 68 deletions

File tree

VideoQnA/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 ./videoqna.py $HOME/videoqna.py
89

VideoQnA/docker_compose/intel/cpu/xeon/set_env.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ popd > /dev/null
88

99
host_ip=$(hostname -I | awk '{print $1}')
1010

11-
export HF_TOKEN=${HF_TOKEN}
1211
export HF_TOKEN=${HF_TOKEN}
1312

1413
export INDEX_NAME="mega-videoqna"

VideoQnA/docker_image_build/build.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
videoqna:
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}
@@ -23,7 +25,7 @@ services:
2325
dockerfile: comps/dataprep/src/Dockerfile
2426
extends: videoqna
2527
image: ${REGISTRY:-opea}/dataprep:${TAG:-latest}
26-
embedding:
28+
embedding-multimodal-clip:
2729
build:
2830
context: GenAIComps
2931
dockerfile: comps/third_parties/clip/src/Dockerfile

VideoQnA/tests/test_compose_on_xeon.sh

Lines changed: 24 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -15,68 +15,15 @@ LOG_PATH="$WORKPATH/tests"
1515
ip_address=$(hostname -I | awk '{print $1}')
1616
export host_ip=${ip_address}
1717

18-
function setup_env() {
19-
export HF_TOKEN=${HF_TOKEN}
20-
21-
export INDEX_NAME="mega-videoqna"
22-
export LLM_DOWNLOAD="True" # Set to "False" before redeploy LVM server to avoid model download
23-
export RERANK_COMPONENT_NAME="OPEA_VIDEO_RERANKING"
24-
export LVM_COMPONENT_NAME="OPEA_VIDEO_LLAMA_LVM"
25-
export EMBEDDING_COMPONENT_NAME="OPEA_CLIP_EMBEDDING"
26-
export USECLIP=1
27-
export LOGFLAG=True
28-
29-
export EMBEDDING_SERVICE_HOST_IP=${host_ip}
30-
export LVM_SERVICE_HOST_IP=${host_ip}
31-
export MEGA_SERVICE_HOST_IP=${host_ip}
32-
export RERANK_SERVICE_HOST_IP=${host_ip}
33-
export RETRIEVER_SERVICE_HOST_IP=${host_ip}
34-
export VDMS_HOST=${host_ip}
35-
36-
export BACKEND_PORT=8888
37-
export DATAPREP_PORT=6007
38-
export EMBEDDER_PORT=6990
39-
export MULTIMODAL_CLIP_EMBEDDER_PORT=6991
40-
export LVM_PORT=9399
41-
export RERANKING_PORT=8000
42-
export RETRIEVER_PORT=7000
43-
export UI_PORT=5173
44-
export VDMS_PORT=8001
45-
export VIDEO_LLAMA_PORT=9009
46-
47-
export BACKEND_HEALTH_CHECK_ENDPOINT="http://${host_ip}:${BACKEND_PORT}/v1/health_check"
48-
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:${BACKEND_PORT}/v1/videoqna"
49-
export CLIP_EMBEDDING_ENDPOINT="http://${host_ip}:${MULTIMODAL_CLIP_EMBEDDER_PORT}"
50-
export DATAPREP_GET_FILE_ENDPOINT="http://${host_ip}:${DATAPREP_PORT}/v1/dataprep/get"
51-
export DATAPREP_GET_VIDEO_LIST_ENDPOINT="http://${host_ip}:${DATAPREP_PORT}/v1/dataprep/get_videos"
52-
export DATAPREP_INGEST_SERVICE_ENDPOINT="http://${host_ip}:${DATAPREP_PORT}/v1/dataprep/ingest_videos"
53-
export EMBEDDING_ENDPOINT="http://${host_ip}:${EMBEDDER_PORT}/v1/embeddings"
54-
export FRONTEND_ENDPOINT="http://${host_ip}:${UI_PORT}/_stcore/health"
55-
export LVM_ENDPOINT="http://${host_ip}:${VIDEO_LLAMA_PORT}"
56-
export LVM_VIDEO_ENDPOINT="http://${host_ip}:${VIDEO_LLAMA_PORT}/generate"
57-
export RERANKING_ENDPOINT="http://${host_ip}:${RERANKING_PORT}/v1/reranking"
58-
export RETRIEVER_ENDPOINT="http://${host_ip}:${RETRIEVER_PORT}/v1/retrieval"
59-
export TEI_RERANKING_ENDPOINT="http://${host_ip}:${TEI_RERANKING_PORT}"
60-
export UI_ENDPOINT="http://${host_ip}:${UI_PORT}/_stcore/health"
61-
62-
export no_proxy="${NO_PROXY},${host_ip},vdms-vector-db,dataprep-vdms-server,clip-embedding-server,reranking-tei-server,retriever-vdms-server,lvm-video-llama,lvm,videoqna-xeon-backend-server,videoqna-xeon-ui-server"
63-
}
6418

6519
function build_docker_images() {
6620
opea_branch=${opea_branch:-"main"}
67-
# If the opea_branch isn't main, replace the git clone branch in Dockerfile.
68-
if [[ "${opea_branch}" != "main" ]]; then
69-
cd $WORKPATH
70-
OLD_STRING="RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
71-
NEW_STRING="RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
72-
find . -type f -name "Dockerfile*" | while read -r file; do
73-
echo "Processing file: $file"
74-
sed -i "s|$OLD_STRING|$NEW_STRING|g" "$file"
75-
done
76-
fi
77-
7821
cd $WORKPATH/docker_image_build
79-
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git GenAIComps
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
8027

8128
# Create .cache directory for cache volume to connect (avoids permission denied error)
8229
OLD_STRING="mkdir -p /home/user "
@@ -88,13 +35,13 @@ function build_docker_images() {
8835
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
8936
docker compose -f build.yaml build --no-cache > ${LOG_PATH}/docker_image_build.log 2>&1
9037

91-
docker pull intellabs/vdms:latest
9238
docker images && sleep 1s
9339
}
9440

9541
function start_services() {
9642
echo "Starting services..."
9743
cd $WORKPATH/docker_compose/intel/cpu/xeon/
44+
source ./set_env.sh
9845

9946
docker volume create video-llama-model
10047
docker volume create videoqna-cache
@@ -331,23 +278,35 @@ function stop_docker() {
331278

332279
function main() {
333280

334-
setup_env
281+
echo "::group::stop_docker"
335282
stop_docker
283+
echo "::endgroup::"
336284

285+
echo "::group::build_docker_images"
337286
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
287+
echo "::endgroup::"
338288

339-
start_time=$(date +%s)
289+
echo "::group::start_services"
340290
start_services
341-
end_time=$(date +%s)
342-
duration=$((end_time-start_time))
343-
echo "Mega service start duration is $duration s" && sleep 1s
291+
echo "::endgroup::"
344292

293+
echo "::group::validate_microservices"
345294
validate_microservices
295+
echo "::endgroup::"
296+
297+
echo "::group::validate_megaservice"
346298
validate_megaservice
299+
echo "::endgroup::"
300+
301+
echo "::group::validate_frontend"
347302
validate_frontend
303+
echo "::endgroup::"
348304

305+
echo "::group::stop_docker"
349306
stop_docker
350-
echo y | docker system prune
307+
echo "::endgroup::"
308+
309+
docker system prune -f
351310

352311
}
353312

0 commit comments

Comments
 (0)