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

Remove Maven client at runtime + Provide a way to load Druid extensions through local file system #1638

Merged
merged 1 commit into from
Oct 26, 2015

Conversation

guobingkun
Copy link
Contributor

This is a follow up of https://groups.google.com/forum/#!searchin/druid-development/proposal/druid-development/7KJCsQ9GvGo/u3XMyNLmeAIJ

This pull request does the following,

  1. Remove maven client from downloading extensions at runtime
  2. Provide a way to load Druid extensions and hadoop dependencies through file system.
  3. Refactor pull-deps so that it can download extensions into extension directories.
  4. Add documents on how to use this new extension loading mechanism

@guobingkun guobingkun force-pushed the remove_maven_client_code branch 4 times, most recently from b9b48ae to 68d7b9d Compare August 18, 2015 18:10
@guobingkun guobingkun closed this Aug 18, 2015
@guobingkun guobingkun reopened this Aug 18, 2015
@guobingkun
Copy link
Contributor Author

Close and reopen to restart the build.

@guobingkun guobingkun closed this Aug 19, 2015
@guobingkun guobingkun reopened this Aug 19, 2015
@guobingkun guobingkun force-pushed the remove_maven_client_code branch 3 times, most recently from ce3c742 to 8ce526a Compare August 20, 2015 14:20
@guobingkun guobingkun changed the title Provide a way to load Druid extensions through local file system Remove Maven client at runtime + Provide a way to load Druid extensions through local file system Aug 20, 2015
@guobingkun guobingkun force-pushed the remove_maven_client_code branch 2 times, most recently from ca4574f to 4450881 Compare August 20, 2015 16:28

If you don't specify `druid.extensions.toLoad`, Druid will load all the extensions under root extension directory.

### How to prepare extensions directories using `tools pull-deps`?
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel this should be the default option as it is the easier option and be placed before the instructions to load manual setup.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think if we keep including all the base extensions in release tarballs (like @xvrl's newer 0.8.1 builds) then this point is not too important, since most people will be using the prebuilt extensions dir. Only people wanting to use their own extensions would have to decide how to get the jars.

@fjy
Copy link
Contributor

fjy commented Aug 21, 2015

@guobingkun I have a few minor comments but overall I am extremely excited for this to get merged. How backwards compatible is this? It seems like it is backwards compatible and we don't need to update the 0.x version.

@@ -33,10 +34,6 @@
@NotNull
private boolean searchCurrentClassloader = true;

@JsonProperty
@NotNull
private List<String> coordinates = ImmutableList.of();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this actually be left in, and give an error at startup if it is specified?

There doesn't seem to be a migration plan overall here. (or I could have just missed 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.

I believe it's sufficient to mention this deprecation in the release note? Even if people set this property, it will be ignored and not cause any harm.

Copy link
Contributor

Choose a reason for hiding this comment

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

not cause any harm

Not true, if they didn't realize one of the nodes had not been updated to the "new" config, then it will not launch properly, or will have missing functionality that may not even report on bootup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if I fully understand this. Are you worrying about people not being aware of one of the nodes hadn't been updated to the latest version? If that node fails on bootup then people will realize it's not updated properly. If that node just runs the old version silently, then failing on "specifying druid.extensions.coordinates" will not help either since that node didn't pick up this code. Or did I miss something?

Copy link
Contributor

Choose a reason for hiding this comment

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

If someone is updating their cluster to the latest binaries, it could be easy for them to miss the release notes that the druid.extensions.coordinates changed. And it can cause late failures.

Since the config change is not handled at start time, and there is no migration method to warn people of the config change (other than release notes) AND failure to migrate to the new config can cause node failure due to extensions not being present when they are expected to be present, that would make this PR an incompatible change.

Personally, I'm ok with eliminating the setting provided that there is an informative error on startup (or even better, an informative warning and transparent handling of migration until next major version release). Would be worth getting input from the other contributors though.

@fjy
Copy link
Contributor

fjy commented Sep 17, 2015

👍 But before merging we should decide on the new version of Druid and mysql packaging


5. Once all dependencies have been downloaded successfully, replicate the `repo` directory to the machine behind the firewall; e.g. `/opt/druid-<version>/repo`
6. Create property `druid.extensions.localRepository=`*`path to repo directory`* in the *`Druid Directory`*`/config/_common/common.runtime.properties` file; e.g. `druid.extensions.localRepository=/opt/druid-<version>/repo`
When you are behind a firewall, the IRC wikipedia channels that feed realtime data into Druid will not be accessible. To workaround this challenge, you will need to make the Wikipedia example GeoLite DB dependency available offline, see below.
Copy link
Member

Choose a reason for hiding this comment

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

This sentence is a bit confusing, making GeoLite avaible offline will not solve the IRC problem as the sentence implies.
There are two problems, one is that IRC may be firewalled, in which case there's nothing you can do. The other problem is that downloading data from maxmind may not be possible, in which case GeoLite needs to be downloaded offline.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the doc so that it reflects your comment.

@xvrl
Copy link
Member

xvrl commented Sep 17, 2015

@cheddar unless we relicense the mysql metadata store code under GPL, I don't see how packaging it as a separate tarball would make a difference?

@xvrl
Copy link
Member

xvrl commented Sep 17, 2015

Assuming this has been tested, other than my last few comments about docs, and maybe resolve the mysql tabarll issue outside of this PR, I'm 👍

try {
URLClassLoader loader = getClassLoaderForCoordinates(aether, coordinate, config.getDefaultVersion());
if (config.searchCurrentClassloader()) {
for (T module : ServiceLoader.load(clazz, Thread.currentThread().getContextClassLoader())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

ServiceLoader.load checks context classloader automatically, but it probably doesn't hurt to have it here.

@drcrallen
Copy link
Contributor

This is looking good!

As a note, it is blocked until https://groups.google.com/d/msg/druid-development/KXpLwUisJcU/eCM3GfgPBAAJ is resolved

@guobingkun guobingkun force-pushed the remove_maven_client_code branch 2 times, most recently from ef1d59d to 2acd649 Compare September 18, 2015 19:03
@xvrl xvrl modified the milestone: 0.9.0 Sep 19, 2015
@drcrallen
Copy link
Contributor

@guobingkun I think this is ready to merge, can you please cleanup the merge conflicts?

@guobingkun
Copy link
Contributor Author

@drcrallen Conflicts resolved.

1) Remove maven client from downloading extensions at runtime.
2) Provide a way to load Druid extensions and hadoop dependencies through file system.
3) Refactor pull-deps so that it can download extensions into extension directories.
4) Add documents on how to use this new extension loading mechanism.
5) Change the way how Druid tarball is generated. Now all the extensions + hadoop-client 2.3.0
are packaged within the Druid tarball.
fjy added a commit that referenced this pull request Oct 26, 2015
Remove Maven client at runtime + Provide a way to load Druid extensions through local file system
@fjy fjy merged commit 5f23703 into apache:master Oct 26, 2015
@guobingkun guobingkun deleted the remove_maven_client_code branch October 26, 2015 16:32
<goal>single</goal>
</goals>
<configuration>
<finalName>mysql-metdata-storage</finalName>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@se7entyse7en Thanks! That's definitely a typo, I will send a PR to fix it.

@drcrallen
Copy link
Contributor

This is weird, #2067 but this still passed travis

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.

8 participants