Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker retriever-qdrant-server fails #360

Closed
endomorphosis opened this issue Jul 29, 2024 · 6 comments
Closed

docker retriever-qdrant-server fails #360

endomorphosis opened this issue Jul 29, 2024 · 6 comments
Assignees
Labels

Comments

@endomorphosis
Copy link

root@laion-gaudi2-00:~/GenAIComps# docker logs retriever-qdrant-server
Traceback (most recent call last):
File "/home/user/comps/retrievers/haystack/qdrant/retriever_qdrant.py", line 4, in
from haystack.components.embedders import HuggingFaceTEITextEmbedder, SentenceTransformersTextEmbedder
ImportError: cannot import name 'HuggingFaceTEITextEmbedder' from 'haystack.components.embedders' (/home/user/.local/lib/python3.11/site-packages/haystack/components/embedders/init.py)

@wangkl2
Copy link
Collaborator

wangkl2 commented Jul 31, 2024

@endomorphosis Thanks for reporting this issue.

Are you using the v0.8 tag for this Qdrant retriever example? If this is the case, please help check the version of haystack-ai in your environment. There is API change of haystack since v2.3, which caused this import error. If the haystack-ai version in your env is >= 2.3, please downgrade the version to 2.2.4. We've just updated this in the requirements.txt in the main branch: https://github.com/opea-project/GenAIComps/blob/main/comps/retrievers/haystack/qdrant/requirements.txt#L4

With v2.3.1:
image

With v2.2.4:
image

@endomorphosis
Copy link
Author

export https_proxy=127.0.0.1
export QDRANT_HOST=100.83.51.234
export QDRANT_PORT=6333
export EMBED_DIMENSION=1024
export INDEX_NAME=wikipedia
export TEI_EMBEDDING_ENDPOINT=https://100.83.51.234:8080/embed

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

results in the error message.

root@laion-gaudi2-00:~/GenAIComps# docker logs 418514b37962
Traceback (most recent call last):
  File "/home/user/comps/retrievers/haystack/qdrant/retriever_qdrant.py", line 8, in <module>
    from qdrant_config import EMBED_DIMENSION, EMBED_ENDPOINT, EMBED_MODEL, INDEX_NAME, QDRANT_HOST, QDRANT_PORT
  File "/home/user/comps/retrievers/haystack/qdrant/qdrant_config.py", line 17, in <module>
    QDRANT_PORT = int(os.getenv("QDRANT_PORT", 6333))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@wangkl2
Copy link
Collaborator

wangkl2 commented Aug 5, 2024

@endomorphosis Please align the name of the env variables that you set on bare metal and to the ones pass into the docker container. From your command, 6333 has been set for QDRANT_PORT while you use ${your_qdrant_port} to set the env variable during launching the docker container.
i.e.
Option1: Set the env variables directly in the docker run command:

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=xxxx -e QDRANT_HOST=xxxx -e QDRANT_PORT=xxxx opea/retriever-qdrant:latest

Option2: pass the env variables you've set into the docker container:

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

Without correct setting of the qdrant port:

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
fa661241f48009ad69ec3b765994bacc29b693f310bb92db5777d24909220391
(base) wangk2@7cc25526b786:~$ docker logs fa661241f48009ad69ec3b765994bacc29b693f310bb92db5777d24909220391
Traceback (most recent call last):
  File "/home/user/comps/retrievers/haystack/qdrant/retriever_qdrant.py", line 8, in <module>
    from qdrant_config import EMBED_DIMENSION, EMBED_ENDPOINT, EMBED_MODEL, INDEX_NAME, QDRANT_HOST, QDRANT_PORT
  File "/home/user/comps/retrievers/haystack/qdrant/qdrant_config.py", line 17, in <module>
    QDRANT_PORT = int(os.getenv("QDRANT_PORT", 6333))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

With correct settings via option2:
image

@endomorphosis
Copy link
Author

i will try running this tomorrow, as it is almost 4am right now, the documentation should be corrected if this is the proper syntax.

@endomorphosis
Copy link
Author

This has worked successfully, I am going to see about setting up multiple retrievers now

@wangkl2
Copy link
Collaborator

wangkl2 commented Aug 9, 2024

Modified the example readme accordingly. Since it solves the issue and works now, close this issue for now.

@wangkl2 wangkl2 closed this as completed Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants