Skip to content

Commit 3025791

Browse files
p365labsruflin
authored andcommitted
update docker-compose to 3.4, update ES version & bug on new ES version on Percentiles aggregations (#1531)
I've updated the: - docker-compose to a newer version (3.4) - updated to ElasticSearch 6.4.x (available on [HERE](https://www.docker.elastic.co/)) - Updated Percentiles Aggregation Tests as the T-Digest algorithm has been updated and so all the tests failed. Have a look at [the PR on ES](elastic/elasticsearch#28305)
1 parent 044be5e commit 3025791

File tree

5 files changed

+23
-30
lines changed

5 files changed

+23
-30
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file based on the
99
* `\Elastica\ResultSet::next` returns `void` instead of `\Elastica\Result|false`
1010
* `\Elastica\Bulk\ResponseSet::current` returns `\Elastica\Bulk\Response` instead of `\Elastica\Bulk\Response|false`
1111
* `\Elastica\Multi\ResultSet::current` returns `\Elastica\ResultSet` instead of `\Elastica\ResultSet|false`
12+
* Aggreation\Percentiles updated to a newer version of the Algorithm (T-Digest 3.2) and Percentiles results changed a bit Have a [look at here](https://github.com/elastic/elasticsearch/pull/28305), so updated tests in order not to fail. [#1531]([#1352](https://github.com/ruflin/Elastica/pull/1531))
1213

1314
### Bugfixes
1415

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ All library issues should go to the [issue tracker from github](https://github.c
1717

1818
Compatibility
1919
-------------
20-
This release is compatible with all Elasticsearch 6.x releases. It was tested with version 6.2.4.
20+
This release is compatible with all Elasticsearch 6.x releases. It was tested with version 6.4.2.
2121

2222

2323
Contributing

docker-compose.yml

+11-20
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2.0'
1+
version: '3.4'
22

33
services:
44
elastica:
@@ -10,25 +10,20 @@ services:
1010
networks:
1111
- esnet
1212

13-
#SETUP ELASTICSEARCH 6.0-beta1
1413
elasticsearch6_1:
1514
build: ./env/elasticsearch/
1615
container_name: elasticsearch
1716
privileged: true
1817
environment:
1918
- bootstrap.memory_lock=true
20-
- network.host=172.18.0.15
19+
- network.host=10.10.10.15
2120
- xpack.security.enabled=false
2221
- xpack.monitoring.enabled=false
23-
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
22+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
2423
ulimits:
2524
memlock:
2625
soft: -1
2726
hard: -1
28-
nofile:
29-
soft: 65536
30-
hard: 65536
31-
mem_limit: 1g
3227
cap_add:
3328
- ALL
3429
- IPC_LOCK
@@ -38,38 +33,34 @@ services:
3833
- 9200:9200
3934
networks:
4035
esnet:
41-
ipv4_address: 172.18.0.15
36+
ipv4_address: 10.10.10.15
4237
elasticsearch6_2:
4338
build: ./env/elasticsearch/
4439
privileged: true
4540
environment:
4641
- bootstrap.memory_lock=true
47-
- network.host=172.18.0.16
42+
- network.host=10.10.10.16
4843
- xpack.security.enabled=false
4944
- xpack.monitoring.enabled=false
50-
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
45+
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
5146
ulimits:
5247
memlock:
5348
soft: -1
5449
hard: -1
55-
nofile:
56-
soft: 65536
57-
hard: 65536
58-
mem_limit: 1g
5950
cap_add:
6051
- ALL
6152
- IPC_LOCK
6253
volumes:
6354
- esdata1:/usr/share/elasticsearch/data
6455
networks:
6556
esnet:
66-
ipv4_address: 172.18.0.16
57+
ipv4_address: 10.10.10.16
6758

6859
nginx:
6960
build: ./env/nginx/
7061
networks:
7162
esnet:
72-
ipv4_address: 172.18.0.5
63+
ipv4_address: 10.10.10.5
7364

7465

7566
volumes:
@@ -82,6 +73,6 @@ networks:
8273
esnet:
8374
driver: bridge
8475
ipam:
85-
config:
86-
- subnet: 172.18.0.0/16
87-
gateway: 172.18.0.1
76+
driver: default
77+
config:
78+
- subnet: 10.10.10.0/24

env/elasticsearch/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM docker.elastic.co/elasticsearch/elasticsearch:6.2.4
1+
#https://www.docker.elastic.co/
2+
FROM docker.elastic.co/elasticsearch/elasticsearch:6.4.2
23
MAINTAINER Nicolas Ruflin <[email protected]>
34

4-
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
5+
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch ingest-attachment
56

67

78
# Copy config files

test/Elastica/Aggregation/PercentilesTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public function testSetScript()
8686
*/
8787
public function testActualWork()
8888
{
89+
8990
// prepare
9091
$index = $this->_createIndex();
9192
$type = $index->getType('offer');
@@ -113,13 +114,12 @@ public function testActualWork()
113114
$resultSet = $type->search($query);
114115
$aggrResult = $resultSet->getAggregation('price_percentile');
115116

116-
// hope it's ok to hardcode results...
117-
$this->assertEquals(109.0, $aggrResult['values']['1.0']);
118-
$this->assertEquals(145.0, $aggrResult['values']['5.0']);
119-
$this->assertEquals(325.0, $aggrResult['values']['25.0']);
117+
$this->assertEquals(100.0, $aggrResult['values']['1.0']);
118+
$this->assertEquals(100.0, $aggrResult['values']['5.0']);
119+
$this->assertEquals(300.0, $aggrResult['values']['25.0']);
120120
$this->assertEquals(550.0, $aggrResult['values']['50.0']);
121-
$this->assertEquals(775.0, $aggrResult['values']['75.0']);
122-
$this->assertEquals(955.0, $aggrResult['values']['95.0']);
123-
$this->assertEquals(991.0, $aggrResult['values']['99.0']);
121+
$this->assertEquals(800.0, $aggrResult['values']['75.0']);
122+
$this->assertEquals(1000.0, $aggrResult['values']['95.0']);
123+
$this->assertEquals(1000.0, $aggrResult['values']['99.0']);
124124
}
125125
}

0 commit comments

Comments
 (0)