Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
dist: trusty
language: scala
scala:
- 2.11.8
git:
depth: 3
jdk:
- oraclejdk8
script: "mvn test -B"

matrix:
include:
- scala: 2.11.12
script: "mvn test -B -Pscala-2.11"

- scala: 2.12.12
script: "mvn test -B -Pscala-2.12"

# safelist
branches:
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ The implementation is based on [Spark Tensorflow Connector](https://github.com/t
## Including the library

The artifacts are published to [bintray](https://bintray.com/linkedin/maven/spark-tfrecord) and [maven central](https://search.maven.org/search?q=spark-tfrecord) repositories.
Current releases were built with scala-2.11.

- Version 0.1.x is based on Spark 2.3.
- Version 0.2.x is based on Spark 3.0.
- Version 0.1.x targets Spark 2.3 and Scala 2.11
- Version 0.2.x targets Spark 2.4 and both Scala 2.11 and 2.12

To use the package, please include the dependency as follows

Expand All @@ -28,14 +27,13 @@ The library can be built with Maven 3.3.9 or newer as shown below:
# Build Spark-TFRecord
git clone https://github.com/linkedin/spark-tfrecord.git
cd spark-tfrecord
mvn clean install
mvn -Pscala-2.11 clean install

# One can specify the spark version and tensorflow hadoop version, for example
mvn clean install -Dspark.version=2.4.6 -Dtensorflow.hadoop.version=1.15.0
mvn -Pscala-2.11 clean install -Dspark.version=2.4.6 -Dtensorflow.hadoop.version=1.15.0

# Or for building with Spark 3, use the following
mvn clean install -Dspark.version=3.0.0 -Dscala.binary.version=2.12 -Dscala.compiler.version=2.12.11 -Dscala.test.version=3.0.0
# In this instance we would suggest changing the `<artifactId>` in the `pom.xml` to spark-tfrecord_2.12
mvn -Pscala-2.12 clean install -Dspark.version=3.0.0
```

## Using Spark Shell
Expand Down
47 changes: 40 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
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>
<groupId>com.linkedin.sparktfrecord</groupId>
<artifactId>spark-tfrecord_2.11</artifactId>
<artifactId>spark-tfrecord_${scala.binary.version}</artifactId>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now possible due to the cross-compilation plugin.

<packaging>jar</packaging>
<version>0.2.2</version>
<version>0.2.3</version>
<name>spark-tfrecord</name>
<url>https://github.com/linkedin/spark-tfrecord</url>
<description>TensorFlow TFRecord data source for Apache Spark</description>
Expand All @@ -28,13 +28,11 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<scala.maven.version>3.2.2</scala.maven.version>
<scala.binary.version>2.11</scala.binary.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed because cross-compilation plugin requires / recommends they are not defaulted and only set through Profiles.

I was able to select a Profile inside IntelliJ and the project compiled in my IDE.

<scala.compiler.version>2.11.8</scala.compiler.version>
<scalatest.maven.version>1.0</scalatest.maven.version>
<scala.test.version>2.2.6</scala.test.version>
<scala.test.version>3.0.8</scala.test.version>
<spark.version>2.4.6</spark.version>
<maven.compiler.version>3.0</maven.compiler.version>
<java.version>1.8</java.version>
<spark.version>2.4.6</spark.version>
<junit.version>4.11</junit.version>
<tensorflow.hadoop.version>1.15.0</tensorflow.hadoop.version>
</properties>
Expand Down Expand Up @@ -87,7 +85,7 @@
<configuration>
<recompileMode>incremental</recompileMode>
<useZincServer>true</useZincServer>
<scalaVersion>${scala.compiler.version}</scalaVersion>
<scalaVersion>${scala.version}</scalaVersion>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The plugin appears to want this property name.

<checkMultipleScalaVersions>false</checkMultipleScalaVersions>
</configuration>
</plugin>
Expand Down Expand Up @@ -173,6 +171,20 @@
</execution>
</executions>
</plugin>
<!-- Scala cross compilation support: https://github.com/kelnos/scala-cross-maven-plugin -->
<plugin>
<groupId>org.spurint.maven.plugins</groupId>
<artifactId>scala-cross-maven-plugin</artifactId>
<version>0.2.1</version>
<executions>
<execution>
<id>rewrite-pom</id>
<goals>
<goal>rewrite-pom</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -223,6 +235,10 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.spurint.maven.plugins</groupId>
<artifactId>scala-cross-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -321,6 +337,23 @@
</plugins>
</build>
</profile>

<profile>
<id>scala-2.11</id>
<properties>
<scala.binary.version>2.11</scala.binary.version>
<scala.version>2.11.12</scala.version>
</properties>
</profile>

<profile>
<id>scala-2.12</id>
<properties>
<scala.binary.version>2.12</scala.binary.version>
<scala.version>2.12.12</scala.version>
</properties>
</profile>

</profiles>

<developers>
Expand Down