feat: Change docker-compose.yml file (#3673)

* feat: Change `docker-compose.yml` file

* Add `volumes` to read from the local `/pipelines` folder
* Change the `PIPELINE_YAML_PATH` value and refer to the local `pipelines.haystack-pipeline.yml`
* Change the elasticsearch image

* Fix volume

* Update readme to direct users to the new demos repository
This commit is contained in:
Bilge Yücel 2023-01-03 11:49:12 +03:00 committed by GitHub
parent b155297a06
commit 434beebfb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 83 deletions

View File

@ -154,63 +154,7 @@ Ask any question on countries or capital cities and let Haystack return the answ
**Local**
Start up a Haystack service via [Docker Compose](https://docs.docker.com/compose/).
With this you can begin calling it directly via the REST API or even interact with it using the included Streamlit UI.
<details>
<summary>Click here for a step-by-step guide</summary>
**1. Update/install Docker and Docker Compose, then launch Docker**
```
apt-get update && apt-get install docker && apt-get install docker-compose
service docker start
```
**2. Clone Haystack repository**
```
git clone https://github.com/deepset-ai/haystack.git
```
**3. Pull images & launch demo app**
```
cd haystack
docker-compose pull
docker-compose up
# Or on a GPU machine: docker-compose -f docker-compose-gpu.yml up
```
You should be able to see the following in your terminal window as part of the log output:
```
..
ui_1 | You can now view your Streamlit app in your browser.
..
ui_1 | External URL: http://192.168.108.218:8501
..
haystack-api_1 | [2021-01-01 10:21:58 +0000] [17] [INFO] Application startup complete.
```
**4. Open the Streamlit UI for Haystack by pointing your browser to the "External URL" from above.**
You should see the following:
![image](https://raw.githubusercontent.com/deepset-ai/haystack/main/docs/img/streamlit_ui_screenshot.png)
You can then try different queries against a pre-defined set of indexed articles related to Game of Thrones.
**Note**: The following containers are started as a part of this demo:
* Haystack API: listens on port 8000
* DocumentStore (Elasticsearch): listens on port 9200
* Streamlit UI: listens on port 8501
Please note that the demo will [publish](https://docs.docker.com/config/containers/container-networking/) the container ports to the outside world. *We suggest that you review the firewall settings depending on your system setup and the security guidelines.*
</details>
To run the Explore The World demo on your own machine and customize it to your needs, check out the instructions on [Explore the World repository](https://github.com/deepset-ai/haystack-demos/tree/main/explore_the_world) on GitHub.
## :vulcan_salute: Community

View File

@ -3,23 +3,21 @@ services:
haystack-api:
# Pull Haystack's latest commit
image: "deepset/haystack:cpu-main"
volumes:
- ./rest_api/rest_api/pipeline:/opt/pipelines
ports:
- 8000:8000
restart: on-failure
environment:
# See rest_api/pipeline/pipelines.haystack-pipeline.yml for configurations of Search & Indexing Pipeline.
- DOCUMENTSTORE_PARAMS_HOST=elasticsearch
- PIPELINE_YAML_PATH=/opt/venv/lib/python3.10/site-packages/rest_api/pipeline/pipelines.haystack-pipeline.yml
- QUERY_PIPELINE_NAME=query
- PIPELINE_YAML_PATH=/opt/pipelines/pipelines.haystack-pipeline.yml
- TOKENIZERS_PARALLELISM=false
depends_on:
elasticsearch:
condition: service_healthy
elasticsearch:
# This image is "ready-to-query" with some indexed articles
# about countries and capital cities from Wikipedia:
image: "deepset/elasticsearch-countries-and-capitals"
image: "docker.elastic.co/elasticsearch/elasticsearch:7.17.6"
ports:
- 9200:9200
restart: on-failure
@ -31,23 +29,3 @@ services:
interval: 10s
timeout: 1s
retries: 10
ui:
depends_on:
- haystack-api
build:
context: ui
dockerfile: Dockerfile
ports:
- 8501:8501
restart: on-failure
environment:
- API_ENDPOINT=http://haystack-api:8000
- EVAL_FILE=ui/eval_labels_example.csv
# The value of the following variables will be read from the host, if present.
# They can also be temporarily set for docker-compose, for example:
# DISABLE_FILE_UPLOAD=1 DEFAULT_DOCS_FROM_RETRIEVER=5 docker-compose up
- DISABLE_FILE_UPLOAD
- DEFAULT_QUESTION_AT_STARTUP
- DEFAULT_DOCS_FROM_RETRIEVER
- DEFAULT_NUMBER_OF_ANSWERS