nadav-har-tzvi commented on a change in pull request #42: Amaterasu 8
URL: https://github.com/apache/incubator-amaterasu/pull/42#discussion_r257777454
 
 

 ##########
 File path: 
frameworks/spark/dispatcher/src/main/scala/org/apache/amaterasu/frameworks/spark/dispatcher/runners/providers/SparkSubmitScalaRunnerProvider.scala
 ##########
 @@ -0,0 +1,46 @@
+package org.apache.amaterasu.frameworks.spark.dispatcher.runners.providers
+
+import java.io.File
+
+import org.apache.amaterasu.common.configuration.ClusterConfig
+import org.apache.amaterasu.common.dataobjects.ActionData
+import org.apache.amaterasu.common.utils.ArtifactUtil
+import org.apache.amaterasu.sdk.frameworks.RunnerSetupProvider
+
+import scala.collection.JavaConverters._
+
+class SparkSubmitScalaRunnerProvider extends RunnerSetupProvider {
+
+  private var conf: ClusterConfig = _
+  val jarFile = new 
File(this.getClass.getProtectionDomain.getCodeSource.getLocation.getPath)
+  val amaDist = new File (s"${new File(jarFile.getParent).getParent}/dist")
+
+  override def getCommand(jobId: String, actionData: ActionData, env: String, 
executorId: String, callbackAddress: String): String = {
+    val util = new ArtifactUtil(List(actionData.repo).asJava, jobId)
+    val classParam = if (actionData.getHasArtifact)  s" --class 
${actionData.entryClass}" else ""
+    s"spark-2.2.1-bin-hadoop2.7/bin/spark-submit $classParam 
${util.getLocalArtifacts(actionData.getArtifact).get(0).getName} --deploy-mode 
client --jars spark-runtime-${conf.version}.jar >&1"
 
 Review comment:
   Is the hardcoded spark version mandatory?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to