]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
script: update ceph-debug-docker for centos:stream
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 29 Oct 2021 02:13:50 +0000 (22:13 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 29 Oct 2021 02:15:17 +0000 (22:15 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/script/ceph-debug-docker.sh

index 84b735b12a378fc87b4da77df0234aa661642982..2c2407e64cb443f7f7e4e50ce88fe083faf9901f 100755 (executable)
@@ -14,6 +14,8 @@ set -e
 
 CACHE=""
 FLAVOR="default"
+SUDO=""
+PRIVILEGED=""
 
 function run {
     printf "%s\n" "$*"
@@ -21,7 +23,7 @@ function run {
 }
 
 function main {
-    eval set -- $(getopt --name "$0" --options 'h' --longoptions 'help,no-cache,flavor:' -- "$@")
+    eval set -- $(getopt --name "$0" --options 'h' --longoptions 'help,no-cache,flavor:,sudo,privileged' -- "$@")
 
     while [ "$#" -gt 0 ]; do
         case "$1" in
@@ -37,6 +39,14 @@ function main {
                 FLAVOR=$2
                 shift 2
                 ;;
+            --privileged)
+                PRIVILEGED=--privileged
+                shift 1
+                ;;
+            --sudo)
+                SUDO=sudo
+                shift 1
+                ;;
             --)
                 shift
                 break
@@ -84,7 +94,13 @@ function main {
 
     T=$(mktemp -d)
     pushd "$T"
-    distro="${env/://}"
+    case "$env" in
+        centos:stream)
+            distro="centos/8"
+            ;;
+        *)
+            distro="${env/://}"
+    esac
     api_url="https://shaman.ceph.com/api/search/?status=ready&project=ceph&flavor=${FLAVOR}&distros=${distro}/$(arch)&ref=${branch}&sha1=${sha}"
     repo_url="$(wget -O - "$api_url" | jq -r '.[0].chacra_url')repo"
     # validate url:
@@ -104,19 +120,27 @@ RUN apt-key add cephdev.asc && \
     apt-get update --yes && \
     DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get --assume-yes -q --no-install-recommends install -o Dpkg::Options::=--force-confnew --allow-unauthenticated ceph ceph-osd-dbg ceph-mds-dbg ceph-mgr-dbg ceph-mon-dbg ceph-common-dbg ceph-fuse-dbg ceph-test-dbg radosgw-dbg python3-cephfs python3-rados
 EOF
-        time run docker build $CACHE --tag "$tag" .
+        time run $SUDO docker build $CACHE --tag "$tag" .
     else # try RHEL flavor
         case "$env" in
             centos:7)
                 python_bindings="python36-rados python36-cephfs"
+                base_debuginfo=""
                 ceph_debuginfo="ceph-debuginfo"
                 debuginfo=/etc/yum.repos.d/CentOS-Linux-Debuginfo.repo
                 ;;
             centos:8)
                 python_bindings="python3-rados python3-cephfs"
+                base_debuginfo="glibc-debuginfo"
                 ceph_debuginfo="ceph-base-debuginfo"
                 debuginfo=/etc/yum.repos.d/CentOS-Linux-Debuginfo.repo
                 ;;
+            centos:stream)
+                python_bindings="python3-rados python3-cephfs"
+                base_debuginfo="glibc-debuginfo"
+                ceph_debuginfo="ceph-base-debuginfo"
+                debuginfo=/etc/yum.repos.d/CentOS-Stream-Debuginfo.repo
+                ;;
         esac
         if [ "${FLAVOR}" = "crimson" ]; then
             ceph_debuginfo+=" ceph-crimson-osd-debuginfo ceph-crimson-osd"
@@ -132,16 +156,16 @@ RUN yum update -y && \
 RUN wget -O /etc/yum.repos.d/ceph-dev.repo $repo_url && \
     yum clean all && \
     yum upgrade -y && \
-    yum install -y ceph ${ceph_debuginfo} ${python_bindings}
+    yum install -y ceph ${base_debuginfo} ${ceph_debuginfo} ${python_bindings}
 EOF
-        time run docker build $CACHE --tag "$tag" .
+        time run $SUDO docker build $CACHE --tag "$tag" .
     fi
     popd
     rm -rf -- "$T"
 
     printf "built image %s\n" "$tag"
 
-    run docker run -ti -v /ceph:/ceph:ro -v /cephfs:/cephfs:ro -v /teuthology:/teuthology:ro "$tag"
+    run $SUDO docker run $PRIVILEGED -ti -v /ceph:/ceph:ro -v /cephfs:/cephfs:ro -v /teuthology:/teuthology:ro "$tag"
     return 0
 }