@@ -17,25 +17,17 @@ export host_ip=$(hostname -I | awk '{print $1}')
1717
1818function 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
192184function 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
197189function 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