nadav-har-tzvi commented on a change in pull request #32: Amaterasu 35 URL: https://github.com/apache/incubator-amaterasu/pull/32#discussion_r206435900
########## File path: frameworks/spark/dispatcher/src/main/scala/org/apache/amaterasu/frameworks/spark/dispatcher/runners/providers/SparkScalaRunnerProvider.scala ########## @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +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 SparkScalaRunnerProvider 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: Same points as in PySpark. Also, I wonder if we can somehow make some of these configurations shared between Spark-Scala and PySpark. ---------------------------------------------------------------- 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