-
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
Allow extended plugins to be optional #16909
Allow extended plugins to be optional #16909
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
❌ Gradle check result for 29ff5b0: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 29ff5b0: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Craig Perkins <[email protected]>
Re-opening this PR based on the conversation on #16030 |
❌ Gradle check result for 3ebe10e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Craig Perkins <[email protected]>
❌ Gradle check result for 7e75335: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
server/src/main/java/org/opensearch/plugins/PluginsService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Hit a new problem and not sure how to move forward... Usually its the plugin being extended that will supply the SPI jar on the classpath and that would be the single instance of the jar in the node. When trying to make extended plugins optional, I can't rely on the extended plugin being installed and instead the extending plugin would need to provide the jar. If you have both the extended and the extending plugins providing the jar then it leads to jar hell.
|
The extending plugin has to have the |
Signed-off-by: Craig Perkins <[email protected]>
Could you please create a documentation issue to document this change (and extended plugins in general) [1], we have done that for semantic versioning fe [1] https://opensearch.org/docs/latest/install-and-configure/plugins/ |
❌ Gradle check result for 754bc6f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Opened a doc issue: opensearch-project/documentation-website#9016 |
Signed-off-by: Craig Perkins <[email protected]>
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.
@andrross any concerns / comments regarding this change? thank you!
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-16909-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 845fbfa10407f3264e6aab8812eff4ef0ad8be24
# Push it to GitHub
git push --set-upstream origin backport/backport-16909-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
I'll open up a manual backport |
* Allow extended plugins to be optional (#16909) * Make extended plugins optional Signed-off-by: Craig Perkins <[email protected]> * Make extended plugins optional Signed-off-by: Craig Perkins <[email protected]> * Load extensions for classpath plugins Signed-off-by: Craig Perkins <[email protected]> * Ensure only single instance for each classpath extension Signed-off-by: Craig Perkins <[email protected]> * Add test for classpath plugin extended plugin loading Signed-off-by: Craig Perkins <[email protected]> * Modify test to allow optional extended plugin Signed-off-by: Craig Perkins <[email protected]> * Only optional extended plugins Signed-off-by: Craig Perkins <[email protected]> * Add additional warning message Signed-off-by: Craig Perkins <[email protected]> * Add to CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Add tag to make extended plugin optional Signed-off-by: Craig Perkins <[email protected]> * Only send plugin names when serializing PluginInfo Signed-off-by: Craig Perkins <[email protected]> * Keep track of optional extended plugins in separate set Signed-off-by: Craig Perkins <[email protected]> * Include in ser/de of PluginInfo Signed-off-by: Craig Perkins <[email protected]> * Change to 3_0_0 Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit 845fbfa) * Fix cherry-pick Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]>
* Make extended plugins optional Signed-off-by: Craig Perkins <[email protected]> * Make extended plugins optional Signed-off-by: Craig Perkins <[email protected]> * Load extensions for classpath plugins Signed-off-by: Craig Perkins <[email protected]> * Ensure only single instance for each classpath extension Signed-off-by: Craig Perkins <[email protected]> * Add test for classpath plugin extended plugin loading Signed-off-by: Craig Perkins <[email protected]> * Modify test to allow optional extended plugin Signed-off-by: Craig Perkins <[email protected]> * Only optional extended plugins Signed-off-by: Craig Perkins <[email protected]> * Add additional warning message Signed-off-by: Craig Perkins <[email protected]> * Add to CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Add tag to make extended plugin optional Signed-off-by: Craig Perkins <[email protected]> * Only send plugin names when serializing PluginInfo Signed-off-by: Craig Perkins <[email protected]> * Keep track of optional extended plugins in separate set Signed-off-by: Craig Perkins <[email protected]> * Include in ser/de of PluginInfo Signed-off-by: Craig Perkins <[email protected]> * Change to 3_0_0 Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]>
Description
When a plugin extends another extensible plugin, OpenSearch requires the other plugin to be installed ahead of time.
This PR adds a new way to specify that extended plugins are optional. This PR warns the cluster administrator that the dependent plugin is missing on installation.
See below example for configuration:
In most use-cases, a plugin will extend another plugin because it offers core functionality. i.e. Anomaly detections needs job-scheduler to run detectors. In other cases, a plugin may extend another but only for a particular feature of the plugin that not all users will use. In such cases, does the extended plugin need to be installed if a user will never use the functionality?
While this doesn't make sense in all use-cases, the Security plugin would like to offer a SPI for plugins to share resources. In order for the security plugin to offer a SPI, other plugins would need to declare that they extend the security plugin. The problem with this is that security is optional and plugins currently support clusters where the security plugin is installed or clusters where it is not installed. By allowing extendedPlugins to be optional, this will allow security to offer a SPI but not be required for installation.
A warning is presented to a cluster administrator when trying to install a plugin that extends another plugin without the extended plugin being installed.
This PR is to enable the plugin resource sharing use-case. Additional discussion can be found on #16030
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.