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

Updating Developer guide #84

Merged
merged 7 commits into from
Aug 15, 2022
Merged
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
24 changes: 24 additions & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,30 @@ Run tests :
```
./gradlew clean build test
```
## Generate Artifact
In opensearch-sdk navigate to build/distributions. Look for tar ball in the form `opensearch-sdk-1.0.0-SNAPSHOT.tar`. If not found follow the below steps to create one:
```
./gradlew clean && ./gradlew build
```
Once the tar ball is generated navigate to /src/test/resources and look for extension.yml. Create one if not present
Copy link
Member

Choose a reason for hiding this comment

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

Running the artifact would look for the extension.yml file within the opensearch-sdk/build/distributions/opensearch-sdk-1.0.0-SNAPSHOT/src/test/resources/ instead of the opensearch-sdk/src/test/resources directory. This will cause the following error:
Exception in thread "main" java.io.FileNotFoundException: src/test/resources/extension.yml (No such file or directory) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:212) at java.base/java.io.FileInputStream.<init>(FileInputStream.java:154) at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:354) at com.fasterxml.jackson.dataformat.yaml.YAMLFactory.createParser(YAMLFactory.java:15) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3494) at org.opensearch.sdk.ExtensionsRunner.readExtensionSettings(ExtensionsRunner.java:90) at org.opensearch.sdk.ExtensionsRunner.<init>(ExtensionsRunner.java:67) at org.opensearch.sdk.ExtensionsRunner.main(ExtensionsRunner.java:386)

Perhaps we should add this as a note and remind developers to create the extension.yml file within the correct directory prior to running the binary

Copy link
Member

Choose a reason for hiding this comment

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

Create #86 to address this

Copy link
Member

Choose a reason for hiding this comment

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

Let's resolve #86 before merging this then. @joshpalis @vibrantvarun WDYT?

Look for tar ball in /build/distributions. To run the artifact i.e. tar ball, run the below command
```
tar -xvf opensearch-sdk-1.0.0-SNAPSHOT.tar
```
TODO https://github.com/opensearch-project/opensearch-sdk/issues/52
Navigate to opensearch-sdk/build/distributions/opensearch-sdk-1.0.0-SNAPSHOT/
- Check if src folder exists in using `ls`.
Copy link
Member

@owaiskazi19 owaiskazi19 Aug 12, 2022

Choose a reason for hiding this comment

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

Are we not sure if src folder will exist? Did we have any case where it didn't actually?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah we have to create src folder

Copy link
Member Author

@vibrantvarun vibrantvarun Aug 12, 2022

Choose a reason for hiding this comment

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

Once #52 get resolved, there will no need to create src folder as location of extension.yml file will be finalized.

- If the src folder does not exist, create it using `mkdir src && cd src && mkdir test && cd test && mkdir resources && cd resources`.
The above command will generate a path opensearch-sdk/build/distributions/opensearch-sdk-1.0.0-SNAPSHOT/src/test/resources
- Manually create a file titled `extension.yml` within the resources directory using an IDE or an in-line text editor. Below is the sample of extension.yml

Sample extensions.yml file:
```
extensionName: extension
hostAddress: 127.0.0.1
hostPort: 4532
```
- After extension.yml is generated then start opensearch-sdk by ./bin/opensearch-sdk

## Submitting Changes

Expand Down