Skip to content

Commit 0e33047

Browse files
Setup elasticsearch sync in docker environment
Setup elasticsearch sync in docker environment. Initial change in rules for test execution aggregation to create duration for activities and tests.
1 parent b96a42d commit 0e33047

File tree

5 files changed

+85
-21
lines changed

5 files changed

+85
-21
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ before_install:
2525
before_script:
2626
- cd src/main/docker/
2727
- source env.bash
28-
- docker-compose up -d
28+
- docker-compose up -d mongodb rabbitmq eiffel-er jenkins mail-server ei-backend
2929
- sleep 60
3030
- cd ../../../
3131

src/main/docker/docker-compose.yml

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ services:
146146
aliases:
147147
- jenkins
148148

149-
150149
mail-server:
151150
image: ${MAILSERVER_IMAGE}
152151
expose:
@@ -212,6 +211,72 @@ services:
212211
- logging.level.org.springframework.web=DEBUG
213212
- logging.level.com.ericsson.ei=DEBUG
214213

214+
elasticsearch:
215+
restart: always
216+
image: ${ELASTICSEARCH_IMAGE}
217+
ports:
218+
- "${ELASTICSEARCH_PORT1}:9200"
219+
- "${ELASTICSEARCH_PORT2}:9300"
220+
depends_on:
221+
- mongodb
222+
environment:
223+
- ES_JAVA_OPTS=-Xms2048m -Xmx2048m
224+
- discovery.type=single-node
225+
healthcheck:
226+
test: "wget -q -O - http://localhost:9200/_cat/health"
227+
interval: 1s
228+
timeout: 30s
229+
retries: 300
230+
ulimits:
231+
memlock:
232+
soft: -1
233+
hard: -1
234+
235+
networks:
236+
eiffel_2.0_1:
237+
aliases:
238+
- elasticsearch
239+
240+
kibana:
241+
restart: always
242+
image: ${KIBANA_IMAGE}
243+
expose:
244+
- "8080"
245+
ports:
246+
- "${KIBANA_PORT}:8080"
247+
depends_on:
248+
- elasticsearch
249+
environment:
250+
- SERVER_PORT=8080
251+
- SERVER_NAME=kibana.example.org
252+
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
253+
254+
networks:
255+
eiffel_2.0_1:
256+
aliases:
257+
- kibana
258+
259+
## monstache is used to sync from mongodb to elasticsearch using oplog in mongodb
260+
monstache:
261+
restart: always
262+
image: ${MONSTACHE_IMAGE}
263+
expose:
264+
- "8080"
265+
ports:
266+
- "${MONSTACHE_PORT}:8080"
267+
depends_on:
268+
- mongodb
269+
- elasticsearch
270+
environment:
271+
- MONSTACHE_MONGO_URL=mongodb:${MONGODB_PORT}
272+
- MONSTACHE_ES_URLS=http://elasticsearch:9200
273+
links:
274+
- elasticsearch
275+
276+
networks:
277+
eiffel_2.0_1:
278+
aliases:
279+
- monstache
215280

216281
networks:
217282
eiffel_2.0_1:

src/main/docker/env.bash

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ export JENKINS_PORT=8082
88
export MAIL_SMTP_PORT=1025
99
export MAIL_WEB_PORT=8025
1010
export EI_BACKEND_PORT=8090
11+
export ELASTICSEARCH_PORT1=8026
12+
export ELASTICSEARCH_PORT2=8027
13+
export KIBANA_PORT=8085
14+
export MONSTACHE_PORT=8086
1115

1216

1317
export MONGODB_IMAGE="mongo:latest"
@@ -16,3 +20,6 @@ export EIFFEL_ER_IMAGE="eiffelericsson/eiffel-er:0.0.67"
1620
export JENKINS_IMAGE="bitnami/jenkins:2.138.3"
1721
export MAILSERVER_IMAGE="mailhog/mailhog"
1822
export EI_BACKEND_IMAGE="eiffelericsson/eiffel-intelligence-backend:1.0.1"
23+
export ELASTICSEARCH_IMAGE="docker.elastic.co/elasticsearch/elasticsearch:6.2.4"
24+
export KIBANA_IMAGE="docker.elastic.co/kibana/kibana:6.2.4"
25+
export MONSTACHE_IMAGE="rwynn/monstache:4.15.1"

src/main/resources/SourceChangeObjectRules.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"ArrayMergeOptions": "",
5959
"HistoryIdentifyRules": "",
6060
"HistoryExtractionRules": "",
61-
"ProcessRules": null
61+
"ProcessRules": "{activityDuration : diff(causedActivities | [?triggeredEventId=='%IdentifyRules%'].canceledTime | [0], causedActivities | [?triggeredEventId=='%IdentifyRules%'].startedTime | [0])}"
6262
},
6363
{
6464
"TemplateName": "SC_1",
@@ -73,7 +73,7 @@
7373
"ArrayMergeOptions": "",
7474
"HistoryIdentifyRules": "",
7575
"HistoryExtractionRules": "",
76-
"ProcessRules": null
76+
"ProcessRules": "{activityDuration : diff(causedActivities | [?triggeredEventId=='%IdentifyRules%'].finishedTime | [0], causedActivities | [?triggeredEventId=='%IdentifyRules%'].startedTime | [0])}"
7777
},
7878
{
7979
"TemplateName": "SC_1",

src/main/resources/TestExecutionObjectRules.json

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
"StartEvent": "YES",
88
"IdentifyRules": "[meta.id]",
99
"MatchIdRules": {"_id": "%IdentifyRules_objid%"},
10-
"ExtractionRules": "{ activity_triggered_event_id : meta.id, type : meta.type, time : meta.time, version : meta.version, ongoing : `\"false\"` }",
10+
"ExtractionRules": "{ activity_triggered_event_id : meta.id, type : meta.type, activity_triggered_time : meta.time, version : meta.version, ongoing : `\"false\"` }",
1111
"MergeResolverRules": null,
1212
"ArrayMergeOptions": "",
1313
"HistoryIdentifyRules": "",
1414
"HistoryExtractionRules": "",
15-
"ProcessRules": null,
16-
"ProcessFunction": null
15+
"ProcessRules": null
1716
},
1817
{
1918
"TemplateName": "TEST_EXECUTION_1",
@@ -27,8 +26,7 @@
2726
"ArrayMergeOptions": "",
2827
"HistoryIdentifyRules": "",
2928
"HistoryExtractionRules": "",
30-
"ProcessRules": null,
31-
"ProcessFunction": null
29+
"ProcessRules": null
3230
},
3331
{
3432
"TemplateName": "TEST_EXECUTION_1",
@@ -43,8 +41,7 @@
4341
"ArrayMergeOptions": "",
4442
"HistoryIdentifyRules": "",
4543
"HistoryExtractionRules": "",
46-
"ProcessRules": null,
47-
"ProcessFunction": null
44+
"ProcessRules": null
4845
},
4946
{
5047
"TemplateName": "TEST_EXECUTION_1",
@@ -59,8 +56,7 @@
5956
"ArrayMergeOptions": "",
6057
"HistoryIdentifyRules": "",
6158
"HistoryExtractionRules": "",
62-
"ProcessRules": null,
63-
"ProcessFunction": null
59+
"ProcessRules": null
6460
},
6561
{
6662
"TemplateName": "TEST_EXECUTION_1",
@@ -75,8 +71,7 @@
7571
"ArrayMergeOptions": "",
7672
"HistoryIdentifyRules": "",
7773
"HistoryExtractionRules": "",
78-
"ProcessRules": null,
79-
"ProcessFunction": null
74+
"ProcessRules": null
8075
},
8176
{
8277
"TemplateName": "TEST_EXECUTION_1",
@@ -91,8 +86,7 @@
9186
"ArrayMergeOptions": "",
9287
"HistoryIdentifyRules": "",
9388
"HistoryExtractionRules": "",
94-
"ProcessRules": null,
95-
"ProcessFunction": null
89+
"ProcessRules": null
9690
},
9791
{
9892
"TemplateName": "TEST_EXECUTION_1",
@@ -107,8 +101,7 @@
107101
"ArrayMergeOptions": "",
108102
"HistoryIdentifyRules": "",
109103
"HistoryExtractionRules": "",
110-
"ProcessRules": null,
111-
"ProcessFunction": null
104+
"ProcessRules": null
112105
},
113106
{
114107
"TemplateName": "TEST_EXECUTION_1",
@@ -123,7 +116,6 @@
123116
"ArrayMergeOptions": "",
124117
"HistoryIdentifyRules": "",
125118
"HistoryExtractionRules": "",
126-
"ProcessRules": null,
127-
"ProcessFunction": null
119+
"ProcessRules": null
128120
}
129121
]

0 commit comments

Comments
 (0)