]>
git.proxmox.com Git - ceph.git/blob - ceph/src/script/ceph-debug-docker.sh
3 # This can be run from e.g. the senta machines which have docker available. You
4 # may need to run this script with sudo.
6 # Once you have booted into the image, you should be able to debug the core file:
7 # $ gdb -q /ceph/teuthology-archive/.../coredump/1500013578.8678.core
9 # You may want to install other packages (yum) as desired.
11 # Once you're finished, please delete old images in a timely fashion.
23 eval set -- $
(getopt
--name "$0" --options 'h' --longoptions 'help,no-cache' -- "$@")
25 while [ "$#" -gt 0 ]; do
28 printf '%s: [--no-cache] <branch> <enviornment>\n' "$0"
43 printf "specify the branch [default \"master\"]: "
45 if [ -z "$branch" ]; then
51 printf "branch: %s\n" "$branch"
54 printf "specify the build environment [default \"centos:7\"]: "
56 if [ -z "$env" ]; then
62 printf "env: %s\n" "$env"
64 if [ -n "$SUDO_USER" ]; then
66 elif [ -n "$USER" ]; then
72 image
="${user}/ceph-ci:${branch}-${env/:/-}"
76 if grep ubuntu
<<<"$env" > /dev
/null
2>&1; then
77 # Docker makes it impossible to access anything outside the CWD : /
78 cp -- /ceph
/shaman
/cephdev.asc .
79 cat > Dockerfile
<<EOF
83 RUN apt-get update --yes --quiet && \
84 apt-get install --yes --quiet screen wget gdb software-properties-common python-software-properties apt-transport-https
85 COPY cephdev.asc cephdev.asc
86 RUN apt-key add cephdev.asc
87 RUN add-apt-repository "\$(wget --quiet -O - https://shaman.ceph.com/api/repos/ceph/${branch}/latest/${env/://}/repo)" && \
88 apt-get update --yes && \
89 apt-get install --yes --allow-unauthenticated ceph ceph-mds-dbg ceph-mgr-dbg ceph-mon-dbg ceph-fuse-dbg ceph-test-dbg radosgw-dbg
91 time run docker build
$CACHE --tag "$image" .
92 else # try RHEL flavor
93 time run docker build
$CACHE --tag "$image" - <<EOF
97 RUN yum update -y && \
98 yum install -y screen epel-release wget psmisc ca-certificates gdb
99 RUN wget -O /etc/yum.repos.d/ceph-dev.repo https://shaman.ceph.com/api/repos/ceph/${branch}/latest/centos/7/repo && \
102 yum install -y ceph ceph-debuginfo ceph-fuse
108 printf "built image %s\n" "$image"
110 run docker run
-ti -v /ceph
:/ceph
:ro
"$image"