Permalink
Browse files

SPARK-1121: Include avro for yarn-alpha builds

This lets us explicitly include Avro based on a profile for 0.23.X
builds. It makes me sad how convoluted it is to express this logic
in Maven. @tgraves and @sryza curious if this works for you.

I'm also considering just reverting to how it was before. The only
real problem was that Spark advertised a dependency on Avro
even though it only really depends transitively on Avro through
other deps.

Author: Patrick Wendell <pwendell@gmail.com>

Closes #49 from pwendell/avro-build-fix and squashes the following commits:

8d6ee92 [Patrick Wendell] SPARK-1121: Add avro to yarn-alpha profile
  • Loading branch information...
1 parent fd31adb commit c3f5e075335a65ea522b2f76716921ec056c52ed @pwendell pwendell committed Mar 2, 2014
View
@@ -31,6 +31,20 @@
<name>Spark Project Bagel</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
View
@@ -31,6 +31,20 @@
<name>Spark Project Core</name>
<url>http://spark.apache.org/</url>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <profiles>
+ <profile>
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
@@ -76,7 +76,3 @@ The maven build includes support for building a Debian package containing the as
$ mvn -Pdeb -DskipTests clean package
The debian package can then be found under assembly/target. We added the short commit hash to the file name so that we can distinguish individual packages built for SNAPSHOT versions.
-
-## A note about Hadoop version 0.23.x
-
-For building spark with hadoop 0.23.x and also yarn, you will have to manually add a dependency on avro (org.apache.avro, avro, 1.7.4).
View
@@ -31,6 +31,20 @@
<name>Spark Project Examples</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<repositories>
<repository>
<id>apache-repo</id>
View
@@ -31,6 +31,20 @@
<name>Spark Project External Flume</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
View
@@ -31,6 +31,20 @@
<name>Spark Project External Kafka</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
View
@@ -31,6 +31,20 @@
<name>Spark Project External MQTT</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<repositories>
<repository>
<id>mqtt-repo</id>
View
@@ -31,6 +31,20 @@
<name>Spark Project External Twitter</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
View
@@ -31,6 +31,20 @@
<name>Spark Project External ZeroMQ</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
View
@@ -31,6 +31,20 @@
<name>Spark Project GraphX</name>
<url>http://spark-project.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
View
@@ -31,6 +31,20 @@
<name>Spark Project ML Library</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
View
15 pom.xml
@@ -426,6 +426,21 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ <version>1.7.4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>net.java.dev.jets3t</groupId>
<artifactId>jets3t</artifactId>
<version>0.7.1</version>
View
@@ -31,6 +31,20 @@
<name>Spark Project REPL</name>
<url>http://spark.apache.org/</url>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <profiles>
+ <profile>
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<properties>
<deb.install.path>/usr/share/spark</deb.install.path>
<deb.user>root</deb.user>
View
@@ -31,6 +31,20 @@
<name>Spark Project Streaming</name>
<url>http://spark.apache.org/</url>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<repositories>
<repository>
<id>apache-repo</id>
View
@@ -30,6 +30,20 @@
<name>Spark Project Tools</name>
<url>http://spark.apache.org/</url>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <profiles>
+ <profile>
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
View
@@ -24,6 +24,20 @@
<relativePath>../pom.xml</relativePath>
</parent>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<groupId>org.apache.spark</groupId>
<artifactId>spark-yarn-alpha_2.10</artifactId>
<packaging>jar</packaging>
View
@@ -53,14 +53,6 @@
<version>${yarn.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.avro</groupId>
- <artifactId>avro</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.avro</groupId>
- <artifactId>avro-ipc</artifactId>
- </dependency>
- <dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.binary.version}</artifactId>
<scope>test</scope>
@@ -78,6 +70,15 @@
<modules>
<module>alpha</module>
</modules>
+
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
</profile>
<profile>
View
@@ -24,6 +24,20 @@
<relativePath>../pom.xml</relativePath>
</parent>
+ <profiles>
+ <profile>
+ <!-- SPARK-1121: SPARK-1121: Adds an explicit dependency on Avro to work around
+ a Hadoop 0.23.X issue -->
+ <id>yarn-alpha</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
<groupId>org.apache.spark</groupId>
<artifactId>spark-yarn_2.10</artifactId>
<packaging>jar</packaging>

0 comments on commit c3f5e07

Please sign in to comment.