Skip to content

Commit 0869029

Browse files
authored
update image build for 2 new examples (#729)
Signed-off-by: chensuyue <suyue.chen@intel.com> Signed-off-by: Chendi.Xue <chendi.xue@intel.com>
1 parent fa12083 commit 0869029

File tree

8 files changed

+85
-22
lines changed

8 files changed

+85
-22
lines changed

DocIndexRetriever/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WORKDIR /home/user/GenAIComps
1818
RUN pip install --no-cache-dir --upgrade pip && \
1919
pip install --no-cache-dir -r /home/user/GenAIComps/requirements.txt
2020

21-
COPY GenAIExamples/DocIndexRetriever/docker/retrieval_tool.py /home/user/retrieval_tool.py
21+
COPY ./retrieval_tool.py /home/user/retrieval_tool.py
2222

2323
ENV PYTHONPATH=$PYTHONPATH:/home/user/GenAIComps
2424

DocIndexRetriever/docker/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ DocRetriever are the most widely adopted use case for leveraging the different m
3535
```bash
3636
cd ..
3737
git clone https://github.com/opea-project/GenAIExamples.git
38-
docker build --no-cache -t opea/doc-index-retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f GenAIExamples/DocIndexRetriever/docker/Dockerfile .
38+
cd GenAIExamples/DocIndexRetriever/docker
39+
docker build --no-cache -t opea/doc-index-retriever:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./Dockerfile .
3940
```
4041

4142
## 3. Start all the services Docker Containers
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
services:
5+
doc-index-retriever:
6+
build:
7+
args:
8+
http_proxy: ${http_proxy}
9+
https_proxy: ${https_proxy}
10+
no_proxy: ${no_proxy}
11+
dockerfile: ./Dockerfile
12+
image: ${REGISTRY:-opea}/doc-index-retriever:${TAG:-latest}
13+
embedding-tei:
14+
build:
15+
context: GenAIComps
16+
dockerfile: comps/embeddings/langchain/docker/Dockerfile
17+
extends: doc-index-retriever
18+
image: ${REGISTRY:-opea}/embedding-tei:${TAG:-latest}
19+
retriever-redis:
20+
build:
21+
context: GenAIComps
22+
dockerfile: comps/retrievers/langchain/redis/docker/Dockerfile
23+
extends: chatqna
24+
image: ${REGISTRY:-opea}/retriever-redis:${TAG:-latest}
25+
reranking-tei:
26+
build:
27+
context: GenAIComps
28+
dockerfile: comps/reranks/tei/docker/Dockerfile
29+
extends: doc-index-retriever
30+
image: ${REGISTRY:-opea}/reranking-tei:${TAG:-latest}
31+
dataprep-on-ray-redis:
32+
build:
33+
context: GenAIComps
34+
dockerfile: comps/dataprep/redis/langchain_ray/docker/Dockerfile
35+
extends: doc-index-retriever
36+
image: ${REGISTRY:-opea}/dataprep-on-ray-redis:${TAG:-latest}

DocIndexRetriever/docker/gaudi/docker_compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ services:
8282
image: opea/reranking-tei:latest
8383
container_name: reranking-tei-server
8484
ports:
85-
- "18000:8000"
85+
- "8000:8000"
8686
ipc: host
8787
entrypoint: python local_reranking.py
8888
environment:

DocIndexRetriever/docker/xeon/docker_compose.yaml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Copyright (C) 2024 Intel Corporation
32
# SPDX-License-Identifier: Apache-2.0
43

@@ -9,34 +8,38 @@ services:
98
image: redis/redis-stack:7.2.0-v9
109
container_name: redis-vector-db
1110
ports:
12-
- "16379:6379"
11+
- "6379:6379"
1312
- "8001:8001"
1413
dataprep-redis-service:
15-
image: opea/dataprep-on-ray-redis:latest
14+
image: opea/dataprep-redis:latest
1615
container_name: dataprep-redis-server
1716
depends_on:
1817
- redis-vector-db
1918
ports:
2019
- "6007:6007"
20+
- "6008:6008"
21+
- "6009:6009"
2122
environment:
2223
no_proxy: ${no_proxy}
2324
http_proxy: ${http_proxy}
2425
https_proxy: ${https_proxy}
2526
REDIS_URL: ${REDIS_URL}
2627
INDEX_NAME: ${INDEX_NAME}
28+
TEI_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
2729
tei-embedding-service:
2830
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.2
2931
container_name: tei-embedding-server
3032
ports:
31-
- "8090:80"
33+
- "6006:80"
3234
volumes:
3335
- "./data:/data"
3436
shm_size: 1g
3537
environment:
3638
no_proxy: ${no_proxy}
3739
http_proxy: ${http_proxy}
3840
https_proxy: ${https_proxy}
39-
command: --model-id ${EMBEDDING_MODEL_ID}
41+
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
42+
command: --model-id ${EMBEDDING_MODEL_ID} --auto-truncate
4043
embedding:
4144
image: opea/embedding-tei:latest
4245
container_name: embedding-tei-server
@@ -49,6 +52,7 @@ services:
4952
no_proxy: ${no_proxy}
5053
http_proxy: ${http_proxy}
5154
https_proxy: ${https_proxy}
55+
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
5256
TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
5357
LANGCHAIN_API_KEY: ${LANGCHAIN_API_KEY}
5458
LANGCHAIN_TRACING_V2: ${LANGCHAIN_TRACING_V2}
@@ -68,17 +72,40 @@ services:
6872
https_proxy: ${https_proxy}
6973
REDIS_URL: ${REDIS_URL}
7074
INDEX_NAME: ${INDEX_NAME}
75+
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
76+
TEI_EMBEDDING_ENDPOINT: ${TEI_EMBEDDING_ENDPOINT}
7177
LANGCHAIN_API_KEY: ${LANGCHAIN_API_KEY}
7278
LANGCHAIN_TRACING_V2: ${LANGCHAIN_TRACING_V2}
7379
LANGCHAIN_PROJECT: "opea-retriever-service"
7480
restart: unless-stopped
81+
82+
tei-reranking-service:
83+
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.2
84+
container_name: tei-reranking-server
85+
ports:
86+
- "8808:80"
87+
volumes:
88+
- "./data:/data"
89+
shm_size: 1g
90+
environment:
91+
no_proxy: ${no_proxy}
92+
http_proxy: ${http_proxy}
93+
https_proxy: ${https_proxy}
94+
HUGGINGFACEHUB_API_TOKEN: ${HUGGINGFACEHUB_API_TOKEN}
95+
HF_HUB_DISABLE_PROGRESS_BARS: 1
96+
HF_HUB_ENABLE_HF_TRANSFER: 0
97+
command: --model-id ${RERANK_MODEL_ID} --auto-truncate
98+
7599
reranking:
76100
image: opea/reranking-tei:latest
77-
container_name: reranking-tei-server
101+
container_name: reranking-tei-xeon-server
102+
volumes:
103+
- ${WORKDIR}/GenAIComps/comps/:/home/user/comps
104+
depends_on:
105+
- tei-reranking-service
78106
ports:
79-
- "18000:8000"
107+
- "8000:8000"
80108
ipc: host
81-
entrypoint: python local_reranking.py
82109
environment:
83110
no_proxy: ${no_proxy}
84111
http_proxy: ${http_proxy}
@@ -99,6 +126,7 @@ services:
99126
- tei-embedding-service
100127
- embedding
101128
- retriever
129+
- tei-reranking-service
102130
- reranking
103131
ports:
104132
- "8889:8889"

DocIndexRetriever/tests/test_docindexretriever_on_gaudi.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ LOG_PATH="$WORKPATH/tests"
1010
ip_address=$(hostname -I | awk '{print $1}')
1111

1212
function build_docker_images() {
13-
cd $WORKPATH/../../
13+
cd $WORKPATH/docker
1414
if [ ! -d "GenAIComps" ] ; then
1515
git clone https://github.com/opea-project/GenAIComps.git
1616
fi
1717
cd GenAIComps
18-
git status
1918

2019
docker build -t opea/embedding-tei:latest -f comps/embeddings/langchain/docker/Dockerfile .
2120
docker build -t opea/retriever-redis:latest -f comps/retrievers/langchain/redis/docker/Dockerfile .
@@ -25,8 +24,8 @@ function build_docker_images() {
2524
docker pull ghcr.io/huggingface/tgi-gaudi:latest
2625
docker pull redis/redis-stack:7.2.0-v9
2726

28-
cd $WORKPATH/../../
29-
docker build -t opea/doc-index-retriever:latest -f GenAIExamples/DocIndexRetriever/docker/Dockerfile .
27+
cd $WORKPATH/docker
28+
docker build -t opea/doc-index-retriever:latest -f ./Dockerfile .
3029
}
3130

3231
function start_services() {

ProductivitySuite/docker/docker_build_compose.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ services:
4141
dockerfile: comps/dataprep/redis/langchain/docker/Dockerfile
4242
extends: chatqna
4343
image: ${REGISTRY:-opea}/dataprep-redis:${TAG:-latest}
44-
promptregistry-mongo:
44+
promptregistry-mongo-server:
4545
build:
4646
context: GenAIComps
4747
dockerfile: comps/prompt_registry/mongo/docker/Dockerfile
4848
extends: chatqna
4949
image: ${REGISTRY:-opea}/promptregistry-mongo-server:${TAG:-latest}
50-
chathistory-mongo:
50+
chathistory-mongo-server:
5151
build:
5252
context: GenAIComps
5353
dockerfile: comps/chathistory/mongo/docker/Dockerfile
5454
extends: chatqna
5555
image: ${REGISTRY:-opea}/chathistory-mongo-server:${TAG:-latest}
56-
productivity-suite-react-ui:
56+
productivity-suite-react-ui-server:
5757
build:
5858
context: ui
5959
dockerfile: ./docker/Dockerfile.react
@@ -86,13 +86,13 @@ services:
8686
context: ../../FaqGen/docker/
8787
dockerfile: ./Dockerfile
8888
image: ${REGISTRY:-opea}/faqgen:${TAG:-latest}
89-
llm_faqgen:
89+
llm-faqgen-tgi:
9090
build:
9191
context: GenAIComps
9292
dockerfile: comps/llms/faq-generation/tgi/Dockerfile
9393
extends: faqgen
9494
image: ${REGISTRY:-opea}/llm-faqgen-tgi:${TAG:-latest}
95-
llm_docsum_server:
95+
llm-docsum-tgi:
9696
build:
9797
context: GenAIComps
9898
dockerfile: comps/llms/summarization/tgi/Dockerfile

ProductivitySuite/tests/test_productivitysuite_on_xeon.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ function build_docker_images() {
1919
git clone https://github.com/opea-project/GenAIComps.git
2020

2121
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
22-
service_list="chatqna dataprep-redis embedding-tei promptregistry-mongo llm_docsum_server llm_faqgen chathistory-mongo retriever-redis reranking-tei llm-tgi productivity-suite-react-ui codegen docsum faqgen"
23-
docker compose -f docker_build_compose.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
22+
docker compose -f docker_build_compose.yaml build --no-cache > ${LOG_PATH}/docker_image_build.log
2423

2524
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
2625
docker pull ghcr.io/huggingface/text-generation-inference:2.1.0

0 commit comments

Comments
 (0)