-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Extensions] REST API to initialize an extension and dynamically load it #8029
[Extensions] REST API to initialize an extension and dynamically load it #8029
Conversation
37cc044
to
3b9dde4
Compare
Gradle Check (Jenkins) Run Completed with:
|
3b9dde4
to
1dfba83
Compare
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.
doing an initial pass
server/src/main/java/org/opensearch/extensions/ExtensionDependency.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/extensions/rest/RestInitializeExtensionAction.java
Outdated
Show resolved
Hide resolved
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Codecov Report
@@ Coverage Diff @@
## main #8029 +/- ##
============================================
- Coverage 70.99% 70.87% -0.13%
+ Complexity 56683 56607 -76
============================================
Files 4720 4721 +1
Lines 267590 267614 +24
Branches 39208 39218 +10
============================================
- Hits 189984 189661 -323
- Misses 61635 61980 +345
- Partials 15971 15973 +2
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
2301655
to
183a157
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
Gradle Check (Jenkins) Run Completed with:
|
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-8029-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f015e6a6cc205d1300c852fc731aac90bac3d930
# Push it to GitHub
git push --set-upstream origin backport/backport-8029-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
… it (opensearch-project#8029) * Implemented REST API for initializing extension Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Cleanup extensions.yml design Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added tests for RestInitializeExtensionAction Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Pulled extensions REST request in extensions directory Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Removed forbidden APIs from rest action and modified tests Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added entry in changelog Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added test for parse Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Spotless Fixed Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled exceptions Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled test failure Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> --------- Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
… it (opensearch-project#8029) * Implemented REST API for initializing extension Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Cleanup extensions.yml design Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added tests for RestInitializeExtensionAction Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Pulled extensions REST request in extensions directory Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Removed forbidden APIs from rest action and modified tests Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added entry in changelog Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added test for parse Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Spotless Fixed Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled exceptions Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled test failure Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> --------- Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
… it (opensearch-project#8029) * Implemented REST API for initializing extension Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Cleanup extensions.yml design Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added tests for RestInitializeExtensionAction Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Pulled extensions REST request in extensions directory Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Removed forbidden APIs from rest action and modified tests Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added entry in changelog Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added test for parse Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Spotless Fixed Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled exceptions Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled test failure Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> --------- Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
… it (opensearch-project#8029) * Implemented REST API for initializing extension Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Cleanup extensions.yml design Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added tests for RestInitializeExtensionAction Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Pulled extensions REST request in extensions directory Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Removed forbidden APIs from rest action and modified tests Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added entry in changelog Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added test for parse Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Spotless Fixed Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled exceptions Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled test failure Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> --------- Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
… it (#8029) (#8210) * Implemented REST API for initializing extension * Cleanup extensions.yml design * Added tests for RestInitializeExtensionAction * Pulled extensions REST request in extensions directory * Removed forbidden APIs from rest action and modified tests * Added entry in changelog * Added test for parse * Addressed PR comments * Addressed PR comments * Spotless Fixed * Handled exceptions * Handled test failure --------- Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
… it (opensearch-project#8029) (opensearch-project#8210) * Implemented REST API for initializing extension * Cleanup extensions.yml design * Added tests for RestInitializeExtensionAction * Pulled extensions REST request in extensions directory * Removed forbidden APIs from rest action and modified tests * Added entry in changelog * Added test for parse * Addressed PR comments * Addressed PR comments * Spotless Fixed * Handled exceptions * Handled test failure --------- Signed-off-by: Owais Kazi <owaiskazi19@gmail.com>
… it (opensearch-project#8029) * Implemented REST API for initializing extension Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Cleanup extensions.yml design Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added tests for RestInitializeExtensionAction Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Pulled extensions REST request in extensions directory Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Removed forbidden APIs from rest action and modified tests Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added entry in changelog Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added test for parse Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Spotless Fixed Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled exceptions Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled test failure Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> --------- Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> Signed-off-by: Rishab Nahata <rnnahata@amazon.com>
… it (opensearch-project#8029) * Implemented REST API for initializing extension Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Cleanup extensions.yml design Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added tests for RestInitializeExtensionAction Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Pulled extensions REST request in extensions directory Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Removed forbidden APIs from rest action and modified tests Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added entry in changelog Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Added test for parse Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Addressed PR comments Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Spotless Fixed Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled exceptions Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> * Handled test failure Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> --------- Signed-off-by: Owais Kazi <owaiskazi19@gmail.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
Currently, extensions are initialized in OpenSearch by creating an extensions.yml file. This allows OpenSearch to load the extensions only during the bootstrap. The approach created a chicken-egg problem when the hostAddress and hostPort of the OpenSearch cluster is unknown to extension to send a communication request.
This PR
extensions.yml
file and loading the extensions from it.Request:
_extensions/initialize
Body:
Related Issues
Resolves opensearch-project/opensearch-sdk-java#782
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.