Tuana commited on
Commit
7597300
2 Parent(s): 041b05d 9ef5cb6

Merge pull request #6 from TuanaCelik/mayank/dockerfile

Browse files
Files changed (2) hide show
  1. README.md +22 -1
  2. retriever_reader.yml +3 -1
README.md CHANGED
@@ -5,4 +5,25 @@ colorFrom: pink
5
  colorTo: yellow
6
  sdk: docker
7
  pinned: false
8
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  colorTo: yellow
6
  sdk: docker
7
  pinned: false
8
+ ---
9
+
10
+ ## Steps to run locally
11
+
12
+ - git clone the repo.
13
+ - docker pull elastic search: `docker pull docker.elastic.co/elasticsearch/elasticsearch:7.9.2`
14
+ - docker run elastic search: `docker run -d -p 9200:9200 -e "discovery.type=single-node" elasticsearch:7.9.2`
15
+ - find the elastic search host IP: `docker ps`, copy the container ID of elastic search, run `docker inspect <ID>`
16
+ - edit the `pipeline.yaml` with new IP address.
17
+ - build the image: `docker build -t haystack_simple_demo -f Dockerfile .`
18
+ - run the image: `docker run -it --rm haystack_simple_demo`
19
+ - get the demo image IP in the same way as you did for elastic search IP
20
+
21
+ Now we can query this from terminal using following commands:
22
+
23
+ find ./test-data -name '*.txt' -exec curl --request POST --url http://<DEMO_IMAGE_IP>:8000/file-upload --header 'accept: application/json' --header 'content-type: multipart/form-data' --form files="@{}" --form meta=null ;
24
+
25
+
26
+ curl --request POST --url http://<DEMO_IMAGE_IP>:8000/documents/get_by_filters --header 'accept: application/json' --header 'content-type: application/json' --data '{"filters": {}}'
27
+
28
+
29
+ curl --request POST --url http://<DEMO_IMAGE_IP>:8000/query --header 'accept: application/json' --header 'content-type: application/json' --data '{"query": "what is my name?"}'
retriever_reader.yml CHANGED
@@ -1,6 +1,8 @@
1
  components:
2
  - name: DocumentStore
3
- type: InMemoryDocumentStore
 
 
4
  - name: tfidf_ret
5
  params:
6
  document_store: DocumentStore
 
1
  components:
2
  - name: DocumentStore
3
+ type: ElasticsearchDocumentStore
4
+ params:
5
+ host: 172.17.0.2
6
  - name: tfidf_ret
7
  params:
8
  document_store: DocumentStore