From f231e5d46d11f1bb4c8f3a05758f14b30cb53ce9 Mon Sep 17 00:00:00 2001 From: Bapt Abl Date: Fri, 18 Mar 2022 18:17:43 +0100 Subject: [PATCH] Upgrade to 7.17.1, add docker files and update readme --- README.md | 67 ++++++++++++------ build.gradle | 4 +- docker-compose.yml | 17 +++++ docker/Dockerfile | 4 ++ gradle.properties | 4 +- ...y-geo-7.17.0.jar => legacy-geo-7.17.1.jar} | Bin 116741 -> 116752 bytes 6 files changed, 71 insertions(+), 25 deletions(-) create mode 100644 docker-compose.yml create mode 100644 docker/Dockerfile rename libs/{legacy-geo-7.17.0.jar => legacy-geo-7.17.1.jar} (93%) diff --git a/README.md b/README.md index aea8a01..1f85af9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ``` @@ -134,7 +135,7 @@ Result: Document indexing with shape fixing: ``` -POST main/_doc +POST main/_doc?pipeline=geo_extension { "geoshape_0": { "type": "Polygon", @@ -172,7 +173,7 @@ POST main/_doc ] } } -GET main/_search?pipeline=geo_extension +GET main/_search ``` Result: @@ -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 | | --------------------- | -------------- | ---------- | @@ -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 diff --git a/build.gradle b/build.gradle index 6fd4e8a..7005ce9 100644 --- a/build.gradle +++ b/build.gradle @@ -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' @@ -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") } } diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..33bdcc4 --- /dev/null +++ b/docker-compose.yml @@ -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 diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..fee935f --- /dev/null +++ b/docker/Dockerfile @@ -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 diff --git a/gradle.properties b/gradle.properties index c3977d4..24eb203 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/libs/legacy-geo-7.17.0.jar b/libs/legacy-geo-7.17.1.jar similarity index 93% rename from libs/legacy-geo-7.17.0.jar rename to libs/legacy-geo-7.17.1.jar index 07a3f9638d9f990ebe47b276caff2f03e1f7cd68..08d9a78c3351b69c2c37047a7db1e0e0f4d07445 100644 GIT binary patch delta 3113 zcmZuzd0dl68lEA6AV;_)+=NR&q>w5>u_(r+MSiJVr3C~mRM#Q~xms7YQkp7mr3gxt zL8SgrS;11I-2@_+fKpt=16i!%RjMvl3wUf-!2@F>>a!rE-}~oR?esiPU2u_9b6z>m5Cpx-KTZtl!ZpB=2D2o_(n< z*2RbG?zg>jEmmA(YPaWw_0!IWWqxaR+6t=g4oqfCzJJo8<5c9&E7SWfw9hJcZ&sY; z_jmF=dsL|DT;9Jv`tZ+|ymyt}(q}DhMH}yT7b*?v6YF}G7J+P9?kX|vq0UUfLFWBl*#sacDz@-EE%G&4rwaBej3lk{ulGD*piIqK7~ z!mgst=|?J`osC~`XTUhNq2eECaM#4Jf3kUCsAqVM=i(sJar~ipOgE`i zS>^pCfjjuIVOw`YwYSmrkCL96WNm%>Lf2=zdw;KJP4ix{bM2a8SZ<$X4!xIt z>q(!Sh;ImM=#Jk}+aGz`TKrOeS@^~s&!P#P>11tB3|9`pq&GNtp$PSD=8P9aDD*_m z^yww?<=`|b5<~&yT`jGID|E<8nHcEAAtrQK0402q>c1|SS18i~AexIV2175z?}W3} zb_?Jp9W!Fy9Z*9$?}B;- zP+xs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