diff --git a/kudu/1.17.1/22.03-lts-sp1/Dockerfile b/kudu/1.17.1/22.03-lts-sp1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..d218730de187a92c8680639238239e07fc0fab45 --- /dev/null +++ b/kudu/1.17.1/22.03-lts-sp1/Dockerfile @@ -0,0 +1,55 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp1 +FROM ${BASE} AS build + +ARG VERSION=1.17.1 + +RUN yum install -y autoconf automake cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain \ + flex gcc gcc-c++ gdb git java-1.8.0-openjdk-devel krb5-server krb5-workstation libtool \ + make openssl-devel patch pkgconfig rsync unzip vim-common which hostname memkind gem graphviz \ + ruby-devel zlib-devel openeuler-lsb && \ + ln -s /usr/bin/python3 /usr/bin/python + +RUN curl -fSL --output kudu.tar.gz https://github.com/apache/kudu/archive/refs/tags/${VERSION}.tar.gz && \ + mkdir -p /kudu && tar -zvxf kudu.tar.gz -C /kudu --strip-components=1 && \ + rm -f kudu.tar.gz && yum clean all + +RUN cd /kudu && \ + build-support/enable_devtoolset.sh && \ + thirdparty/build-if-necessary.sh + +RUN mkdir -p /kudu/build/release && cd /kudu/build/release && \ + ../../build-support/enable_devtoolset.sh && \ + ../../thirdparty/installed/common/bin/cmake \ + -DNO_TESTS=1 \ + -DCMAKE_BUILD_TYPE=release ../.. && \ + make -j"$(nproc)" && \ + make DESTDIR=/opt/kudu install && \ + ln -s /kudu/build/release/bin/kudu /usr/bin/kudu + + +FROM ${BASE} + +ARG BUILD_DIR="/kudu" +ARG INSTALL_DIR="/opt/kudu" +ARG DATA_DIR="/var/lib/kudu" + +COPY --chown=kudu:kudu entrypoint.sh / +RUN yum install -y shadow-utils && \ + groupadd -g 1000 kudu || groupmod -n kudu $(getent group 1000 | cut -d: -f1) && \ + useradd --shell /bin/bash -u 1000 -g kudu -m kudu && \ + mkdir -p ${INSTALL_DIR} && chown -R kudu:kudu ${INSTALL_DIR} && \ + mkdir -p ${DATA_DIR} && chown -R kudu:kudu ${DATA_DIR} && \ + chmod +x /entrypoint.sh + +WORKDIR $INSTALL_DIR/bin +COPY --chown=kudu:kudu --from=build ${BUILD_DIR}/build/latest/bin/kudu ./ +ENV PATH=$INSTALL_DIR/bin/:$PATH + +WORKDIR $INSTALL_DIR +COPY --chown=kudu:kudu --from=build ${BUILD_DIR}/www ./www + +USER kudu + + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["help"] \ No newline at end of file diff --git a/kudu/1.17.1/22.03-lts-sp1/entrypoint.sh b/kudu/1.17.1/22.03-lts-sp1/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..92a636de621e4a16aa95536c5eac619c57ecc0bd --- /dev/null +++ b/kudu/1.17.1/22.03-lts-sp1/entrypoint.sh @@ -0,0 +1,140 @@ +#!/bin/bash + +set -e +set -o pipefail + +function print_help { + echo "Supported commands:" + echo " master - Start a Kudu Master" + echo " tserver - Start a Kudu TServer" + echo " kudu - Run the Kudu CLI" + echo " help - print useful information and exit" + echo "" + echo "Other commands can be specified to run shell commands." + echo "" + echo "Environment variables:" + echo "KUDU_MASTERS:" + echo " Defines the kudu-master and kudu-tserver configured master addresses." + echo " Defaults to localhost." + echo "DATA_DIR:" + echo " Defines the root directory to use. Subdirectories are added depending on whether a " + echo " Kudu master or a Kudu tablet server is being deployed. Ignored if the FS_WAL_DIR " + echo " environment variable is set." + echo " NOTE: this variable is deprecated. FS_WAL_DIR should be used instead." + echo " Defaults to /var/lib/kudu." + echo "FS_WAL_DIR:" + echo " Defines the WAL directory to use. Takes precedence over the DATA_DIR environment " + echo " variable." + echo "FS_DATA_DIRS:" + echo " Defines the data directories to use. If set, the FS_WAL_DIR environment variable " + echo " must also be set." + echo " Defaults to the value of the FS_WAL_DIR environment variable." + echo "MASTER_ARGS:" + echo " Defines custom arguments passed to kudu-master." + echo " Defaults to an empty set." + echo " kudu-master is run with the set of arguments built from" + echo " DEFAULT_ARGS appended by MASTER_ARGS, so Kudu flags in DEFAULT_ARGS" + echo " can be overridden by corresponding flags in MASTER_ARGS." + echo "TSERVER_ARGS:" + echo " Defines custom arguments passed to kudu-tserver." + echo " Defaults to an empty set." + echo " kudu-tserver is run with the set of arguments built from" + echo " DEFAULT_ARGS appended by TSERVER_ARGS, so Kudu flags in DEFAULT_ARGS" + echo " can be overridden by corresponding flags in TSERVER_ARGS." + echo "DEFAULT_ARGS:" + echo " Defines a recommended base set of arguments." +} + +if [[ -z "$FS_WAL_DIR" && -n "$FS_DATA_DIRS" ]]; then + echo "If FS_DATA_DIRS is set, FS_WAL_DIR must also be set" + echo "FS_WAL_DIR: $FS_WAL_DIR" + echo "FS_DATA_DIRS: $FS_DATA_DIRS" + exit 1 +fi + +DATA_DIR=${DATA_DIR:="/var/lib/kudu"} +if [[ -n "$FS_WAL_DIR" ]]; then + # Use the WAL directory for data if a data directory is not specified. + WAL_DIR="$FS_WAL_DIR" + DATA_DIRS=${FS_DATA_DIRS:="$FS_WAL_DIR"} +else + # If no WAL directory is specified, use a subdirectory in the root directory. + WAL_DIR="$DATA_DIR/$1" + DATA_DIRS="$DATA_DIR/$1" +fi + +# Define the defaults environment variables. +KUDU_MASTERS=${KUDU_MASTERS:=""} + # TODO: Remove use_hybrid_clock=false when ntpd is setup. +DEFAULT_ARGS="--fs_wal_dir=$WAL_DIR \ + --fs_data_dirs=$DATA_DIRS \ + --webserver_doc_root=/opt/kudu/www \ + --stderrthreshold=0 \ + --use_hybrid_clock=false" +MASTER_ARGS=${MASTER_ARGS:=""} +TSERVER_ARGS=${TSERVER_ARGS:=""} + +# Wait until the master hosts can be resolved. +# +# Without this Kudu will fail with "Name or service not known" errors +# on startup. +# +# Gives a maximum of 5 attempts/seconds to each host. On failure +# falls through without failing to still give Kudu a chance to startup +# or fail on it's own. +function wait_for_master_hosts() { + IFS="," + for HOST in $KUDU_MASTERS + do + MAX_ATTEMPTS=5 + ATTEMPTS=0 + until `ping -c1 "$HOST" &>/dev/null;` || [[ "$ATTEMPTS" -eq "$MAX_ATTEMPTS" ]]; do + ATTEMPTS=$((ATTEMPTS + 1)) + sleep 2; + done + done + unset IFS +} + +function make_directories() { + IFS="," + mkdir -p $WAL_DIR + for DIR in $DATA_DIRS + do + mkdir -p $DIR + done + unset IFS +} + +# If no arguments are passed, print the help. +if [[ -z "$1" ]]; then + print_help + exit 1 +fi + +# Note: we use "master" and "tserver" here so the kudu-master and kudu-tserver +# binaries can be manually invoked if needed. +if [[ "$1" == "master" ]]; then + make_directories + wait_for_master_hosts + # Supply --master_addresses even if a single master address is specified. + if [[ -n "$KUDU_MASTERS" ]]; then + MASTER_ARGS="--master_addresses=$KUDU_MASTERS $MASTER_ARGS" + fi + exec kudu master run ${DEFAULT_ARGS} ${MASTER_ARGS} +elif [[ "$1" == "tserver" ]]; then + make_directories + wait_for_master_hosts + if [[ -n "$KUDU_MASTERS" ]]; then + TSERVER_ARGS="--tserver_master_addrs=$KUDU_MASTERS $TSERVER_ARGS" + else + TSERVER_ARGS="--tserver_master_addrs=localhost $TSERVER_ARGS" + fi + exec kudu tserver run ${DEFAULT_ARGS} ${TSERVER_ARGS} +elif [[ "$1" == "help" ]]; then + print_help + exit 0 +fi + +# Support calling anything else in the container. +exec "$@" \ No newline at end of file diff --git a/kudu/1.17.1/22.03-lts-sp3/Dockerfile b/kudu/1.17.1/22.03-lts-sp3/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7a27b9d71e60ebcac4845a2349b21d6b603df51e --- /dev/null +++ b/kudu/1.17.1/22.03-lts-sp3/Dockerfile @@ -0,0 +1,55 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp3 +FROM ${BASE} AS build + +ARG VERSION=1.17.1 + +RUN yum install -y autoconf automake cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain \ + flex gcc gcc-c++ gdb git java-1.8.0-openjdk-devel krb5-server krb5-workstation libtool \ + make openssl-devel patch pkgconfig rsync unzip vim-common which hostname memkind gem graphviz \ + ruby-devel zlib-devel openeuler-lsb && \ + ln -s /usr/bin/python3 /usr/bin/python + +RUN curl -fSL --output kudu.tar.gz https://github.com/apache/kudu/archive/refs/tags/${VERSION}.tar.gz && \ + mkdir -p /kudu && tar -zvxf kudu.tar.gz -C /kudu --strip-components=1 && \ + rm -f kudu.tar.gz && yum clean all + +RUN cd /kudu && \ + build-support/enable_devtoolset.sh && \ + thirdparty/build-if-necessary.sh + +RUN mkdir -p /kudu/build/release && cd /kudu/build/release && \ + ../../build-support/enable_devtoolset.sh && \ + ../../thirdparty/installed/common/bin/cmake \ + -DNO_TESTS=1 \ + -DCMAKE_BUILD_TYPE=release ../.. && \ + make -j"$(nproc)" && \ + make DESTDIR=/opt/kudu install && \ + ln -s /kudu/build/release/bin/kudu /usr/bin/kudu + + +FROM ${BASE} + +ARG BUILD_DIR="/kudu" +ARG INSTALL_DIR="/opt/kudu" +ARG DATA_DIR="/var/lib/kudu" + +COPY --chown=kudu:kudu entrypoint.sh / +RUN yum install -y shadow-utils && \ + groupadd -g 1000 kudu || groupmod -n kudu $(getent group 1000 | cut -d: -f1) && \ + useradd --shell /bin/bash -u 1000 -g kudu -m kudu && \ + mkdir -p ${INSTALL_DIR} && chown -R kudu:kudu ${INSTALL_DIR} && \ + mkdir -p ${DATA_DIR} && chown -R kudu:kudu ${DATA_DIR} && \ + chmod +x /entrypoint.sh + +WORKDIR $INSTALL_DIR/bin +COPY --chown=kudu:kudu --from=build ${BUILD_DIR}/build/latest/bin/kudu ./ +ENV PATH=$INSTALL_DIR/bin/:$PATH + +WORKDIR $INSTALL_DIR +COPY --chown=kudu:kudu --from=build ${BUILD_DIR}/www ./www + +USER kudu + + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["help"] \ No newline at end of file diff --git a/kudu/1.17.1/22.03-lts-sp3/entrypoint.sh b/kudu/1.17.1/22.03-lts-sp3/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..92a636de621e4a16aa95536c5eac619c57ecc0bd --- /dev/null +++ b/kudu/1.17.1/22.03-lts-sp3/entrypoint.sh @@ -0,0 +1,140 @@ +#!/bin/bash + +set -e +set -o pipefail + +function print_help { + echo "Supported commands:" + echo " master - Start a Kudu Master" + echo " tserver - Start a Kudu TServer" + echo " kudu - Run the Kudu CLI" + echo " help - print useful information and exit" + echo "" + echo "Other commands can be specified to run shell commands." + echo "" + echo "Environment variables:" + echo "KUDU_MASTERS:" + echo " Defines the kudu-master and kudu-tserver configured master addresses." + echo " Defaults to localhost." + echo "DATA_DIR:" + echo " Defines the root directory to use. Subdirectories are added depending on whether a " + echo " Kudu master or a Kudu tablet server is being deployed. Ignored if the FS_WAL_DIR " + echo " environment variable is set." + echo " NOTE: this variable is deprecated. FS_WAL_DIR should be used instead." + echo " Defaults to /var/lib/kudu." + echo "FS_WAL_DIR:" + echo " Defines the WAL directory to use. Takes precedence over the DATA_DIR environment " + echo " variable." + echo "FS_DATA_DIRS:" + echo " Defines the data directories to use. If set, the FS_WAL_DIR environment variable " + echo " must also be set." + echo " Defaults to the value of the FS_WAL_DIR environment variable." + echo "MASTER_ARGS:" + echo " Defines custom arguments passed to kudu-master." + echo " Defaults to an empty set." + echo " kudu-master is run with the set of arguments built from" + echo " DEFAULT_ARGS appended by MASTER_ARGS, so Kudu flags in DEFAULT_ARGS" + echo " can be overridden by corresponding flags in MASTER_ARGS." + echo "TSERVER_ARGS:" + echo " Defines custom arguments passed to kudu-tserver." + echo " Defaults to an empty set." + echo " kudu-tserver is run with the set of arguments built from" + echo " DEFAULT_ARGS appended by TSERVER_ARGS, so Kudu flags in DEFAULT_ARGS" + echo " can be overridden by corresponding flags in TSERVER_ARGS." + echo "DEFAULT_ARGS:" + echo " Defines a recommended base set of arguments." +} + +if [[ -z "$FS_WAL_DIR" && -n "$FS_DATA_DIRS" ]]; then + echo "If FS_DATA_DIRS is set, FS_WAL_DIR must also be set" + echo "FS_WAL_DIR: $FS_WAL_DIR" + echo "FS_DATA_DIRS: $FS_DATA_DIRS" + exit 1 +fi + +DATA_DIR=${DATA_DIR:="/var/lib/kudu"} +if [[ -n "$FS_WAL_DIR" ]]; then + # Use the WAL directory for data if a data directory is not specified. + WAL_DIR="$FS_WAL_DIR" + DATA_DIRS=${FS_DATA_DIRS:="$FS_WAL_DIR"} +else + # If no WAL directory is specified, use a subdirectory in the root directory. + WAL_DIR="$DATA_DIR/$1" + DATA_DIRS="$DATA_DIR/$1" +fi + +# Define the defaults environment variables. +KUDU_MASTERS=${KUDU_MASTERS:=""} + # TODO: Remove use_hybrid_clock=false when ntpd is setup. +DEFAULT_ARGS="--fs_wal_dir=$WAL_DIR \ + --fs_data_dirs=$DATA_DIRS \ + --webserver_doc_root=/opt/kudu/www \ + --stderrthreshold=0 \ + --use_hybrid_clock=false" +MASTER_ARGS=${MASTER_ARGS:=""} +TSERVER_ARGS=${TSERVER_ARGS:=""} + +# Wait until the master hosts can be resolved. +# +# Without this Kudu will fail with "Name or service not known" errors +# on startup. +# +# Gives a maximum of 5 attempts/seconds to each host. On failure +# falls through without failing to still give Kudu a chance to startup +# or fail on it's own. +function wait_for_master_hosts() { + IFS="," + for HOST in $KUDU_MASTERS + do + MAX_ATTEMPTS=5 + ATTEMPTS=0 + until `ping -c1 "$HOST" &>/dev/null;` || [[ "$ATTEMPTS" -eq "$MAX_ATTEMPTS" ]]; do + ATTEMPTS=$((ATTEMPTS + 1)) + sleep 2; + done + done + unset IFS +} + +function make_directories() { + IFS="," + mkdir -p $WAL_DIR + for DIR in $DATA_DIRS + do + mkdir -p $DIR + done + unset IFS +} + +# If no arguments are passed, print the help. +if [[ -z "$1" ]]; then + print_help + exit 1 +fi + +# Note: we use "master" and "tserver" here so the kudu-master and kudu-tserver +# binaries can be manually invoked if needed. +if [[ "$1" == "master" ]]; then + make_directories + wait_for_master_hosts + # Supply --master_addresses even if a single master address is specified. + if [[ -n "$KUDU_MASTERS" ]]; then + MASTER_ARGS="--master_addresses=$KUDU_MASTERS $MASTER_ARGS" + fi + exec kudu master run ${DEFAULT_ARGS} ${MASTER_ARGS} +elif [[ "$1" == "tserver" ]]; then + make_directories + wait_for_master_hosts + if [[ -n "$KUDU_MASTERS" ]]; then + TSERVER_ARGS="--tserver_master_addrs=$KUDU_MASTERS $TSERVER_ARGS" + else + TSERVER_ARGS="--tserver_master_addrs=localhost $TSERVER_ARGS" + fi + exec kudu tserver run ${DEFAULT_ARGS} ${TSERVER_ARGS} +elif [[ "$1" == "help" ]]; then + print_help + exit 0 +fi + +# Support calling anything else in the container. +exec "$@" \ No newline at end of file diff --git a/kudu/1.17.1/24.03-lts/Dockerfile b/kudu/1.17.1/24.03-lts/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..05e20d30eb9a9e0c07198d5cd3d01b288a1faac3 --- /dev/null +++ b/kudu/1.17.1/24.03-lts/Dockerfile @@ -0,0 +1,55 @@ +ARG BASE=openeuler/openeuler:24.03-lts +FROM ${BASE} AS build + +ARG VERSION=1.17.1 + +RUN yum install -y autoconf automake cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain \ + flex gcc gcc-c++ gdb git java-1.8.0-openjdk-devel krb5-server krb5-workstation libtool \ + make openssl-devel patch pkgconfig rsync unzip vim-common which hostname memkind gem graphviz \ + ruby-devel zlib-devel openeuler-lsb && \ + ln -s /usr/bin/python3 /usr/bin/python + +RUN curl -fSL --output kudu.tar.gz https://github.com/apache/kudu/archive/refs/tags/${VERSION}.tar.gz && \ + mkdir -p /kudu && tar -zvxf kudu.tar.gz -C /kudu --strip-components=1 && \ + rm -f kudu.tar.gz && yum clean all + +RUN cd /kudu && \ + build-support/enable_devtoolset.sh && \ + thirdparty/build-if-necessary.sh + +RUN mkdir -p /kudu/build/release && cd /kudu/build/release && \ + ../../build-support/enable_devtoolset.sh && \ + ../../thirdparty/installed/common/bin/cmake \ + -DNO_TESTS=1 \ + -DCMAKE_BUILD_TYPE=release ../.. && \ + make -j"$(nproc)" && \ + make DESTDIR=/opt/kudu install && \ + ln -s /kudu/build/release/bin/kudu /usr/bin/kudu + + +FROM ${BASE} + +ARG BUILD_DIR="/kudu" +ARG INSTALL_DIR="/opt/kudu" +ARG DATA_DIR="/var/lib/kudu" + +COPY --chown=kudu:kudu entrypoint.sh / +RUN yum install -y shadow-utils && \ + groupadd -g 1000 kudu || groupmod -n kudu $(getent group 1000 | cut -d: -f1) && \ + useradd --shell /bin/bash -u 1000 -g kudu -m kudu && \ + mkdir -p ${INSTALL_DIR} && chown -R kudu:kudu ${INSTALL_DIR} && \ + mkdir -p ${DATA_DIR} && chown -R kudu:kudu ${DATA_DIR} && \ + chmod +x /entrypoint.sh + +WORKDIR $INSTALL_DIR/bin +COPY --chown=kudu:kudu --from=build ${BUILD_DIR}/build/latest/bin/kudu ./ +ENV PATH=$INSTALL_DIR/bin/:$PATH + +WORKDIR $INSTALL_DIR +COPY --chown=kudu:kudu --from=build ${BUILD_DIR}/www ./www + +USER kudu + + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["help"] \ No newline at end of file diff --git a/kudu/1.17.1/24.03-lts/entrypoint.sh b/kudu/1.17.1/24.03-lts/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..92a636de621e4a16aa95536c5eac619c57ecc0bd --- /dev/null +++ b/kudu/1.17.1/24.03-lts/entrypoint.sh @@ -0,0 +1,140 @@ +#!/bin/bash + +set -e +set -o pipefail + +function print_help { + echo "Supported commands:" + echo " master - Start a Kudu Master" + echo " tserver - Start a Kudu TServer" + echo " kudu - Run the Kudu CLI" + echo " help - print useful information and exit" + echo "" + echo "Other commands can be specified to run shell commands." + echo "" + echo "Environment variables:" + echo "KUDU_MASTERS:" + echo " Defines the kudu-master and kudu-tserver configured master addresses." + echo " Defaults to localhost." + echo "DATA_DIR:" + echo " Defines the root directory to use. Subdirectories are added depending on whether a " + echo " Kudu master or a Kudu tablet server is being deployed. Ignored if the FS_WAL_DIR " + echo " environment variable is set." + echo " NOTE: this variable is deprecated. FS_WAL_DIR should be used instead." + echo " Defaults to /var/lib/kudu." + echo "FS_WAL_DIR:" + echo " Defines the WAL directory to use. Takes precedence over the DATA_DIR environment " + echo " variable." + echo "FS_DATA_DIRS:" + echo " Defines the data directories to use. If set, the FS_WAL_DIR environment variable " + echo " must also be set." + echo " Defaults to the value of the FS_WAL_DIR environment variable." + echo "MASTER_ARGS:" + echo " Defines custom arguments passed to kudu-master." + echo " Defaults to an empty set." + echo " kudu-master is run with the set of arguments built from" + echo " DEFAULT_ARGS appended by MASTER_ARGS, so Kudu flags in DEFAULT_ARGS" + echo " can be overridden by corresponding flags in MASTER_ARGS." + echo "TSERVER_ARGS:" + echo " Defines custom arguments passed to kudu-tserver." + echo " Defaults to an empty set." + echo " kudu-tserver is run with the set of arguments built from" + echo " DEFAULT_ARGS appended by TSERVER_ARGS, so Kudu flags in DEFAULT_ARGS" + echo " can be overridden by corresponding flags in TSERVER_ARGS." + echo "DEFAULT_ARGS:" + echo " Defines a recommended base set of arguments." +} + +if [[ -z "$FS_WAL_DIR" && -n "$FS_DATA_DIRS" ]]; then + echo "If FS_DATA_DIRS is set, FS_WAL_DIR must also be set" + echo "FS_WAL_DIR: $FS_WAL_DIR" + echo "FS_DATA_DIRS: $FS_DATA_DIRS" + exit 1 +fi + +DATA_DIR=${DATA_DIR:="/var/lib/kudu"} +if [[ -n "$FS_WAL_DIR" ]]; then + # Use the WAL directory for data if a data directory is not specified. + WAL_DIR="$FS_WAL_DIR" + DATA_DIRS=${FS_DATA_DIRS:="$FS_WAL_DIR"} +else + # If no WAL directory is specified, use a subdirectory in the root directory. + WAL_DIR="$DATA_DIR/$1" + DATA_DIRS="$DATA_DIR/$1" +fi + +# Define the defaults environment variables. +KUDU_MASTERS=${KUDU_MASTERS:=""} + # TODO: Remove use_hybrid_clock=false when ntpd is setup. +DEFAULT_ARGS="--fs_wal_dir=$WAL_DIR \ + --fs_data_dirs=$DATA_DIRS \ + --webserver_doc_root=/opt/kudu/www \ + --stderrthreshold=0 \ + --use_hybrid_clock=false" +MASTER_ARGS=${MASTER_ARGS:=""} +TSERVER_ARGS=${TSERVER_ARGS:=""} + +# Wait until the master hosts can be resolved. +# +# Without this Kudu will fail with "Name or service not known" errors +# on startup. +# +# Gives a maximum of 5 attempts/seconds to each host. On failure +# falls through without failing to still give Kudu a chance to startup +# or fail on it's own. +function wait_for_master_hosts() { + IFS="," + for HOST in $KUDU_MASTERS + do + MAX_ATTEMPTS=5 + ATTEMPTS=0 + until `ping -c1 "$HOST" &>/dev/null;` || [[ "$ATTEMPTS" -eq "$MAX_ATTEMPTS" ]]; do + ATTEMPTS=$((ATTEMPTS + 1)) + sleep 2; + done + done + unset IFS +} + +function make_directories() { + IFS="," + mkdir -p $WAL_DIR + for DIR in $DATA_DIRS + do + mkdir -p $DIR + done + unset IFS +} + +# If no arguments are passed, print the help. +if [[ -z "$1" ]]; then + print_help + exit 1 +fi + +# Note: we use "master" and "tserver" here so the kudu-master and kudu-tserver +# binaries can be manually invoked if needed. +if [[ "$1" == "master" ]]; then + make_directories + wait_for_master_hosts + # Supply --master_addresses even if a single master address is specified. + if [[ -n "$KUDU_MASTERS" ]]; then + MASTER_ARGS="--master_addresses=$KUDU_MASTERS $MASTER_ARGS" + fi + exec kudu master run ${DEFAULT_ARGS} ${MASTER_ARGS} +elif [[ "$1" == "tserver" ]]; then + make_directories + wait_for_master_hosts + if [[ -n "$KUDU_MASTERS" ]]; then + TSERVER_ARGS="--tserver_master_addrs=$KUDU_MASTERS $TSERVER_ARGS" + else + TSERVER_ARGS="--tserver_master_addrs=localhost $TSERVER_ARGS" + fi + exec kudu tserver run ${DEFAULT_ARGS} ${TSERVER_ARGS} +elif [[ "$1" == "help" ]]; then + print_help + exit 0 +fi + +# Support calling anything else in the container. +exec "$@" \ No newline at end of file diff --git a/kudu/meta.yml b/kudu/meta.yml index 5dbfdcc25708f5423aff65df9031a911bdfdc9a7..9a1bfe680874674f00366e54cc01a9041afb935d 100644 --- a/kudu/meta.yml +++ b/kudu/meta.yml @@ -1,2 +1,8 @@ 1.17.1-oe2403lts: - path: kudu/1.17.1/24.03-lts/Dockerfile \ No newline at end of file + path: kudu/1.17.1/24.03-lts/Dockerfile +1.17.1-oe2403lts: + path: kudu/1.17.1/24.03-lts/Dockerfile +1.17.1-oe2203sp3: + path: kudu/1.17.1/22.03-lts-sp3/Dockerfile +1.17.1-oe2203sp1: + path: kudu/1.17.1/22.03-lts-sp1/Dockerfile \ No newline at end of file