]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-debug-docker: support centos 8
authorKefu Chai <kchai@redhat.com>
Wed, 22 Jul 2020 13:41:41 +0000 (21:41 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 22 Jul 2020 15:08:26 +0000 (23:08 +0800)
* default to centos:8, as we've moved to centos:8 now
* do not assume that the base image is centos:7, use centos:8 if it is
  specified.
* install python3-* packages for centos:8 and install python36-*
  packages for centos:7. as el8 is now a python3 distro, and
  centos:7 now has python36.
* s/screen/tmux/. because screen is now offered by EPEL, while tmux
  is in BaseOS.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/script/ceph-debug-docker.sh

index eac98183eeec218edb5032faef9b5968fe7ef77d..3751845e171abab48aa5d1ea6048a50c24a5f36b 100755 (executable)
@@ -57,10 +57,10 @@ function main {
     printf "branch: %s\nsha1: %s\n" "$branch" "$sha"
 
     if [ -z "$2" ]; then
-        printf "specify the build environment [default \"centos:7\"]: "
+        printf "specify the build environment [default \"centos:8\"]: "
         read env
         if [ -z "$env" ]; then
-            env=centos:7
+            env=centos:8
         fi
     else
         env="$2"
@@ -96,16 +96,27 @@ RUN apt-key add cephdev.asc && \
 EOF
         time run docker build $CACHE --tag "$tag" .
     else # try RHEL flavor
+        case "$env" in
+            centos:7)
+                python_bindings="python36-rados python36-cephfs"
+                ceph_debuginfo="ceph-debuginfo"
+                ;;
+            centos:8)
+                python_bindings="python3-rados python3-cephfs"
+                ceph_debuginfo="ceph-base-debuginfo"
+                ;;
+        esac
+        IFS=":" read -r distro distro_release <<< "$env"
         time run docker build $CACHE --tag "$tag" - <<EOF
 FROM ${env}
 
 WORKDIR /root
 RUN yum update -y && \
-    yum install -y screen epel-release wget psmisc ca-certificates gdb
-RUN wget -O /etc/yum.repos.d/ceph-dev.repo https://shaman.ceph.com/api/repos/ceph/${branch}/${sha}/centos/7/repo && \
+    yum install -y tmux epel-release wget psmisc ca-certificates gdb
+RUN wget -O /etc/yum.repos.d/ceph-dev.repo https://shaman.ceph.com/api/repos/ceph/${branch}/${sha}/${distro}/${distro_release}/repo && \
     yum clean all && \
     yum upgrade -y && \
-    yum install -y ceph ceph-debuginfo ceph-fuse python34-rados python34-cephfs
+    yum install -y ceph ${ceph_debuginfo} ceph-fuse ${python_bindings}
 EOF
     fi
     popd