You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by om...@apache.org on 2021/03/18 21:52:35 UTC

[orc] branch master updated: ORC-694: Improve Dockerfile per os to support jdk argument

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 75726b1  ORC-694: Improve Dockerfile per os to support jdk argument
75726b1 is described below

commit 75726b10a4d32d931ead5f0d57626c5ee20ace6a
Author: Yukihiro Okada <yu...@users.noreply.github.com>
AuthorDate: Tue Mar 16 01:06:51 2021 +0900

    ORC-694: Improve Dockerfile per os to support jdk argument
    
    Fixes #655
    
    Signed-off-by: Owen O'Malley <oo...@linkedin.com>
---
 docker/README.md                 |  9 ++++++++-
 docker/centos7/Dockerfile        | 18 +++++++++++++++---
 docker/centos8/Dockerfile        | 17 ++++++++++++++---
 docker/reinit.sh                 | 12 +++++++++---
 docker/run-all.sh                | 12 +++++++++---
 docker/run-one.sh                | 12 +++++++++---
 docker/ubuntu18/Dockerfile       |  5 +++--
 docker/ubuntu20-clang/Dockerfile |  5 +++--
 docker/ubuntu20/Dockerfile       |  5 +++--
 9 files changed, 73 insertions(+), 22 deletions(-)

diff --git a/docker/README.md b/docker/README.md
index 3ba46fd..bb4ea03 100644
--- a/docker/README.md
+++ b/docker/README.md
@@ -18,10 +18,17 @@ The scripts are:
 * `run-one.sh` *owner* *branch* *os* - test the owner's branch on one OS
 * `reinit.sh` - rebuild all of the base images without the image cache
 
+`run-all.sh`, `run-one.sh` and `reinit.sh` tests both on jdk8 and 11 across OSes
+
 A base image for each OS is built using:
 
     cd docker/$os
-    docker build -t orc-$os .
+    FOR jdk8:  docker build -t "orc-$os-jdk8" --build-arg jdk=8 .
+    FOR jdk11: docker build -t "orc-$os-jdk11" --build-arg jdk=11 .
+
+## JDK 11 support
+
+For debian9 & ubuntu16: JDK 11 support isn't provided.
 
 ## Clean up
 
diff --git a/docker/centos7/Dockerfile b/docker/centos7/Dockerfile
index 82c9cbe..f9267d1 100644
--- a/docker/centos7/Dockerfile
+++ b/docker/centos7/Dockerfile
@@ -19,6 +19,7 @@
 
 FROM centos:7
 LABEL maintainer="Apache ORC project <de...@orc.apache.org>"
+ARG jdk=8
 
 RUN yum check-update || true
 RUN yum -y install epel-release
@@ -31,8 +32,6 @@ RUN yum install -y \
   gcc-c++ \
   gettext-devel \
   git \
-  java-1.8.0-openjdk \
-  java-1.8.0-openjdk-devel \
   libtool \
   make \
   maven \
@@ -40,7 +39,20 @@ RUN yum install -y \
   tar \
   wget \
   which \
-  zlib-devel
+  zlib-devel && \
+  if [ "${jdk}" = "11" ] ; then \
+    yum install -y \
+    java-11-openjdk \
+    java-11-openjdk-devel \
+    && \
+    update-alternatives --set java  $(readlink -f /usr/lib/jvm/java-11-openjdk/bin/java) && \
+    update-alternatives --set javac $(readlink -f /usr/lib/jvm/java-11-openjdk/bin/javac) \
+  ; else \
+    yum install -y \
+    java-1.8.0-openjdk \
+    java-1.8.0-openjdk-devel \
+  ; fi
+
 # Our scripts assume that cmake is called 'cmake'
 RUN ln -s /usr/bin/cmake3 /usr/bin/cmake
 
diff --git a/docker/centos8/Dockerfile b/docker/centos8/Dockerfile
index 3736b31..14ddc70 100644
--- a/docker/centos8/Dockerfile
+++ b/docker/centos8/Dockerfile
@@ -19,6 +19,7 @@
 
 FROM centos:8
 LABEL maintainer="Apache ORC project <de...@orc.apache.org>"
+ARG jdk=8
 
 RUN yum check-update || true
 RUN yum install -y \
@@ -30,8 +31,6 @@ RUN yum install -y \
   gcc-c++ \
   gettext-devel \
   git \
-  java-1.8.0-openjdk \
-  java-1.8.0-openjdk-devel \
   libtool \
   make \
   maven \
@@ -39,7 +38,19 @@ RUN yum install -y \
   tar \
   wget \
   which \
-  zlib-devel
+  zlib-devel && \
+  if [ "${jdk}" = "11" ] ; then \
+    yum install -y \
+    java-11-openjdk  \
+    java-11-openjdk-devel \
+    && \
+    update-alternatives --set java  $(readlink -f /usr/lib/jvm/java-11-openjdk/bin/java) && \
+    update-alternatives --set javac $(readlink -f /usr/lib/jvm/java-11-openjdk/bin/javac) \
+  ; else \
+    yum install -y \
+    java-1.8.0-openjdk \
+    java-1.8.0-openjdk-devel \
+  ; fi
 
 ENV TZ=America/Los_Angeles
 WORKDIR /root
diff --git a/docker/reinit.sh b/docker/reinit.sh
index 24e697c..e3a36ba 100755
--- a/docker/reinit.sh
+++ b/docker/reinit.sh
@@ -16,9 +16,15 @@
 # limitations under the License.
 
 start=`date`
-for os in `cat os-list.txt`; do
-  echo "Re-initialize $os"
-  ( cd $os && docker build --no-cache -t "orc-$os" . )
+for jdk in 8 11; do
+  for os in `cat os-list.txt`; do
+    if [[ "$os" = "debian10" && "$jdk" = "8" ]] || [[ "$os" = "debian9" && "$jdk" = "11" ]] || [[ "$os" = "ubuntu16" && "$jdk" = "11" ]]; then
+      echo "Skip an initialize $os with $jdk"
+      continue
+    fi
+    echo "Re-initialize $os with $jdk"
+    ( cd $os && docker build --no-cache -t "orc-${os}-jdk${jdk}" --build-arg jdk=${jdk} . )
+  done
 done
 echo "Start: $start"
 echo "End:" `date`
diff --git a/docker/run-all.sh b/docker/run-all.sh
index 81876f4..6979e1d 100755
--- a/docker/run-all.sh
+++ b/docker/run-all.sh
@@ -32,9 +32,15 @@ function failure {
 rm -f logs/pids.txt logs/*.log
 
 start=`date`
-for os in `cat os-list.txt`; do
-  echo "Building $os"
-  ( cd $os && docker build -t "orc-$os" . ) > logs/$os-build.log 2>&1 || exit 1
+for jdk in 8 11; do
+    for os in `cat os-list.txt`; do
+        if [[ "$os" = "debian10" && "$jdk" = "8" ]] || [[ "$os" = "debian9" && "$jdk" = "11" ]] || [[ "$os" = "ubuntu16" && "$jdk" = "11" ]]; then
+            echo "Skip building $os with $jdk"
+            continue
+        fi
+        echo "Building $os for $jdk"
+        ( cd $os && docker build -t "orc-$os-jdk${jdk}" --build-arg jdk=$jdk . ) > logs/${os}-jdk${jdk}-build.log 2>&1 || exit 1
+    done
 done
 testStart=`date`
 
diff --git a/docker/run-one.sh b/docker/run-one.sh
index da29dc6..9c049e4 100755
--- a/docker/run-one.sh
+++ b/docker/run-one.sh
@@ -44,8 +44,14 @@ else
      OPTS=""
      ;;
   esac
-  docker run $VOLUME "orc-$OS" /bin/bash -c \
-	 "$CLONE && $MAKEDIR && cmake $OPTS .. && make package test-out" \
-      || failure
+
+  for jdk in 8 11; do
+   if [[ "$OS" = "debian10" && "$jdk" = "8" ]] || [[ "$OS" = "debian9" && "$jdk" = "11" ]] || [[ "$OS" = "ubuntu16" && "$jdk" = "11" ]]; then
+      continue
+    fi
+   docker run $VOLUME "orc-$OS-jdk${jdk}" /bin/bash -c \
+      "$CLONE && $MAKEDIR && cmake $OPTS .. && make package test-out" \
+         || failure
+   done
 fi
 echo "Finished $OS at $(date)"
diff --git a/docker/ubuntu18/Dockerfile b/docker/ubuntu18/Dockerfile
index ea1b945..2996756 100644
--- a/docker/ubuntu18/Dockerfile
+++ b/docker/ubuntu18/Dockerfile
@@ -19,6 +19,7 @@
 
 FROM ubuntu:18.04
 LABEL maintainer="Apache ORC project <de...@orc.apache.org>"
+ARG jdk=8
 
 RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
 RUN apt-get update
@@ -32,9 +33,9 @@ RUN apt-get install -y \
   make \
   curl \
   maven \
-  openjdk-8-jdk \
+  openjdk-${jdk}-jdk \
   tzdata
-RUN update-java-alternatives --set java-1.8.0-openjdk-amd64
+RUN update-java-alternatives --set java-1.${jdk}.0-openjdk-amd64
 
 WORKDIR /root
 VOLUME /root/.m2/repository
diff --git a/docker/ubuntu20-clang/Dockerfile b/docker/ubuntu20-clang/Dockerfile
index 869c1e8..fff0537 100644
--- a/docker/ubuntu20-clang/Dockerfile
+++ b/docker/ubuntu20-clang/Dockerfile
@@ -19,6 +19,7 @@
 
 FROM ubuntu:20.04
 LABEL maintainer="Apache ORC project <de...@orc.apache.org>"
+ARG jdk=8
 
 RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
 RUN apt-get update
@@ -31,9 +32,9 @@ RUN apt-get install -y \
   make \
   curl \
   maven \
-  openjdk-8-jdk \
+  openjdk-${jdk}-jdk \
   tzdata
-RUN update-java-alternatives --set java-1.8.0-openjdk-amd64
+RUN update-java-alternatives --set java-1.${jdk}.0-openjdk-amd64
 
 ENV CC=clang
 ENV CXX=clang++
diff --git a/docker/ubuntu20/Dockerfile b/docker/ubuntu20/Dockerfile
index 316ec3f..9862b04 100644
--- a/docker/ubuntu20/Dockerfile
+++ b/docker/ubuntu20/Dockerfile
@@ -19,6 +19,7 @@
 
 FROM ubuntu:20.04
 LABEL maintainer="Apache ORC project <de...@orc.apache.org>"
+ARG jdk=8
 
 RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
 RUN apt-get update
@@ -32,9 +33,9 @@ RUN apt-get install -y \
   make \
   curl \
   maven \
-  openjdk-8-jdk \
+  openjdk-${jdk}-jdk \
   tzdata
-RUN update-java-alternatives --set java-1.8.0-openjdk-amd64
+RUN update-java-alternatives --set java-1.${jdk}.0-openjdk-amd64
 
 WORKDIR /root
 VOLUME /root/.m2/repository