Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge first batch of feature/extensions into main #5347

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
072318f
Merge first batch of feature/extensions into main
ryanbogan Nov 22, 2022
bdd4b58
Fixed CHANGELOG
ryanbogan Nov 22, 2022
21355f1
Fixed newline errors
ryanbogan Nov 22, 2022
2f1a588
Renaming and CHANGELOG fixes
ryanbogan Nov 23, 2022
2912b8c
Refactor extension loading into private method
ryanbogan Nov 25, 2022
2fb8d7e
Rebase with main
ryanbogan Nov 25, 2022
02fb4e0
Removed skipValidation and added connectToExtensionNode method
ryanbogan Nov 28, 2022
934391d
Remove unnecessary feature flag calls
ryanbogan Dec 2, 2022
3710b4d
Renaming and exception handling
ryanbogan Dec 3, 2022
3fae24a
Merge branch 'main' into merge_feature_extensions_into_main_1
ryanbogan Dec 4, 2022
59286a0
Change latches to CompletableFuture
ryanbogan Dec 5, 2022
31d0b61
Removed unnecessary validateSettingKey call
ryanbogan Dec 5, 2022
5b43239
Fix azure-core dependency
ryanbogan Dec 6, 2022
162214c
Update SHAs
ryanbogan Dec 6, 2022
63e3825
Remove unintended dependency changes
ryanbogan Dec 6, 2022
c3c1111
Removed dynamic settings regitration, removed info() method, and adde…
ryanbogan Dec 6, 2022
f28a8fe
Merge branch 'main' into merge_feature_extensions_into_main_1
ryanbogan Dec 6, 2022
6e47403
Add javadoc
ryanbogan Dec 6, 2022
e14e6b3
Fixed spotless failure
ryanbogan Dec 6, 2022
99050d8
Removed NoopExtensionsManager
ryanbogan Dec 7, 2022
4cb8c39
Added functioning NoopExtensionsManager
ryanbogan Dec 7, 2022
59ad6e4
Added missing javadoc
ryanbogan Dec 7, 2022
c7ffd71
Remove forbiddenAPI
ryanbogan Dec 7, 2022
1d265b6
Fix spotless
ryanbogan Dec 8, 2022
f00a6ca
Change logger.info to logger.error in handleException
ryanbogan Dec 8, 2022
b93d41f
Fix ExtensionsManagerTests
ryanbogan Dec 8, 2022
c4643c3
Merge main into merge_feature_extensions_into_main_1
ryanbogan Dec 9, 2022
a5a1aff
Removing unrelated change
ryanbogan Dec 9, 2022
def10fa
Update SHAs
ryanbogan Dec 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Test] Add IAE test for deprecated edgeNGram analyzer name ([#5040](https://github.com/opensearch-project/OpenSearch/pull/5040))
- Allow mmap to use new JDK-19 preview APIs in Apache Lucene 9.4+ ([#5151](https://github.com/opensearch-project/OpenSearch/pull/5151))
- Add feature flag for extensions ([#5211](https://github.com/opensearch-project/OpenSearch/pull/5211))
- Merge first batch of feature/extensions into main ([#5347](https://github.com/opensearch-project/OpenSearch/pull/5347))
ryanbogan marked this conversation as resolved.
Show resolved Hide resolved

### Dependencies
- Bumps `log4j-core` from 2.18.0 to 2.19.0
Expand Down
2 changes: 0 additions & 2 deletions modules/ingest-geoip/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ opensearchplugin {
dependencies {
api('com.maxmind.geoip2:geoip2:3.0.2')
// geoip2 dependencies:
api("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
api("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}")
api('com.maxmind.db:maxmind-db:2.1.0')

testImplementation 'org.elasticsearch:geolite2-databases:20191119'
Expand Down

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions modules/ingest-geoip/licenses/jackson-databind-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions modules/ingest-geoip/licenses/jackson-databind-NOTICE

This file was deleted.

2 changes: 0 additions & 2 deletions plugins/discovery-ec2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ dependencies {
api "commons-logging:commons-logging:${versions.commonslogging}"
api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
api "commons-codec:commons-codec:${versions.commonscodec}"
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
ryanbogan marked this conversation as resolved.
Show resolved Hide resolved
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
}

restResources {
Expand Down
8 changes: 0 additions & 8 deletions plugins/discovery-ec2/licenses/jackson-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions plugins/discovery-ec2/licenses/jackson-NOTICE

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 4 additions & 6 deletions plugins/repository-azure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,28 @@ opensearchplugin {
}

dependencies {
api 'com.azure:azure-core:1.34.0'
api 'com.azure:azure-core:1.33.0'
ryanbogan marked this conversation as resolved.
Show resolved Hide resolved
api 'com.azure:azure-storage-common:12.18.1'
api 'com.azure:azure-core-http-netty:1.12.7'
api 'com.azure:azure-core-http-netty:1.12.4'
api "io.netty:netty-codec-dns:${versions.netty}"
api "io.netty:netty-codec-socks:${versions.netty}"
api "io.netty:netty-codec-http2:${versions.netty}"
api "io.netty:netty-handler-proxy:${versions.netty}"
api "io.netty:netty-resolver-dns:${versions.netty}"
api "io.netty:netty-transport-native-unix-common:${versions.netty}"
implementation project(':modules:transport-netty4')
api 'com.azure:azure-storage-blob:12.20.0'
api 'com.azure:azure-storage-blob:12.16.1'
api 'org.reactivestreams:reactive-streams:1.0.4'
api 'io.projectreactor:reactor-core:3.4.23'
api 'io.projectreactor.netty:reactor-netty:1.0.18'
api 'io.projectreactor.netty:reactor-netty-core:1.0.24'
api 'io.projectreactor.netty:reactor-netty-http:1.0.24'
api "org.slf4j:slf4j-api:${versions.slf4j}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
api "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}"
api "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:${versions.jackson}"
api "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}"
api 'org.codehaus.woodstox:stax2-api:4.2.1'
implementation "com.fasterxml.woodstox:woodstox-core:${versions.woodstox}"
implementation 'com.fasterxml.woodstox:woodstox-core:6.2.8'
runtimeOnly 'com.google.guava:guava:31.1-jre'
api 'org.apache.commons:commons-lang3:3.12.0'
testImplementation project(':test:fixtures:azure-fixture')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
93f105c2e923f0ab90521cc0e6e729b9c8304ad8

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
70dcc08887f2d70a8f812bf00d4fa10390fab3fd

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
84054ca8a6660eb77910925d71f70330fd3d83aa

This file was deleted.

8 changes: 0 additions & 8 deletions plugins/repository-azure/licenses/jackson-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions plugins/repository-azure/licenses/jackson-NOTICE

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
670748292899c53b1963730d9eb7f8ab71314e90

This file was deleted.

1 change: 0 additions & 1 deletion plugins/repository-hdfs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ dependencies {
api 'org.apache.htrace:htrace-core4:4.2.0-incubating'
api "org.apache.logging.log4j:log4j-core:${versions.log4j}"
api 'org.apache.avro:avro:1.11.1'
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
api 'com.google.code.gson:gson:2.10'
runtimeOnly 'com.google.guava:guava:31.1-jre'
api 'com.google.protobuf:protobuf-java:3.21.7'
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions plugins/repository-s3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ dependencies {
api "commons-logging:commons-logging:${versions.commonslogging}"
api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
api "commons-codec:commons-codec:${versions.commonscodec}"
api "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"
api "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}"
api "joda-time:joda-time:${versions.joda}"

Expand Down
8 changes: 0 additions & 8 deletions plugins/repository-s3/licenses/jackson-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions plugins/repository-s3/licenses/jackson-NOTICE

This file was deleted.

This file was deleted.

This file was deleted.

25 changes: 3 additions & 22 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ dependencies {
// jna
api "net.java.dev.jna:jna:${versions.jna}"

api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"

testImplementation(project(":test:framework")) {
// tests use the locally compiled version of server
exclude group: 'org.opensearch', module: 'server'
Expand Down Expand Up @@ -208,31 +211,12 @@ tasks.named("processResources").configure {

tasks.named("thirdPartyAudit").configure {
ignoreMissingClasses(
// from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml)
'com.fasterxml.jackson.databind.ObjectMapper',

// from log4j
'com.conversantmedia.util.concurrent.SpinPolicy',
'com.fasterxml.jackson.annotation.JsonInclude$Include',
'com.fasterxml.jackson.databind.DeserializationContext',
'com.fasterxml.jackson.databind.DeserializationFeature',
'com.fasterxml.jackson.databind.JsonMappingException',
'com.fasterxml.jackson.databind.JsonNode',
'com.fasterxml.jackson.databind.Module$SetupContext',
'com.fasterxml.jackson.databind.ObjectReader',
'com.fasterxml.jackson.databind.ObjectWriter',
'com.fasterxml.jackson.databind.SerializerProvider',
'com.fasterxml.jackson.databind.deser.std.StdDeserializer',
'com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer',
'com.fasterxml.jackson.databind.module.SimpleModule',
'com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter',
'com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider',
'com.fasterxml.jackson.databind.ser.std.StdScalarSerializer',
'com.fasterxml.jackson.databind.ser.std.StdSerializer',
'com.fasterxml.jackson.dataformat.xml.JacksonXmlModule',
'com.fasterxml.jackson.dataformat.xml.XmlMapper',
'com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter',
'com.fasterxml.jackson.databind.node.ObjectNode',
'org.fusesource.jansi.Ansi',
'org.fusesource.jansi.AnsiRenderer$Code',
'com.lmax.disruptor.EventFactory',
Expand Down Expand Up @@ -292,9 +276,6 @@ tasks.named("thirdPartyAudit").configure {
'org.noggit.JSONParser',

// from lucene-spatial
'com.fasterxml.jackson.databind.JsonSerializer',
'com.fasterxml.jackson.databind.JsonDeserializer',
'com.fasterxml.jackson.databind.node.ArrayNode',
'com.google.common.geometry.S2Cell',
'com.google.common.geometry.S2CellId',
'com.google.common.geometry.S2Projections',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(waitForTimedOut);
}

@Override
public String toString() {
return "ClusterStateResponse{" + "clusterState=" + clusterState + '}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
4 changes: 4 additions & 0 deletions server/src/main/java/org/opensearch/bootstrap/Security.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.opensearch.common.SuppressForbidden;
import org.opensearch.common.io.PathUtils;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.FeatureFlags;
import org.opensearch.env.Environment;
import org.opensearch.http.HttpTransportSettings;
import org.opensearch.plugins.PluginInfo;
Expand Down Expand Up @@ -316,6 +317,9 @@ static void addFilePermissions(Permissions policy, Environment environment) thro
addDirectoryPath(policy, Environment.PATH_HOME_SETTING.getKey(), environment.libDir(), "read,readlink", false);
addDirectoryPath(policy, Environment.PATH_HOME_SETTING.getKey(), environment.modulesDir(), "read,readlink", false);
addDirectoryPath(policy, Environment.PATH_HOME_SETTING.getKey(), environment.pluginsDir(), "read,readlink", false);
if (FeatureFlags.isEnabled(FeatureFlags.EXTENSIONS)) {
addDirectoryPath(policy, Environment.PATH_HOME_SETTING.getKey(), environment.extensionDir(), "read,readlink", false);
}
addDirectoryPath(policy, "path.conf'", environment.configDir(), "read,readlink", false);
// read-write dirs
addDirectoryPath(policy, "java.io.tmpdir", environment.tmpDir(), "read,readlink,write,delete", false);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.opensearch.cluster;

import org.opensearch.cluster.service.ClusterService;
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.io.stream.StreamOutput;
import org.opensearch.common.settings.Settings;
import org.opensearch.transport.TransportResponse;

import java.io.IOException;
import java.util.Objects;

/**
* PluginSettings Response for Extensibility
*
* @opensearch.internal
*/
public class ClusterSettingsResponse extends TransportResponse {
private final Settings clusterSettings;

public ClusterSettingsResponse(ClusterService clusterService) {
this.clusterSettings = clusterService.getSettings();
}

public ClusterSettingsResponse(StreamInput in) throws IOException {
super(in);
this.clusterSettings = Settings.readSettingsFromStream(in);
}

@Override
public void writeTo(StreamOutput out) throws IOException {
Settings.writeSettingsToStream(clusterSettings, out);
}

@Override
public String toString() {
return "ClusterSettingsResponse{" + "clusterSettings=" + clusterSettings + '}';
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ClusterSettingsResponse that = (ClusterSettingsResponse) o;
return Objects.equals(clusterSettings, that.clusterSettings);
}

@Override
public int hashCode() {
return Objects.hash(clusterSettings);
}

}
Loading