This is an automated email from the ASF dual-hosted git repository.

xtsong pushed a commit to branch dev-1.12
in repository https://gitbox.apache.org/repos/asf/flink-docker.git


The following commit(s) were added to refs/heads/dev-1.12 by this push:
     new f8b7af6  [FLINK-20650] Mark "native-k8s" as deprecated and do the 
preparatory work for pass-through mode in docker-entrypoint.sh
f8b7af6 is described below

commit f8b7af6fd4977c0d3e012d473838cd69c890e334
Author: wangyang0918 <[email protected]>
AuthorDate: Thu Dec 17 18:12:20 2020 +0800

    [FLINK-20650] Mark "native-k8s" as deprecated and do the preparatory work 
for pass-through mode in docker-entrypoint.sh
    
    After this commit, the preparatory work(e.g. copying plugins, set 
environments, disabling jemalloc, etc.) will always be done for pass-through 
mode. This is harmless for normal commands and is necessary for native K8s 
commands. The native K8s commandsare generated in Flink client and 
ResourceManger to launch the JobManager/TaskManager pod.
    
    This closes #49
---
 docker-entrypoint.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 68db96b..a83e2a2 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -19,6 +19,7 @@
 ###############################################################################
 
 COMMAND_STANDALONE="standalone-job"
+# Deprecated, should be remove in Flink release 1.13
 COMMAND_NATIVE_KUBERNETES="native-k8s"
 COMMAND_HISTORY_SERVER="history-server"
 COMMAND_DISABLE_JEMALLOC="disable-jemalloc"
@@ -108,7 +109,7 @@ disable_jemalloc_env() {
 
 args=("$@")
 if [ "$1" = "help" ]; then
-    printf "Usage: $(basename "$0") 
(jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_NATIVE_KUBERNETES}|${COMMAND_HISTORY_SERVER})
 [${COMMAND_DISABLE_JEMALLOC}]\n"
+    printf "Usage: $(basename "$0") 
(jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_HISTORY_SERVER}) 
[${COMMAND_DISABLE_JEMALLOC}]\n"
     printf "    Or $(basename "$0") help\n\n"
     printf "By default, Flink image adopts jemalloc as default memory 
allocator and will disable jemalloc if option '${COMMAND_DISABLE_JEMALLOC}' 
given.\n"
     exit 0
@@ -171,4 +172,16 @@ elif [ "$1" = "$COMMAND_NATIVE_KUBERNETES" ]; then
     exec $(drop_privs_cmd) bash -c "${args[@]}"
 fi
 
-exec "$@"
+args=("${args[@]}")
+
+disable_jemalloc_env args
+
+copy_plugins_if_required
+
+# Set the Flink related environments
+export _FLINK_HOME_DETERMINED=true
+. $FLINK_HOME/bin/config.sh
+export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS"
+
+echo "Running command in pass-through mode: ${args[@]}"
+exec $(drop_privs_cmd) "${args[@]}"

Reply via email to