Skip to content

Commit

Permalink
[SPARK-23133][K8S] Fix passing java options to Executor
Browse files Browse the repository at this point in the history
Pass through spark java options to the executor in context of docker image.
Closes apache#20296

andrusha: Deployed two version of containers to local k8s, checked that java options were present in the updated image on the running executor.
Manual test

Author: Andrew Korzhuev <[email protected]>

Closes apache#20322 from foxish/patch-1.

(cherry picked from commit f568e9c)
Signed-off-by: Marcelo Vanzin <[email protected]>
  • Loading branch information
andrusha authored and Marcelo Vanzin committed Jan 18, 2018
1 parent 1f88fcd commit b8c6d93
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ shift 1

SPARK_CLASSPATH="$SPARK_CLASSPATH:${SPARK_HOME}/jars/*"
env | grep SPARK_JAVA_OPT_ | sed 's/[^=]*=\(.*\)/\1/g' > /tmp/java_opts.txt
readarray -t SPARK_DRIVER_JAVA_OPTS < /tmp/java_opts.txt
readarray -t SPARK_JAVA_OPTS < /tmp/java_opts.txt
if [ -n "$SPARK_MOUNTED_CLASSPATH" ]; then
SPARK_CLASSPATH="$SPARK_CLASSPATH:$SPARK_MOUNTED_CLASSPATH"
fi
Expand All @@ -54,7 +54,7 @@ case "$SPARK_K8S_CMD" in
driver)
CMD=(
${JAVA_HOME}/bin/java
"${SPARK_DRIVER_JAVA_OPTS[@]}"
"${SPARK_JAVA_OPTS[@]}"
-cp "$SPARK_CLASSPATH"
-Xms$SPARK_DRIVER_MEMORY
-Xmx$SPARK_DRIVER_MEMORY
Expand All @@ -67,7 +67,7 @@ case "$SPARK_K8S_CMD" in
executor)
CMD=(
${JAVA_HOME}/bin/java
"${SPARK_EXECUTOR_JAVA_OPTS[@]}"
"${SPARK_JAVA_OPTS[@]}"
-Xms$SPARK_EXECUTOR_MEMORY
-Xmx$SPARK_EXECUTOR_MEMORY
-cp "$SPARK_CLASSPATH"
Expand Down

0 comments on commit b8c6d93

Please sign in to comment.