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

Update the developer guide to add a section to run remote backed storage from dev environment #16223

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

srikanthpadakanti
Copy link
Contributor

@srikanthpadakanti srikanthpadakanti commented Oct 7, 2024

Description

Add a section to run remote backed storage from dev environment

Related Issues

Closes #16096

#10651

Check List

  • Functionality includes testing.
  • [*] Commits are signed per the DCO using --signoff
  • [*] API changes companion pull request created, if applicable.
  • [*] Public documentation issue/PR created, if applicable.

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.

Signed-off-by: Srikanth Padakanti <[email protected]>
@srikanthpadakanti srikanthpadakanti changed the title Update the developer guide #16096 Update the developer guide to add a section to run remote backed storage from dev environment Oct 7, 2024


// Add AWS credentials to the keystore
keystore 's3.client.default.access_key', '<access_key>'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think storing credentials in this file should be a recommended practice.

How about reading from env variables instead as an alternative unless there are better ways:

keystore 's3.client.default.access_key', System.getenv('AWS_ACCESS_KEY_ID')
keystore 's3.client.default.secret_key', System.getenv('AWS_SECRET_ACCESS_KEY')
keystore 's3.client.default.session_token', System.getenv('AWS_SESSION_TOKEN')
export AWS_ACCESS_KEY_ID=<access_key>
export AWS_SECRET_ACCESS_KEY=<secret_key>
export AWS_SESSION_TOKEN=<session_token>

In that way onlly authorized users are able to run this script.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand that storing credentials directly isn't the recommended approach, and I agree. You can definitely export these values and access them through system variables. My goal here is to demonstrate how to run OpenSearch locally while connecting to remote storage.

The reason I’m using them directly in the file is that my tokens [access_key, secret, token] are temporarily generated and have a validity of only 45 minutes.

Made the recommended changes.

Copy link
Contributor Author

@srikanthpadakanti srikanthpadakanti left a comment

Choose a reason for hiding this comment

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

Made the recommended changes.



// Add AWS credentials to the keystore
keystore 's3.client.default.access_key', '<access_key>'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand that storing credentials directly isn't the recommended approach, and I agree. You can definitely export these values and access them through system variables. My goal here is to demonstrate how to run OpenSearch locally while connecting to remote storage.

The reason I’m using them directly in the file is that my tokens [access_key, secret, token] are temporarily generated and have a validity of only 45 minutes.

Made the recommended changes.

Copy link
Contributor Author

@srikanthpadakanti srikanthpadakanti left a comment

Choose a reason for hiding this comment

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

Made the recommended changes.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Thanks! I made a bunch of nitpicky asks, choose the ones that you think are good ones.

CHANGELOG.md Outdated Show resolved Hide resolved
DEVELOPER_GUIDE.md Outdated Show resolved Hide resolved
DEVELOPER_GUIDE.md Outdated Show resolved Hide resolved
DEVELOPER_GUIDE.md Outdated Show resolved Hide resolved
DEVELOPER_GUIDE.md Outdated Show resolved Hide resolved
DEVELOPER_GUIDE.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Oct 10, 2024
srikanthpadakanti and others added 6 commits October 14, 2024 22:40
Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
Signed-off-by: Srikanth Padakanti <[email protected]>
Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
Signed-off-by: Srikanth Padakanti <[email protected]>
Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
Signed-off-by: Srikanth Padakanti <[email protected]>
Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
Signed-off-by: Srikanth Padakanti <[email protected]>
Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
Signed-off-by: Srikanth Padakanti <[email protected]>
Signed-off-by: Srikanth Padakanti <[email protected]>
Copy link
Contributor Author

@srikanthpadakanti srikanthpadakanti left a comment

Choose a reason for hiding this comment

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

Considered the recommended suggestions and made sure to incorporate everyone of them.

Copy link
Contributor Author

@srikanthpadakanti srikanthpadakanti left a comment

Choose a reason for hiding this comment

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

Made the recommended changes

Signed-off-by: Srikanth Padakanti <[email protected]>
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

More nits, sorry to be annoying. Thanks for hanging in here with me!

The TOC is the one really needed.

@@ -556,6 +556,40 @@ Then, you need to apply patterns for git-secrets, you can install the AWS standa
git secrets --register-aws
```

#### Remote Backed Storage
Copy link
Member

Choose a reason for hiding this comment

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

The developer guide has a TOC on the top that needs to be re-generated/updated.

Screenshot 2024-10-16 at 6 40 13 AM

```
testClusters {
runTask {
// Add following lines to enable remote store
Copy link
Member

Choose a reason for hiding this comment

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

To be consistent with the text below.

Suggested change
// Add following lines to enable remote store
// Enable remote store

setting 'node.attr.remote_store.repository.my-repository.settings.bucket', '<bucket_name>'
setting 'node.attr.remote_store.repository.my-repository.settings.base_path', '<base_path>'
setting 'node.attr.remote_store.repository.my-repository.settings.region', '<region>' # e.g. us-west-2

Copy link
Member

Choose a reason for hiding this comment

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

Nit: remove one of the empty lines.

keystore 's3.client.default.secret_key', System.getenv('AWS_SECRET_ACCESS_KEY')
keystore 's3.client.default.session_token', System.getenv('AWS_SESSION_TOKEN')
```
Then run by giving the required plugin as parameter
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Then run by giving the required plugin as parameter
Then run by specifying the required plugin as parameter.

```
Then run by giving the required plugin as parameter
```
Exporting values to use as system variable.
Copy link
Member

Choose a reason for hiding this comment

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

Remove this line, it's text and can't be copy-pasted.

export AWS_SECRET_ACCESS_KEY=<secret_key>
export AWS_SESSION_TOKEN=<session_token>

Example: plugin can be 'repository-s3'
Copy link
Member

Choose a reason for hiding this comment

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

In this section it has to be repository-s3, just remove this line.

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Nov 15, 2024
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 stalled Issues that have stalled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] Add a section to run remote backed storage from dev environment
4 participants