Skip to content

Commit

Permalink
Bugfix for receiving arguments
Browse files Browse the repository at this point in the history
In certain shell environments, arguments given to CLIKickoff can come as
many strings instead of just one. This fix marshalls all arguments into
one string and operates on a garbage-in, garbage-out principle. Because
CLIKickoff is only intended to be called programmatically from
Spark-Launch, this fix should suffice.
  • Loading branch information
ecurtin authored and Emily Curtin committed Jan 29, 2018
1 parent b2ada5a commit 4d40764
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
20 changes: 7 additions & 13 deletions cli/src/main/scala/com/ibm/sparktc/sparkbench/cli/CLIKickoff.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,16 @@

package com.ibm.sparktc.sparkbench.cli

import java.io.File

import com.ibm.sparktc.sparkbench.utils.SparkBenchException
import org.slf4j.{Logger, LoggerFactory}
import com.ibm.sparktc.sparkbench.workload.MultipleSuiteKickoff

object CLIKickoff extends App {

override def main(args: Array[String]): Unit = {
args.length match {
case 1 => {
// val file = new File(args.head)
// if(!file.exists()) throw SparkBenchException(s"Cannot find configuration file: ${file.getPath}")
val worksuites = Configurator(args.head)
MultipleSuiteKickoff.run(worksuites)
}
case _ => throw new IllegalArgumentException("Requires exactly one option: config file path")
}
val log: Logger = LoggerFactory.getLogger(this.getClass)
log.info(s"args received: ${args.mkString(", ")}")
if(args.isEmpty) throw new IllegalArgumentException("CLIKickoff received no arguments")
val oneStr = args.mkString(" ")
val worksuites = Configurator(oneStr)
MultipleSuiteKickoff.run(worksuites)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@

package com.ibm.sparktc.sparkbench.cli

import java.io.File
import java.util

import com.ibm.sparktc.sparkbench.utils.SparkBenchException
import com.ibm.sparktc.sparkbench.utils.TypesafeAccessories.configToMapStringSeqAny

import scala.collection.JavaConverters._
Expand Down Expand Up @@ -71,7 +67,4 @@ object Configurator {
output
)
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ import com.ibm.sparktc.sparkbench.sparklaunch.submission.sparksubmit.SparkSubmit

import scala.collection.parallel.ForkJoinTaskSupport
import scala.collection.JavaConverters._
import scala.sys.process._
import scala.util.Try
import com.ibm.sparktc.sparkbench.sparklaunch.{SparkLaunchDefaults => SLD}

object SparkLaunch extends App {

Expand Down

0 comments on commit 4d40764

Please sign in to comment.