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

[Backport 1.x] Add support for minimum compatible version for Extensions and OpenSearch #399

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ Here is an example extension configuration `extensions.yml`:
extensions:
- name: sample-extension // extension name
uniqueId: opensearch-sdk-1 // identifier for the extension
hostName: 'sdk_host' // name of the host where extension is running
hostAddress: '127.0.0.1' // host to reach
port: '4532' // port to reach
version: '1.0' // extension version
description: Extension for the Opensearch SDK Repo // description of the extension
opensearchVersion: '3.0.0' // OpenSearch compatibility
opensearchVersion: '3.0.0' // Compiled with OpenSearch version
minimumCompatibleVersion: '3.0.0' // Minimum version of OpenSearch the extension is wire compatible with
```

### Communication
Expand All @@ -74,6 +73,10 @@ The sequence diagram below shows the process of initializing an Extension, regis

The `org.opensearch.sdk.sample` package contains a sample `HelloWorldExtension` implementing the below steps. It is executed following the steps in the [`DEVELOPER_GUIDE`](DEVELOPER_GUIDE.md).

#### Wire Compatibility

Extensions will be wire compatible across minor and patch versions. The configuration contains `minimumCompatibleVersion` which is validated by ExtensionsManager in OpenSearch.

#### Extension REST Actions Walk Through

![](Docs/ExtensionRestActions.svg)
Expand Down
7 changes: 1 addition & 6 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,11 @@ A sample `extensions.yml` file is shown below. The `uniqueId` will be used in RE
extensions:
- name: hello-world
uniqueId: opensearch-sdk-java-1
hostName: 'sdk_host'
hostAddress: '127.0.0.1'
port: '4532'
version: '1.0'
description: Extension for the Opensearch SDK Repo
opensearchVersion: '3.0.0'
javaVersion: '14'
className: ExtensionsRunner
customFolderName: opensearch-sdk-java
hasNativeController: false
minimumCompatibleVersion: '3.0.0'
```

#### Run OpenSearch
Expand Down
7 changes: 2 additions & 5 deletions src/test/java/org/opensearch/sdk/TestExtensionsRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,10 @@ public void testHandleExtensionInitRequest() throws UnknownHostException {
DiscoveryExtensionNode extension = new DiscoveryExtensionNode(
EXTENSION_NAME,
"opensearch-sdk-1",
"",
"",
"",
sourceNode.getAddress(),
new HashMap<String, String>(),
null,
null,
Version.fromString("3.0.0"),
Version.fromString("3.0.0"),
new ArrayList<ExtensionDependency>()
);

Expand Down