-
Notifications
You must be signed in to change notification settings - Fork 133
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
Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors #2586
Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors #2586
Conversation
…IndexDescriptors Signed-off-by: Craig Perkins <[email protected]>
List<SystemIndexDescriptor> systemIndexDescriptors = new ArrayList<>(); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_AGENT_INDEX, "ML Commons Agent Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_CONFIG_INDEX, "ML Commons Configuration Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_CONNECTOR_INDEX, "ML Commons Connector Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_CONTROLLER_INDEX, "ML Commons Controller Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_MODEL_GROUP_INDEX, "ML Commons Model Group Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_MODEL_INDEX, "ML Commons Model Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_TASK_INDEX, "ML Commons Task Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_CONVERSATION_META_INDEX, "ML Commons Conversation Meta Index")); | ||
systemIndexDescriptors | ||
.add(new SystemIndexDescriptor(ML_CONVERSATION_INTERACTIONS_INDEX, "ML Commons Conversation Interactions Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_MEMORY_META_INDEX, "ML Commons Memory Meta Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_MEMORY_MESSAGE_INDEX, "ML Commons Memory Message Index")); | ||
systemIndexDescriptors.add(new SystemIndexDescriptor(ML_STOP_WORDS_INDEX, "ML Commons Stop Words Index")); |
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 supported with a Pattern as well? For e.g. .plugins-ml-*
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.
It could make sense in this case since the plugin has many system indices that follow the same naming convention.
My advice to plugins is to use a pattern if they create a variable amount of system indices based on a pattern.
An example of a variable amount of indices is multi-tenancy where each tenant has a .kibana index that follows a pattern .kibana-{tenantName}
. If the names of all of the indices are known then they should be listed out.
Can a maintainer please review this PR? |
plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
|
@@ -62,6 +62,8 @@ public class CommonValue { | |||
public static final Integer ML_MODEL_GROUP_INDEX_SCHEMA_VERSION = 2; | |||
public static final Integer ML_MODEL_INDEX_SCHEMA_VERSION = 11; | |||
public static final String ML_CONNECTOR_INDEX = ".plugins-ml-connector"; | |||
public static final String ML_CONVERSATION_META_INDEX = ".plugins-ml-conversation-meta"; |
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.
Why do we need these two indices? I don't think we are using these?
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.
Removed these. I added them in a prior commit since they are still tracked in the security plugin: https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java#L55-L56
Signed-off-by: Craig Perkins <[email protected]>
…IndexDescriptors (#2586) * Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Remove unused imports Signed-off-by: Craig Perkins <[email protected]> * Remove unused comments Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit 6c8720e)
…IndexDescriptors (#2586) (#2668) * Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Remove unused imports Signed-off-by: Craig Perkins <[email protected]> * Remove unused comments Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit 6c8720e) Co-authored-by: Craig Perkins <[email protected]>
Description
This PR registers the system indices in this plugin through the SystemIndexPlugin extension point in core. These indices will not be functionally different than they are today, its just a formal registration as a system index.
Issues Resolved
Related to opensearch-project/security#4439
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.