kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From granthe...@apache.org
Subject [kudu] branch master updated: [docker] Add an Impala quickstart image
Date Fri, 13 Mar 2020 19:46:40 GMT
This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new b1fe7d4  [docker] Add an Impala quickstart image
b1fe7d4 is described below

commit b1fe7d495eebd64685498b741974542275f58b5c
Author: Grant Henke <granthenke@apache.org>
AuthorDate: Mon Mar 9 10:03:00 2020 -0500

    [docker] Add an Impala quickstart image
    
    This patch adds an `impala` target that can be built and
    published for use in quickstart examples. The image is a
    single node Impala cluster with a Hive metastore backed
    by Derby. This image is purpose build for quickstart usage
    only and shouldn't be used for production or multi-node
    deployments. The final image size is ~2GB uncompressed.
    
    The build and runtime images reuse the dev and runtime base
    images from Kudu given the additional libraries needed are
    nominal in size and the reuse cuts back on code duplication.
    
    This image will be used in an Impala quickstart guide that
    will be added in a follow on patch.
    
    Currently the image only works on Ubuntu distributions due
    to Impala side script assumptions. Follow on patches will
    fix these issues for other distributions.
    
    Change-Id: I2d88bcb52f793c0fc83c4f84a9b56c5b961e58d5
    Reviewed-on: http://gerrit.cloudera.org:8080/15393
    Tested-by: Grant Henke <granthenke@apache.org>
    Reviewed-by: Andrew Wong <awong@cloudera.com>
    Reviewed-by: Alexey Serbin <aserbin@cloudera.com>
    Tested-by: Kudu Jenkins
---
 .dockerignore                                      |   4 +
 docker/Dockerfile                                  | 163 ++++++++++++++++++++-
 docker/bootstrap-dev-env.sh                        |  39 ++---
 ...tstrap-runtime-env.sh => bootstrap-java-env.sh} |  44 +++---
 docker/bootstrap-maven-env.sh                      |  36 +++++
 docker/bootstrap-python-env.sh                     |   1 +
 docker/bootstrap-runtime-env.sh                    |  18 ++-
 docker/docker-build.sh                             |   4 +-
 docker/impala-entrypoint.sh                        | 100 +++++++++++++
 docker/impala/etc/hadoop/conf/core-site.xml        |  44 ++++++
 docker/impala/etc/hive/conf/hive-site.xml          |  37 +++++
 docker/kudu-entrypoint.sh                          |   4 +-
 12 files changed, 441 insertions(+), 53 deletions(-)

diff --git a/.dockerignore b/.dockerignore
index 1379088..7132890 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -29,9 +29,13 @@
 !version.txt
 
 # Docker files.
+!docker/impala
 !docker/bootstrap-dev-env.sh
+!docker/bootstrap-java-env.sh
+!docker/bootstrap-maven-env.sh
 !docker/bootstrap-python-env.sh
 !docker/bootstrap-runtime-env.sh
+!docker/impala-entrypoint.sh
 !docker/kudu-entrypoint.sh
 
 # Docs files.
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 185ff3d..e5ebd3f 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -44,8 +44,7 @@ ARG VCS_URL
 ARG VERSION
 
 LABEL org.label-schema.name="Apache Kudu Runtime Base" \
-      org.label-schema.description="A base image that has all the runtime \
-        libraries for Kudu pre-installed." \
+      org.label-schema.description="A base image that has all the runtime libraries for Kudu
pre-installed." \
       # Common labels.
       org.label-schema.dockerfile=$DOCKERFILE \
       org.label-schema.maintainer=$MAINTAINER \
@@ -62,10 +61,13 @@ ARG BASE_OS
 FROM $BASE_OS as dev
 
 COPY ./docker/bootstrap-dev-env.sh /
+COPY ./docker/bootstrap-java-env.sh /
 COPY ./docker/bootstrap-python-env.sh /
 RUN ./bootstrap-dev-env.sh \
+  && ./bootstrap-java-env.sh \
   && ./bootstrap-python-env.sh \
   && rm bootstrap-dev-env.sh \
+  && rm bootstrap-java-env.sh \
   && rm bootstrap-python-env.sh
 
 # Common label arguments.
@@ -78,8 +80,7 @@ ARG VCS_URL
 ARG VERSION
 
 LABEL org.label-schema.name="Apache Kudu Development Base" \
-      org.label-schema.description="A base image that has all the development \
-        libraries for Kudu pre-installed." \
+      org.label-schema.description="A base image that has all the development libraries for
Kudu pre-installed." \
       # Common labels.
       org.label-schema.dockerfile=$DOCKERFILE \
       org.label-schema.maintainer=$MAINTAINER \
@@ -324,4 +325,156 @@ LABEL name="Apache Kudu" \
       org.label-schema.vcs-ref=$VCS_REF \
       org.label-schema.vcs-type=$VCS_TYPE \
       org.label-schema.vcs-url=$VCS_URL \
-      org.label-schema.version=$VERSION
\ No newline at end of file
+      org.label-schema.version=$VERSION
+
+#
+# ---- Impala Build ----
+# Builds an image that has the Impala source code pre-built.
+# This is useful for generating a small runtime image.
+#
+FROM dev AS impala-build
+
+ARG IMPALA_VERSION="3.3.0"
+
+# Use the bash shell for all RUN commands.
+SHELL ["/bin/bash", "-c"]
+
+# Install Maven.
+COPY ./docker/bootstrap-maven-env.sh /
+RUN ./bootstrap-maven-env.sh \
+  && rm bootstrap-maven-env.sh
+
+WORKDIR /impala
+
+# Download and un-tar an Impala source release.
+RUN wget -nv http://archive.apache.org/dist/impala/${IMPALA_VERSION}/apache-impala-${IMPALA_VERSION}.tar.gz
-O apache-impala.tar.gz \
+  && tar -xzf apache-impala.tar.gz --strip-components=1 \
+  && rm apache-impala.tar.gz
+
+# Build Impala
+RUN source bin/impala-config.sh \
+  && ./buildall.sh -release -noclean -notests \
+  && docker/setup_build_context.py
+
+# Copy to the expected install location in the runtime image.
+# This helps avoid issues where docker won't follow symbolic links on copy.
+RUN mkdir /opt/impala \
+  && cp -Lr /impala/docker/build_context/release/bin /opt/impala/bin \
+  && cp -Lr /impala/docker/build_context/release/lib /opt/impala/lib \
+  && cp -Lr /impala/docker/build_context/release/www /opt/impala/www \
+  && cp -Lr /impala/toolchain/cdh_components-*/hive-* /opt/hive \
+  && cp -Lr /impala/toolchain/cdh_components-*/hadoop-* /opt/hadoop
+
+# Common label arguments.
+ARG DOCKERFILE
+ARG MAINTAINER
+ARG URL
+ARG VCS_REF
+ARG VCS_TYPE
+ARG VCS_URL
+ARG VERSION
+
+LABEL name="Apache Impala Build" \
+      description="An image that has the Impala source code pre-built." \
+      org.apache.kudu.impala.version=$IMPALA_VERSION \
+      # Common labels.
+      org.label-schema.dockerfile=$DOCKERFILE \
+      org.label-schema.maintainer=$MAINTAINER \
+      org.label-schema.url=$URL \
+      org.label-schema.vcs-ref=$VCS_REF \
+      org.label-schema.vcs-type=$VCS_TYPE \
+      org.label-schema.vcs-url=$VCS_URL \
+      org.label-schema.version=$VERSION
+
+#
+# ---- Kudu Impala ----
+# Builds a runtime image with the Impala binaries pre-installed.
+# This image is only for use with the Kudu Quickstart.
+#
+FROM runtime AS impala
+
+ARG UID=1000
+ARG GID=1000
+ARG DATA_DIR="/var/lib/impala"
+ARG IMPALA_VERSION="3.3.0"
+
+ENV IMPALA_HOME="/opt/impala"
+ENV HIVE_HOME="/opt/hive"
+ENV HIVE_CONF_DIR="/etc/hive/conf"
+ENV HADOOP_HOME="/opt/hadoop"
+ENV HADOOP_CONF_DIR="/etc/hadoop/conf"
+
+# Setup the impala user and create the neccessary directories.
+# We do this before copying any files othwerwise the image size is doubled by the chown change.
+RUN groupadd -g ${GID} impala || groupmod -n impala $(getent group ${GID} | cut -d: -f1)
\
+    && useradd --shell /bin/bash -u ${UID} -g ${GID} -m impala \
+    && mkdir -p ${IMPALA_HOME} && chown -R impala:impala ${IMPALA_HOME} \
+    && mkdir -p ${HIVE_HOME} && chown -R impala:impala ${HIVE_HOME} \
+    && mkdir -p ${HADOOP_HOME} && chown -R impala:impala ${HADOOP_HOME} \
+    && mkdir -p ${DATA_DIR} && chown -R impala:impala ${DATA_DIR}
+
+# Copy the Impala install.
+WORKDIR $IMPALA_HOME
+COPY --chown=impala:impala --from=impala-build /opt/impala ./
+# Symlink here instead of in setup_build_context to avoid duplicate binaries.
+WORKDIR $IMPALA_HOME/bin
+RUN ln -s impalad statestored && ln -s impalad catalogd
+
+# Copy the Hive install.
+WORKDIR $HIVE_HOME
+COPY --chown=impala:impala --from=impala-build /opt/hive ./
+
+# Copy the Hadoop install.
+WORKDIR $HADOOP_HOME
+COPY --chown=impala:impala --from=impala-build /opt/hadoop ./
+
+# Add to the binaries to the path.
+ENV PATH=$IMPALA_HOME/bin/:$PATH
+ENV PATH=$HIVE_HOME/bin/:$PATH
+ENV PATH=$HADOOP_HOME/bin/:$PATH
+
+# Copy the impala config files.
+COPY ./docker/impala/etc /etc
+
+WORKDIR /
+# Install Java.
+COPY ./docker/bootstrap-java-env.sh /
+RUN ./bootstrap-java-env.sh \
+  && rm bootstrap-java-env.sh
+# Install Python.
+COPY ./docker/bootstrap-python-env.sh /
+RUN ./bootstrap-python-env.sh \
+  && rm bootstrap-python-env.sh
+# Install the impala-shell.
+# TODO(ghenke): Install from the impala-build image.
+RUN pip install impala-shell
+
+# Copy the entrypoint script.
+WORKDIR $IMPALA_HOME/bin
+COPY --chown=impala:impala ./docker/impala-entrypoint.sh /
+
+USER impala
+# Add the entrypoint.
+ENTRYPOINT ["/impala-entrypoint.sh"]
+CMD ["help"]
+
+# Common label arguments.
+ARG DOCKERFILE
+ARG MAINTAINER
+ARG URL
+ARG VCS_REF
+ARG VCS_TYPE
+ARG VCS_URL
+ARG VERSION
+
+LABEL name="Apache Impala" \
+      description="An image with the Impala binaries pre-installed. This image is only for
use with the Kudu Quickstart." \
+      org.apache.kudu.impala.version=$IMPALA_VERSION \
+      # Common labels.
+      org.label-schema.dockerfile=$DOCKERFILE \
+      org.label-schema.maintainer=$MAINTAINER \
+      org.label-schema.url=$URL \
+      org.label-schema.vcs-ref=$VCS_REF \
+      org.label-schema.vcs-type=$VCS_TYPE \
+      org.label-schema.vcs-url=$VCS_URL \
+      org.label-schema.version=$VERSION
diff --git a/docker/bootstrap-dev-env.sh b/docker/bootstrap-dev-env.sh
index 9ea5aad..5547d7f 100755
--- a/docker/bootstrap-dev-env.sh
+++ b/docker/bootstrap-dev-env.sh
@@ -24,6 +24,7 @@
 ##########################################################
 
 set -xe
+set -o pipefail
 
 # Install the prerequisite libraries, if they are not installed.
 # CentOS/RHEL
@@ -60,6 +61,13 @@ if [[ -f "/usr/bin/yum" ]]; then
     which \
     wget
 
+  # Install exta impala packages for the impala images. They are nominal in size.
+  # --no-install-recommends keeps the install smaller
+  yum install -y \
+    libffi-devel \
+    lzo-devel \
+    tzdata
+
   # Install docs build libraries.
   # Note: Uncomment to include in your dev images. These are excluded to reduce image size
and build time.
   # yum install -y \
@@ -91,25 +99,6 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
   # Update the repo.
   apt-get update -y
 
-  # Install lsb-release so we can reliably detect the release.
-  apt-get install -y --no-install-recommends lsb-release
-  VERSION_NAME=$(lsb_release -c | cut -d":" -f2 | tr -d '[:blank:]')
-
-  # Install OpenJDK 8.
-  if [[ "$VERSION_NAME" == "jessie" ]]; then
-    apt-get install -y --no-install-recommends software-properties-common
-    add-apt-repository "deb http://http.debian.net/debian jessie-backports main"
-    apt-get update -y
-    apt-get install -y --no-install-recommends -t jessie-backports openjdk-8-jdk
-  elif [[ "$VERSION_NAME" == "trusty" ]]; then
-    apt-get install -y --no-install-recommends software-properties-common
-    add-apt-repository ppa:openjdk-r/ppa
-    apt-get update -y
-    apt-get install -y --no-install-recommends openjdk-8-jdk
-  else
-    apt-get install -y --no-install-recommends openjdk-8-jdk
-  fi
-
   # Install core build libraries.
   # --no-install-recommends keeps the install smaller
   apt-get install -y --no-install-recommends \
@@ -143,13 +132,13 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
     vim-common \
     wget
 
+  # Install exta impala packages for the impala images. They are nominal in size.
+  # --no-install-recommends keeps the install smaller
   apt-get install -y --no-install-recommends \
-    doxygen \
-    gem \
-    graphviz \
-    ruby-dev \
-    xsltproc \
-    zlib1g-dev
+    libffi-dev \
+    liblzo2-2 \
+    tzdata
+
   # Install docs build libraries.
   # Note: Uncomment to include in your dev images. These are excluded to reduce image size
and build time.
   # apt-get install -y --no-install-recommends \
diff --git a/docker/bootstrap-runtime-env.sh b/docker/bootstrap-java-env.sh
similarity index 60%
copy from docker/bootstrap-runtime-env.sh
copy to docker/bootstrap-java-env.sh
index 654ec4d..f05442d 100755
--- a/docker/bootstrap-runtime-env.sh
+++ b/docker/bootstrap-java-env.sh
@@ -18,26 +18,22 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-# This script handles bootstrapping a base OS for
+# This script handles bootstrapping java for
 # the Apache Kudu base docker images.
 #
 ##########################################################
 
 set -xe
+set -o pipefail
 
-# Install the required runtime packages, if they are not installed.
+# Install the prerequisite libraries, if they are not installed.
 # CentOS/RHEL
 if [[ -f "/usr/bin/yum" ]]; then
   # Update the repo.
   yum update -y
 
-  # Install runtime packages.
-  yum install -y \
-    cyrus-sasl-gssapi \
-    cyrus-sasl-plain \
-    krb5-server \
-    krb5-workstation \
-    openssl
+  # Install OpenJDK 8.
+  yum install -y java-1.8.0-openjdk-devel
 
   # Reduce the image size by cleaning up after the install.
   yum clean all
@@ -50,16 +46,24 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
   # Update the repo.
   apt-get update -y
 
-  # Install runtime packages.
-  # --no-install-recommends keeps the install smaller
-  apt-get install -y --no-install-recommends \
-    krb5-admin-server \
-    krb5-kdc \
-    krb5-user \
-    libsasl2-2 \
-    libsasl2-modules \
-    libsasl2-modules-gssapi-mit \
-    openssl
+  # Install lsb-release so we can reliably detect the release.
+  apt-get install -y --no-install-recommends lsb-release
+  VERSION_NAME=$(lsb_release -c | cut -d":" -f2 | tr -d '[:blank:]')
+
+  # Install OpenJDK 8.
+  if [[ "$VERSION_NAME" == "jessie" ]]; then
+    apt-get install -y --no-install-recommends software-properties-common
+    add-apt-repository "deb http://http.debian.net/debian jessie-backports main"
+    apt-get update -y
+    apt-get install -y --no-install-recommends -t jessie-backports openjdk-8-jdk
+  elif [[ "$VERSION_NAME" == "trusty" ]]; then
+    apt-get install -y --no-install-recommends software-properties-common
+    add-apt-repository ppa:openjdk-r/ppa
+    apt-get update -y
+    apt-get install -y --no-install-recommends openjdk-8-jdk
+  else
+    apt-get install -y --no-install-recommends openjdk-8-jdk
+  fi
 
   # Reduce the image size by cleaning up after the install.
   apt-get clean
@@ -69,4 +73,4 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
 else
   echo "Unsupported OS"
   exit 1
-fi
\ No newline at end of file
+fi
diff --git a/docker/bootstrap-maven-env.sh b/docker/bootstrap-maven-env.sh
new file mode 100755
index 0000000..8bb6429
--- /dev/null
+++ b/docker/bootstrap-maven-env.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+##########################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# This script handles bootstrapping maven for
+# the Apache Kudu impala build docker image.
+#
+##########################################################
+
+set -xe
+set -o pipefail
+
+MVN_VERSION="3.6.3"
+MVN_CHECKSUM="c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0"
+wget -nv \
+  https://www-us.apache.org/dist/maven/maven-3/$MVN_VERSION/binaries/apache-maven-$MVN_VERSION-bin.tar.gz
+sha512sum -c - <<< "$MVN_CHECKSUM apache-maven-$MVN_VERSION-bin.tar.gz"
+tar -C /usr/local/ -xf apache-maven-$MVN_VERSION-bin.tar.gz
+ln -s /usr/local/apache-maven-$MVN_VERSION/bin/mvn /usr/local/bin
+rm -f apache-maven-$MVN_VERSION-bin.tar.gz
diff --git a/docker/bootstrap-python-env.sh b/docker/bootstrap-python-env.sh
index f1f1c29..2ea5901 100755
--- a/docker/bootstrap-python-env.sh
+++ b/docker/bootstrap-python-env.sh
@@ -24,6 +24,7 @@
 ##########################################################
 
 set -xe
+set -o pipefail
 
 function install_python_packages() {
   PYTHON_VERSION=$(python --version 2>&1 | cut -d' ' -f2)
diff --git a/docker/bootstrap-runtime-env.sh b/docker/bootstrap-runtime-env.sh
index 654ec4d..259e2bf 100755
--- a/docker/bootstrap-runtime-env.sh
+++ b/docker/bootstrap-runtime-env.sh
@@ -24,6 +24,7 @@
 ##########################################################
 
 set -xe
+set -o pipefail
 
 # Install the required runtime packages, if they are not installed.
 # CentOS/RHEL
@@ -39,6 +40,14 @@ if [[ -f "/usr/bin/yum" ]]; then
     krb5-workstation \
     openssl
 
+  # Install exta impala runtime packages used by the impala-runtime image. They are nominal
in size.
+  # --no-install-recommends keeps the install smaller
+  yum install -y \
+    cyrus-sasl-devel \
+    lzo-devel \
+    tzdata \
+    which
+
   # Reduce the image size by cleaning up after the install.
   yum clean all
   rm -rf /var/cache/yum /tmp/* /var/tmp/*
@@ -61,6 +70,13 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
     libsasl2-modules-gssapi-mit \
     openssl
 
+  # Install exta impala runtime packages used by the impala-runtime image. They are nominal
in size.
+  # --no-install-recommends keeps the install smaller
+  apt-get install -y --no-install-recommends \
+    liblzo2-2 \
+    libsasl2-dev \
+    tzdata
+
   # Reduce the image size by cleaning up after the install.
   apt-get clean
   rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -69,4 +85,4 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
 else
   echo "Unsupported OS"
   exit 1
-fi
\ No newline at end of file
+fi
diff --git a/docker/docker-build.sh b/docker/docker-build.sh
index 0eb8f53..32422f3 100755
--- a/docker/docker-build.sh
+++ b/docker/docker-build.sh
@@ -83,7 +83,9 @@
 #      via the `--cache-from` option. This option tells docker
 #      images to consider as cache sources.
 ##########################################################
-set -ex
+
+set -xe
+set -o pipefail
 
 ROOT=$(cd $(dirname "$BASH_SOURCE")/.. ; pwd)
 
diff --git a/docker/impala-entrypoint.sh b/docker/impala-entrypoint.sh
new file mode 100755
index 0000000..61d086b
--- /dev/null
+++ b/docker/impala-entrypoint.sh
@@ -0,0 +1,100 @@
+#!/bin/bash
+################################################################################
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+################################################################################
+#
+# This script follows the pattern described in the docker best practices here:
+# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#entrypoint
+################################################################################
+
+set -xe
+set -o pipefail
+
+function print_help {
+  echo "Supported commands:"
+  echo "   impala        - Start a single node, Kudu only, Impala cluster"
+  echo "   impala-shell  - Start the Impala shell 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 configured master addresses."
+  echo "  Defaults to kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251"
+}
+
+# Define the default environment variables.
+KUDU_MASTERS=${KUDU_MASTERS:="kudu-master-1:7051,kudu-master-2:7151,kudu-master-3:7251"}
+
+DATA_DIR="/var/lib/impala"
+LOG_DIR="$DATA_DIR/logs"
+
+export JAVA_HOME=$(which javac | xargs readlink -f | sed "s:/bin/javac::")
+
+function start_hive_metastore() {
+  # If the derby files do not existm initialize the schema.
+  if [ ! -d "${DATA_DIR}/metastore/metastore_db" ]; then
+    schematool -dbType derby -initSchema
+  fi
+  # Starth the Hive Metastore.
+  hive --service metastore &
+}
+
+function start_statestored() {
+  daemon_entrypoint.sh statestored -log_dir=${DATA_DIR}/logs &
+}
+
+function start_catalogd() {
+  daemon_entrypoint.sh catalogd -log_dir=${DATA_DIR}/logs \
+  -abort_on_config_error=false -catalog_topic_mode=minimal \
+  -hms_event_polling_interval_s=0 -invalidate_tables_on_memory_pressure=true &
+}
+
+function start_impalad() {
+  daemon_entrypoint.sh impalad -log_dir=${DATA_DIR}/logs \
+  -abort_on_config_error=false -mem_limit_includes_jvm=true \
+  -use_local_catalog=true -rpc_use_loopback=true \
+  -kudu_master_hosts=${KUDU_MASTERS} &
+}
+
+# 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" == "impala" ]]; then
+  mkdir -p $DATA_DIR
+  mkdir -p $LOG_DIR
+  start_hive_metastore
+  start_statestored
+  start_catalogd
+  start_impalad
+  tail -F ${LOG_DIR}/impalad.INFO
+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/docker/impala/etc/hadoop/conf/core-site.xml b/docker/impala/etc/hadoop/conf/core-site.xml
new file mode 100644
index 0000000..bcd4103
--- /dev/null
+++ b/docker/impala/etc/hadoop/conf/core-site.xml
@@ -0,0 +1,44 @@
+<!--
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+-->
+<configuration>
+    <property>
+        <name>fs.defaultFS</name>
+        <value>file:/var/lib/impala</value>
+    </property>
+    <!-- This isn't meant to be a secure image so allow
+    root and impala to proxy as any user in case it's
+    useful for demo purposes. -->
+    <property>
+        <name>hadoop.proxyuser.root.hosts</name>
+        <value>*</value>
+    </property>
+    <property>
+        <name>hadoop.proxyuser.root.groups</name>
+        <value>*</value>
+    </property>
+    <property>
+        <name>hadoop.proxyuser.impala.hosts</name>
+        <value>*</value>
+    </property>
+    <property>
+        <name>hadoop.proxyuser.impala.groups</name>
+        <value>*</value>
+    </property>
+</configuration>
\ No newline at end of file
diff --git a/docker/impala/etc/hive/conf/hive-site.xml b/docker/impala/etc/hive/conf/hive-site.xml
new file mode 100644
index 0000000..8ec9567
--- /dev/null
+++ b/docker/impala/etc/hive/conf/hive-site.xml
@@ -0,0 +1,37 @@
+<!--
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+-->
+<configuration>
+<property>
+    <name>javax.jdo.option.ConnectionURL</name>
+    <value>jdbc:derby:;databaseName=/var/lib/impala/metastore/metastore_db;create=true</value>
+</property>
+<property>
+    <name>javax.jdo.option.ConnectionDriverName</name>
+    <value>org.apache.derby.jdbc.EmbeddedDriver</value>
+</property>
+<property>
+    <name>hive.metastore.warehouse.dir</name>
+    <value>file:///var/lib/impala/warehouse/</value>
+</property>
+<property>
+    <name>hive.metastore.uris</name>
+    <value>thrift://localhost:9083</value>
+</property>
+</configuration>
\ No newline at end of file
diff --git a/docker/kudu-entrypoint.sh b/docker/kudu-entrypoint.sh
index 26e19a3..f763085 100755
--- a/docker/kudu-entrypoint.sh
+++ b/docker/kudu-entrypoint.sh
@@ -21,7 +21,9 @@
 # This script follows the pattern described in the docker best practices here:
 # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#entrypoint
 ################################################################################
-set -e
+
+set -xe
+set -o pipefail
 
 function print_help {
   echo "Supported commands:"


Mime
View raw message