Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-29474] [CORE] [WIP] CLI support for Spark-on-Docker-on-Yarn #48018

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,24 @@ private[spark] class SparkSubmit extends Logging {
mergeFn = Some(mergeFileLists(_, _))),
OptionAssigner(args.archives, YARN, ALL_DEPLOY_MODES, confKey = "spark.yarn.dist.archives",
mergeFn = Some(mergeFileLists(_, _))),
OptionAssigner(
if (args.yarnDockerImage != null) "docker" else "",
YARN, ALL_DEPLOY_MODES, confKey = "spark.yarn.appMasterEnv.YARN_CONTAINER_RUNTIME_TYPE"),
OptionAssigner(
args.yarnDockerImage, YARN, ALL_DEPLOY_MODES,
confKey = "spark.yarn.appMasterEnv.YARN_CONTAINER_RUNTIME_DOCKER_IMAGE"),
OptionAssigner(
args.yarnDockerMounts, YARN, ALL_DEPLOY_MODES,
confKey = "spark.yarn.appMasterEnv.YARN_CONTAINER_RUNTIME_DOCKER_MOUNTS"),
OptionAssigner(
if (args.executorDockerImage != null) "docker" else "",
YARN, ALL_DEPLOY_MODES, confKey = "spark.executorEnv.YARN_CONTAINER_RUNTIME_TYPE"),
OptionAssigner(
args.executorDockerImage, YARN, ALL_DEPLOY_MODES,
confKey = "spark.executorEnv.YARN_CONTAINER_RUNTIME_DOCKER_IMAGE"),
OptionAssigner(
args.executorDockerMounts, YARN, ALL_DEPLOY_MODES,
confKey = "spark.executorEnv.YARN_CONTAINER_RUNTIME_DOCKER_MOUNTS"),

// Other options
OptionAssigner(args.numExecutors, YARN | KUBERNETES, ALL_DEPLOY_MODES,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
var totalExecutorCores: String = null
var propertiesFile: String = null
private var loadSparkDefaults: Boolean = false
var yarnDockerImage: String = null;
var yarnDockerMounts: String = null;
var executorDockerImage: String = null;
var executorDockerMounts: String = null;
var driverMemory: String = null
var driverExtraClassPath: String = null
var driverExtraLibraryPath: String = null
Expand Down Expand Up @@ -228,6 +232,11 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
name = Option(name).orElse(env.get("SPARK_YARN_APP_NAME")).orNull
}

yarnDockerImage = Option(yarnDockerImage).orNull
yarnDockerMounts = Option(yarnDockerMounts).orNull
executorDockerImage = Option(executorDockerImage).orNull
executorDockerMounts = Option(executorDockerMounts).orNull

// Set name from main class if not given
name = Option(name).orElse(Option(mainClass)).orNull
if (name == null && primaryResource != null) {
Expand Down Expand Up @@ -324,6 +333,10 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
| driverExtraClassPath $driverExtraClassPath
| driverExtraLibraryPath $driverExtraLibraryPath
| driverExtraJavaOptions $driverExtraJavaOptions
| yarnDockerImage $yarnDockerImage
| yarnDockerMounts $yarnDockerMounts
| executorDockerImage $executorDockerImage
| executorDockerMounts $executorDockerMounts
| supervise $supervise
| queue $queue
| numExecutors $numExecutors
Expand Down Expand Up @@ -394,6 +407,18 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
case DRIVER_LIBRARY_PATH =>
driverExtraLibraryPath = value

case YARN_DOCKER_IMAGE =>
yarnDockerImage = value

case YARN_DOCKER_MOUNTS =>
yarnDockerMounts = value

case EXECUTOR_DOCKER_IMAGE =>
executorDockerImage = value

case EXECUTOR_DOCKER_MOUNTS =>
executorDockerMounts = value

case PROPERTIES_FILE =>
propertiesFile = value

Expand Down Expand Up @@ -557,6 +582,16 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
|
| --executor-memory MEM Memory per executor (e.g. 1000M, 2G) (Default: 1G).
|
| --yarn-docker-image The docker image to use for YARN app master - also sets
| the YARN app master runtime to docker.
|
| --yarn-docker-mounts The volumes to mount on the YARN docker container.
|
| --executor-docker-image The docker image to use for the executors - also sets the
| executor runtime to docker.
|
| --executor-docker-mounts The volumes to mount on the executor docker containers.
|
| --proxy-user NAME User to impersonate when submitting the application.
| This argument does not work with --principal / --keytab.
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class SparkSubmitOptionParser {
protected final String DRIVER_LIBRARY_PATH = "--driver-library-path";
protected final String DRIVER_MEMORY = "--driver-memory";
protected final String EXECUTOR_MEMORY = "--executor-memory";
protected final String YARN_DOCKER_IMAGE = "--yarn-docker-image";
protected final String YARN_DOCKER_MOUNTS = "--yarn-docker-mounts";
protected final String EXECUTOR_DOCKER_IMAGE = "--executor-docker-image";
protected final String EXECUTOR_DOCKER_MOUNTS = "--executor-docker-mounts";
protected final String FILES = "--files";
protected final String JARS = "--jars";
protected final String KILL_SUBMISSION = "--kill";
Expand Down Expand Up @@ -120,6 +124,10 @@ class SparkSubmitOptionParser {
{ REPOSITORIES },
{ STATUS },
{ TOTAL_EXECUTOR_CORES },
{ YARN_DOCKER_IMAGE },
{ YARN_DOCKER_MOUNTS },
{ EXECUTOR_DOCKER_IMAGE },
{ EXECUTOR_DOCKER_MOUNTS },
};

/**
Expand Down