-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-40677][CONNECT][FOLLOWUP] Refactor shade relocation/rename rules
#38162
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
Changes from all commits
d90fe86
857c54b
0a62b78
0b74479
26f3b60
179d31e
ebce193
d9a4fd4
6544f9d
c69a4fd
5029371
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -655,19 +655,47 @@ object SparkConnect { | |
|
|
||
| (assembly / logLevel) := Level.Info, | ||
|
|
||
| // Exclude `scala-library` from assembly. | ||
| (assembly / assemblyPackageScala / assembleArtifact) := false, | ||
|
|
||
| // Exclude `pmml-model-*.jar`, `scala-collection-compat_*.jar`,`jsr305-*.jar` and | ||
| // `netty-*.jar` and `unused-1.0.0.jar` from assembly. | ||
| (assembly / assemblyExcludedJars) := { | ||
| val cp = (assembly / fullClasspath).value | ||
| cp filter { v => | ||
| val name = v.data.getName | ||
| name.startsWith("pmml-model-") || name.startsWith("scala-collection-compat_") || | ||
| name.startsWith("jsr305-") || name.startsWith("netty-") || name == "unused-1.0.0.jar" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HyukjinKwon should we share Netty with Spark?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we need merge #38185 first, otherwise, netty cannot be filtered out here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need rebase after #38185 merged |
||
| } | ||
| }, | ||
|
|
||
| (assembly / assemblyShadeRules) := Seq( | ||
| ShadeRule.rename("io.grpc.**" -> "org.sparkproject.connect.grpc.@0").inAll, | ||
| ShadeRule.rename("com.google.common.**" -> "org.sparkproject.connect.guava.@1").inAll, | ||
| ShadeRule.rename("com.google.thirdparty.**" -> "org.sparkproject.connect.guava.@1").inAll, | ||
| ShadeRule.rename("com.google.protobuf.**" -> "org.sparkproject.connect.protobuf.@1").inAll, | ||
| ShadeRule.rename("android.annotation.**" -> "org.sparkproject.connect.android_annotation.@1").inAll, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just a nit:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I think we should follow the existing rules,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see it now. |
||
| ShadeRule.rename("io.perfmark.**" -> "org.sparkproject.connect.io_perfmark.@1").inAll, | ||
| ShadeRule.rename("org.codehaus.mojo.animal_sniffer.**" -> "org.sparkproject.connect.animal_sniffer.@1").inAll, | ||
| ShadeRule.rename("com.google.j2objc.annotations.**" -> "org.sparkproject.connect.j2objc_annotations.@1").inAll, | ||
| ShadeRule.rename("com.google.errorprone.annotations.**" -> "org.sparkproject.connect.errorprone_annotations.@1").inAll, | ||
| ShadeRule.rename("org.checkerframework.**" -> "org.sparkproject.connect.checkerframework.@1").inAll, | ||
| ShadeRule.rename("com.google.gson.**" -> "org.sparkproject.connect.gson.@1").inAll, | ||
| ShadeRule.rename("com.google.api.**" -> "org.sparkproject.connect.google_protos.api.@1").inAll, | ||
| ShadeRule.rename("com.google.cloud.**" -> "org.sparkproject.connect.google_protos.cloud.@1").inAll, | ||
| ShadeRule.rename("com.google.geo.**" -> "org.sparkproject.connect.google_protos.geo.@1").inAll, | ||
| ShadeRule.rename("com.google.logging.**" -> "org.sparkproject.connect.google_protos.logging.@1").inAll, | ||
| ShadeRule.rename("com.google.longrunning.**" -> "org.sparkproject.connect.google_protos.longrunning.@1").inAll, | ||
| ShadeRule.rename("com.google.rpc.**" -> "org.sparkproject.connect.google_protos.rpc.@1").inAll, | ||
| ShadeRule.rename("com.google.type.**" -> "org.sparkproject.connect.google_protos.type.@1").inAll | ||
| ), | ||
|
|
||
| (assembly / assemblyMergeStrategy) := { | ||
| case m if m.toLowerCase(Locale.ROOT).endsWith("manifest.mf") => MergeStrategy.discard | ||
| // Drop all proto files that are not needed as artifacts of the build. | ||
| case m if m.toLowerCase(Locale.ROOT).endsWith(".proto") => MergeStrategy.discard | ||
| case _ => MergeStrategy.first | ||
| }, | ||
| } | ||
| ) | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
scala-collectionpicked up from Scala library itself? I remember there's an option to exclude this (e.g.,includeScala = False)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be
(assembly / assemblyPackageScala / assembleArtifact) := false, but I foundscala-collectionwas not excluded, let me tryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HyukjinKwon The results are the same, from the document, it should be this option, but it only excludes the
scala-library, not the 'scala-collection compat_'.