Skip to content

Commit

Permalink
[ML-311] Upgrade spark to 3.2.2 to resolve security scan
Browse files Browse the repository at this point in the history
Signed-off-by: minmingzhu <[email protected]>
  • Loading branch information
minmingzhu authored Jun 30, 2023
1 parent a2122a8 commit 392d0c1
Show file tree
Hide file tree
Showing 28 changed files with 38 additions and 36 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ The following runtime packages with all their dependencies should be installed i
* Apache Spark 3.1.3
* Apache Spark 3.2.0
* Apache Spark 3.2.1
* Apache Spark 3.2.2

### Supported Intel® oneAPI Toolkits

Expand Down
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
OAP_MLLIB_VERSION=1.6.0
SPARK_VERSION=3.2.0
SPARK_VERSION=3.2.2
PLATFORM_PROFILE=CPU_GPU_PROFILE
2 changes: 1 addition & 1 deletion examples/scala/als-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<oap.version>1.2.0</oap.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<spark.version>3.2.0</spark.version>
<spark.version>3.2.2</spark.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion examples/scala/correlation-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<oap.version>1.2.0</oap.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<spark.version>3.2.0</spark.version>
<spark.version>3.2.2</spark.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion examples/scala/kmeans-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<oap.version>1.2.0</oap.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<spark.version>3.2.0</spark.version>
<spark.version>3.2.2</spark.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion examples/scala/linear-regression-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<oap.version>1.2.0</oap.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<spark.version>3.2.0</spark.version>
<spark.version>3.2.2</spark.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion examples/scala/naive-bayes-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<oap.version>1.2.0</oap.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<spark.version>3.2.0</spark.version>
<spark.version>3.2.2</spark.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion examples/scala/pca-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<oap.version>1.2.0</oap.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<spark.version>3.2.0</spark.version>
<spark.version>3.2.2</spark.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion examples/scala/summarizer-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<oap.version>1.3.0</oap.version>
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<spark.version>3.2.0</spark.version>
<spark.version>3.2.2</spark.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion mllib-dal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<scala.version>2.12.15</scala.version>
<scala.binary.version>2.12</scala.binary.version>
<scalatest.version>3.2.9</scalatest.version>
<spark.version>3.2.0</spark.version>
<spark.version>3.2.2</spark.version>
<dal.version>2021.5.0.91</dal.version>
<assembly.description>src/assembly/assembly.xml</assembly.description>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.intel.oap.mllib.Utils

import org.apache.spark.internal.Logging
import org.apache.spark.ml.classification.NaiveBayesModel
import org.apache.spark.ml.classification.spark321.{NaiveBayes => NaiveBayesSpark321}
import org.apache.spark.ml.classification.spark322.{NaiveBayes => NaiveBayesSpark322}
import org.apache.spark.ml.param.ParamMap
import org.apache.spark.sql.Dataset
import org.apache.spark.{SPARK_VERSION, SparkException}
Expand All @@ -35,7 +35,7 @@ object NaiveBayesShim extends Logging {
logInfo(s"Loading NaiveBayes for Spark $SPARK_VERSION")

val shim = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" => new NaiveBayesSpark321(uid)
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" | "3.2.2" => new NaiveBayesSpark322(uid)
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
shim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import com.intel.oap.mllib.Utils
import org.apache.spark.internal.Logging
import org.apache.spark.ml.classification.RandomForestClassificationModel
import org.apache.spark.{SPARK_VERSION, SparkException}
import org.apache.spark.ml.classification.spark321.{RandomForestClassifier => RandomForestClassifier321}
import org.apache.spark.ml.classification.spark322.{RandomForestClassifier => RandomForestClassifier322}
import org.apache.spark.ml.param.ParamMap
import org.apache.spark.sql.Dataset

Expand All @@ -33,7 +33,8 @@ object RandomForestClassifierShim extends Logging {
logInfo(s"Loading RandomForestClassifier for Spark $SPARK_VERSION")

val shim = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" => new RandomForestClassifier321(uid)
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" | "3.2.2" =>
new RandomForestClassifier322(uid)
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
shim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.intel.oap.mllib.Utils

import org.apache.spark.internal.Logging
import org.apache.spark.ml.clustering.{KMeans, KMeansModel}
import org.apache.spark.ml.clustering.spark321.{KMeans => KMeansSpark321}
import org.apache.spark.ml.clustering.spark322.{KMeans => KMeansSpark322}
import org.apache.spark.ml.param.ParamMap
import org.apache.spark.sql.Dataset
import org.apache.spark.{SPARK_VERSION, SparkException}
Expand All @@ -34,7 +34,7 @@ object KMeansShim extends Logging {
def create(uid: String): KMeansShim = {
logInfo(s"Loading KMeans for Spark $SPARK_VERSION")
val kmeans = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" => new KMeansSpark321(uid)
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" | "3.2.2" => new KMeansSpark322(uid)
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
kmeans
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import com.intel.oap.mllib.Utils

import org.apache.spark.internal.Logging
import org.apache.spark.ml.feature.PCAModel
import org.apache.spark.ml.feature.spark321.{PCA => PCASpark321}
import org.apache.spark.ml.feature.spark322.{PCA => PCASpark322}
import org.apache.spark.ml.param.ParamMap
import org.apache.spark.sql.Dataset
import org.apache.spark.{SPARK_VERSION, SparkException}
Expand All @@ -34,7 +34,7 @@ object PCAShim extends Logging {
def create(uid: String): PCAShim = {
logInfo(s"Loading PCA for Spark $SPARK_VERSION")
val pca = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" => new PCASpark321(uid)
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" | "3.2.2" => new PCASpark322(uid)
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
pca
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import com.intel.oap.mllib.Utils
import org.apache.spark.internal.Logging
import org.apache.spark.ml.recommendation.ALS.Rating
import org.apache.spark.ml.recommendation.spark313.{ALS => ALSSpark313}
import org.apache.spark.ml.recommendation.spark321.{ALS => ALSSpark321}
import org.apache.spark.ml.recommendation.spark322.{ALS => ALSSpark322}
import org.apache.spark.rdd.RDD
import org.apache.spark.storage.StorageLevel
import org.apache.spark.{SPARK_VERSION, SparkException}
Expand Down Expand Up @@ -50,7 +50,7 @@ object ALSShim extends Logging {
logInfo(s"Loading ALS for Spark $SPARK_VERSION")
val als = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" => new ALSSpark313()
case "3.2.0" | "3.2.1" => new ALSSpark321()
case "3.2.0" | "3.2.1" | "3.2.2" => new ALSSpark322()
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
als
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import org.apache.spark.internal.Logging
import org.apache.spark.ml.param.ParamMap
import org.apache.spark.ml.regression.LinearRegressionModel
import org.apache.spark.ml.regression.spark313.{LinearRegression => LinearRegressionSpark313}
import org.apache.spark.ml.regression.spark321.{LinearRegression => LinearRegressionSpark321}
import org.apache.spark.ml.regression.spark322.{LinearRegression => LinearRegressionSpark322}
import org.apache.spark.sql.Dataset
import org.apache.spark.{SPARK_VERSION, SparkException}

Expand All @@ -36,7 +36,7 @@ object LinearRegressionShim extends Logging {
logInfo(s"Loading ALS for Spark $SPARK_VERSION")
val linearRegression = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" => new LinearRegressionSpark313(uid)
case "3.2.0" | "3.2.1" => new LinearRegressionSpark321(uid)
case "3.2.0" | "3.2.1" | "3.2.2" => new LinearRegressionSpark322(uid)
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
linearRegression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.apache.spark.internal.Logging
import org.apache.spark.{SPARK_VERSION, SparkException}
import org.apache.spark.ml.param.ParamMap
import org.apache.spark.ml.regression.RandomForestRegressionModel
import org.apache.spark.ml.regression.spark321.{RandomForestRegressor => RandomForestRegressor321}
import org.apache.spark.ml.regression.spark322.{RandomForestRegressor => RandomForestRegressor322}
import org.apache.spark.sql.Dataset

trait RandomForestRegressorShim extends Logging {
Expand All @@ -33,7 +33,7 @@ object RandomForestRegressorShim extends Logging {
logInfo(s"Loading RandomForestClassifier for Spark $SPARK_VERSION")

val shim = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" => new RandomForestRegressor321(uid)
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" | "3.2.2" => new RandomForestRegressor322(uid)
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
shim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import org.apache.spark.sql.{DataFrame, Dataset}
import org.apache.spark.storage.StorageLevel

import scala.reflect.ClassTag
import org.apache.spark.ml.stat.spark321.{Correlation => CorrelationSpark321}
import org.apache.spark.ml.stat.spark322.{Correlation => CorrelationSpark322}

trait CorrelationShim extends Serializable with Logging {
def corr(dataset: Dataset[_], column: String, method: String): DataFrame
Expand All @@ -35,7 +35,7 @@ object CorrelationShim extends Logging {
def create(): CorrelationShim = {
logInfo(s"Loading Correlation for Spark $SPARK_VERSION")
val als = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" => new CorrelationSpark321()
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" | "3.2.2" => new CorrelationSpark322()
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
als
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.apache.spark.mllib.linalg.Vector
import org.apache.spark.mllib.stat.MultivariateStatisticalSummary
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{DataFrame, Dataset}
import org.apache.spark.mllib.stat.spark321.{Statistics => SummarizerSpark321}
import org.apache.spark.mllib.stat.spark322.{Statistics => SummarizerSpark322}

trait SummarizerShim extends Serializable with Logging {
def colStats(X: RDD[Vector]): MultivariateStatisticalSummary
Expand All @@ -35,7 +35,7 @@ object SummarizerShim extends Logging {
def create(): SummarizerShim = {
logInfo(s"Loading Summarizer for Spark $SPARK_VERSION")
val summarizer = Utils.getSparkVersion() match {
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" => new SummarizerSpark321()
case "3.1.1" | "3.1.2" | "3.1.3" | "3.2.0" | "3.2.1" | "3.2.2" => new SummarizerSpark322()
case _ => throw new SparkException(s"Unsupported Spark version $SPARK_VERSION")
}
summarizer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
// scalastyle:on

package org.apache.spark.ml.classification.spark321
package org.apache.spark.ml.classification.spark322

import com.intel.oap.mllib.Utils
import com.intel.oap.mllib.classification.{NaiveBayesDALImpl, NaiveBayesShim}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
// scalastyle:on

package org.apache.spark.ml.classification.spark321
package org.apache.spark.ml.classification.spark322

import com.intel.oap.mllib.Utils
import com.intel.oap.mllib.classification.{LearningNode => LearningNodeDAL, RandomForestClassifierDALImpl, RandomForestClassifierShim}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
// scalastyle:on

package org.apache.spark.ml.clustering.spark321
package org.apache.spark.ml.clustering.spark322

import com.intel.oap.mllib.Utils
import com.intel.oap.mllib.clustering.{KMeansDALImpl, KMeansShim}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
// scalastyle:on

package org.apache.spark.ml.feature.spark321
package org.apache.spark.ml.feature.spark322

import com.intel.oap.mllib.Utils
import com.intel.oap.mllib.feature.{PCADALImpl, PCAShim}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
// scalastyle:on

package org.apache.spark.ml.recommendation.spark321
package org.apache.spark.ml.recommendation.spark322

import com.github.fommil.netlib.BLAS.{getInstance => blas}
import com.intel.oap.mllib.{Utils => DALUtils}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
// scalastyle:on

package org.apache.spark.ml.regression.spark321
package org.apache.spark.ml.regression.spark322

import breeze.linalg.{DenseVector => BDV}
import breeze.optimize.{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
// scalastyle:on

package org.apache.spark.ml.regression.spark321
package org.apache.spark.ml.regression.spark322

import com.intel.oap.mllib.Utils
import com.intel.oap.mllib.classification.{LearningNode => LearningNodeDAL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
// scalastyle:on

package org.apache.spark.ml.stat.spark321
package org.apache.spark.ml.stat.spark322

import com.intel.oap.mllib.Utils
import com.intel.oap.mllib.stat.{CorrelationDALImpl, CorrelationShim}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package org.apache.spark.mllib.stat.spark321
package org.apache.spark.mllib.stat.spark322

import com.intel.oap.mllib.Utils
import com.intel.oap.mllib.stat.{SummarizerDALImpl, SummarizerShim}
Expand Down

0 comments on commit 392d0c1

Please sign in to comment.