Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
daemon: remove forego usage
Browse files Browse the repository at this point in the history
This removes the forego installation and osd scenarios using it since
it isn't maintained and used anymore.

Signed-off-by: Dimitri Savineau <[email protected]>
(cherry picked from commit 7c5f7e3)
  • Loading branch information
dsavineau committed Nov 4, 2021
1 parent d26d13c commit 49ffd85
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 180 deletions.
1 change: 0 additions & 1 deletion ceph-releases/ALL/centos/daemon/__DOCKERFILE_PREINSTALL__
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
COPY --from=builder /go/bin/forego /usr/local/bin/forego
6 changes: 0 additions & 6 deletions src/daemon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# forego build

FROM docker.io/golang:1.17 AS builder
ENV CGO_ENABLED=0
RUN go install github.com/ddollar/[email protected]

# CEPH DAEMON IMAGE

FROM __ENV_[DAEMON_BASE_IMAGE]__
Expand Down
4 changes: 2 additions & 2 deletions src/daemon/__DOCKERFILE_CLEAN_DAEMON__
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
rm -f /usr/bin/{etcd-tester,etcd-dump-logs} && \
# Let's compress fat binaries but keep them executable
# As we don't run them often, the performance penalty isn't that big
for binary in /usr/local/bin/{confd,forego,kubectl} /usr/bin/etcdctl; do \
for binary in /usr/local/bin/{confd,kubectl} /usr/bin/etcdctl; do \
if [ -f "$binary" ]; then gzexe $binary && rm -f ${binary}~; fi; \
done && \
# Remove etcd since all we need is etcdctl
rm -f /usr/bin/etcd && \
# Strip binaries
bash -c ' \
function ifstrip () { if compgen -g "$1"; then strip -s "$1"; fi } && \
ifstrip /usr/local/bin/{confd,forego,kubectl}' && \
ifstrip /usr/local/bin/{confd,kubectl}' && \
# Uncomment below line for more detailed debug info
# find / -xdev -type f -exec du -c {} \; |sort -n && \
echo "CLEAN DAEMON DONE!"
5 changes: 2 additions & 3 deletions src/daemon/common_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ function dev_part {
function osd_trying_to_determine_scenario {
: "${OSD_DEVICE:=none}"
if [[ ${OSD_DEVICE} == "none" ]]; then
log "Bootstrapped OSD(s) found; using OSD directory"
source /opt/ceph-container/bin/osd_directory.sh
osd_directory
log "No device found, please provide one with OSD_DEVICE variable"
exit 1
elif parted --script "${OSD_DEVICE}" print | grep -sqE '^ 1.*ceph data'; then
log "Bootstrapped OSD found; activating ${OSD_DEVICE}"
source /opt/ceph-container/bin/osd_disk_activate.sh
Expand Down
6 changes: 0 additions & 6 deletions src/daemon/entrypoint.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ case "$CEPH_DAEMON" in
source /opt/ceph-container/bin/start_osd.sh
start_osd
;;
osd_directory)
# TAG: osd_directory
source /opt/ceph-container/bin/start_osd.sh
OSD_TYPE="directory"
start_osd
;;
osd_directory_single)
# TAG: osd_directory_single
source /opt/ceph-container/bin/start_osd.sh
Expand Down
16 changes: 2 additions & 14 deletions src/daemon/osd_scenarios/osd_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
set -e

# Start the latest OSD
# In case of forego, we don't run ceph-osd, start_forego will do it later
start_osd() {
mode=$1 #forego or empty

OSD_ID=$(find /var/lib/ceph/osd/ -maxdepth 1 -mindepth 1 -printf '%TY-%Tm-%Td %TT %p\n' | sort -n | tail -n1 | awk -F '-' -v pattern="$CLUSTER" '$0 ~ pattern {print $4}')

# ceph-disk activiate has exec'ed /usr/bin/ceph-osd ${CLI_OPTS[@]} -f -i ${OSD_ID}
Expand All @@ -16,15 +13,6 @@ start_osd() {
while [ -e /proc/"${OSD_PID}" ]; do sleep 1;done
fi

if [ "$mode" = "forego" ]; then
echo "${CLUSTER}-${OSD_ID}: /usr/bin/ceph-osd ${CLI_OPTS[*]} -f -i ${OSD_ID} --setuser ceph --setgroup disk" | tee -a /etc/forego/"${CLUSTER}"/Procfile
else
log "SUCCESS"
exec /usr/bin/ceph-osd "${CLI_OPTS[@]}" -f -i "${OSD_ID}" --setuser ceph --setgroup disk
fi
}

# Starting forego
start_forego() {
exec /usr/local/bin/forego start -f /etc/forego/"${CLUSTER}"/Procfile
log "SUCCESS"
exec /usr/bin/ceph-osd "${CLI_OPTS[@]}" -f -i "${OSD_ID}" --setuser ceph --setgroup disk
}
72 changes: 0 additions & 72 deletions src/daemon/osd_scenarios/osd_directory.sh

This file was deleted.

65 changes: 0 additions & 65 deletions src/daemon/osd_scenarios/osd_disks.sh

This file was deleted.

10 changes: 0 additions & 10 deletions src/daemon/start_osd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ function start_osd {
fi

case "$OSD_TYPE" in
directory)
source /opt/ceph-container/bin/osd_directory.sh
source /opt/ceph-container/bin/osd_common.sh
osd_directory
;;
directory_single)
source /opt/ceph-container/bin/osd_directory_single.sh
osd_directory_single
Expand All @@ -38,11 +33,6 @@ function start_osd {
source /opt/ceph-container/bin/osd_disk_activate.sh
osd_activate
;;
devices)
source /opt/ceph-container/bin/osd_disks.sh
source /opt/ceph-container/bin/osd_common.sh
osd_disks
;;
activate_journal)
source /opt/ceph-container/bin/osd_activate_journal.sh
source /opt/ceph-container/bin/osd_common.sh
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/variables_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# LIST OF ALL SCENARIOS AVAILABLE #
###################################

ALL_SCENARIOS="populate_kvstore mon osd osd_directory osd_directory_single osd_ceph_disk osd_ceph_disk_prepare osd_ceph_disk_activate osd_ceph_activate_journal mds rgw rgw_user nfs zap_device mon_health mgr disk_introspection demo disk_list tcmu_runner rbd_target_api rbd_target_gw"
ALL_SCENARIOS="populate_kvstore mon osd osd_directory_single osd_ceph_disk osd_ceph_disk_prepare osd_ceph_disk_activate osd_ceph_activate_journal mds rgw rgw_user nfs zap_device mon_health mgr disk_introspection demo disk_list tcmu_runner rbd_target_api rbd_target_gw"


#########################
Expand Down

0 comments on commit 49ffd85

Please sign in to comment.