Skip to content

Commit

Permalink
Update Dockerfiles for 1.12.0 release
Browse files Browse the repository at this point in the history
Deprecate command `native-k8` and add preparation for pass-through mode.

This is to address the comments in the following docker-library/official-images PR.
docker-library/official-images#9249
  • Loading branch information
xintongsong committed Dec 23, 2020
1 parent 7035f03 commit 0bdb5b0
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 8 deletions.
17 changes: 15 additions & 2 deletions 1.12/scala_2.11-java11-debian/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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[@]}"
17 changes: 15 additions & 2 deletions 1.12/scala_2.11-java8-debian/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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[@]}"
17 changes: 15 additions & 2 deletions 1.12/scala_2.12-java11-debian/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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[@]}"
17 changes: 15 additions & 2 deletions 1.12/scala_2.12-java8-debian/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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[@]}"

0 comments on commit 0bdb5b0

Please sign in to comment.