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 #2772

Merged
merged 9 commits into from
Jul 10, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jun 24, 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, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc 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.

…IndexDescriptors

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@noCharger
Copy link
Contributor

@cwperks The Flint Request Index is another system index. Will it be covered in this PR?

@cwperks
Copy link
Member Author

cwperks commented Jun 24, 2024

@noCharger Can you link me to where the index is defined?

I created this PR based off of the indices currently tracked by the security repo: https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java#L72

@cwperks
Copy link
Member Author

cwperks commented Jun 25, 2024

@derek-ho
Copy link
Collaborator

@noCharger This index? https://github.com/opensearch-project/sql/blob/main/async-query-core/src/main/java/org/opensearch/sql/spark/execution/statestore/OpenSearchStateStoreUtil.java#L18

Should I add .query_execution_request* to the list of system index descriptors?

Yes looks like that should be added

@noCharger
Copy link
Contributor

@noCharger This index? https://github.com/opensearch-project/sql/blob/main/async-query-core/src/main/java/org/opensearch/sql/spark/execution/statestore/OpenSearchStateStoreUtil.java#L18

Should I add .query_execution_request* to the list of system index descriptors?

Yes please, also could you point me if any additional change needed for CI?

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks
Copy link
Member Author

cwperks commented Jul 1, 2024

Yes looks like that should be added

Added

@cwperks
Copy link
Member Author

cwperks commented Jul 1, 2024

Yes please, also could you point me if any additional change needed for CI?

@noCharger On the main branch, security is targeting Java 21. The CI failure is related to the Java version used for CI checks.

Exception in thread "main" java.lang.IllegalStateException: opensearch-security requires Java 21:, your system: 11.0.23+9

@noCharger
Copy link
Contributor

Yes please, also could you point me if any additional change needed for CI?

@noCharger On the main branch, security is targeting Java 21. The CI failure is related to the Java version used for CI checks.

Exception in thread "main" java.lang.IllegalStateException: opensearch-security requires Java 21:, your system: 11.0.23+9

@cwperks #2787 is merged now

@cwperks
Copy link
Member Author

cwperks commented Jul 8, 2024

@noCharger I rebased, but there are still CI Check failures.

Have you seen these failures before?

Run actions/checkout@v3
/usr/bin/docker exec  7e91a6adc94f2190b678754e7db3328083f510b4023d9a3240f1f3a65a1b6e00 sh -c "cat /etc/*release | grep ^ID"
/__e/node20/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /__e/node20/bin/node)
/__e/node20/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)

ref: https://github.com/opensearch-project/sql/actions/runs/9810713201/job/27092980700?pr=2772

cwperks and others added 5 commits July 8, 2024 14:13
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
@cwperks
Copy link
Member Author

cwperks commented Jul 9, 2024

@derek-ho @noCharger All CI checks have passed. Can you re-review this PR?

OpenSearchDataSourceMetadataStorage.DATASOURCE_INDEX_NAME, "SQL DataSources index"));
systemIndexDescriptors.add(
new SystemIndexDescriptor(
SPARK_REQUEST_BUFFER_INDEX_NAME + "*", "SQL Spark Request Buffer index pattern"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

@noCharger does each datasource create its own request index?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like it is the case based on:

"%s_%s", SPARK_REQUEST_BUFFER_INDEX_NAME, datasourceName.toLowerCase(Locale.ROOT));

Copy link
Member

Choose a reason for hiding this comment

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

Yes each datasource creates an index based on its name. Is it enough to define the pattern?

Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of this registration?

Copy link
Member Author

Choose a reason for hiding this comment

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

opensearch-project/security#4535

Security currently maintains a list of system indices through an OpenSearch setting. This change will allow security to rely on a registry of these indices from the core instead of relying on a setting.

Copy link
Member Author

Choose a reason for hiding this comment

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

Part of this greater effort: opensearch-project/security#4439

Copy link
Collaborator

@derek-ho derek-ho left a comment

Choose a reason for hiding this comment

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

LGTM but let's confirm we need the * pattern @noCharger can you take a look here?

@derek-ho derek-ho merged commit d3ecb2d into opensearch-project:main Jul 10, 2024
12 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 10, 2024
…IndexDescriptors (#2772)

* Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add Spark Buffer index pattern

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Upgrade to checkout v4

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix CI issues

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Move env

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Revert "Upgrade to checkout v4"

This reverts commit b35573b.

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Co-authored-by: Derek Ho <dxho@amazon.com>
(cherry picked from commit d3ecb2d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
derek-ho added a commit that referenced this pull request Jul 15, 2024
…IndexDescriptors (#2772) (#2817)

* Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors



* Add Spark Buffer index pattern



* Upgrade to checkout v4



* Fix CI issues



* Move env



* Revert "Upgrade to checkout v4"

This reverts commit b35573b.

---------




(cherry picked from commit d3ecb2d)

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Derek Ho <dxho@amazon.com>
manasvinibs pushed a commit to manasvinibs/sql that referenced this pull request Aug 14, 2024
…IndexDescriptors (opensearch-project#2772)

* Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add Spark Buffer index pattern

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Upgrade to checkout v4

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix CI issues

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Move env

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Revert "Upgrade to checkout v4"

This reverts commit b35573b.

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Co-authored-by: Derek Ho <dxho@amazon.com>
jzonthemtn pushed a commit to jzonthemtn/sql that referenced this pull request Aug 28, 2024
…IndexDescriptors (opensearch-project#2772)

* Register system index descriptors through SystemIndexPlugin.getSystemIndexDescriptors

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add Spark Buffer index pattern

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Upgrade to checkout v4

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix CI issues

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Move env

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Revert "Upgrade to checkout v4"

This reverts commit b35573b.

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
Co-authored-by: Derek Ho <dxho@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants