Skip to content

Commit 2f44f83

Browse files
authored
[CICD enhance] GraphRAG run CI with latest base image, group logs in GHA outputs. (#2051)
Signed-off-by: chensuyue <suyue.chen@intel.com>
1 parent bc03ba2 commit 2f44f83

3 files changed

Lines changed: 31 additions & 21 deletions

File tree

GraphRAG/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 ./graphrag.py $HOME/graphrag.py
89

GraphRAG/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
graphrag:
66
build:
77
args:
8+
IMAGE_REPO: ${REGISTRY}
9+
BASE_TAG: ${TAG}
810
http_proxy: ${http_proxy}
911
https_proxy: ${https_proxy}
1012
no_proxy: ${no_proxy}

GraphRAG/tests/test_compose_on_gaudi.sh

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,17 @@ export host_ip=$(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
3020

3121
cd $WORKPATH/docker_image_build
3222
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
3327

3428
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
29+
docker compose -f build.yaml build --no-cache > ${LOG_PATH}/docker_image_build.log 2>&1
3630

37-
docker pull ghcr.io/huggingface/tgi-gaudi:2.3.1
38-
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.6
3931
docker images && sleep 1s
4032
}
4133

@@ -49,7 +41,7 @@ function start_services() {
4941

5042
n=0
5143
until [[ "$n" -ge 100 ]]; do
52-
docker logs tgi-gaudi-server > ${LOG_PATH}/tgi_service_start.log
44+
docker logs tgi-gaudi-server > ${LOG_PATH}/tgi_service_start.log 2>&1
5345
if grep -q Connected ${LOG_PATH}/tgi_service_start.log; then
5446
break
5547
fi
@@ -191,25 +183,40 @@ function validate_frontend() {
191183

192184
function stop_docker() {
193185
cd $WORKPATH/docker_compose/intel/hpu/gaudi
194-
docker compose -f compose.yaml stop && docker compose -f compose.yaml rm -f
186+
docker compose -f compose.yaml down
195187
}
196188

197189
function main() {
198190

191+
echo "::group::stop_docker"
199192
stop_docker
193+
echo "::endgroup::"
194+
195+
echo "::group::build_docker_images"
200196
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
201-
start_time=$(date +%s)
197+
echo "::endgroup::"
198+
199+
echo "::group::start_services"
202200
start_services
203-
end_time=$(date +%s)
204-
duration=$((end_time-start_time))
205-
echo "Mega service start duration is $duration s"
201+
echo "::endgroup::"
206202

203+
echo "::group::validate_microservices"
207204
validate_microservices
205+
echo "::endgroup::"
206+
207+
echo "::group::validate_megaservice"
208208
validate_megaservice
209+
echo "::endgroup::"
210+
211+
echo "::group::validate_frontend"
209212
validate_frontend
213+
echo "::endgroup::"
210214

215+
echo "::group::stop_docker"
211216
stop_docker
212-
echo y | docker system prune
217+
echo "::endgroup::"
218+
219+
docker system prune -f
213220

214221
}
215222

0 commit comments

Comments
 (0)