Skip to content

Add developer guide #18

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

Merged
merged 2 commits into from
Jun 25, 2021
Merged

Add developer guide #18

merged 2 commits into from
Jun 25, 2021

Conversation

VijayanB
Copy link
Member

Signed-off-by: Vijayan Balasubramanian balasvij@amazon.com

Description

Update gem spec and DEVELOPER_GUIDE.

Issues Resolved

#6

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@VijayanB VijayanB changed the title Update guide Add developer guide Jun 23, 2021
@VijayanB VijayanB self-assigned this Jun 23, 2021
@VijayanB VijayanB added the documentation Improvements or additions to documentation label Jun 23, 2021
@VijayanB VijayanB linked an issue Jun 23, 2021 that may be closed by this pull request
@VijayanB
Copy link
Member Author

Link to see this change in better readable format: https://github.com/VijayanB/logstash-output-opensearch/blob/guide/DEVELOPER_GUIDE.md

@vamshin vamshin requested a review from stockholmux June 23, 2021 04:23

## Getting Started

### Git Clone logstash-output-opensearch Repo
Copy link
Member

Choose a reason for hiding this comment

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

How about just call clone repo?

Copy link
Member

Choose a reason for hiding this comment

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

I would state it differently in the heading - if someone wants to contribute they should fork.

So, maybe "### Fork the logstash-output-opensearch Repo"


#### JRuby

This plugin builds using JRuby. This means you'll need JRuby with the Bundler gem installed.
Copy link
Member

Choose a reason for hiding this comment

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

Do these commands work for all the OS?

Copy link
Member

Choose a reason for hiding this comment

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

This should. I use rvm everywhere.

Copy link
Member

Choose a reason for hiding this comment

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

Link to JRuby.org the first time it's mentioned so folks get some context.


#### JRuby

This plugin builds using JRuby. This means you'll need JRuby with the Bundler gem installed.
Copy link
Member

Choose a reason for hiding this comment

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

This should. I use rvm everywhere.

rvm install jruby

#Installing bundler
jruby -S gem install bundler
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be rvm use jruby, then gem install bundler.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack


```bash
# Set up Environment variable for docker to pull your test environment
export LOGSTASH_VERSION=7.13.2 # mandatory
Copy link
Member

Choose a reason for hiding this comment

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

Can this be defaulted. I ran into logstash-plugins/logstash-output-elasticsearch#1019 which seems more annoying than anything else.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack.

To perform unit tests, set `INTEGRATION=false` and re-run the `docker-run.sh`.
You don't have to set up docker again.

2. Tests against OpenDistro clusters.
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a "test against Elasticsearch OSS"?

Copy link
Member Author

Choose a reason for hiding this comment

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

There is no difference between opendistro and Elasticsearch OSS. If you still feel we need dedicated test, it can be added easily too.

Copy link
Member

@stockholmux stockholmux left a comment

Choose a reason for hiding this comment

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

Looks good - a few minor things.


## Getting Started

### Git Clone logstash-output-opensearch Repo
Copy link
Member

Choose a reason for hiding this comment

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

I would state it differently in the heading - if someone wants to contribute they should fork.

So, maybe "### Fork the logstash-output-opensearch Repo"


### Git Clone logstash-output-opensearch Repo

Fork [opensearch-project/logstash-output-opensearch](https://github.com/opensearch-project/logstash-output-opensearch) and clone locally, e.g. `git clone https://github.com/[your username]/logstash-output-opensearch.git`.
Copy link
Member

Choose a reason for hiding this comment

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

I think block style code is more clear and easier to identify

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack


#### JRuby

This plugin builds using JRuby. This means you'll need JRuby with the Bundler gem installed.
Copy link
Member

Choose a reason for hiding this comment

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

Link to JRuby.org the first time it's mentioned so folks get some context.

bin/logstash -e 'output {opensearch {}}'
```

At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply re-run Logstash.
Copy link
Member

Choose a reason for hiding this comment

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

Version: 1.0.0
File: logstash-output-opensearch-1.0.0.gem
```
The s.version number from your gemspec file will provide the gem version, in this case, 1.0.0.
Copy link
Member

Choose a reason for hiding this comment

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

s.version

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack


### Authorization

Authorization to a secure OpenSearch cluster requires read permission at index level.
Copy link
Member

Choose a reason for hiding this comment

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

point to the documentation on index level permissions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack

@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'logstash-output-opensearch'
s.version = '1.0.0'

s.licenses = ['Apache License (2.0)']
s.licenses = ['Apache-2.0']
s.summary = "Stores logs in OpenSearch"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gem. This gem is not a stand-alone program"
s.authors = ["OpenSearch"]
Copy link
Member

Choose a reason for hiding this comment

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

Should this be "OpenSearch Community"?

Copy link
Member Author

Choose a reason for hiding this comment

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

@dblock @vamshin what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I really don't know what it should be. It feels wrong to remove Elastic here, but maybe we should say OpenSearch Contributors?

Copy link
Member Author

Choose a reason for hiding this comment

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

@dblock @stockholmux what do you think of this ?
s.authors = ["Elastic", "OpenSearch Contributors"]

Copy link
Member

Choose a reason for hiding this comment

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

Since this plugin is more about OSS and Apache2.0, I feel just OpenSearch Contributors should be good enough?

Copy link
Member

Choose a reason for hiding this comment

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

I'm queasy removing "Elastic".

I would use the array as mentioned by @VijayanB.


### Run Tests

We run both unit tests and integration tests inside docker environment.
Copy link
Member

Choose a reason for hiding this comment

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

The 'royal we' here is weird. Rephrase to be first person singular 'You should run both unit....' or similar

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack

```

To perform unit tests, set `INTEGRATION=false` and re-run the `docker-run.sh`.
You don't have to set up docker again.
Copy link
Member

Choose a reason for hiding this comment

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

big D for Docker

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack


## Configuration for Logstash Output OpenSearch Plugin

To run the Logstash Output Opensearch plugin, simply add a configuration following the below documentation.
Copy link
Member

Choose a reason for hiding this comment

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

Simply is not a great word for this type of document.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack

Copy link
Member

@stockholmux stockholmux left a comment

Choose a reason for hiding this comment

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

Tiny nit.


Example:
```bash
git clone https://github.com/[your username]/logstash-output-opensearch.git.
Copy link
Member

Choose a reason for hiding this comment

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

this should be 'git fork' to match the above text?

Copy link
Member Author

@VijayanB VijayanB Jun 23, 2021

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@VijayanB Ahh - This is why I can't do these at the end of the day. My bad. LGTM

@VijayanB VijayanB requested a review from stockholmux June 24, 2021 17:50
Copy link
Member

@stockholmux stockholmux left a comment

Choose a reason for hiding this comment

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

Good on the git clone (🤦‍♂️ on my part) and a comment on the gemspec


Example:
```bash
git clone https://github.com/[your username]/logstash-output-opensearch.git.
Copy link
Member

Choose a reason for hiding this comment

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

@VijayanB Ahh - This is why I can't do these at the end of the day. My bad. LGTM

@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
s.name = 'logstash-output-opensearch'
s.version = '1.0.0'

s.licenses = ['Apache License (2.0)']
s.licenses = ['Apache-2.0']
s.summary = "Stores logs in OpenSearch"
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gem. This gem is not a stand-alone program"
s.authors = ["OpenSearch"]
Copy link
Member

Choose a reason for hiding this comment

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

I'm queasy removing "Elastic".

I would use the array as mentioned by @VijayanB.

Copy link
Member

@vamshin vamshin left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks

Update gem spec and DEVELOPER_GUIDE.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Add exclude pattern since it is expected.

Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
@VijayanB VijayanB merged commit 7de04ba into opensearch-project:develop Jun 25, 2021
@VijayanB VijayanB deleted the guide branch June 25, 2021 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up README and other files
4 participants