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

Updated Developer Guide #16

Merged
merged 6 commits into from
Jun 16, 2022
Merged
Changes from 4 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
33 changes: 25 additions & 8 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
# OpenSearch SDK Developer Guide
- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [Git Clone IndependentPlugin Repo](#git-clone-independentplugin-repo)
- [Run Independent Plugin](#run-independent-plugin)
- [Git Clone OpenSearch-SDK Repo](#git-clone-OpenSearch-SDK-repo)
- [Git Clone OpenSearch Repo](#git-clone-opensearch-repo)
- [Publish OpenSearch Feature/Extensions branch to Maven local](#publish-opensearch-feature/extensions-branch-to-maven-local)
- [Run OpenSearch-SDK](#run-opensearch-sdk)
- [Run Tests](#run-tests)
- [Send Message using Telnet](#send-message-using-telnet)

Expand All @@ -14,12 +16,24 @@ Read more about extensibility [here](https://github.com/opensearch-project/OpenS

## Getting Started

### Git Clone IndependentPlugin Repo
Fork [IndependentPlugin](https://github.com/owaiskazi19/IndependentPlugin) and clone locally, e.g. `git clone https://github.com/[your username]/IndependentPlugin.git`.
### Git Clone OpenSearch SDK Repo
Fork [OpenSearch SDK](https://github.com/opensearch-project/opensearch-sdk) and clone locally, e.g. `git clone https://github.com/[your username]/opensearch-sdk.git`.

### Run Independent Plugin
### Git Clone OpenSearch Repo
Fork [OpenSearch](https://github.com/opensearch-project/OpenSearch) and clone locally, e.g. `git clone https://github.com/[your username]/OpenSearch.git`.

Run main script using `gradlew run`.
## Publish OpenSearch feature/extensions Branch to Maven local
The work done to support the extensions framework is located on the `feature/extensions` branch of the OpenSearch project. It is necessary to publish the dependencies of this branch to your local maven repository prior to running the OpenSearch SDK on a seperate process.

- First navigate to the directory that OpenSearch has been cloned to
- Checkout the correct branch, e.g. `git checkout feature/extensions`.
- Run `./gradlew publishToMavenLocal`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next step should be run ./gradlew check to make sure the build is successful


It is necessary to publish dependencies to a local maven repository until this branch is merged to `main`, at which point all dependencies will be published to Maven central.

### Run OpenSearch SDK

Navigate to the directory that OpenSearch-SDK has been cloned to and run main script using `./gradlew run`.

```
./gradlew run
Expand All @@ -37,6 +51,9 @@ Bound addresses will then be logged to the terminal :
[main] INFO transportservice.TransportService - profile [test]: publish_address {127.0.0.1:5555}, bound_addresses {[::1]:5555}, {127.0.0.1:5555}
```

Once the bound addresses are logged to the terminal, navigate to the directory that OpenSearch has been cloned to and start OpenSearch feature/extensions branch using `./gradlew run`.
It is important that the OpenSearch SDK is already up and running prior to starting OpenSearch, since extension discovery occurs only if the OpenSearch SDK is already listening on a pre-defined port. Once discovery is complete and the data transfer connection between both nodes has been established, OpenSearch and the OpenSearch SDK will now be able to comminicate.

### Run Tests

Run tests :
Expand All @@ -46,7 +63,7 @@ Run tests :

### Send Message using Telnet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of telnet should we mention about running OpenSearch in another terminal as this was written before the connection was established?


To send a message, first run the IndependentPlugin :
To send a message, first run the OpenSearch-SDK :

```
./gradlew run
Expand All @@ -61,7 +78,7 @@ Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
The original terminal used to run the independent plugin will log the connection request :
The original terminal used to run the OpenSearch-SDK will log the connection request :
```
[opensearch[NettySizeHeaderFrameDecoderTests][transport_worker][T#5]] TRACE transportservice.TcpTransport - Tcp transport channel accepted: Netty4TcpChannel{localAddress=/127.0.0.1:5555, remoteAddress=/127.0.0.1:57302}
[opensearch[NettySizeHeaderFrameDecoderTests][transport_worker][T#5]] TRACE transportservice.netty4.OpenSearchLoggingHandler - [id: 0x8c1cc239, L:/127.0.0.1:5555 - R:/127.0.0.1:57302] REGISTERED
Expand Down