Skip to content

Commit

Permalink
feat: Change docker-compose.yml file (#3673)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bilgeyucel committed Jan 3, 2023
1 parent b155297 commit 434beeb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 83 deletions.
58 changes: 1 addition & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:https://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

Expand Down
30 changes: 4 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:https://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

0 comments on commit 434beeb

Please sign in to comment.