-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-40448][CONNECT] Spark Connect build as Driver Plugin with Shaded Dependencies #37710
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
45c7bc5
c2c6de0
034a44d
0cedf00
5d4b8dd
506fc44
0f6a687
9adf4bd
ed2fe24
786efbb
8693efb
d336b2a
dbe3d1f
3ea55ca
127a492
4c63000
b713969
0547e07
074e1f7
e77a018
21224ec
e22975f
9601449
b3ab663
8968f1e
87a50d4
fefc84a
193e6b0
e1f862e
d5b6002
8bb03d2
265aca3
d6f64e8
3d00bb0
3525eab
7e1dd58
fa9e85e
cf6b19a
16bf911
762104a
ca4cfbb
79bbfd6
ec1221b
63d8ebc
70ad818
ae75ca4
7e615f7
8effefb
aa68119
fcefe9e
ff8e4ad
b2f6548
feb0233
4b02eb3
aec7e3d
e4485c3
4ef5a35
e13b955
6c96205
d1e3c13
9d43765
448fcc8
b3d2d8c
b2c6bfd
11ad9b6
7617b82
ce4900b
28e7741
8223615
8bf14f2
87ba6f2
45f23e0
4971980
4aafab8
38b69ce
07b0ec8
f47b8e9
b57cbd2
77470cd
ee13ae2
51be506
549a10e
b0608f3
279faf4
e5e2347
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 |
|---|---|---|
| @@ -0,0 +1,279 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
| ~ contributor license agreements. See the NOTICE file distributed with | ||
| ~ this work for additional information regarding copyright ownership. | ||
| ~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| ~ (the "License"); you may not use this file except in compliance with | ||
| ~ the License. You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
|
|
||
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-parent_2.12</artifactId> | ||
| <version>3.4.0-SNAPSHOT</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <artifactId>spark-connect_2.12</artifactId> | ||
| <packaging>jar</packaging> | ||
| <name>Spark Project Connect</name> | ||
| <url>https://spark.apache.org/</url> | ||
| <properties> | ||
| <sbt.project.name>connect</sbt.project.name> | ||
| <protobuf.version>3.21.1</protobuf.version> | ||
| <guava.version>31.0.1-jre</guava.version> | ||
| <io.grpc.version>1.47.0</io.grpc.version> | ||
| <tomcat.annotations.api.version>6.0.53</tomcat.annotations.api.version> | ||
| </properties> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-core_${scala.binary.version}</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>provided</scope> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-core_${scala.binary.version}</artifactId> | ||
| <version>${project.version}</version> | ||
| <type>test-jar</type> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-catalyst_${scala.binary.version}</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>provided</scope> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-sql_${scala.binary.version}</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>provided</scope> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-catalyst_${scala.binary.version}</artifactId> | ||
| <version>${project.version}</version> | ||
| <type>test-jar</type> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-sql_${scala.binary.version}</artifactId> | ||
| <version>${project.version}</version> | ||
| <type>test-jar</type> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.spark</groupId> | ||
| <artifactId>spark-tags_${scala.binary.version}</artifactId> | ||
| <version>${project.version}</version> | ||
| <scope>provided</scope> | ||
| <exclusions> | ||
| <exclusion> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <!-- #if scala-2.13 --><!-- | ||
| <dependency> | ||
| <groupId>org.scala-lang.modules</groupId> | ||
| <artifactId>scala-parallel-collections_${scala.binary.version}</artifactId> | ||
| </dependency> | ||
| --><!-- #endif scala-2.13 --> | ||
| <dependency> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| <version>${guava.version}</version> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>failureaccess</artifactId> | ||
| <version>1.0.1</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.protobuf</groupId> | ||
| <artifactId>protobuf-java</artifactId> | ||
| <version>${protobuf.version}</version> | ||
| <scope>compile</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-netty-shaded</artifactId> | ||
| <version>${io.grpc.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-protobuf</artifactId> | ||
| <version>${io.grpc.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-services</artifactId> | ||
| <version>${io.grpc.version}</version> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-stub</artifactId> | ||
| <version>${io.grpc.version}</version> | ||
| </dependency> | ||
| <dependency> <!-- necessary for Java 9+ --> | ||
| <groupId>org.apache.tomcat</groupId> | ||
| <artifactId>annotations-api</artifactId> | ||
| <version>${tomcat.annotations.api.version}</version> | ||
| <scope>provided</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.scalacheck</groupId> | ||
| <artifactId>scalacheck_${scala.binary.version}</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.mockito</groupId> | ||
| <artifactId>mockito-core</artifactId> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| </dependencies> | ||
| <build> | ||
| <!-- Protobuf compilation for Spark Connect --> | ||
| <extensions> | ||
| <extension> | ||
| <groupId>kr.motd.maven</groupId> | ||
| <artifactId>os-maven-plugin</artifactId> | ||
| <version>1.6.2</version> | ||
| </extension> | ||
| </extensions> | ||
| <outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory> | ||
| <testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>build-helper-maven-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>add-sources</id> | ||
| <phase>generate-sources</phase> | ||
| <goals> | ||
| <goal>add-source</goal> | ||
| </goals> | ||
| <configuration> | ||
| <sources> | ||
| <source>src/main/scala-${scala.binary.version}</source> | ||
| </sources> | ||
| </configuration> | ||
| </execution> | ||
| <execution> | ||
| <id>add-scala-test-sources</id> | ||
| <phase>generate-test-sources</phase> | ||
| <goals> | ||
| <goal>add-test-source</goal> | ||
| </goals> | ||
| <configuration> | ||
| <sources> | ||
| <source>src/test/gen-java</source> | ||
| </sources> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <!-- Add protobuf-maven-plugin and provide ScalaPB as a code generation plugin --> | ||
| <plugin> | ||
| <groupId>org.xolstice.maven.plugins</groupId> | ||
| <artifactId>protobuf-maven-plugin</artifactId> | ||
|
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. @HyukjinKwon @grundprinzip Report another issue: Compile Already file a jira SPARK-40593, I think at least we should explicitly point out the compilation dependency somewhere
Member
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. Thanks @LuciferYang for checking this out. |
||
| <version>0.6.1</version> | ||
| <configuration> | ||
| <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact> | ||
| <pluginId>grpc-java</pluginId> | ||
| <pluginArtifact>io.grpc:protoc-gen-grpc-java:${io.grpc.version}:exe:${os.detected.classifier}</pluginArtifact> | ||
| <protoSourceRoot>src/main/protobuf</protoSourceRoot> | ||
| </configuration> | ||
| <executions> | ||
| <execution> | ||
| <goals> | ||
| <goal>compile</goal> | ||
| <goal>compile-custom</goal> | ||
| <goal>test-compile</goal> | ||
| </goals> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <!-- Shade all GRPC / Guava / Protobuf dependencies of this build --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| <configuration> | ||
| <shadedArtifactAttached>false</shadedArtifactAttached> | ||
| <artifactSet> | ||
| <includes> | ||
| <include>com.google.guava:*</include> | ||
| <include>io.grpc:*:</include> | ||
| <include>com.google.protobuf:*</include> | ||
| </includes> | ||
| </artifactSet> | ||
| <relocations> | ||
| <relocation> | ||
| <pattern>com.google.common</pattern> | ||
| <shadedPattern>${spark.shade.packageName}.connect.guava</shadedPattern> | ||
| <includes> | ||
| <include>com.google.common.**</include> | ||
| </includes> | ||
| </relocation> | ||
| <relocation> | ||
| <pattern>com.google.thirdparty</pattern> | ||
| <shadedPattern>${spark.shade.packageName}.connect.guava</shadedPattern> | ||
| <includes> | ||
| <include>com.google.thirdparty.**</include> | ||
| </includes> | ||
| </relocation> | ||
| <relocation> | ||
| <pattern>com.google.protobuf</pattern> | ||
| <shadedPattern>${spark.shade.packageName}.connect.protobuf</shadedPattern> | ||
| <includes> | ||
| <include>com.google.protobuf.**</include> | ||
| </includes> | ||
| </relocation> | ||
| <relocation> | ||
| <pattern>io.grpc</pattern> | ||
| <shadedPattern>${spark.shade.packageName}.connect.grpc</shadedPattern> | ||
| </relocation> | ||
| </relocations> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| version: v1 | ||
| plugins: | ||
| - remote: buf.build/protocolbuffers/plugins/cpp:v3.20.0-1 | ||
| out: gen/proto/cpp | ||
| - remote: buf.build/protocolbuffers/plugins/csharp:v3.20.0-1 | ||
| out: gen/proto/csharp | ||
| - remote: buf.build/protocolbuffers/plugins/java:v3.20.0-1 | ||
| out: gen/proto/java | ||
| - remote: buf.build/protocolbuffers/plugins/python:v3.20.0-1 | ||
| out: gen/proto/python | ||
| - remote: buf.build/grpc/plugins/python:v1.47.0-1 | ||
| out: gen/proto/python | ||
| - remote: buf.build/protocolbuffers/plugins/go:v1.28.0-1 | ||
| out: gen/proto/go | ||
| opt: | ||
| - paths=source_relative | ||
| - remote: buf.build/grpc/plugins/go:v1.2.0-1 | ||
| out: gen/proto/go | ||
| opt: | ||
| - paths=source_relative | ||
| - require_unimplemented_servers=false | ||
| - remote: buf.build/grpc/plugins/ruby:v1.47.0-1 | ||
| out: gen/proto/ruby | ||
| - remote: buf.build/protocolbuffers/plugins/ruby:v21.2.0-1 | ||
| out: gen/proto/ruby |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
| version: v1 | ||
| directories: | ||
| - protobuf |
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.
May I ask some questions, @grundprinzip and @HyukjinKwon ?
KafkaorAvro?hadoop-cloudat least?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.
This one, I will handle separately. It will be published like Kafka or Avro, and yes it will be covered by a profile. I will do separately.
Uh oh!
There was an error while loading. Please reload this page.
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.
Run
dev/make-distribution.sh --tgzand decompress the generated tar ball, I found the jars related togrpcandprotobuf-java-util-3.19.2.jarare also placed in the jars directory as follows:should we explicitly exclude them here due to they already shaded
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.
same concerns at #37710 (comment)
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.
Thanks for pointing this out. I am working on this - would make a PR soon.