Skip to content

HBASE-29016 Refactor assembly creation to use only DependencySets and… - #6519

Closed
stoty wants to merge 6 commits into
apache:masterfrom
stoty:HBASE-29016
Closed

HBASE-29016 Refactor assembly creation to use only DependencySets and…#6519
stoty wants to merge 6 commits into
apache:masterfrom
stoty:HBASE-29016

Conversation

@stoty

@stotystoty commented Dec 4, 2024

Copy link
Copy Markdown
Contributor

… move cached classpath creation to a new module

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@stoty

stoty commented Dec 5, 2024

Copy link
Copy Markdown
ContributorAuthor

I have tested this on a pseudo-distributed cluster, starting and stopping HBase, and running a simple smoke test via HBase shell, and the rowCounter MR job.

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-build-configuration</artifactId>

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Better names welcome

@NihalJainNihalJainDec 6, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

may be hbase-dev-generate-classpath? so that we can prefix all dev related modules as "hbase-dev-*" in case we add more in future

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I will hold off changing that in case we get other suggestions.

… move cached classpath creation to a new module
also remove explicit jaxsw-ri dependency from assembly
<exclude>org.apache.yetus:audience-annotations</exclude>
<exclude>org.slf4j:*</exclude>
<exclude>org.apache.logging.log4j:*</exclude>
<!-- TODO shouldn't we also exclude duplicate io.opentelemetry.* jars which are added to client-facing-thirdparty ? -->

@NihalJainNihalJainDec 6, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @stoty any reason for not excluding io.opentelemetry.* here?

@stotystotyDec 6, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I wasn't 100% sure that the current version doesn't do this on purpose, and I wanted to minimize the changes.

We can add the exclusion here, or we can open a follow-up ticket for that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sound good either ways

<!-- Exclude the Ruby jar that goes in the lib/ruby directory -->
<exclude>org.jruby:jruby-complete</exclude>
<!-- Exclude jars that go into the lib/client-facing-thirdparty directoy -->
<exclude>com.github.stephenc.findbugs:findbugs-annotations</exclude>

@NihalJainNihalJainDec 6, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so the excludes block should be kept in sync with any dependencies we add in a sub folder of lib. may be add a note somewhere to avoid dependencies getting duplicated?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good idea.

</files>

<dependencySets>
<dependencySet>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is client.xml and hadoop-three-compat a copy now?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Yes.
The differences were already minimal, I think they were accidental, too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure, we can see if we should keep both as follow up. I am good as long as generated assembly is same

Comment threadhbase-generate-dev-classpath/pom.xml Outdated
<artifactId>hbase-mapreduce</artifactId>
<type>test-jar</type>
</dependency>
<!-- To dump tools in hbase-procedure into cached_classpath.txt. -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this comment is no longer needed right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ah we are referring why we addded hbase-procedure here. ignore comment

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Actually, I think that this comment IS redundant, I don't see why hbase-procedure would be different than the rest of the artifacts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

exactly

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I think that some of the scope changes, etc are also unneccessary in this case, but I ran out steam when cleaning up the pom.

@NihalJain

NihalJain commented Dec 6, 2024

Copy link
Copy Markdown
Contributor

Is there any difference between tarball generated with this change and without this change? If both are same, a +1 from me, as long as we all are fine to move to use only DependencySets, this is lot cleaner and avoids mixing up.

Although it is important to note that this step comes with a extra maintenance step of excluding any non base folder directory jar. But I am fine with this given we barely add new sub folders and we already plan to add a note in code to notify devs to take care of this.

@stoty

stoty commented Dec 6, 2024

Copy link
Copy Markdown
ContributorAuthor

Yes, there are changes,.
I have added a list of the changes with analysis to the JIRA.

About half of them is the jaxws-ri removal, which could be split into a different issue, if desired.

@NihalJain

NihalJain commented Dec 6, 2024

Copy link
Copy Markdown
Contributor

Yes, there are changes,. I have added a list of the changes with analysis to the JIRA.

About half of them is the jaxws-ri removal, which could be split into a different issue, if desired.

It would prefer to have it separate it it is not too much effort since if we do more this jira should be otherwise "Refactor and cleanup"

Also thinking about the future use case of having assembly with assembly-without-hadoop-jars, have you thought how the dependencySet mechanism will be able to handle it? Would we need to create a new module for assembly-without-hadoop-jars now? As now I am not sure how we can support multiple assemblies with single dependency set without managing inclusion/exclusion lists for each assembly.xml. Or do we plan to follow inclusion/exclusion list approach only.

@stoty

stoty commented Dec 6, 2024

Copy link
Copy Markdown
ContributorAuthor

I have also added some reasoning on why we need the assembly changes to the JIRA.

@NihalJain

Copy link
Copy Markdown
Contributor

I have also added some reasoning on why we need the assembly changes to the JIRA.

Just saw the JIRA title, sounds good to me.

@stoty

stoty commented Dec 6, 2024

Copy link
Copy Markdown
ContributorAuthor

For the hadoop-less assembly, I plan to copy this assembly, and add the Hadoop artifacts as provided scope dependencies.

That is the best (only) way I know to remove both the Hadoop artifacts, and their exclusive transitive dependencies, while keeping HBase's transitive dependencies.

The only other way I know would be excluding and including everything by hand, which would be super fragile.

@stoty

stoty commented Dec 6, 2024

Copy link
Copy Markdown
ContributorAuthor

Re-added jaxws-ri

@Apache-HBase

This comment has been minimized.

<include>org.apache.hbase:hbase-shaded-client-byo-hadoop</include>
</includes>
<outputDirectory>lib</outputDirectory>
<useTransitiveDependencies>true</useTransitiveDependencies>

@NihalJainNihalJainDec 6, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: <!-- Exclude artifacts added in the sub-directories to avoid duplication -->

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Synced to the other xml

@NihalJainNihalJain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 LGTM

@stoty

stoty commented Dec 6, 2024

Copy link
Copy Markdown
ContributorAuthor

I have checked the external and internal classpaths, and determined that duplicating the opentelemtry JARs is not needed.
The shaded classpaths don't care, and the internal classpath had duplicated copies.

@stoty

stoty commented Dec 6, 2024

Copy link
Copy Markdown
ContributorAuthor

So I removed the duplication.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

</dependency>
<!-- We don't really add this to assembly tarball, we retain it here just to dump it into
cached_classpath.txt ! See HBASE-28433 for more info. -->
<!-- This is an optional dependency of hbase-external-blockcache.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If so, let's just remove the optional flag in hbase-external-blockcache's pom file?

@stotystotyDec 9, 2024

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I took another look at this.

I guess that the original intent was to NOT include it in the assembly, it just got lost somehow.

The last version is also from 2017, so this doesn't look a maintaned library.

Based on the comments, getting this right is far from trivial, and this probably has few users, so it might be better to keep it optional, and just leave it out from assembly.

That way most users will get less JARs, and the few (if any) users of it would have to provide it themselves.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Or we can do the removal in another ticket, so that it's better documented.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I have opened a [DISCUSS] thread for spymemcached removal.

@Apache9

Copy link
Copy Markdown
Contributor

Let's have a try first.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 35sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 30sMaven dependency ordering for branch
+1 💚mvninstall4m 19smaster passed
+1 💚compile10m 12smaster passed
+1 💚spotless0m 54sbranch has no errors when running spotless:check.
-0 ⚠️patch1m 9sUsed diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for patch
+1 💚mvninstall3m 43sthe patch passed
+1 💚compile9m 33sthe patch passed
+1 💚javac9m 33sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚xmllint0m 0sNo new issues.
+1 💚hadoopcheck13m 19sPatch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚spotless0m 54spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 34sThe patch does not generate ASF License warnings.
52m 59s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6519/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6519
Optional Testsdupname asflicense javac codespell detsecrets xmllint hadoopcheck spotless compile
unameLinux a29ca77ca737 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 94734e7
Default JavaEclipse Adoptium-17.0.11+9
Max. process+thread count188 (vs. ulimit of 30000)
modulesC: hbase-assembly hbase-dev-generate-classpath . U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6519/4/console
versionsgit=2.34.1 maven=3.9.8 xmllint=20913
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@stoty

stoty commented Jan 9, 2025

Copy link
Copy Markdown
ContributorAuthor

I have already merged this back in December.

@stotystoty closed this Jan 9, 2025
Sign up for freeto 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.

4 participants

@stoty@Apache-HBase@NihalJain@Apache9