Skip to content

Commit

Permalink
Refine the instructions to run the retriever example with qdrant (ope…
Browse files Browse the repository at this point in the history
…a-project#442)

Signed-off-by: Wang, Kai Lawrence <[email protected]>
  • Loading branch information
wangkl2 authored and BaoHuiling committed Aug 15, 2024
1 parent 534a155 commit 56ac5eb
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions comps/retrievers/haystack/qdrant/README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,54 @@
# Retriever Microservice with Qdrant

# 🚀Start Microservice with Python
# 1. 🚀Start Microservice with Python (Option 1)

## Install Requirements
## 1.1 Install Requirements

```bash
pip install -r requirements.txt
```

## Start Qdrant Server
## 1.2 Start Qdrant Server

Please refer to this [readme](../../../vectorstores/langchain/qdrant/README.md).

## Setup Environment Variables
## 1.3 Setup Environment Variables

```bash
export http_proxy=${your_http_proxy}
export https_proxy=${your_https_proxy}
export QDRANT_HOST=${your_qdrant_host_ip}
export QDRANT_PORT=6333
export EMBED_DIMENSION=${your_embedding_dimension}
export INDEX_NAME=${your_index_name}
export TEI_EMBEDDING_ENDPOINT=${your_tei_endpoint}
```

## Start Retriever Service
## 1.4 Start Retriever Service

```bash
export TEI_EMBEDDING_ENDPOINT="http://${your_ip}:6060"
python haystack/qdrant/retriever_qdrant.py
```

# 🚀Start Microservice with Docker
# 2. 🚀Start Microservice with Docker (Option 2)

## Build Docker Image
## 2.1 Setup Environment Variables

```bash
export QDRANT_HOST=${your_qdrant_host_ip}
export QDRANT_PORT=6333
export TEI_EMBEDDING_ENDPOINT="http://${your_ip}:6060"
```

## 2.2 Build Docker Image

```bash
cd ../../
docker build -t opea/retriever-qdrant:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/retrievers/haystack/qdrant/docker/Dockerfile .
```

## Run Docker with CLI
## 2.3 Run Docker with CLI

```bash
docker run -d --name="retriever-qdrant-server" -p 7000:7000 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e TEI_EMBEDDING_ENDPOINT=${your_tei_endpoint} -e QDRANT_HOST=${your_qdrant_host_ip} -e QDRANT_PORT=${your_qdrant_port} opea/retriever-qdrant:latest
docker run -d --name="retriever-qdrant-server" -p 7000:7000 --ipc=host -e http_proxy=$http_proxy -e https_proxy=$https_proxy -e TEI_EMBEDDING_ENDPOINT=$TEI_EMBEDDING_ENDPOINT -e QDRANT_HOST=$QDRANT_HOST -e QDRANT_PORT=$QDRANT_PORT opea/retriever-qdrant:latest
```

# 🚀3. Consume Retriever Service
Expand Down

0 comments on commit 56ac5eb

Please sign in to comment.