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

Allow druid-kubernetes-overlord-extensions to be loaded in any druid service #13872

Conversation

nlippis
Copy link
Contributor

@nlippis nlippis commented Mar 2, 2023

Allow druid-kubernetes-overlord-extensions to be loaded in any druid service

Only setup kubernetes task runner bindings when the node has the overlord role

Release note


Key changed/added classes in this PR
  • K8sOverlordModule.java

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

Copy link
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

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

👍 this seems consistent with other modules that should alter behavior based on where they are run

I think you might get hit by the code coverage bot though. If that happens search for files ending with ModuleTest for examples which all typically do something with Guice.createInjector to make an injector and set some stuff and make sure the right things happen.

It looks like you also got caught up by the dependency bot for using org.apache.commons.collections4 without explicitly adding it to the pom.

Warning:  Used undeclared dependencies found:
Warning:     org.apache.commons:commons-collections4:jar:4.2:provided

so either add to the pom or don't use it (it looks like LagBasedAutoScaler is the only thing using org.apache.commons.collections4 in druid-indexing-service)

binder,
Key.get(TaskRunnerFactory.class)
);
if (SetUtils.emptyIfNull(nodeRoles).contains(NodeRole.OVERLORD)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It turns out that there is an easier way to do this:

@LoadScope(roles = NodeRole.OVERLORD_JSON_NAME)
public class K8sOverlordModule implements DruidModule

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

Choose a reason for hiding this comment

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

neat 👍

Copy link
Member

Choose a reason for hiding this comment

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

oof, I even reviewed the change that added that, but totally forgot about it 🙃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@abhishekagarwal87 abhishekagarwal87 merged commit 7123681 into apache:master Mar 3, 2023
98 checks passed
@nlippis nlippis deleted the druid-kubernetes-module-loadable-in-any-druid-service branch March 3, 2023 19:38
317brian pushed a commit to 317brian/druid that referenced this pull request Mar 10, 2023
…service (apache#13872)

Allow druid-kubernetes-overlord-extensions to be loaded in any druid service
@clintropolis clintropolis added this to the 26.0 milestone Apr 10, 2023
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.

None yet

4 participants