Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 9f8be58

Browse files
authored
[PIO-199] Spark 2.4 support for Scala 2.11 (#503)
* Spark 2.4 support for Scala 2.11 * Update Spark 2.2 series in .travis.yml to 2.2.3
1 parent 52eb306 commit 9f8be58

File tree

5 files changed

+29
-55
lines changed

5 files changed

+29
-55
lines changed

.travis.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ env:
7373
- BUILD_TYPE=Integration
7474
METADATA_REP=PGSQL EVENTDATA_REP=PGSQL MODELDATA_REP=PGSQL
7575
PIO_SCALA_VERSION=2.11.12
76-
PIO_SPARK_VERSION=2.2.2
76+
PIO_SPARK_VERSION=2.2.3
7777
PIO_HADOOP_VERSION=2.6.5
7878
- BUILD_TYPE=Integration
7979
METADATA_REP=PGSQL EVENTDATA_REP=PGSQL MODELDATA_REP=HDFS
@@ -94,13 +94,18 @@ env:
9494
- BUILD_TYPE=Integration
9595
METADATA_REP=PGSQL EVENTDATA_REP=PGSQL MODELDATA_REP=PGSQL
9696
PIO_SCALA_VERSION=2.11.12
97-
PIO_SPARK_VERSION=2.2.2
97+
PIO_SPARK_VERSION=2.2.3
9898
PIO_HADOOP_VERSION=2.7.7
9999
- BUILD_TYPE=Integration
100100
METADATA_REP=PGSQL EVENTDATA_REP=PGSQL MODELDATA_REP=HDFS
101101
PIO_SCALA_VERSION=2.11.12
102102
PIO_SPARK_VERSION=2.3.2
103103
PIO_HADOOP_VERSION=2.7.7
104+
- BUILD_TYPE=Integration
105+
METADATA_REP=PGSQL EVENTDATA_REP=PGSQL MODELDATA_REP=HDFS
106+
PIO_SCALA_VERSION=2.11.12
107+
PIO_SPARK_VERSION=2.4.0
108+
PIO_HADOOP_VERSION=2.7.7
104109

105110
- BUILD_TYPE=LicenseCheck
106111

build.sbt

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,6 @@
1616
*/
1717
import PIOBuild._
1818

19-
lazy val scalaSparkDepsVersion = Map(
20-
"2.11" -> Map(
21-
"2.0" -> Map(
22-
"akka" -> "2.5.16",
23-
"hadoop" -> "2.7.7",
24-
"json4s" -> "3.2.11"),
25-
"2.1" -> Map(
26-
"akka" -> "2.5.17",
27-
"hadoop" -> "2.7.7",
28-
"json4s" -> "3.2.11"),
29-
"2.2" -> Map(
30-
"akka" -> "2.5.17",
31-
"hadoop" -> "2.7.7",
32-
"json4s" -> "3.2.11"),
33-
"2.3" -> Map(
34-
"akka" -> "2.5.17",
35-
"hadoop" -> "2.7.7",
36-
"json4s" -> "3.2.11")))
37-
3819
name := "apache-predictionio-parent"
3920

4021
version in ThisBuild := "0.14.0-SNAPSHOT"
@@ -60,23 +41,22 @@ sparkVersion in ThisBuild := sys.props.getOrElse("spark.version", "2.1.3")
6041

6142
sparkBinaryVersion in ThisBuild := binaryVersion(sparkVersion.value)
6243

63-
akkaVersion in ThisBuild := sys.props.getOrElse(
64-
"akka.version",
65-
scalaSparkDepsVersion(scalaBinaryVersion.value)(sparkBinaryVersion.value)("akka"))
44+
hadoopVersion in ThisBuild := sys.props.getOrElse("hadoop.version", "2.7.7")
45+
46+
akkaVersion in ThisBuild := sys.props.getOrElse("akka.version", "2.5.17")
6647

6748
lazy val es = sys.props.getOrElse("elasticsearch.version", "5.6.9")
6849

6950
elasticsearchVersion in ThisBuild := es
7051

71-
lazy val hbase = sys.props.getOrElse("hbase.version", "1.2.6")
72-
73-
hbaseVersion in ThisBuild := hbase
52+
hbaseVersion in ThisBuild := sys.props.getOrElse("hbase.version", "1.2.6")
7453

75-
json4sVersion in ThisBuild := scalaSparkDepsVersion(scalaBinaryVersion.value)(sparkBinaryVersion.value)("json4s")
76-
77-
hadoopVersion in ThisBuild := sys.props.getOrElse(
78-
"hadoop.version",
79-
scalaSparkDepsVersion(scalaBinaryVersion.value)(sparkBinaryVersion.value)("hadoop"))
54+
json4sVersion in ThisBuild := {
55+
sparkBinaryVersion.value match {
56+
case "2.0" | "2.1" | "2.2" | "2.3" => "3.2.11"
57+
case "2.4" => "3.5.3"
58+
}
59+
}
8060

8161
val conf = file("conf")
8262

data/build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import PIOBuild._
2020
name := "apache-predictionio-data"
2121

2222
libraryDependencies ++= Seq(
23+
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
2324
"com.github.nscala-time" %% "nscala-time" % "2.6.0",
2425
"com.google.guava" % "guava" % "14.0.1",
2526
"com.typesafe.akka" %% "akka-http-testkit" % "10.1.5" % "test",

docs/manual/source/install/install-sourcecode.html.md.erb

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ replace `/home/abc` with your own home directory wherever you see it.
2727
You can use pre-built binary distribution for Apache PredictionIO® if you are
2828
building against
2929

30-
* Scala 2.11.8
31-
* Spark 2.1.1
30+
* Scala 2.11.12
31+
* Spark 2.1.3
3232
* Hadoop 2.7.7
3333
* Elasticsearch 5.6.9
3434

@@ -100,17 +100,14 @@ and complete information.
100100
### Building
101101

102102
Run the following at the directory where you downloaded the source code to build
103-
Apache PredictionIO®. By default, the build will be against
104-
105-
* Scala 2.11.8
106-
* Spark 2.1.1
107-
* Hadoop 2.7.7
108-
* Elasticsearch 5.6.9
103+
Apache PredictionIO®.
104+
As an example, if you want to build PredictionIO to support Scala 2.11.12,
105+
Spark 2.4.0, and Elasticsearch 6.4.2, you can do
109106

110107
```
111108
$ tar zxvf apache-predictionio-<%= data.versions.pio %>.tar.gz
112109
$ cd apache-predictionio-<%= data.versions.pio %>
113-
$ ./make-distribution.sh
110+
$ ./make-distribution.sh -Dscala.version=2.11.12 -Dspark.version=2.4.0 -Delasticsearch.version=6.4.2
114111
```
115112

116113
You should see something like the following when it finishes building
@@ -136,17 +133,10 @@ Starting from version 0.11.0, PredictionIO can be built against different
136133
versions of dependencies. As of writing, one could build PredictionIO against
137134
these different dependencies:
138135

139-
* 2.11.x
140-
* 2.0.x, 2.1.x, 2.2.x, 2.3.x
136+
* Scala 2.11.x
137+
* Spark 2.0.x, 2.1.x, 2.2.x, 2.3.x, 2.4.x
141138
* Hadoop 2.6.x, 2.7.x
142-
* Elasticsearch 1.7.x(deprecated), 5.x
143-
144-
As an example, if you want to build PredictionIO to support Scala 2.11.8,
145-
Spark 2.1.0, and Elasticsearch 5.3.0, you can do
146-
147-
```
148-
$ ./make-distribution.sh -Dscala.version=2.11.8 -Dspark.version=2.1.0 -Delasticsearch.version=5.3.0
149-
```
139+
* Elasticsearch 1.7.x(deprecated), 5.6.x, 6.x
150140

151141
## Installing Dependencies
152142

storage/elasticsearch/build.sbt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ import PIOBuild._
1919

2020
name := "apache-predictionio-data-elasticsearch"
2121

22-
elasticsearchSparkArtifact := (if (majorVersion(sparkVersion.value) == 2) "elasticsearch-spark-20" else "elasticsearch-spark-13")
23-
2422
elasticsearchVersion := (if (majorVersion(elasticsearchVersion.value) < 5) "5.6.9" else elasticsearchVersion.value)
2523

2624
libraryDependencies ++= Seq(
2725
"org.apache.predictionio" %% "apache-predictionio-core" % version.value % "provided",
2826
"org.apache.spark" %% "spark-core" % sparkVersion.value % "provided",
29-
"org.elasticsearch.client" % "elasticsearch-rest-client" % elasticsearchVersion.value,
30-
"org.elasticsearch" %% elasticsearchSparkArtifact.value % elasticsearchVersion.value
27+
"org.elasticsearch.client" % "elasticsearch-rest-client" % elasticsearchVersion.value,
28+
"org.elasticsearch" %% "elasticsearch-spark-20" % elasticsearchVersion.value
3129
exclude("org.apache.spark", "*"),
3230
"org.elasticsearch" % "elasticsearch-hadoop-mr" % elasticsearchVersion.value,
3331
"org.specs2" %% "specs2" % "2.3.13" % "test")

0 commit comments

Comments
 (0)