mirror of
https://github.com/lxc/incus.git
synced 2026-02-05 09:46:19 +01:00
github: Deal with new Github images
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
50
.github/workflows/tests.yml
vendored
50
.github/workflows/tests.yml
vendored
@@ -352,21 +352,28 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
make
|
make
|
||||||
|
|
||||||
|
- name: Setup scratch space
|
||||||
|
if: "matrix.backend == 'ceph' || matrix.backend == 'linstor'"
|
||||||
|
run: |
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
if mountpoint -q /mnt; then
|
||||||
|
[ -e /mnt/swapfile ] && sudo swapoff /mnt/swapfile
|
||||||
|
block_path="$(findmnt --noheadings --output SOURCE --target /mnt | sed 's/[0-9]\+$//')"
|
||||||
|
sudo umount /mnt
|
||||||
|
sudo wipefs -a "${block_path}"
|
||||||
|
sudo ln -s "${block_path}" "/dev/scratch"
|
||||||
|
else
|
||||||
|
sudo truncate -s 20G /scratch.img
|
||||||
|
block_path="$(sudo losetup --show -f /scratch.img)"
|
||||||
|
sudo ln -s "${block_path}" "/dev/scratch"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup MicroCeph
|
- name: Setup MicroCeph
|
||||||
if: ${{ matrix.backend == 'ceph' }}
|
if: matrix.backend == 'ceph'
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# If the rootfs and the ephemeral part are on the same physical disk, giving the whole
|
|
||||||
# disk to microceph would wipe our rootfs. Since it is pretty rare for GitHub Action
|
|
||||||
# runners to have a single disk, we immediately bail rather than trying to gracefully
|
|
||||||
# handle it. Once snapd releases with https://github.com/snapcore/snapd/pull/13150,
|
|
||||||
# we will be able to stop worrying about that special case.
|
|
||||||
if [ "$(stat -c '%d' /)" = "$(stat -c '%d' /mnt)" ]; then
|
|
||||||
echo "FAIL: rootfs and ephemeral part on the same disk, aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
sudo apt-get install --no-install-recommends -y snapd
|
sudo apt-get install --no-install-recommends -y snapd
|
||||||
sudo snap install microceph --channel=quincy/stable
|
sudo snap install microceph --channel=quincy/stable
|
||||||
sudo apt-get install --no-install-recommends -y ceph-common
|
sudo apt-get install --no-install-recommends -y ceph-common
|
||||||
@@ -379,11 +386,9 @@ jobs:
|
|||||||
for flag in nosnaptrim noscrub nobackfill norebalance norecover noscrub nodeep-scrub; do
|
for flag in nosnaptrim noscrub nobackfill norebalance norecover noscrub nodeep-scrub; do
|
||||||
sudo microceph.ceph osd set $flag
|
sudo microceph.ceph osd set $flag
|
||||||
done
|
done
|
||||||
|
|
||||||
# Repurpose the ephemeral disk for ceph OSD.
|
# Repurpose the ephemeral disk for ceph OSD.
|
||||||
sudo swapoff /mnt/swapfile
|
sudo microceph disk add --wipe "/dev/scratch"
|
||||||
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 rm -rf /etc/ceph
|
||||||
sudo ln -s /var/snap/microceph/current/conf/ /etc/ceph
|
sudo ln -s /var/snap/microceph/current/conf/ /etc/ceph
|
||||||
sudo microceph enable rgw
|
sudo microceph enable rgw
|
||||||
@@ -393,6 +398,7 @@ jobs:
|
|||||||
sudo microceph.ceph fs ls
|
sudo microceph.ceph fs ls
|
||||||
sleep 30
|
sleep 30
|
||||||
sudo microceph.ceph status
|
sudo microceph.ceph status
|
||||||
|
|
||||||
# Wait until there are no more "unkowns" pgs
|
# Wait until there are no more "unkowns" pgs
|
||||||
for _ in $(seq 60); do
|
for _ in $(seq 60); do
|
||||||
if sudo microceph.ceph pg stat | grep -wF unknown; then
|
if sudo microceph.ceph pg stat | grep -wF unknown; then
|
||||||
@@ -405,16 +411,10 @@ jobs:
|
|||||||
sudo rm -f /snap/bin/rbd
|
sudo rm -f /snap/bin/rbd
|
||||||
|
|
||||||
- name: Setup LINSTOR
|
- name: Setup LINSTOR
|
||||||
if: ${{ matrix.backend == 'linstor' }}
|
if: matrix.backend == 'linstor'
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# As with Ceph, we hope for a spare disk.
|
|
||||||
if [ "$(stat -c '%d' /)" = "$(stat -c '%d' /mnt)" ]; then
|
|
||||||
echo "FAIL: rootfs and ephemeral part on the same disk, aborting"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
sudo add-apt-repository ppa:linbit/linbit-drbd9-stack -y
|
sudo add-apt-repository ppa:linbit/linbit-drbd9-stack -y
|
||||||
|
|
||||||
# Install everything required to compile DRBD and run LINSTOR tools.
|
# Install everything required to compile DRBD and run LINSTOR tools.
|
||||||
@@ -437,11 +437,7 @@ jobs:
|
|||||||
sudo linstor node create local "${runner_ip}" --node-type combined
|
sudo linstor node create local "${runner_ip}" --node-type combined
|
||||||
|
|
||||||
# Repurpose the ephemeral disk for LINSTOR physical storage.
|
# Repurpose the ephemeral disk for LINSTOR physical storage.
|
||||||
sudo swapoff /mnt/swapfile
|
sudo linstor physical-storage create-device-pool --storage-pool incus --pool-name linstor-incus zfsthin local "/dev/scratch"
|
||||||
ephemeral_disk="$(findmnt --noheadings --output SOURCE --target /mnt | sed 's/[0-9]\+$//')"
|
|
||||||
sudo umount /mnt
|
|
||||||
sudo wipefs -a "${ephemeral_disk}"
|
|
||||||
sudo linstor physical-storage create-device-pool --storage-pool incus --pool-name linstor-incus zfsthin local "${ephemeral_disk}"
|
|
||||||
|
|
||||||
# Update the runner env.
|
# Update the runner env.
|
||||||
echo "INCUS_LINSTOR_CLUSTER=${runner_ip}" >> "$GITHUB_ENV"
|
echo "INCUS_LINSTOR_CLUSTER=${runner_ip}" >> "$GITHUB_ENV"
|
||||||
|
|||||||
Reference in New Issue
Block a user