This repository was archived by the owner on Jan 9, 2020. It is now read-only.
forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 117
Allow configuration to set environment variables on driver and executor #395
Closed
tangzhankun
wants to merge
2
commits into
apache-spark-on-k8s:branch-2.1-kubernetes
from
tangzhankun:add-env-conf
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -768,6 +768,22 @@ from the other deployment modes. See the [configuration page](configuration.html | |
| <code>myIdentifier</code>. Multiple node selector keys can be added by setting multiple configurations with this prefix. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>spark.executorEnv.[EnvironmentVariableName]</code></td> | ||
| <td>(none)</td> | ||
| <td> | ||
| Add the environment variable specified by <code>EnvironmentVariableName</code> to | ||
| the Executor process. The user can specify multiple of these to set multiple environment variables. | ||
| </td> | ||
| </tr> | ||
| <tr> | ||
| <td><code>spark.kubernetes.driverEnv.[EnvironmentVariableName]</code></td> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the equivalent of YARN's |
||
| <td>(none)</td> | ||
| <td> | ||
| Add the environment variable specified by <code>EnvironmentVariableName</code> to | ||
| the Driver process. The user can specify multiple of these to set multiple environment variables. | ||
| </td> | ||
| </tr> | ||
| </table> | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -456,15 +456,15 @@ private[spark] class KubernetesClusterSchedulerBackend( | |
| .withValue(cp) | ||
| .build() | ||
| } | ||
| val requiredEnv = Seq( | ||
| val requiredEnv = (Seq( | ||
| (ENV_EXECUTOR_PORT, executorPort.toString), | ||
| (ENV_DRIVER_URL, driverUrl), | ||
| // Executor backend expects integral value for executor cores, so round it up to an int. | ||
| (ENV_EXECUTOR_CORES, math.ceil(executorCores).toInt.toString), | ||
| (ENV_EXECUTOR_MEMORY, executorMemoryString), | ||
| (ENV_APPLICATION_ID, applicationId()), | ||
| (ENV_EXECUTOR_ID, executorId), | ||
| (ENV_MOUNTED_CLASSPATH, s"$executorJarsDownloadDir/*")) | ||
| (ENV_MOUNTED_CLASSPATH, s"$executorJarsDownloadDir/*")) ++ sc.executorEnvs.toSeq) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if a user specifies an executorEnv that conflicts with one of the above? I think we want to prohibit users from overriding the Spark-internal settings and throw an exception if they attempt to do that |
||
| .map(env => new EnvVarBuilder() | ||
| .withName(env._1) | ||
| .withValue(env._2) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already doc'd in
docs/configuration.md-- please remove this duplicate config fromdocs/running-on-kubernetes.mdand reference it in thespark.kubernetes.driverEnv.[EnvironmentVariableName]section below with language something likeFor executors, use the generic spark.executorEnv.[EnvironmentVariableName] which works across cluster managers