Skip to content

Commit

Permalink
Upgrade to 7.17.1, add docker files and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Bapt Abl committed Mar 18, 2022
1 parent 34f3eba commit f231e5d
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 25 deletions.
67 changes: 46 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This is an `Ingest`, `Search` and `Script` plugin.

## Installation

`bin/elasticsearch-plugin https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.17.0.0/elasticsearch-plugin-geoshape-7.17.0.0.zip"`
`bin/elasticsearch-plugin https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.17.1.0/elasticsearch-plugin-geoshape-7.17.1.0.zip"`


## Build
Expand Down Expand Up @@ -63,26 +63,27 @@ PUT _ingest/pipeline/geo_extension
]
}
PUT main
PUT main/_mapping
{
"dynamic_templates": [
{
"geoshapes": {
"match": "geoshape_*",
"mapping": {
"properties": {
"geoshape": {"type": "geo_shape"},
"hash": {"type": "keyword"},
"wkb": {"type": "binary", "doc_values": true},
"type": {"type": "keyword"},
"area": {"type": "half_float"},
"bbox": {"type": "geo_point"},
"centroid": {"type": "geo_point"}
"mappings": {
"dynamic_templates": [
{
"geoshapes": {
"match": "geoshape_*",
"mapping": {
"properties": {
"geoshape": {"type": "geo_shape"},
"hash": {"type": "keyword"},
"wkb": {"type": "binary", "doc_values": true},
"type": {"type": "keyword"},
"area": {"type": "half_float"},
"bbox": {"type": "geo_point"},
"centroid": {"type": "geo_point"}
}
}
}
}
}
]
]
}
}
GET main/_mapping
```
Expand Down Expand Up @@ -134,7 +135,7 @@ Result:

Document indexing with shape fixing:
```
POST main/_doc
POST main/_doc?pipeline=geo_extension
{
"geoshape_0": {
"type": "Polygon",
Expand Down Expand Up @@ -172,7 +173,7 @@ POST main/_doc
]
}
}
GET main/_search?pipeline=geo_extension
GET main/_search
```

Result:
Expand Down Expand Up @@ -355,7 +356,7 @@ Result:
The first 3 digits of the plugin version is the corresponding Elasticsearch version. The last digit is used for plugin versioning.

To install it, launch this command in Elasticsearch directory replacing the url by the correct link for your Elasticsearch version (see table)
`bin/elasticsearch-plugin https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.17.0.0/elasticsearch-plugin-geoshape-7.17.0.0.zip"`
`bin/elasticsearch-plugin https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.17.1.0/elasticsearch-plugin-geoshape-7.17.1.0.zip"`

| elasticsearch version | plugin version | plugin url |
| --------------------- | -------------- | ---------- |
Expand All @@ -373,7 +374,31 @@ To install it, launch this command in Elasticsearch directory replacing the url
| 7.4.0 | 7.4.0.0 | https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.4.0.0/elasticsearch-plugin-geoshape-7.4.0.0.zip |
| 7.5.1 | 7.5.1.0 | https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.5.1.0/elasticsearch-plugin-geoshape-7.5.1.0.zip |
| 7.6.0 | 7.6.0.0 | https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.6.0.0/elasticsearch-plugin-geoshape-7.6.0.0.zip |
| 7.17.0 | 7.17.0.0 | https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.17.0.0/elasticsearch-plugin-geoshape-7.17.0.0.zip |
| 7.17.1 | 7.17.1.0 | https://github.com/opendatasoft/elasticsearch-plugin-geoshape/releases/download/v7.17.1.0/elasticsearch-plugin-geoshape-7.17.1.0.zip |



## Development Environment Setup

Build the plugin using gradle:
```sh
./gradlew build
```

or
```sh
./gradlew assemble # (to avoid the test suite)
```

Then the following command will start a dockerized ES and will install the previously built plugin:
```sh
docker-compose up
```

Please be careful during development: you'll need to manually rebuild the .zip using `./gradlew build` on each code
change before running `docker-compose` up again.

> NOTE: In `docker-compose.yml` you can uncomment the debug env and attach a REMOTE JVM on `*:5005` to debug the plugin.

## License
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies {
// However this archive is not included in the final plugin bundle, since
// legacy geo and its dependencies (JTS) are already present at runtime
// with ES (see the jar/manifest rule below)
compileOnly files('libs/legacy-geo-7.17.0.jar')
compileOnly files('libs/legacy-geo-7.17.1.jar')

// jts.io.common is not part of ES and will be shipped with this plugin
implementation group: 'org.locationtech.jts.io', name: 'jts-io-common', version: '1.15.0'
Expand All @@ -66,7 +66,7 @@ dependencies {
jar {
manifest {
attributes(
"Class-Path": "../../modules/legacy-geo/legacy-geo-7.17.0.jar ../../modules/legacy-geo/jts-core-1.15.0.jar ../../modules/legacy-geo/spatial4j-0.7.jar")
"Class-Path": "../../modules/legacy-geo/legacy-geo-7.17.1.jar ../../modules/legacy-geo/jts-core-1.15.0.jar ../../modules/legacy-geo/spatial4j-0.7.jar")

}
}
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "3.7"

services:
elasticsearch-plugin-debug:
build:
context: .
dockerfile: docker/Dockerfile
target: elasticsearch-plugin-debug
environment:
- discovery.type=single-node
# NO DEBUG
- ES_JAVA_OPTS=-Xms512m -Xmx512m
# DEBUG
# - ES_JAVA_OPTS=-Xms512m -Xmx512m -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005
ports:
- "9200:9200"
- "5005:5005" # DEBUG
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.1 AS elasticsearch-plugin-debug

COPY /build/distributions/elasticsearch-plugin-geoshape-7.17.1.0.zip /tmp/elasticsearch-plugin-geoshape-7.17.1.0.zip
RUN ./bin/elasticsearch-plugin install file:/tmp/elasticsearch-plugin-geoshape-7.17.1.0.zip
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elastic_version = 7.17.0
plugin_version = 7.17.0.0
elastic_version = 7.17.1
plugin_version = 7.17.1.0
Binary file not shown.

0 comments on commit f231e5d

Please sign in to comment.