Skip to content

Commit

Permalink
daemon/demo: add crash support
Browse files Browse the repository at this point in the history
This adds creating the crash keyring and starting the ceph-crash daemon.
Also add the demo validation for the CI.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit b7f54ce)
  • Loading branch information
dsavineau committed Aug 3, 2021
1 parent 02c23a4 commit 4be0072
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/daemon/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,20 @@ function bootstrap_sree {
}


#########
# CRASH #
#########
function bootstrap_crash {
CRASH_NAME="client.crash"
mkdir -p /var/lib/ceph/crash/posted
ceph "${CLI_OPTS[@]}" auth get-or-create "${CRASH_NAME}" mon 'profile crash' mgr 'profile crash' -o /etc/ceph/"${CLUSTER}"."${CRASH_NAME}".keyring
chown --verbose -R ceph. /etc/ceph/"${CLUSTER}"."${CRASH_NAME}".keyring /var/lib/ceph/crash

# start ceph-crash
nohup ceph-crash -n "${CRASH_NAME}" &
}


###################
# BUILD BOOTSTRAP #
###################
Expand All @@ -362,7 +376,7 @@ function build_bootstrap {
bootstrap_mgr

if [[ "$DEMO_DAEMONS" == "all" ]]; then
daemons_list="osd mds rgw nfs rbd_mirror rest_api"
daemons_list="osd mds rgw nfs rbd_mirror rest_api crash"
else
# change commas to space
comma_to_space=${DEMO_DAEMONS//,/ }
Expand Down Expand Up @@ -407,6 +421,9 @@ function build_bootstrap {
rest_api)
bootstrap_rest_api
;;
crash)
bootstrap_crash
;;
*)
log "ERROR: unknown scenario!"
log "Available scenarios are: mon mgr osd mds rgw nfs rbd_mirror rest_api"
Expand Down
6 changes: 6 additions & 0 deletions travis-builds/validate_demo_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ function test_demo_rest_api {
return $(wait_for_daemon "$DOCKER_COMMAND mgr dump | grep -sq 'restful\": \"https://.*:8003'")
}

function test_demo_crash {
# shellcheck disable=SC2046
return $(wait_for_daemon "ps aux | grep -sq [c]eph-crash")
}

########
# MAIN #
########
Expand All @@ -94,6 +99,7 @@ test_demo_nfs
test_demo_rbd_mirror
test_demo_mgr
test_demo_rest_api
test_demo_crash
ceph_status # wait again for the cluster to stabilize (mds pools)

if ! docker ps | grep ceph-demo; then
Expand Down

0 comments on commit 4be0072

Please sign in to comment.