-
Notifications
You must be signed in to change notification settings - Fork 84
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
Conversation
Link to see this change in better readable format: https://github.com/VijayanB/logstash-output-opensearch/blob/guide/DEVELOPER_GUIDE.md |
DEVELOPER_GUIDE.md
Outdated
|
||
## Getting Started | ||
|
||
### Git Clone logstash-output-opensearch Repo |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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"
DEVELOPER_GUIDE.md
Outdated
|
||
#### JRuby | ||
|
||
This plugin builds using JRuby. This means you'll need JRuby with the Bundler gem installed. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
DEVELOPER_GUIDE.md
Outdated
|
||
#### JRuby | ||
|
||
This plugin builds using JRuby. This means you'll need JRuby with the Bundler gem installed. |
There was a problem hiding this comment.
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.
DEVELOPER_GUIDE.md
Outdated
rvm install jruby | ||
|
||
#Installing bundler | ||
jruby -S gem install bundler |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
DEVELOPER_GUIDE.md
Outdated
|
||
```bash | ||
# Set up Environment variable for docker to pull your test environment | ||
export LOGSTASH_VERSION=7.13.2 # mandatory |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
DEVELOPER_GUIDE.md
Outdated
|
||
## Getting Started | ||
|
||
### Git Clone logstash-output-opensearch Repo |
There was a problem hiding this comment.
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"
DEVELOPER_GUIDE.md
Outdated
|
||
### 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`. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
DEVELOPER_GUIDE.md
Outdated
|
||
#### JRuby | ||
|
||
This plugin builds using JRuby. This means you'll need JRuby with the Bundler gem installed. |
There was a problem hiding this comment.
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.
DEVELOPER_GUIDE.md
Outdated
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVELOPER_GUIDE.md
Outdated
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
DEVELOPER_GUIDE.md
Outdated
|
||
### Authorization | ||
|
||
Authorization to a secure OpenSearch cluster requires read permission at index level. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
logstash-output-opensearch.gemspec
Outdated
@@ -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"] |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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"]
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
DEVELOPER_GUIDE.md
Outdated
|
||
### Run Tests | ||
|
||
We run both unit tests and integration tests inside docker environment. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
DEVELOPER_GUIDE.md
Outdated
``` | ||
|
||
To perform unit tests, set `INTEGRATION=false` and re-run the `docker-run.sh`. | ||
You don't have to set up docker again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big D for Docker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
DEVELOPER_GUIDE.md
Outdated
|
||
## Configuration for Logstash Output OpenSearch Plugin | ||
|
||
To run the Logstash Output Opensearch plugin, simply add a configuration following the below documentation. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
There was a problem hiding this 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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example for git clone. similar to https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#git-clone-opensearch-repo
There was a problem hiding this comment.
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
There was a problem hiding this 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. |
There was a problem hiding this comment.
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
logstash-output-opensearch.gemspec
Outdated
@@ -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"] |
There was a problem hiding this comment.
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.
There was a problem hiding this 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>
Signed-off-by: Vijayan Balasubramanian balasvij@amazon.com
Description
Update gem spec and DEVELOPER_GUIDE.
Issues Resolved
#6
Check List
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.