From 2669fb0922a36a42d38680ad685e86863c391fb9 Mon Sep 17 00:00:00 2001 From: openeuler_bot Date: Tue, 9 Sep 2025 02:08:56 +0000 Subject: [PATCH] 24.03-lts-sp2 update kudu to 1.18.0 --- Storage/kudu/1.18.0/24.03-lts-sp2/Dockerfile | 62 ++++++++ .../kudu/1.18.0/24.03-lts-sp2/entrypoint.sh | 140 ++++++++++++++++++ Storage/kudu/README.md | 1 + Storage/kudu/doc/image-info.yml | 3 +- Storage/kudu/meta.yml | 4 +- 5 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 Storage/kudu/1.18.0/24.03-lts-sp2/Dockerfile create mode 100644 Storage/kudu/1.18.0/24.03-lts-sp2/entrypoint.sh diff --git a/Storage/kudu/1.18.0/24.03-lts-sp2/Dockerfile b/Storage/kudu/1.18.0/24.03-lts-sp2/Dockerfile new file mode 100644 index 00000000..be7f97cd --- /dev/null +++ b/Storage/kudu/1.18.0/24.03-lts-sp2/Dockerfile @@ -0,0 +1,62 @@ +ARG BASE=openeuler/openeuler:24.03-lts-sp2 +FROM ${BASE} AS build +ARG TARGETARCH +ARG BUILDARCH +ARG VERSION=1.18.0 + +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 krb5-devel \ + make openssl-devel patch pkgconfig rsync unzip vim-common which hostname memkind gem graphviz \ + ruby-devel zlib-devel openeuler-lsb libstdc++-devel && \ + 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 yum -y update && \ + if [ "$TARGETARCH" = "amd64" ]; then \ + BUILDARCH="x86_64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + BUILDARCH="aarch64"; \ + fi && \ + cd /kudu && \ + build-support/enable_devtoolset.sh && \ + thirdparty/build-if-necessary.sh && \ + 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 ../.. \ + -DCMAKE_CXX_FLAGS="-I/usr/include/c++/12 -I/usr/include/c++/12/${BUILDARCH}-openEuler-linux" ../.. && \ + 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/Storage/kudu/1.18.0/24.03-lts-sp2/entrypoint.sh b/Storage/kudu/1.18.0/24.03-lts-sp2/entrypoint.sh new file mode 100644 index 00000000..92a636de --- /dev/null +++ b/Storage/kudu/1.18.0/24.03-lts-sp2/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/Storage/kudu/README.md b/Storage/kudu/README.md index 44d4f0fc..b7d7616b 100644 --- a/Storage/kudu/README.md +++ b/Storage/kudu/README.md @@ -17,6 +17,7 @@ Learn more on [Kudu website](https://kudu.apache.org/). The tag of each kudu docker image consists of the version of kudu and the version of base image. The details are as follows | Tags | Currently | Architectures| |------|-----------|---------------| +|[1.18.0-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Storage/kudu/1.18.0/24.03-lts-sp2/Dockerfile) | kudu 1.18.0 on openEuler 24.03-LTS-SP2 | amd64, arm64 | |[1.17.1-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Storage/kudu/1.17.1/24.03-lts/Dockerfile)| Apache kudu 1.17.1 on openEuler 24.03-LTS | amd64, arm64 | diff --git a/Storage/kudu/doc/image-info.yml b/Storage/kudu/doc/image-info.yml index 505d8015..27c96640 100644 --- a/Storage/kudu/doc/image-info.yml +++ b/Storage/kudu/doc/image-info.yml @@ -11,6 +11,7 @@ tags: | | Tag | Currently | Architectures | |----------|-------------|------------------| + |[1.18.0-oe2403sp2](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Storage/kudu/1.18.0/24.03-lts-sp2/Dockerfile) | kudu 1.18.0 on openEuler 24.03-LTS-SP2 | amd64, arm64 | |[1.17.1-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/Storage/kudu/1.17.1/24.03-lts/Dockerfile)| Apache kudu 1.17.1 on openEuler 24.03-LTS | amd64, arm64 | download: | @@ -65,4 +66,4 @@ upstream: version_url: apache/kudu version_filter: rc;RC backend: GitHub - version_scheme: RPM + version_scheme: RPM \ No newline at end of file diff --git a/Storage/kudu/meta.yml b/Storage/kudu/meta.yml index f706d62e..2353a6fd 100644 --- a/Storage/kudu/meta.yml +++ b/Storage/kudu/meta.yml @@ -1,4 +1,6 @@ 1.17.1-oe2403lts: path: 1.17.1/24.03-lts/Dockerfile 1.18.0-oe2403sp1: - path: 1.18.0/24.03-lts-sp1/Dockerfile \ No newline at end of file + path: 1.18.0/24.03-lts-sp1/Dockerfile +1.18.0-oe2403sp2: + path: 1.18.0/24.03-lts-sp2/Dockerfile \ No newline at end of file -- Gitee