Skip to content

Commit 654b325

Browse files
committed
code cleaninig
Signed-off-by: Mustafa <[email protected]>
1 parent 8493659 commit 654b325

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

tests/retrievers/test_retrievers_milvus.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ echo "TAG=${TAG}"
1313
WORKPATH=$(dirname "$PWD")
1414
LOG_PATH="$WORKPATH/tests"
1515
export host_ip=$(hostname -I | awk '{print $1}')
16-
service_name="retriever-milvus etcd minio standalone"
17-
retriever_service_name="retriever-milvus"
16+
service_name="retriever-milvus"
1817

1918
function build_docker_images() {
2019
cd $WORKPATH
@@ -28,7 +27,7 @@ function build_docker_images() {
2827
}
2928

3029
function start_service() {
31-
export MINIO_PORT1=11611
30+
export MINIO_PORT1=11611 # 11600-11699
3231
export MINIO_PORT2=11612
3332
export MILVUS_STANDALONE_PORT=11613
3433
export TEI_EMBEDDER_PORT=11614
@@ -39,6 +38,13 @@ function start_service() {
3938
export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}"
4039
export MILVUS_HOST=${host_ip}
4140

41+
# wget https://raw.githubusercontent.com/milvus-io/milvus/v2.4.9/configs/milvus.yaml
42+
# wget https://github.com/milvus-io/milvus/releases/download/v2.4.9/milvus-standalone-docker-compose.yml -O docker-compose.yml
43+
# sed '/- \${DOCKER_VOLUME_DIRECTORY:-\.}\/volumes\/milvus:\/var\/lib\/milvus/a \ \ \ \ \ \ - \${DOCKER_VOLUME_DIRECTORY:-\.}\/milvus.yaml:\/milvus\/configs\/milvus.yaml' -i docker-compose.yml
44+
45+
cd $WORKPATH/comps/third_parties/milvus/deployment/docker_compose/
46+
docker compose -f compose.yaml up -d > ${LOG_PATH}/start_services_with_compose_milvus.log
47+
4248
cd $WORKPATH/comps/retrievers/deployment/docker_compose
4349
docker compose -f compose.yaml up ${service_name} -d > ${LOG_PATH}/start_services_with_compose.log
4450

@@ -61,12 +67,12 @@ function validate_microservice() {
6167
echo "[ retriever ] Content is as expected."
6268
else
6369
echo "[ retriever ] Content does not match the expected result: $CONTENT"
64-
docker logs ${retriever_service_name} >> ${LOG_PATH}/retriever.log
70+
docker logs ${service_name} >> ${LOG_PATH}/retriever.log
6571
exit 1
6672
fi
6773
else
6874
echo "[ retriever ] HTTP status is not 200. Received status was $HTTP_STATUS"
69-
docker logs ${retriever_service_name} >> ${LOG_PATH}/retriever.log
75+
docker logs ${service_name} >> ${LOG_PATH}/retriever.log
7076
exit 1
7177
fi
7278
}

tests/retrievers/test_retrievers_neo4j_on_intel_hpu.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ function build_docker_images() {
3939
}
4040

4141
function start_service() {
42+
export NEO4J_PORT1=11631
43+
export NEO4J_PORT2=11632
4244
export TEI_EMBEDDER_PORT=11633
4345
export LLM_ENDPOINT_PORT=11634
4446
export RETRIEVER_PORT=11635
@@ -50,10 +52,7 @@ function start_service() {
5052
export LLM_MODEL_ID="meta-llama/Meta-Llama-3.1-8B-Instruct"
5153
export TGI_LLM_ENDPOINT="http://${host_ip}:${LLM_ENDPOINT_PORT}"
5254
export DATAPREP_SERVICE_ENDPOINT="http://${host_ip}:6004"
53-
export NEO4J_PORT1=7474 # 11631
54-
export NEO4J_PORT2=7687 # 11632
5555
export NEO4J_URI="bolt://${host_ip}:${NEO4J_PORT2}"
56-
export NEO4J_URL="bolt://${host_ip}:${NEO4J_PORT2}"
5756
export NEO4J_USERNAME="neo4j"
5857
export NEO4J_PASSWORD="neo4jtest"
5958
export no_proxy="localhost,127.0.0.1,"${host_ip}
@@ -66,10 +65,9 @@ function start_service() {
6665
# dataprep neo4j
6766
# Not testing openai code path since not able to provide key for cicd
6867
docker run -d --name="test-comps-retrievers-neo4j-llama-index-dataprep" -p 6004:5000 -v ./data:/data --ipc=host -e TGI_LLM_ENDPOINT=$TGI_LLM_ENDPOINT \
69-
-e TEI_EMBEDDING_ENDPOINT=$TEI_EMBEDDING_ENDPOINT -e EMBEDDING_MODEL_ID=$EMBEDDING_MODEL_ID -e LLM_MODEL_ID=$LLM_MODEL_ID -e host_ip=$host_ip -e no_proxy=$no_proxy \
68+
-e TEI_EMBEDDING_ENDPOINT=$TEI_EMBEDDING_ENDPOINT -e TEI_ENDPOINT=$TEI_EMBEDDING_ENDPOINT -e EMBEDDING_MODEL_ID=$EMBEDDING_MODEL_ID -e LLM_MODEL_ID=$LLM_MODEL_ID -e host_ip=$host_ip -e no_proxy=$no_proxy \
7069
-e http_proxy=$http_proxy -e https_proxy=$https_proxy -e NEO4J_URL="bolt://${host_ip}:${NEO4J_PORT2}" -e NEO4J_USERNAME="neo4j" \
71-
-e NEO4J_PASSWORD="neo4jtest" -e NEO4J_PORT1=$NEO4J_PORT1 -e NEO4J_PORT2=$NEO4J_PORT2 -e HF_TOKEN=$HF_TOKEN -e MAX_INPUT_TOKENS=$MAX_INPUT_TOKENS -e LOGFLAG=True \
72-
-e DATAPREP_COMPONENT_NAME="OPEA_DATAPREP_NEO4J_LLAMAINDEX" opea/dataprep-neo4j-llamaindex:comps
70+
-e NEO4J_PASSWORD="neo4jtest" -e HF_TOKEN=$HF_TOKEN -e MAX_INPUT_LEN=$MAX_INPUT_TOKENS -e LOGFLAG=True -e DATAPREP_COMPONENT_NAME="OPEA_DATAPREP_NEO4J_LLAMAINDEX" opea/dataprep-neo4j-llamaindex:comps
7371

7472
sleep 1m
7573

tests/retrievers/test_retrievers_opensearch.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ WORKPATH=$(dirname "$PWD")
1414
LOG_PATH="$WORKPATH/tests"
1515
export host_ip=$(hostname -I | awk '{print $1}')
1616
service_name="opensearch-vector-db tei-embedding-serving retriever-opensearch"
17-
retriever_service_name="retriever-opensearch"
1817

1918
function build_docker_images() {
2019
cd $WORKPATH
@@ -35,7 +34,6 @@ function start_service() {
3534
export OPENSEARCH_INITIAL_ADMIN_PASSWORD="StRoNgOpEa0)"
3635
export EMBEDDING_MODEL_ID="BAAI/bge-base-en-v1.5"
3736
export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}"
38-
export HUGGINGFACEHUB_API_TOKEN=${HF_TOKEN}
3937
export OPENSEARCH_URL="http://${host_ip}:${OPENSEARCH_PORT1}"
4038
export INDEX_NAME="file-index"
4139

@@ -62,13 +60,13 @@ function validate_microservice() {
6260
echo "[ retriever ] Content is as expected."
6361
else
6462
echo "[ retriever ] Content does not match the expected result: $CONTENT"
65-
docker logs ${retriever_service_name} >> ${LOG_PATH}/retriever.log
63+
docker logs ${service_name} >> ${LOG_PATH}/retriever.log
6664
docker logs tei-embedding-serving >> ${LOG_PATH}/tei.log
6765
exit 1
6866
fi
6967
else
7068
echo "[ retriever ] HTTP status is not 200. Received status was $HTTP_STATUS"
71-
docker logs ${retriever_service_name} >> ${LOG_PATH}/retriever.log
69+
docker logs ${service_name} >> ${LOG_PATH}/retriever.log
7270
docker logs tei-embedding-serving >> ${LOG_PATH}/tei.log
7371
exit 1
7472
fi
@@ -82,14 +80,14 @@ function stop_docker() {
8280
}
8381

8482
function main() {
85-
stop_docker
83+
stop_service
8684

8785
build_docker_images
8886
start_service
8987

9088
validate_microservice
9189

92-
stop_docker
90+
stop_service
9391
echo y | docker system prune
9492
}
9593

tests/retrievers/test_retrievers_vdms.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function start_service() {
3737
export TEI_EMBEDDING_ENDPOINT="http://${host_ip}:${TEI_EMBEDDER_PORT}"
3838
export INDEX_NAME="rag-vdms"
3939
export VDMS_USE_CLIP=0 #set to 1 if openai clip embedding should be used
40-
export HUGGINGFACEHUB_API_TOKEN=${HF_TOKEN}
40+
export HF_TOKEN=${HF_TOKEN}
4141
export LOGFLAG=True
4242

4343
cd $WORKPATH/comps/retrievers/deployment/docker_compose

0 commit comments

Comments
 (0)