You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2020/03/24 15:11:14 UTC

[kudu] 01/02: [docker] Make the build image more useful for development

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

commit 8ba5f3e0e8c6157bf6b731f01b0c71549192d2e6
Author: Grant Henke <gr...@apache.org>
AuthorDate: Mon Mar 23 09:23:09 2020 -0500

    [docker] Make the build image more useful for development
    
    This patch makes the docker build image more useful for
    development. It contains a few small changes including:
    - Fixed Sentry in thirdparty
    - Added lsof package to fix HMS tests
    - Replaced ntp with chrony
    - Added build packages (cmake, ninja-build)
    - Added vim for basic file editing
    - Added ccache. A follow on change will allow the docker cache to
    share the ccache between builds too.
    
    With this patch most of the tests pass in the Docker container.
    The following tests are still failing:
    - hybrid_clock-test
    - client-stress-test
    - memory_gc-itest
    - raft_consensus-itest.2
    
    Fixes for these will be added in follow on patches.
    
    I used the following steps to build a xenial image and run the tests:
    
       export TARGETS="build"
       ./docker/docker-build.sh
       docker run -it --rm apache/kudu:build-latest /bin/bash
       cd /kudu
       mkdir build/debug
       cd build/debug
       ../../thirdparty/installed/common/bin/cmake \
         -DCMAKE_BUILD_TYPE=debug ../..
       make -j6
       ctest -j6
    
    Change-Id: I1e4b463a440a3f76fb07425aebcbda2050b9917e
    Reviewed-on: http://gerrit.cloudera.org:8080/15530
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
 docker/Dockerfile           |  4 +++-
 docker/bootstrap-dev-env.sh | 22 ++++++++++++++++++++--
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/docker/Dockerfile b/docker/Dockerfile
index e5ebd3f..6f2eadf 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -70,6 +70,8 @@ RUN ./bootstrap-dev-env.sh \
   && rm bootstrap-java-env.sh \
   && rm bootstrap-python-env.sh
 
+ENV PATH /usr/lib/ccache:/usr/lib64/ccache/:$PATH
+
 # Common label arguments.
 # VCS_REF is not specified to improve docker caching.
 ARG DOCKERFILE
@@ -109,7 +111,7 @@ RUN build-support/enable_devtoolset.sh \
   # Remove all the source files except the hive, hadoop, and sentry sources
   # which are pre-built and symlinked into the installed/common/opt directory.
   && find thirdparty/src/* -maxdepth 0 -type d  \
-    \( ! -name 'hadoop-*' ! -name 'hive-*' ! -name 'apache-sentry-*' \) \
+    \( ! -name 'hadoop-*' ! -name 'hive-*' ! -name 'sentry-*' \) \
     -prune -exec rm -rf {} \; \
   # Remove all the build files except the llvm build which is symlinked into
   # the clang-toolchain directory.
diff --git a/docker/bootstrap-dev-env.sh b/docker/bootstrap-dev-env.sh
index 5547d7f..4ba2c34 100755
--- a/docker/bootstrap-dev-env.sh
+++ b/docker/bootstrap-dev-env.sh
@@ -36,6 +36,7 @@ if [[ -f "/usr/bin/yum" ]]; then
   yum install -y \
     autoconf \
     automake \
+    chrony \
     chrpath \
     cyrus-sasl-devel \
     cyrus-sasl-gssapi \
@@ -49,8 +50,8 @@ if [[ -f "/usr/bin/yum" ]]; then
     krb5-server \
     krb5-workstation \
     libtool \
+    lsof \
     make \
-    ntp \
     openssl-devel \
     patch \
     pkgconfig \
@@ -68,6 +69,14 @@ if [[ -f "/usr/bin/yum" ]]; then
     lzo-devel \
     tzdata
 
+  # Install libraries often used for Kudu development and build performance.
+  yum install -y epel-release
+  yum install -y \
+    ccache \
+    cmake \
+    ninja-build \
+    vim
+
   # 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 \
@@ -86,6 +95,7 @@ if [[ -f "/usr/bin/yum" ]]; then
     wget ${DTLS_RPM_URL} -O ${DTLS_RPM}
     yum install -y scl-utils ${DTLS_RPM}
     yum install -y devtoolset-3-toolchain
+    rm -f $DTLS_RPM
   fi
 
   # Reduce the image size by cleaning up after the install.
@@ -104,6 +114,7 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
   apt-get install -y --no-install-recommends \
     autoconf \
     automake \
+    chrony \
     chrpath \
     curl \
     flex \
@@ -121,8 +132,8 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
     libssl-dev \
     libtool \
     lsb-release \
+    lsof \
     make \
-    ntp \
     openssl \
     patch \
     pkg-config \
@@ -139,6 +150,13 @@ elif [[ -f "/usr/bin/apt-get" ]]; then
     liblzo2-2 \
     tzdata
 
+  # Install libraries often used for Kudu development and build performance.
+  apt-get install -y --no-install-recommends \
+    ccache \
+    cmake \
+    ninja-build \
+    vim
+
   # 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 \