diff --git a/kudu/1.17.1/22.03-lts-sp4/Dockerfile b/kudu/1.17.1/22.03-lts-sp4/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..ef36ac04a3ac29848e115b31ecabb22658ff326c --- /dev/null +++ b/kudu/1.17.1/22.03-lts-sp4/Dockerfile @@ -0,0 +1,55 @@ +ARG BASE=openeuler/openeuler:22.03-lts-sp4 +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-sp4/entrypoint.sh b/kudu/1.17.1/22.03-lts-sp4/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..92a636de621e4a16aa95536c5eac619c57ecc0bd --- /dev/null +++ b/kudu/1.17.1/22.03-lts-sp4/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/README.md b/kudu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..98b17af825ddc88a4339c91af52cb6b1dd25035e --- /dev/null +++ b/kudu/README.md @@ -0,0 +1,59 @@ +# Quick reference + +- The official apache kudu docker image. + +- Maintained by: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative). + +- Where to get help: [openEuler CloudNative SIG](https://gitee.com/openeuler/cloudnative), [openEuler](https://gitee.com/openeuler/community). +# Kudu | openEuler +Current kudu docker images are built on the [openEuler](https://repo.openeuler.org/). This repository is free to use and exempted from per-user rate limits. + +Apache Kudu is an open source distributed data storage engine that makes fast analytics on fast and changing data easy. + +Learn more on [Kudu website](https://kudu.apache.org/). + + +# Supported tags and respective Dockerfile links +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.17.1-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/kudu/1.17.1/24.03-lts/Dockerfile)| Apache kudu 1.17.1 on openEuler 24.03-LTS | amd64, arm64 | + + +# Usage +Here, users can select the `{Tag}` by requirements. + +- Pull the `openeuler/kudu` image + ```bash + docker pull openeuler/kudu:{Tag} + ``` +- Run kudu container + + You can use the following command to find out how to run it: + ```bash + docker run --name my-kudu openeuler/kudu:{Tag} help + ``` + You will see something like this + ``` + Supported commands: + master - Start a Kudu Master + tserver - Start a Kudu TServer + kudu - Run the Kudu CLI + help - print useful information and exit + + Other commands can be specified to run shell commands. + ... + ``` + Above shows the supported commands, you can use this container following [kudu documentation](https://kudu.apache.org/docs/quickstart.html). + +- View container running logs + ```bash + docker logs -f my-kudu + ``` +- To get an interactive shell + ```bash + docker exec -it my-kudu /bin/bash + ``` + +# Question and answering +If you have any questions or want to use some special features, please submit an issue or a pull request on [openeuler-docker-images](https://gitee.com/openeuler/openeuler-docker-images). \ No newline at end of file diff --git a/kudu/doc/image-info.yml b/kudu/doc/image-info.yml new file mode 100644 index 0000000000000000000000000000000000000000..b830f89d8568c8f9807c0cd07c432da5e13b7a97 --- /dev/null +++ b/kudu/doc/image-info.yml @@ -0,0 +1,61 @@ +name: kudu +category: storage +description: Apache kudu是一个分布式数据存储引擎,它可以轻松对快速变化的数据进行快速分析。 +environment: | + 本应用在Docker环境中运行,安装Docker执行如下命令 + ``` + yum install -y docker + ``` +tags: | + kudu镜像的Tag由其版本信息和基础镜像版本信息组成,详细内容如下 + + | Tag | Currently | Architectures | + |----------|-------------|------------------| + |[1.17.1-oe2403lts](https://gitee.com/openeuler/openeuler-docker-images/blob/master/kudu/1.17.1/24.03-lts/Dockerfile)| Apache kudu 1.17.1 on openEuler 24.03-LTS | amd64, arm64 | + +download: | + 拉取镜像到本地 + ``` + docker pull openeuler/kudu:{Tag} + ``` + +usage: | + - 运行容器 + + 首先,使用以下命令查看kudu容器支持的命令: + ``` + docker run --name my-kudu openeuler/kudu:{Tag} help + ``` + + 显示如下内容: + ``` + Supported commands: + master - Start a Kudu Master + tserver - Start a Kudu TServer + kudu - Run the Kudu CLI + help - print useful information and exit + + Other commands can be specified to run shell commands. + ... + ``` + 用户可根据[kudu documentation](https://kudu.apache.org/docs/quickstart.html)使用`openeuler/kudu`容器支持的coommands执行任务。 + + - 测试容器 + + 查看运行日志 + ``` + docker logs -f my-kudu + ``` + + 使用shell交互 + ``` + docker exec -it my-kudu /bin/bash + ``` + +license: Apache-2.0 license +similar_packages: + - N/A +dependency: + - openjdk + - zlib + - python3 diff --git a/kudu/doc/picture/logo.png b/kudu/doc/picture/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1afca89769c79c67e97e8ac1ef7be690fb653ca6 Binary files /dev/null and b/kudu/doc/picture/logo.png differ diff --git a/kudu/meta.yml b/kudu/meta.yml new file mode 100644 index 0000000000000000000000000000000000000000..5dbfdcc25708f5423aff65df9031a911bdfdc9a7 --- /dev/null +++ b/kudu/meta.yml @@ -0,0 +1,2 @@ +1.17.1-oe2403lts: + path: kudu/1.17.1/24.03-lts/Dockerfile \ No newline at end of file