You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ej...@apache.org on 2018/06/19 20:25:35 UTC
spark git commit: [SPARK-24534][K8S] Bypass non spark-on-k8s commands
Repository: spark
Updated Branches:
refs/heads/master 9dbe53eb6 -> 13092d733
[SPARK-24534][K8S] Bypass non spark-on-k8s commands
## What changes were proposed in this pull request?
This PR changes the entrypoint.sh to provide an option to run non spark-on-k8s commands (init, driver, executor) in order to let the user keep with the normal workflow without hacking the image to bypass the entrypoint
## How was this patch tested?
This patch was built manually in my local machine and I ran some tests with a combination of ```docker run``` commands.
Author: rimolive <ri...@gmail.com>
Closes #21572 from rimolive/rimolive-spark-24534.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/13092d73
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/13092d73
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/13092d73
Branch: refs/heads/master
Commit: 13092d733791b19cd7994084178306e0c449f2ed
Parents: 9dbe53e
Author: rimolive <ri...@gmail.com>
Authored: Tue Jun 19 13:25:00 2018 -0700
Committer: Erik Erlandson <ee...@redhat.com>
Committed: Tue Jun 19 13:25:00 2018 -0700
----------------------------------------------------------------------
.../src/main/dockerfiles/spark/entrypoint.sh | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/13092d73/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh
----------------------------------------------------------------------
diff --git a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh
index acdb4b1..2f4e115 100755
--- a/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh
+++ b/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh
@@ -37,11 +37,17 @@ if [ -z "$uidentry" ] ; then
fi
SPARK_K8S_CMD="$1"
-if [ -z "$SPARK_K8S_CMD" ]; then
- echo "No command to execute has been provided." 1>&2
- exit 1
-fi
-shift 1
+case "$SPARK_K8S_CMD" in
+ driver | driver-py | executor)
+ shift 1
+ ;;
+ "")
+ ;;
+ *)
+ echo "Non-spark-on-k8s command provided, proceeding in pass-through mode..."
+ exec /sbin/tini -s -- "$@"
+ ;;
+esac
SPARK_CLASSPATH="$SPARK_CLASSPATH:${SPARK_HOME}/jars/*"
env | grep SPARK_JAVA_OPT_ | sort -t_ -k4 -n | sed 's/[^=]*=\(.*\)/\1/g' > /tmp/java_opts.txt
@@ -92,7 +98,6 @@ case "$SPARK_K8S_CMD" in
"$@" $PYSPARK_PRIMARY $PYSPARK_ARGS
)
;;
-
executor)
CMD=(
${JAVA_HOME}/bin/java
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org