Add image build job in docker compose e2e xeon test in CI (#304)

Signed-off-by: Yingchun Guo <yingchun.guo@intel.com>
This commit is contained in:
Ying Chun Guo
2024-06-19 15:24:27 +08:00
committed by GitHub
parent a1a384e1fa
commit a0b94b5401
9 changed files with 81 additions and 114 deletions

View File

@@ -8,22 +8,6 @@ WORKPATH=$(dirname "$PWD")
LOG_PATH="$WORKPATH/tests"
ip_address=$(hostname -I | awk '{print $1}')
function build_docker_images() {
cd $WORKPATH
git clone https://github.com/opea-project/GenAIComps.git
cd GenAIComps
docker build -t opea/llm-tgi:latest -f comps/llms/text-generation/tgi/Dockerfile .
cd $WORKPATH/docker
docker build --no-cache -t opea/codegen:latest -f Dockerfile .
cd $WORKPATH/docker/ui
docker build --no-cache -t opea/codegen-ui:latest -f docker/Dockerfile .
docker images
}
function start_services() {
cd $WORKPATH/docker/xeon
@@ -36,8 +20,12 @@ function start_services() {
sed -i "s/backend_address/$ip_address/g" $WORKPATH/docker/ui/svelte/.env
# Replace the container name with a test-specific name
echo "using image repository $IMAGE_REPO and image tag $IMAGE_TAG"
sed -i "s#image: opea/codegen:latest#image: opea/codegen:${IMAGE_TAG}#g" docker_compose.yaml
sed -i "s#image: opea/codegen-ui:latest#image: opea/codegen-ui:${IMAGE_TAG}#g" docker_compose.yaml
sed -i "s#image: opea/*#image: ${IMAGE_REPO}opea/#g" docker_compose.yaml
# Start Docker Containers
# TODO: Replace the container name with a test-specific name
docker compose -f docker_compose.yaml up -d
sleep 2m # Waits 2 minutes
@@ -140,7 +128,6 @@ function main() {
stop_docker
build_docker_images
start_services
validate_microservices