Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve duplicate images in rerankings
Browse files Browse the repository at this point in the history
Signed-off-by: ZePan110 <ze.pan@intel.com>
ZePan110 committed Jan 3, 2025
1 parent cbcca60 commit d02cf8f
Showing 5 changed files with 16 additions and 24 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/docker/compose/reranks-compose.yaml
Original file line number Diff line number Diff line change
@@ -3,15 +3,7 @@

# this file should be run in the root of the repo
services:
reranking-tei:
reranking:
build:
dockerfile: comps/reranks/src/Dockerfile
image: ${REGISTRY:-opea}/reranking-tei:${TAG:-latest}
reranking-videoqna:
build:
dockerfile: comps/reranks/src/Dockerfile # TODO. need to update
image: ${REGISTRY:-opea}/reranking-videoqna:${TAG:-latest}
reranking-fastrag:
build:
dockerfile: comps/reranks/src/Dockerfile # TODO. need to update
image: ${REGISTRY:-opea}/reranking-fastrag:${TAG:-latest}
image: ${REGISTRY:-opea}/reranking:${TAG:-latest}
2 changes: 1 addition & 1 deletion comps/reranks/deployment/docker_compose/rerank_tei.yaml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ services:
command: --model-id ${RERANK_MODEL_ID} --hf-api-token ${HF_TOKEN}
reranking:
image: opea/reranking:latest
container_name: reranking-tei-server
container_name: reranking-server
ports:
- "8000:8000"
ipc: host
10 changes: 5 additions & 5 deletions tests/reranks/test_reranks_fastrag.sh
Original file line number Diff line number Diff line change
@@ -8,20 +8,20 @@ WORKPATH=$(dirname "$PWD")
ip_address=$(hostname -I | awk '{print $1}')
function build_docker_images() {
cd $WORKPATH
docker build --no-cache --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -t opea/reranking-fastrag:comps -f comps/reranks/fastrag/Dockerfile .
docker build --no-cache --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -t opea/reranking:comps -f comps/reranks/fastrag/Dockerfile .
if [ $? -ne 0 ]; then
echo "opea/reranking-fastrag built fail"
echo "opea/reranking built fail"
exit 1
else
echo "opea/reranking-fastrag built successful"
echo "opea/reranking built successful"
fi
}

function start_service() {
export EMBED_MODEL="Intel/bge-small-en-v1.5-rag-int8-static"
fastrag_service_port=5020
unset http_proxy
docker run -d --name="test-comps-reranking-fastrag-server" -p ${fastrag_service_port}:8000 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e EMBED_MODEL=$EMBED_MODEL opea/reranking-fastrag:comps
docker run -d --name="test-comps-reranking-server" -p ${fastrag_service_port}:8000 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e EMBED_MODEL=$EMBED_MODEL opea/reranking:comps
sleep 3m
}

@@ -35,7 +35,7 @@ function validate_microservice() {
echo "Result correct."
else
echo "Result wrong. Received was $result"
docker logs test-comps-reranking-fastrag-server
docker logs test-comps-reranking-server
exit 1
fi
}
8 changes: 4 additions & 4 deletions tests/reranks/test_reranks_opea_tei.sh
Original file line number Diff line number Diff line change
@@ -25,12 +25,12 @@ function start_service() {
model=BAAI/bge-reranker-base
revision=refs/pr/4
volume=$PWD/data
docker run -d --name="test-comps-reranking-tei-endpoint" -p $tei_endpoint:80 -v $volume:/data -e http_proxy=$http_proxy -e https_proxy=$https_proxy --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-1.5 --model-id $model
docker run -d --name="test-comps-reranking-endpoint" -p $tei_endpoint:80 -v $volume:/data -e http_proxy=$http_proxy -e https_proxy=$https_proxy --pull always ghcr.io/huggingface/text-embeddings-inference:cpu-1.5 --model-id $model
sleep 3m
export TEI_RERANKING_ENDPOINT="http://${ip_address}:${tei_endpoint}"
tei_service_port=5007
unset http_proxy
docker run -d --name="test-comps-reranking-tei-server" -e LOGFLAG=True -p ${tei_service_port}:8000 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e TEI_RERANKING_ENDPOINT=$TEI_RERANKING_ENDPOINT -e HF_TOKEN=$HF_TOKEN -e RERANK_TYPE="tei" opea/reranking:comps
docker run -d --name="test-comps-reranking-server" -e LOGFLAG=True -p ${tei_service_port}:8000 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e TEI_RERANKING_ENDPOINT=$TEI_RERANKING_ENDPOINT -e HF_TOKEN=$HF_TOKEN -e RERANK_TYPE="tei" opea/reranking:comps
sleep 15
}

@@ -45,8 +45,8 @@ function validate_microservice() {
echo "Content is as expected."
else
echo "Content does not match the expected result: $CONTENT"
docker logs test-comps-reranking-tei-server
docker logs test-comps-reranking-tei-endpoint
docker logs test-comps-reranking-server
docker logs test-comps-reranking-endpoint
exit 1
fi
}
8 changes: 4 additions & 4 deletions tests/reranks/test_reranks_videoqna.sh
Original file line number Diff line number Diff line change
@@ -9,22 +9,22 @@ ip_address=$(hostname -I | awk '{print $1}')

function build_docker_images() {
cd $WORKPATH
docker build --no-cache -t opea/reranking-videoqna:comps --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/reranks/videoqna/Dockerfile .
docker build --no-cache -t opea/reranking:comps --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/reranks/videoqna/Dockerfile .
}

function start_service() {
docker run -d --name "test-comps-reranking-videoqna-server" \
docker run -d --name "test-comps-reranking-server" \
-p 5037:8000 \
--ipc=host \
-e no_proxy=${no_proxy} \
-e http_proxy=${http_proxy} \
-e https_proxy=${https_proxy} \
-e CHUNK_DURATION=${CHUNK_DURATION} \
-e FILE_SERVER_ENDPOINT=${FILE_SERVER_ENDPOINT} \
opea/reranking-videoqna:comps
opea/reranking:comps


until docker logs test-comps-reranking-videoqna-server 2>&1 | grep -q "Uvicorn running on"; do
until docker logs test-comps-reranking-server 2>&1 | grep -q "Uvicorn running on"; do
sleep 2
done
}

0 comments on commit d02cf8f

Please sign in to comment.