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

Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors #2586

Merged
merged 8 commits into from
Jul 17, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jun 21, 2024

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

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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.

@cwperks cwperks temporarily deployed to ml-commons-cicd-env June 24, 2024 18:45 — with GitHub Actions Inactive
@cwperks cwperks temporarily deployed to ml-commons-cicd-env June 24, 2024 18:45 — with GitHub Actions Inactive
@cwperks cwperks temporarily deployed to ml-commons-cicd-env June 24, 2024 19:43 — with GitHub Actions Inactive
Comment on lines 1031 to 1044
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"));

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-*

Copy link
Member Author

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.

@cwperks
Copy link
Member Author

cwperks commented Jul 2, 2024

Can a maintainer please review this PR?

Signed-off-by: Craig Perkins <[email protected]>
@cwperks cwperks had a problem deploying to ml-commons-cicd-env July 5, 2024 15:24 — with GitHub Actions Failure
Signed-off-by: Craig Perkins <[email protected]>
@cwperks cwperks temporarily deployed to ml-commons-cicd-env July 9, 2024 20:35 — with GitHub Actions Inactive
@cwperks cwperks had a problem deploying to ml-commons-cicd-env July 9, 2024 20:35 — with GitHub Actions Failure
@ylwu-amzn
Copy link
Collaborator

RestMLDeployModelActionIT > testReDeployModel FAILED
    java.lang.Exception: Test abandoned because suite timeout was reached.
        at __randomizedtesting.SeedInfo.seed([BC9B3B175CC25BB4]:0)

@cwperks cwperks temporarily deployed to ml-commons-cicd-env July 12, 2024 18:02 — with GitHub Actions Inactive
@cwperks cwperks temporarily deployed to ml-commons-cicd-env July 15, 2024 14:57 — with GitHub Actions Inactive
@cwperks cwperks temporarily deployed to ml-commons-cicd-env July 16, 2024 15:33 — with GitHub Actions Inactive
@cwperks cwperks temporarily deployed to ml-commons-cicd-env July 16, 2024 15:33 — with GitHub Actions Inactive
@cwperks cwperks temporarily deployed to ml-commons-cicd-env July 16, 2024 16:31 — with GitHub Actions Inactive
ylwu-amzn
ylwu-amzn previously approved these changes Jul 16, 2024
@@ -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";
Copy link
Collaborator

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?

Copy link
Member Author

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]>
@ylwu-amzn ylwu-amzn merged commit 6c8720e into opensearch-project:main Jul 17, 2024
6 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 17, 2024
…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)
xinyual pushed a commit that referenced this pull request Jul 18, 2024
…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]>
@b4sjoo b4sjoo added the v2.16.0 Issues targeting release v2.16.0 label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x v2.16.0 Issues targeting release v2.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants