Skip to content

Commit

Permalink
[RORDEV-991] new ES 8.10.0 support (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
coutoPL authored Sep 15, 2023
1 parent 6554a0b commit 0cc9775
Show file tree
Hide file tree
Showing 172 changed files with 13,973 additions and 10 deletions.
6 changes: 4 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ stages:
strategy:
maxParallel: 99
matrix:
IT_es810x:
ROR_TASK: integration_es810x
IT_es89x:
ROR_TASK: integration_es89x
IT_es88x:
Expand Down Expand Up @@ -167,8 +169,8 @@ stages:
strategy:
maxParallel: 99
matrix:
IT_es89x:
ROR_TASK: integration_es89x
IT_es810x:
ROR_TASK: integration_es810x
IT_es80x:
ROR_TASK: integration_es80x
- job:
Expand Down
24 changes: 16 additions & 8 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ if [[ -z $TRAVIS ]] || [[ $ROR_TASK == "core_tests" ]]; then
./gradlew --stacktrace core:test
fi

if [[ -z $TRAVIS ]] || [[ $ROR_TASK == "integration_es810x" ]]; then
echo ">>> es810x => Running testcontainers.."
./gradlew integration-tests:test '-PesModule=es810x' || ( find . |grep hs_err |xargs cat && exit 1 )
fi

if [[ -z $TRAVIS ]] || [[ $ROR_TASK == "integration_es89x" ]]; then
echo ">>> es89x => Running testcontainers.."
./gradlew integration-tests:test '-PesModule=es89x' || ( find . |grep hs_err |xargs cat && exit 1 )
Expand Down Expand Up @@ -189,21 +194,24 @@ if [[ -z $TRAVIS ]] || [[ $ROR_TASK == "package_es8xx" ]]; then

echo ">>> ($0) additional builds of ES module for specified ES version"

#es89
#es810x
./gradlew --stacktrace es810x:ror '-PesVersion=8.10.0'

#es89x
./gradlew --stacktrace es89x:ror '-PesVersion=8.9.2'
./gradlew --stacktrace es89x:ror '-PesVersion=8.9.1'
./gradlew --stacktrace es89x:ror '-PesVersion=8.9.0'

#es88
#es88x
./gradlew --stacktrace es88x:ror '-PesVersion=8.8.2'
./gradlew --stacktrace es88x:ror '-PesVersion=8.8.1'
./gradlew --stacktrace es88x:ror '-PesVersion=8.8.0'

#es87
#es87x
./gradlew --stacktrace es87x:ror '-PesVersion=8.7.1'
./gradlew --stacktrace es87x:ror '-PesVersion=8.7.0'

#es85
#es85x
./gradlew --stacktrace es85x:ror '-PesVersion=8.6.2'
./gradlew --stacktrace es85x:ror '-PesVersion=8.6.1'
./gradlew --stacktrace es85x:ror '-PesVersion=8.6.0'
Expand All @@ -212,25 +220,25 @@ if [[ -z $TRAVIS ]] || [[ $ROR_TASK == "package_es8xx" ]]; then
./gradlew --stacktrace es85x:ror '-PesVersion=8.5.1'
./gradlew --stacktrace es85x:ror '-PesVersion=8.5.0'

#es84
#es84x
./gradlew --stacktrace es84x:ror '-PesVersion=8.4.3'
./gradlew --stacktrace es84x:ror '-PesVersion=8.4.2'
./gradlew --stacktrace es84x:ror '-PesVersion=8.4.1'
./gradlew --stacktrace es84x:ror '-PesVersion=8.4.0'

#es83
#es83x
./gradlew --stacktrace es83x:ror '-PesVersion=8.3.3'
./gradlew --stacktrace es83x:ror '-PesVersion=8.3.2'
./gradlew --stacktrace es83x:ror '-PesVersion=8.3.1'
./gradlew --stacktrace es83x:ror '-PesVersion=8.3.0'

#es82
#es82x
./gradlew --stacktrace es82x:ror '-PesVersion=8.2.3'
./gradlew --stacktrace es82x:ror '-PesVersion=8.2.2'
./gradlew --stacktrace es82x:ror '-PesVersion=8.2.1'
./gradlew --stacktrace es82x:ror '-PesVersion=8.2.0'

#es81
#es81x
./gradlew --stacktrace es81x:ror '-PesVersion=8.1.3'
./gradlew --stacktrace es81x:ror '-PesVersion=8.1.2'
./gradlew --stacktrace es81x:ror '-PesVersion=8.1.1'
Expand Down
92 changes: 92 additions & 0 deletions es810x/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* This file is part of ReadonlyREST.
*
* ReadonlyREST is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ReadonlyREST is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ReadonlyREST. If not, see http://www.gnu.org/licenses/
*/

plugins {
id "readonlyrest.plugin-common-conventions"
}

def pluginFullName = pluginName + '-' + version

compileScala {
sourceCompatibility = 17
targetCompatibility = 17
}

dependencies {
implementation project(path: ':core')
implementation project(path: ':ror-tools', configuration: 'shadow')
implementation project(path: ':ror-tools-core')
implementation group: 'org.elasticsearch', name: 'elasticsearch' , version: esVersion
implementation group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: esVersion
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.1'
compileOnly group: 'org.locationtech.spatial4j', name: 'spatial4j', version: '0.7'
// if you don't have this dependency in local maven, please run publishToMavenLocal task first
compileOnly group: 'org.elasticsearch.plugin', name: 'transport-netty4', version: esVersion
}

configurations {
wagon
distJars {
exclude group: 'org.elasticsearch'
exclude group: 'lucene-core'
exclude module: 'log4j-api'
exclude module: 'log4j-core'
exclude group: 'lucene-analyzers-common'
exclude group: 'org.apache.commons'
exclude group: 'org.yaml'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
}
}

tasks.register('cleanOldData') {
doLast {
delete 'build/tmp/' + pluginFullName
}
}

tasks.register('jarHellCheck', JavaExec) {
outputs.upToDateWhen { false }
mainClass.set("org.elasticsearch.jdk.JarHell")
classpath = project.sourceSets.main.compileClasspath.filter { it.exists() }
}

tasks.register('resolvePluginDescriptorTemplate', Copy) {
dependsOn configureEsVersion
outputs.upToDateWhen { false }
from './plugin-metadata'
into 'build/tmp/' + pluginFullName
expand([
'descriptor': [
'name' : pluginName,
'pluginVersion': project.properties['pluginVersion'],
'esVersion' : project.properties['esVersion']
]
])
}

tasks.register('ror', Zip) {
dependsOn(cleanOldData, jarHellCheck, toJar, resolvePluginDescriptorTemplate)
outputs.upToDateWhen { false }
archivesBaseName = pluginName
into('.')
{
from configurations.distJars.filter { x -> !x.name.contains('spatial4j') && !x.name.contains('jts') }
from 'build/libs/' + pluginFullName + '.jar'
from 'build/tmp/' + pluginFullName
}
}
1 change: 1 addition & 0 deletions es810x/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
esVersion=8.10.0
27 changes: 27 additions & 0 deletions es810x/plugin-metadata/plugin-descriptor.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# This file is part of ReadonlyREST.
#
# ReadonlyREST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ReadonlyREST is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ReadonlyREST. If not, see http://www.gnu.org/licenses/
#
#
# Elasticsearch plugin descriptor file
# This file must exist as 'plugin-descriptor.properties' in a folder named `elasticsearch`
# inside all plugins.
#
name=${descriptor.name}
version=${descriptor.pluginVersion}
description=Safely expose Elasticsearch REST API
classname=tech.beshu.ror.es.ReadonlyRestPlugin
java.version=1.8
elasticsearch.version=${descriptor.esVersion}
14 changes: 14 additions & 0 deletions es810x/plugin-metadata/plugin-security.policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
grant {
permission java.io.FilePermission "/usr/share/elasticsearch", "read";
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.misc.*";
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.RuntimePermission "setContextClassLoader";
permission java.net.SocketPermission "*", "accept, resolve, connect";
permission java.security.SecurityPermission "insertProvider";
permission java.security.SecurityPermission "putProviderProperty.BCFIPS";
permission java.security.SecurityPermission "putProviderProperty.BCJSSE";
permission java.util.PropertyPermission "*", "read,write";
};
Loading

0 comments on commit 0cc9775

Please sign in to comment.