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

Cluster tools #1124

Merged
merged 6 commits into from
Nov 8, 2024
Merged

Conversation

AndreKurait
Copy link
Member

@AndreKurait AndreKurait commented Nov 7, 2024

Description

Creates library cluster_tools for an easy to extend library of tools around opensearch business logic for migrations.

Ships with tools: create_index, change_shards, enable/disable_compatibility_mode

Was getting some codecov failures, added retry akin to security repo

  • Category: New feature
  • Why these changes are required? Provide an easy-to-extend library of adhoc cluster manipulations
  • What is the old behavior before changes and new behavior after changes? Library didn't exist

Issues Resolved

https://opensearch.atlassian.net/browse/MIGRATIONS-2201

Is this a backport? If so, please add backport PR # and/or commits #

Testing

Unit testing and some manual testing

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • 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.

Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
@AndreKurait AndreKurait marked this pull request as ready for review November 7, 2024 16:37
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 86.50000% with 27 lines in your changes missing coverage. Please review.

Project coverage is 80.63%. Comparing base (48da9ce) to head (be19bc3).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
...onConsole/cluster_tools/src/cluster_tools/utils.py 61.76% 13 Missing ⚠️
...ionConsole/cluster_tools/src/cluster_tools/main.py 82.60% 12 Missing ⚠️
...onConsole/cluster_tools/src/tools/change_shards.py 96.22% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1124      +/-   ##
============================================
+ Coverage     80.51%   80.63%   +0.12%     
- Complexity     2871     2910      +39     
============================================
  Files           393      399       +6     
  Lines         14554    14829     +275     
  Branches       1000     1007       +7     
============================================
+ Hits          11718    11958     +240     
- Misses         2229     2260      +31     
- Partials        607      611       +4     
Flag Coverage Δ
gradle-test 78.66% <ø> (+0.06%) ⬆️
python-test 89.75% <86.50%> (-0.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

parser.add_argument("primary_shards", type=int, help="Number of primary shards for the index")


def create_index(env: Environment, index_name: str, primary_shards: int) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious if it will be sufficiently useful for people to be able to create an index and have only one setting specified. My guess is that most of the time there are mappings, other settings, etc. With that said, I don't think it's an issue to include it and we can add more flexibility later.

Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
Signed-off-by: Andre Kurait <[email protected]>
@AndreKurait AndreKurait merged commit 66ae561 into opensearch-project:main Nov 8, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants