nadav-har-tzvi commented on a change in pull request #32: Amaterasu 35
URL: https://github.com/apache/incubator-amaterasu/pull/32#discussion_r206435485
##########
File path:
frameworks/spark/dispatcher/src/main/scala/org/apache/amaterasu/frameworks/spark/dispatcher/runners/providers/PySparkRunnerProvider.scala
##########
@@ -0,0 +1,42 @@
+package org.apache.amaterasu.frameworks.spark.dispatcher.runners.providers
+
+import java.net.URLEncoder
+
+import org.apache.amaterasu.common.configuration.ClusterConfig
+import org.apache.amaterasu.common.dataobjects.ActionData
+import org.apache.amaterasu.leader.common.utilities.DataLoader
+import org.apache.amaterasu.sdk.frameworks.RunnerSetupProvider
+import org.apache.hadoop.yarn.api.ApplicationConstants
+
+class PySparkRunnerProvider extends RunnerSetupProvider {
+
+ private var conf: ClusterConfig = _
+
+ override def getCommand(jobId: String, actionData: ActionData, env: String,
executorId: String): String = conf.mode match {
+ case "mesos" => s"""env AMA_NODE=${sys.env("AMA_NODE")} env
MESOS_NATIVE_JAVA_LIBRARY=/usr/lib/libmesos.so env
SPARK_EXECUTOR_URI=http://${sys.env("AMA_NODE")}:${conf.Webserver.Port}/dist/spark-${conf.Webserver.sparkVersion}.tgz
java -cp
executor-${conf.version}-all.jar:spark-runner-${conf.version}-all.jar:spark-runtime-${conf.version}.jar:spark-${conf.Webserver.sparkVersion}/jars/*
-Dscala.usejavacp=true -Djava.library.path=/usr/lib
org.apache.amaterasu.executor.mesos.executors.MesosActionsExecutor $jobId
${conf.master} ${actionData.name}""".stripMargin
Review comment:
Can you please turn it into a multiline string? It is completely unreadable.
Also, MESOS_NATIVE_JAVA_LIBRARY, if I recall, as an example in DC/OS, it is
not located in /usr/lib/mesos.so, so I think the fact that it is hardcoded is a
problem.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services