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/04/09 17:57:34 UTC

[kudu] branch branch-1.12.x updated: [docker] Fix Docker build on the centOS 8 base image

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/branch-1.12.x by this push:
     new a06af64  [docker] Fix Docker build on the centOS 8 base image
a06af64 is described below

commit a06af64f96149d50a8eb128f2a1117084a94af25
Author: Grant Henke <gr...@apache.org>
AuthorDate: Wed Apr 8 18:07:58 2020 -0500

    [docker] Fix Docker build on the centOS 8 base image
    
    In order to install ninja-build in centOS 8+ we need to enable the
    PowerTools repository. Additionally we need to install the
    `python3-devel` package and set it as the default Python.
    
    Change-Id: I52c455e327ed59189cf6b00bb0ffa5fb8fb7feac
    Reviewed-on: http://gerrit.cloudera.org:8080/15695
    Tested-by: Kudu Jenkins
    Reviewed-by: Bankim Bhavsar <ba...@cloudera.com>
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
    (cherry picked from commit 3e0e81906ad654131fb3faf141e726e3630e3898)
    Reviewed-on: http://gerrit.cloudera.org:8080/15697
    Reviewed-by: Hao Hao <ha...@cloudera.com>
---
 docker/bootstrap-dev-env.sh    | 11 ++++++++++-
 docker/bootstrap-python-env.sh | 22 +++++++++++++++++-----
 docker/docker-build.sh         |  1 +
 3 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/docker/bootstrap-dev-env.sh b/docker/bootstrap-dev-env.sh
index 4ba2c34..fcdc496 100755
--- a/docker/bootstrap-dev-env.sh
+++ b/docker/bootstrap-dev-env.sh
@@ -62,6 +62,9 @@ if [[ -f "/usr/bin/yum" ]]; then
     which \
     wget
 
+  # Get the major version for version specific package logic below.
+  OS_MAJOR_VERSION=$(lsb_release -rs | cut -f1 -d.)
+
   # Install exta impala packages for the impala images. They are nominal in size.
   # --no-install-recommends keeps the install smaller
   yum install -y \
@@ -69,6 +72,13 @@ if [[ -f "/usr/bin/yum" ]]; then
     lzo-devel \
     tzdata
 
+  # We need to enable the PowerTools repository on versions 8.0 and newer
+  # to install the ninja-build package.
+  if [[ "$OS_MAJOR_VERSION" -gt "7" ]]; then
+    yum install -y 'dnf-command(config-manager)'
+    yum config-manager --set-enabled PowerTools
+  fi
+
   # Install libraries often used for Kudu development and build performance.
   yum install -y epel-release
   yum install -y \
@@ -88,7 +98,6 @@ if [[ -f "/usr/bin/yum" ]]; then
 
   # To build on a version older than 7.0, the Red Hat Developer Toolset
   # must be installed (in order to have access to a C++11 capable compiler).
-  OS_MAJOR_VERSION=$(lsb_release -rs | cut -f1 -d.)
   if [[ "$OS_MAJOR_VERSION" -lt "7" ]]; then
     DTLS_RPM=rhscl-devtoolset-3-epel-6-x86_64-1-2.noarch.rpm
     DTLS_RPM_URL=https://www.softwarecollections.org/repos/rhscl/devtoolset-3/epel-6-x86_64/noarch/${DTLS_RPM}
diff --git a/docker/bootstrap-python-env.sh b/docker/bootstrap-python-env.sh
index 2ea5901..09a4e92 100755
--- a/docker/bootstrap-python-env.sh
+++ b/docker/bootstrap-python-env.sh
@@ -44,9 +44,9 @@ function install_python_packages() {
     curl https://bootstrap.pypa.io/get-pip.py | python - "pip < 19.0"
   fi
   pip install --upgrade \
-      cython \
-      setuptools \
-      setuptools_scm
+    cython \
+    setuptools \
+    setuptools_scm
 }
 
 # Install the prerequisite libraries, if they are not installed.
@@ -56,12 +56,24 @@ if [[ -f "/usr/bin/yum" ]]; then
   yum update -y
 
   # Install curl, used when installing pip.
-  yum install -y ca-certificates curl
+  yum install -y ca-certificates \
+    curl \
+    redhat-lsb-core
+
+  # Get the major version for version specific package logic below.
+  OS_MAJOR_VERSION=$(lsb_release -rs | cut -f1 -d.)
 
   # Install python development packages.
   yum install -y epel-release
   # g++ is required to check for int128 support in setup.py.
-  yum install -y gcc gcc-c++ python-devel
+  yum install -y gcc gcc-c++
+  if [[ "$OS_MAJOR_VERSION" -lt "8" ]]; then
+    yum install -y python-devel
+  else
+    yum install -y python3-devel
+    alternatives --set python /usr/bin/python3
+  fi
+
   install_python_packages
 
   # Reduce the image size by cleaning up after the install.
diff --git a/docker/docker-build.sh b/docker/docker-build.sh
index 32422f3..8799ea7 100755
--- a/docker/docker-build.sh
+++ b/docker/docker-build.sh
@@ -92,6 +92,7 @@ ROOT=$(cd $(dirname "$BASH_SOURCE")/.. ; pwd)
 # Tested options:
 #   centos:6
 #   centos:7
+#   centos:8
 #   debian:jessie
 #   debian:stretch
 #   ubuntu:trusty