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

[Feature/extensions] Added unit tests and modified extension read logic for ExtensionsOrch… #3449

Merged

Conversation

ryanbogan
Copy link
Member

…estrator

Signed-off-by: Ryan Bogan rbogan@amazon.com

Description

Adds unit tests and reads extensions from file automatically in ExtensionsOrchestrator.

Issues Resolved

3408

Check List

  • [ X] New functionality includes testing.
    • [ X] All tests pass
  • [ X] 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.

…estrator

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@ryanbogan ryanbogan requested review from a team and reta as code owners May 26, 2022 17:24
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 8dedaa9
Log 5611

Reports 5611

@saratvemulapalli saratvemulapalli changed the title Added unit tests and modified extension read logic for ExtensionsOrch… [Feature/extensions] Added unit tests and modified extension read logic for ExtensionsOrch… May 31, 2022
Copy link
Member

@saratvemulapalli saratvemulapalli left a comment

Choose a reason for hiding this comment

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

Did a single pass.
Mostly the changes look good. Lets take care of the comments and I'll do another pass today.
Thanks @ryanbogan

TransportService transportService;
final DiscoveryNode extensionNode;
DiscoveryNode defaultExtensionNode;
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need this ?
We do not need a default Extension node, we should always walk through all extensions when invoking extension points.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just set the defaultExtensionNode to the first extension read because we need it for IndicesModuleRequest

Copy link
Member

Choose a reason for hiding this comment

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

The first extension should not be special :).
With the code we had, it was hacky to enable our manual testing.

We dont need this any more.
For every extension point we should walk through every extension.

extensionsSet.add(
new DiscoveryExtension(
extension.getName(),
"id",
extension.getName(),
Copy link
Member

@dbwiddis dbwiddis Jun 6, 2022

Choose a reason for hiding this comment

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

Are we simply using the name as the persistent ID? Or is this a placeholder?

Should it not be extension.getId()?

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's just a placeholder for now, but I'll try to switch it over since that makes more sense

@@ -3,11 +3,11 @@ extensions:
ephemeralId: uniqueid1
Copy link
Member

Choose a reason for hiding this comment

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

This isn't part of this PR, but isn't the ephemeralId auto-assigned, and should this be the (unique) persistent id?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I'll change it

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 0862a65
Log 5948

Reports 5948

Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

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

LGTM! 🚢

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 31bb9d7
Log 6234

Reports 6234

Copy link
Member

@saratvemulapalli saratvemulapalli left a comment

Choose a reason for hiding this comment

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

Thanks @ryanbogan for these changes.
The changes look good to me.
Some minor comments, few of them could be taken care in follow up PRs.

new TransportAddress(TransportAddress.META_ADDRESS, Integer.parseInt(extension.getPort())),
new HashMap<String, String>(),
Version.fromString(extension.getVersion()),
pluginInfo
Copy link
Member

Choose a reason for hiding this comment

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

I honestly dont remember why we are storing plugin Info.
I think we should be able to get rid of walking through pluginDirs

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 8ff3f26
Log 6238

Reports 6238

new DiscoveryExtension(
extension.getName(),
extension.getUniqueId(),
// placeholder for ephemeral id, will change with POC discovery
Copy link
Member

Choose a reason for hiding this comment

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

If we will always have a unique ephemeral id, why are we using a set?

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 worked better with the findPluginDirectories method that we were using to find extensions. In another PR that I will hopefully raise later today, I will be removing all of the logic related to pluginDirs so I could change it to a list if that's what you recommend

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure d187841
Log 6269

Reports 6269

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure b169ec6
Log 6303

Reports 6303

.put(IndexMetadata.SETTING_VERSION_CREATED, Version.CURRENT)
.put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString())
.build();
ExtensionsOrchestrator orchestrator = new ExtensionsOrchestrator(settings, extensionDir);
Copy link
Member

Choose a reason for hiding this comment

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

nit: orchestrator -> extenionsOrchestrator

Signed-off-by: Ryan Bogan <rbogan@amazon.com>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 3bb299b
Log 6309

Reports 6309

@ryanbogan ryanbogan merged commit 7625fce into opensearch-project:feature/extensions Jun 24, 2022
@ryanbogan ryanbogan deleted the orchestrator_tests branch June 24, 2022 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants