-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Docker Images for running Haystack #85
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3' | ||
services: | ||
haystack-api: | ||
image: "deepset/haystack-api-cpu:0.2.0" | ||
ports: | ||
- 8000:8000 | ||
environment: | ||
# see haystack/api/config.py for additional variables to configure. | ||
# load reader model from transformers' model hub. | ||
- READER_MODEL_PATH=deepset/roberta-base-squad2 | ||
- DB_HOST=elasticsearch | ||
restart: always | ||
|
||
elasticsearch: | ||
# This demo image contains Game of Thrones Wikipedia articles indexed. | ||
# For starting a new Elasticsearch instance, replace image with "elasticsearch:7.6.1". | ||
image: "deepset/elasticsearch-game-of-thrones" | ||
environment: | ||
- discovery.type=single-node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Run Haystack API(on GPU) and Elasticsearch using Docker. | ||
# | ||
# docker-compose doesn't support GPUs in the current version. As a workaround, | ||
# this script runs haystack-api and Elasticsearch Docker Images separately. | ||
# | ||
# To use GPU with Docker, ensure nvidia-docker(https://github.com/NVIDIA/nvidia-docker) is installed. | ||
|
||
docker run -d -p 9200:9200 -e "discovery.type=single-node" elasticsearch:7.6.1 | ||
# wait for Elasticsearch server to start | ||
sleep 30 | ||
docker run --net=host --gpus all -e READER_MODEL_PATH=deepset/roberta-base-squad2 -d deepset/haystack-api-gpu:0.2.0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about naming the image "deepset/haystack-cpu:0.2.0" without the "api"? Is there anything specific for the API in it? We might also re-use it for training / eval ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that sounds good. The
CMD
for the image is specific to the API, but that can easily be moved todocker-compose.yml
andrun_docker_gpu.sh
.