Skip to content

Commit 70418b2

Browse files
[DAGE-20] improvement of Dockerfile (similar to Naz implementation) and updated README.md file
1 parent 1448039 commit 70418b2

6 files changed

Lines changed: 30 additions & 8 deletions

File tree

rre-dataset-generator/README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,37 @@ Depending on your Docker version, you may need to use `docker compose` instead o
8989
If you have Docker Compose v1 installed, use:
9090

9191
```bash
92-
docker-compose up --build
92+
docker-compose -f docker-compose-solr.yml up --build
9393
```
9494
If you have Docker Compose v2 installed, use:
9595
```bash
96-
docker compose up --build
96+
docker compose -f docker-compose-solr.yml up --build
9797
```
9898

9999
This will start 2 services:
100100
- `solr`, available at http://localhost:8983/solr
101-
- `solr-init`, loads documents from solr/data/dataset.json only if Solr doesn't index any documents.
101+
- `solr-init`, loads documents from solr-init/data/dataset.json only if Solr doesn't index any documents.
102+
103+
##### Running Elasticsearch (Standalone)
104+
105+
106+
Similarly to Solr, to run a local Elasticsearch test environment using docker-compose:
107+
```bash
108+
cd tests/integration/
109+
```
110+
111+
Depending on your Docker version, you may need to use `docker compose` instead of `docker-compose`.
112+
If you have Docker Compose v1 installed, use:
113+
114+
```bash
115+
docker-compose -f docker-compose-elasticsearch.yml up --build
116+
```
117+
If you have Docker Compose v2 installed, use:
118+
```bash
119+
docker compose -f docker-compose-elasticsearch.yml up --build
120+
```
121+
122+
This will start 2 services:
123+
- `elasticsearch`, available at http://localhost:9200
124+
- `elasticsearch-init`, loads documents from elasticsearch-init/data/dataset.jsonl only if Elasticsearch doesn't have
125+
any documents in the index.

rre-dataset-generator/src/search_engine/elasticsearch_search_engine.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def _search(self, payload: Dict[str, Any]) -> List[Document]:
9595
log.debug("Elasticsearch query successful.")
9696
log.debug(f"URL: {search_url}")
9797
log.debug(f"Payload: {payload}")
98-
# log.debug(f"Response: {response.json()}")
9998
raw_docs = response.json()['hits']['hits']
10099
reformat_raw_doc = []
101100
for doc in raw_docs:

rre-dataset-generator/src/search_engine/solr_search_engine.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def _search(self, payload: Dict[str, Any]) -> List[Document]:
108108
log.debug("Solr query successful.")
109109
log.debug(f"URL: {search_url}")
110110
log.debug(f"Payload: {payload}")
111-
# log.debug(f"Response: {response.json()}")
112111
raw_docs = response.json()['response']['docs']
113112
reformat_raw_doc = []
114113
for doc in raw_docs:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.elastic.co/elasticsearch/elasticsearch:9.0.4
1+
FROM curlimages/curl:8.14.1
22

33
COPY data/dataset.jsonl /opt/rre-dataset-generator/data/dataset.jsonl
44
COPY --chmod=777 elasticsearch-init.sh /opt/rre-dataset-generator/elasticsearch-init.sh

rre-dataset-generator/tests/integration/elasticsearch-init/elasticsearch-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -euo pipefail
33

44
CLUSTER="http://elasticsearch:9200"
5-
INDEX="testindex"
5+
INDEX="testcore"
66
ENDPOINT="$CLUSTER/$INDEX"
77

88
echo "[INFO] Waiting for Elasticsearch..."

rre-dataset-generator/tests/unit/resources/elasticsearch_good_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
query_template: '{ "query": { "match": { "message": "#$query##" } } }'
22
search_engine_type: "elasticsearch"
3-
search_engine_collection_endpoint: 'http://localhost:9200/testindex/'
3+
search_engine_collection_endpoint: 'http://localhost:9200/testcore/'
44
doc_number: 100
55
doc_fields:
66
- "title"

0 commit comments

Comments
 (0)