Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/19717#discussion_r154750025
--- Diff:
core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala ---
@@ -388,6 +388,32 @@ class SparkSubmitSuite
conf.get("spark.ui.enabled") should be ("false")
}
+ test("handles k8s cluster mode") {
+ val clArgs = Seq(
+ "--deploy-mode", "cluster",
+ "--master", "k8s://host:port",
+ "--executor-memory", "5g",
+ "--class", "org.SomeClass",
+ "--kubernetes-namespace", "foo",
+ "--driver-memory", "4g",
+ "--conf", "spark.kubernetes.driver.docker.image=bar",
+ "/home/thejar.jar",
+ "arg1")
+ val appArgs = new SparkSubmitArguments(clArgs)
+ val (childArgs, classpath, conf, mainClass) =
prepareSubmitEnvironment(appArgs)
+
+ val childArgsMap = childArgs.grouped(2).map(a => a(0) -> a(1)).toMap
+ childArgsMap.get("--primary-java-resource") should be
(Some("file:/home/thejar.jar"))
+ childArgsMap.get("--main-class") should be (Some("org.SomeClass"))
+ childArgsMap.get("--arg") should be (Some("arg1"))
+ mainClass should be ("org.apache.spark.deploy.k8s.submit.Client")
+ classpath should have length (0)
+ conf.get("spark.executor.memory") should be ("5g")
--- End diff --
Check `spark.master` too?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]