@@ -18,25 +18,18 @@ export PATH="~/miniconda3/bin:$PATH"
1818
1919function build_docker_images() {
2020 opea_branch=${opea_branch:- " main" }
21- # If the opea_branch isn't main, replace the git clone branch in Dockerfile.
22- if [[ " ${opea_branch} " != " main" ]]; then
23- cd $WORKPATH
24- OLD_STRING=" RUN git clone --depth 1 https://github.com/opea-project/GenAIComps.git"
25- NEW_STRING=" RUN git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git"
26- find . -type f -name " Dockerfile*" | while read -r file; do
27- echo " Processing file: $file "
28- sed -i " s|$OLD_STRING |$NEW_STRING |g" " $file "
29- done
30- fi
3121
3222 cd $WORKPATH /docker_image_build
3323 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
3428
3529 echo " Build all the images with --no-cache, check docker_image_build.log for details..."
3630 service_list=" audioqna audioqna-ui whisper speecht5"
3731 docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH} /docker_image_build.log
38- echo " docker pull ghcr.io/huggingface/text-generation-inference:2.4.1-rocm"
39- docker pull ghcr.io/huggingface/text-generation-inference:2.4.1-rocm
32+
4033 docker images && sleep 1s
4134}
4235
@@ -56,8 +49,6 @@ function start_services() {
5649
5750 export BACKEND_SERVICE_ENDPOINT=http://${ip_address} :3008/v1/audioqna
5851
59- # sed -i "s/backend_address/$ip_address/g" $WORKPATH/ui/svelte/.env
60-
6152 # Start Docker Containers
6253 docker compose up -d > ${LOG_PATH} /start_services_with_compose.log
6354 n=0
@@ -88,49 +79,33 @@ function validate_megaservice() {
8879
8980}
9081
91- # function validate_frontend() {
92- # Frontend tests are currently disabled
93- # cd $WORKPATH/ui/svelte
94- # local conda_env_name="OPEA_e2e"
95- # export PATH=${HOME}/miniforge3/bin/:$PATH
96- # # conda remove -n ${conda_env_name} --all -y
97- # # conda create -n ${conda_env_name} python=3.12 -y
98- # source activate ${conda_env_name}
99- #
100- # sed -i "s/localhost/$ip_address/g" playwright.config.ts
101- #
102- # # conda install -c conda-forge nodejs -y
103- # npm install && npm ci && npx playwright install --with-deps
104- # node -v && npm -v && pip list
105- #
106- # exit_status=0
107- # npx playwright test || exit_status=$?
108- #
109- # if [ $exit_status -ne 0 ]; then
110- # echo "[TEST INFO]: ---------frontend test failed---------"
111- # exit $exit_status
112- # else
113- # echo "[TEST INFO]: ---------frontend test passed---------"
114- # fi
115- # }
116-
11782function stop_docker() {
11883 cd $WORKPATH /docker_compose/amd/gpu/rocm/
11984 docker compose stop && docker compose rm -f
12085}
12186
12287function main() {
12388
89+ echo " ::group::stop_docker"
12490 stop_docker
91+ echo " ::endgroup::"
92+
93+ echo " ::group::build_docker_images"
12594 if [[ " $IMAGE_REPO " == " opea" ]]; then build_docker_images; fi
95+ echo " ::endgroup::"
96+
97+ echo " ::group::start_services"
12698 start_services
99+ echo " ::endgroup::"
127100
101+ echo " ::group::validate_megaservice"
128102 validate_megaservice
129- # Frontend tests are currently disabled
130- # validate_frontend
103+ echo " ::endgroup::"
131104
105+ echo " ::group::stop_docker"
132106 stop_docker
133- echo y | docker system prune
107+ docker system prune -f
108+ echo " ::endgroup::"
134109
135110}
136111
0 commit comments