Skip to content

Commit

Permalink
Merge pull request #12250 from simondeziel/ceph-pool
Browse files Browse the repository at this point in the history
Try to improve ceph pool creation reliability
  • Loading branch information
tomponline authored Sep 14, 2023
2 parents 3fe1b06 + 6569581 commit 288dac4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:

- name: Install Go (tip)
run: |
curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
curl -sSfL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz
ls -lah gotip.tar.gz
mkdir -p ~/sdk/gotip
tar -C ~/sdk/gotip -xzf gotip.tar.gz
Expand All @@ -150,6 +150,7 @@ jobs:
sudo apt-get update
sudo snap remove lxd --purge
sudo snap remove core20 --purge || true
sudo apt-get autopurge moby-containerd docker uidmap -y
sudo ip link delete docker0
sudo nft flush ruleset
Expand Down Expand Up @@ -218,7 +219,7 @@ jobs:
if: ${{ matrix.backend == 'ceph' }}
run: |
set -x
sudo apt-get install --no-install-recommends -y snapd ceph-common
sudo apt-get install --no-install-recommends -y ceph-common
sudo snap install microceph --edge
sleep 5
sudo microceph cluster bootstrap
Expand All @@ -230,17 +231,11 @@ jobs:
for flag in nosnaptrim noscrub nobackfill norebalance norecover noscrub nodeep-scrub; do
sudo microceph.ceph osd set $flag
done
# Use ephemeral disk mounted on /mnt for ceph OSD.
# The block-devices plug doesn't allow accessing /dev/loopX devices so we make those same devices
# available under alternate names (/dev/sdiY) that are not used inside GitHub Action runners.
# Repurpose the ephemeral disk for ceph OSD.
sudo swapoff /mnt/swapfile
sudo rm -f /mnt/swapfile
loop_file="/mnt/ceph-osd.img"
sudo fallocate -l 10G "${loop_file}"
loop_dev="$(sudo losetup --show --direct-io=on --nooverlap -f "${loop_file}")"
devInfo=($(sudo stat -c '%t %T' "${loop_dev}"))
sudo mknod -m 0660 /dev/sdia b 0x"${devInfo[0]}" 0x"${devInfo[1]}"
sudo microceph disk add --wipe /dev/sdia
ephemeral_disk="$(findmnt --noheadings --output SOURCE --target /mnt | sed 's/[0-9]\+$//')"
sudo umount /mnt
sudo microceph disk add --wipe "${ephemeral_disk}"
sudo rm -rf /etc/ceph
sudo ln -s /var/snap/microceph/current/conf/ /etc/ceph
sudo microceph enable rgw
Expand Down
2 changes: 1 addition & 1 deletion test/backends/ceph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ceph_configure() {

echo "==> Configuring CEPH backend in ${LXD_DIR}"

lxc storage create "lxdtest-$(basename "${LXD_DIR}")" ceph volume.size=25MiB ceph.osd.pg_num=16
lxc storage create "lxdtest-$(basename "${LXD_DIR}")" ceph volume.size=25MiB ceph.osd.pg_num=8
lxc profile device add default root disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")"
}

Expand Down
4 changes: 4 additions & 0 deletions test/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ cleanup() {
read -r _
fi

echo ""
echo "df -h output:"
df -h

if [ -n "${GITHUB_ACTIONS:-}" ]; then
echo "==> Skipping cleanup (GitHub Action runner detected)"
else
Expand Down

0 comments on commit 288dac4

Please sign in to comment.