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

[MDS] Add support for register data sources during the absence of local cluster #2140

Merged
merged 4 commits into from
Sep 6, 2024

Conversation

RyanL1997
Copy link
Collaborator

Description

Add support for register plugin during the absence of local cluster

Issues Resolved

  • Resolve the 500 errors when there is no backend plugins to consume the requests

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.

Signed-off-by: Ryan Liang <jiallian@amazon.com>
public/plugin.tsx Outdated Show resolved Hide resolved
Signed-off-by: Ryan Liang <jiallian@amazon.com>
Signed-off-by: Ryan Liang <jiallian@amazon.com>
Signed-off-by: Ryan Liang <jiallian@amazon.com>
selector: {
displayDatasetsAsSource: false,
// register all s3 datasources only if mds feature flag is disabled
if (!this.featureFlagStatus) {
Copy link
Member

Choose a reason for hiding this comment

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

can we directly use setupDeps.dataSource here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can't access the setupDeps from the start function, we can only access to the startDeps, However, the startDeps.dataSource.dataSourceEnabled is also not accessible, when the dataSource plugin is not registered.

Copy link
Member

Choose a reason for hiding this comment

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

got it. this makes sense for now. Ideally with should stop the registration at setup itself. Adding if condition here: https://github.com/opensearch-project/dashboards-observability/blob/3ad2bf0448f6a705f449f42e62be8398f840ea37/public/plugin.tsx#L264C11-L264C31

@RyanL1997 RyanL1997 merged commit f7e8b72 into opensearch-project:main Sep 6, 2024
10 of 18 checks passed
@RyanL1997 RyanL1997 deleted the neo-support branch September 6, 2024 20:43
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

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/dashboards-observability/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-observability/backport-2.x
# Create a new branch
git switch --create backport/backport-2140-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f7e8b725e706b4394f23c7de8cd29409372af74b
# Push it to GitHub
git push --set-upstream origin backport/backport-2140-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-observability/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-2140-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.17 failed:

The process '/usr/bin/git' failed with exit code 1

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/dashboards-observability/backport-2.17 2.17
# Navigate to the new working tree
pushd ../.worktrees/dashboards-observability/backport-2.17
# Create a new branch
git switch --create backport/backport-2140-to-2.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f7e8b725e706b4394f23c7de8cd29409372af74b
# Push it to GitHub
git push --set-upstream origin backport/backport-2140-to-2.17
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-observability/backport-2.17

Then, create a pull request where the base branch is 2.17 and the compare/head branch is backport/backport-2140-to-2.17.

@@ -169,6 +169,7 @@ export class ObservabilityPlugin
constructor(initializerContext: PluginInitializerContext) {
this.config = initializerContext.config.get<PublicConfig>();
}
private featureFlagStatus: boolean = false;
Copy link
Member

Choose a reason for hiding this comment

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

can this variable naming be more explicit? looking at featureFlagStatus it's hard to tell what the features is..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes I will change that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since the backport is failing, I will manually change it in 2.x first and backport. I will push another commit for change it on main.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have updated here #2144.

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