diff options
author | Patrick Donnelly <pdonnell@redhat.com> | 2021-10-29 04:13:50 +0200 |
---|---|---|
committer | Patrick Donnelly <pdonnell@redhat.com> | 2021-10-29 04:15:17 +0200 |
commit | 9c2ef6a75cb05ab142c267f710a566c2745f72fa (patch) | |
tree | 9e8203366ed96fb72a529dcada983fb17e207884 /src/script | |
parent | Merge pull request #43684 from ybwang0211/doc-host (diff) | |
download | ceph-9c2ef6a75cb05ab142c267f710a566c2745f72fa.tar.xz ceph-9c2ef6a75cb05ab142c267f710a566c2745f72fa.zip |
script: update ceph-debug-docker for centos:stream
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Diffstat (limited to 'src/script')
-rwxr-xr-x | src/script/ceph-debug-docker.sh | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/src/script/ceph-debug-docker.sh b/src/script/ceph-debug-docker.sh index 84b735b12a3..2c2407e64cb 100755 --- a/src/script/ceph-debug-docker.sh +++ b/src/script/ceph-debug-docker.sh @@ -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 } |