haystack/run_docker_gpu.sh
Malte Pietsch a92ca04648
Update GPU docker & fix race condition with multiple workers (#436)
* fix gpu CMD and set tag to latest

* udpate dockerfiles. resolve race condition of index creation with multiple workers

* update dockerfiles for preload. remove try catch for elastic index creation

* add back try/catch. disable multiproc in default config to comply with --preload of gunicorn

* change to pip3 for GPU dockerfile

* remove --preload for gpu
2020-09-29 21:12:44 +02:00

14 lines
763 B
Bash
Executable File

# 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
# alternative: for a demo you can also use this elasticsearch image with already indexed GoT articles
#docker run -d -p 9200:9200 -e "discovery.type=single-node" deepset/elasticsearch-game-of-thrones
# 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-gpu:latest