[jvm-packages] upgrade to Scala 2.12 (#4574)

* bump scala to 2.12 which requires java 8 and also newer flink and akka

* put scala version in artifactId

* fix appveyor

* fix for scaladoc issue that looks like https://github.com/scala/bug/issues/10509

* fix ci_build

* update versions in generate_pom.py

* fix generate_pom.py

* apache does not have a download for spark 2.4.3 distro using scala 2.12 yet, so for now i use a tgz i put on s3

* Upload spark-2.4.3-bin-scala2.12-hadoop2.7.tgz to our own S3

* Update Dockerfile.jvm_cross

* Update Dockerfile.jvm_cross
This commit is contained in:
koertkuipers
2019-07-16 11:43:34 -04:00
committed by Nan Zhu
parent 5544a730f1
commit 3c506b076e
12 changed files with 67 additions and 56 deletions

View File

@@ -27,14 +27,14 @@ XGBoost4J, XGBoost4J-Spark, etc. in maven repository is compiled with g++-4.8.5
```
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j</artifactId>
<artifactId>xgboost4j_2.12</artifactId>
<version>latest_version_num</version>
</dependency>
```
<b>sbt</b>
```sbt
"ml.dmlc" % "xgboost4j" % "latest_version_num"
"ml.dmlc" %% "xgboost4j" % "latest_version_num"
```
For the latest release version number, please check [here](https://github.com/dmlc/xgboost/releases).
@@ -68,17 +68,17 @@ the add dependency as following:
```
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j</artifactId>
<artifactId>xgboost4j_2.12</artifactId>
<version>latest_version_num</version>
</dependency>
```
<b>sbt</b>
```sbt
"ml.dmlc" % "xgboost4j" % "latest_version_num"
"ml.dmlc" %% "xgboost4j" % "latest_version_num"
```
For the latest release version number, please check [here](https://github.com/CodingCat/xgboost/tree/maven-repo/ml/dmlc/xgboost4j).
For the latest release version number, please check [here](https://github.com/CodingCat/xgboost/tree/maven-repo/ml/dmlc/xgboost4j_2.12).
if you want to use `xgboost4j-spark`, you just need to replace xgboost4j with `xgboost4j-spark`

View File

@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost-jvm</artifactId>
<artifactId>xgboost-jvm_2.12</artifactId>
<version>0.90</version>
<packaging>pom</packaging>
<name>XGBoost JVM Package</name>
@@ -31,12 +31,12 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<flink.version>1.5.0</flink.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<flink.version>1.7.2</flink.version>
<spark.version>2.4.3</spark.version>
<scala.version>2.11.12</scala.version>
<scala.binary.version>2.11</scala.binary.version>
<scala.version>2.12.8</scala.version>
<scala.binary.version>2.12</scala.binary.version>
</properties>
<repositories>
<repository>
@@ -372,7 +372,13 @@
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.binary.version}</artifactId>
<version>3.0.0</version>
<version>3.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalactic</groupId>
<artifactId>scalactic_${scala.binary.version}</artifactId>
<version>3.0.8</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -5,10 +5,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost-jvm</artifactId>
<artifactId>xgboost-jvm_2.12</artifactId>
<version>0.90</version>
</parent>
<artifactId>xgboost4j-example</artifactId>
<artifactId>xgboost4j-example_2.12</artifactId>
<version>0.90</version>
<packaging>jar</packaging>
<build>
@@ -25,7 +25,7 @@
<dependencies>
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j-spark</artifactId>
<artifactId>xgboost4j-spark_${scala.binary.version}</artifactId>
<version>0.90</version>
</dependency>
<dependency>
@@ -36,7 +36,7 @@
</dependency>
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j-flink</artifactId>
<artifactId>xgboost4j-flink_${scala.binary.version}</artifactId>
<version>0.90</version>
</dependency>
<dependency>

View File

@@ -5,10 +5,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost-jvm</artifactId>
<artifactId>xgboost-jvm_2.12</artifactId>
<version>0.90</version>
</parent>
<artifactId>xgboost4j-flink</artifactId>
<artifactId>xgboost4j-flink_2.12</artifactId>
<version>0.90</version>
<build>
<plugins>
@@ -25,7 +25,7 @@
<dependencies>
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j</artifactId>
<artifactId>xgboost4j_${scala.binary.version}</artifactId>
<version>0.90</version>
</dependency>
<dependency>

View File

@@ -5,10 +5,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost-jvm</artifactId>
<artifactId>xgboost-jvm_2.12</artifactId>
<version>0.90</version>
</parent>
<artifactId>xgboost4j-spark</artifactId>
<artifactId>xgboost4j-spark_2.12</artifactId>
<build>
<plugins>
<plugin>
@@ -23,7 +23,7 @@
<dependencies>
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j</artifactId>
<artifactId>xgboost4j_${scala.binary.version}</artifactId>
<version>0.90</version>
</dependency>
<dependency>

View File

@@ -8,10 +8,10 @@ pom_template = """
<modelVersion>4.0.0</modelVersion>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j-tester</artifactId>
<artifactId>xgboost4j-tester_2.12</artifactId>
<version>1.0-SNAPSHOT</version>
<name>xgboost4j-tester</name>
<name>xgboost4j-tester_2.12</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -51,19 +51,25 @@ pom_template = """
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_${{scala.binary.version}}</artifactId>
<version>2.3.11</version>
<version>2.5.23</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${{scala.binary.version}}</artifactId>
<version>2.3.11</version>
<version>2.5.23</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${{scala.binary.version}}</artifactId>
<version>3.0.0</version>
<version>3.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalactic</groupId>
<artifactId>scalactic_${{scala.binary.version}}</artifactId>
<version>3.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -97,12 +103,12 @@ pom_template = """
</dependency>
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j</artifactId>
<artifactId>xgboost4j_${{scala.binary.version}}</artifactId>
<version>{xgboost4j_version}</version>
</dependency>
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j</artifactId>
<artifactId>xgboost4j_${{scala.binary.version}}</artifactId>
<version>{xgboost4j_version}</version>
<classifier>tests</classifier>
<type>test-jar</type>
@@ -110,12 +116,12 @@ pom_template = """
</dependency>
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j-spark</artifactId>
<artifactId>xgboost4j-spark_${{scala.binary.version}}</artifactId>
<version>{xgboost4j_version}</version>
</dependency>
<dependency>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost4j-example</artifactId>
<artifactId>xgboost4j-example_${{scala.binary.version}}</artifactId>
<version>{xgboost4j_version}</version>
</dependency>
</dependencies>
@@ -186,7 +192,7 @@ pom_template = """
<version>2.22.1</version>
<configuration>
<dependenciesToScan>
<dependency>ml.dmlc:xgboost4j</dependency>
<dependency>ml.dmlc:xgboost4j_2.12</dependency>
</dependenciesToScan>
</configuration>
</plugin>

View File

@@ -5,10 +5,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ml.dmlc</groupId>
<artifactId>xgboost-jvm</artifactId>
<artifactId>xgboost-jvm_2.12</artifactId>
<version>0.90</version>
</parent>
<artifactId>xgboost4j</artifactId>
<artifactId>xgboost4j_2.12</artifactId>
<version>0.90</version>
<packaging>jar</packaging>
@@ -22,13 +22,13 @@
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_${scala.binary.version}</artifactId>
<version>2.3.11</version>
<version>2.5.23</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${scala.binary.version}</artifactId>
<version>2.3.11</version>
<version>2.5.23</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@@ -78,7 +78,8 @@ public class DMatrix {
* @throws XGBoostError
*/
@Deprecated
public DMatrix(long[] headers, int[] indices, float[] data, SparseType st) throws XGBoostError {
public DMatrix(long[] headers, int[] indices, float[] data, DMatrix.SparseType st)
throws XGBoostError {
long[] out = new long[1];
if (st == SparseType.CSR) {
XGBoostJNI.checkCall(XGBoostJNI.XGDMatrixCreateFromCSREx(headers, indices, data, 0, out));
@@ -100,7 +101,7 @@ public class DMatrix {
* row number
* @throws XGBoostError
*/
public DMatrix(long[] headers, int[] indices, float[] data, SparseType st, int shapeParam)
public DMatrix(long[] headers, int[] indices, float[] data, DMatrix.SparseType st, int shapeParam)
throws XGBoostError {
long[] out = new long[1];
if (st == SparseType.CSR) {

View File

@@ -131,9 +131,7 @@ private[scala] class RabitTracker(numWorkers: Int, port: Option[Int] = None,
}
def stop(): Unit = {
if (!system.isTerminated) {
system.shutdown()
}
system.terminate()
}
/**
@@ -170,12 +168,10 @@ private[scala] class RabitTracker(numWorkers: Int, port: Option[Int] = None,
case Failure(e) =>
IRabitTracker.TrackerStatus.FAILURE.getStatusCode
}
system.shutdown()
system.terminate()
statusCode
case Failure(ex: Throwable) =>
if (!system.isTerminated) {
system.shutdown()
}
system.terminate()
IRabitTracker.TrackerStatus.FAILURE.getStatusCode
}
}