Merge "Fix gates out of disk space"

This commit is contained in:
Jenkins 2017-08-31 13:52:26 +00:00 committed by Gerrit Code Review
commit 9a520e0906
3 changed files with 40 additions and 2 deletions

View File

@ -34,6 +34,25 @@ function setup_disk {
DEV=$(losetup -a | awk -F: '/\/docker/ {print $1}') DEV=$(losetup -a | awk -F: '/\/docker/ {print $1}')
fi fi
# Excerpts from https://github.com/openstack-infra/devstack-gate/blob/dc49f9e6eb18e42c6b175e4e146fa8f3b7633279/functions.sh#L306
if [ -b /dev/xvde ]; then
DEV2='/dev/xvde'
if mount | grep ${DEV2} > /dev/null; then
echo "*** ${DEV2} appears to already be mounted"
echo "*** ${DEV2} unmounting and reformating"
sudo umount ${DEV2}
fi
sudo parted ${DEV2} --script -- mklabel msdos
sync
sudo partprobe
sudo mkfs.ext4 ${DEV2}
sudo mount ${DEV2} /mnt
sudo find /opt/ -mindepth 1 -maxdepth 1 -exec mv {} /mnt/ \;
sudo umount /mnt
sudo mount ${DEV2} /opt
grep -q ${DEV2} /proc/mounts || exit 1
fi
# Format Disks and setup Docker to use BTRFS # Format Disks and setup Docker to use BTRFS
sudo parted ${DEV} -s -- mklabel msdos sudo parted ${DEV} -s -- mklabel msdos
sudo rm -rf /var/lib/docker sudo rm -rf /var/lib/docker

View File

@ -18,6 +18,25 @@ function setup_disk {
DEV=$(losetup -a | awk -F: '/\/docker/ {print $1}') DEV=$(losetup -a | awk -F: '/\/docker/ {print $1}')
fi fi
# Excerpts from https://github.com/openstack-infra/devstack-gate/blob/dc49f9e6eb18e42c6b175e4e146fa8f3b7633279/functions.sh#L306
if [ -b /dev/xvde ]; then
DEV2='/dev/xvde'
if mount | grep ${DEV2} > /dev/null; then
echo "*** ${DEV2} appears to already be mounted"
echo "*** ${DEV2} unmounting and reformating"
sudo umount ${DEV2}
fi
sudo parted ${DEV2} --script -- mklabel msdos
sync
sudo partprobe
sudo mkfs.ext4 ${DEV2}
sudo mount ${DEV2} /mnt
sudo find /opt/ -mindepth 1 -maxdepth 1 -exec mv {} /mnt/ \;
sudo umount /mnt
sudo mount ${DEV2} /opt
grep -q ${DEV2} /proc/mounts || exit 1
fi
# Format Disks and setup Docker to use BTRFS # Format Disks and setup Docker to use BTRFS
sudo parted ${DEV} -s -- mklabel msdos sudo parted ${DEV} -s -- mklabel msdos
sudo rm -rf /var/lib/docker sudo rm -rf /var/lib/docker

View File

@ -158,7 +158,7 @@ function setup_logging {
} }
function prepare_images { function prepare_images {
sudo docker run -d -p 4000:5000 --restart=always -v /tmp/kolla_registry/:/var/lib/registry --name registry registry:2 sudo docker run -d -p 4000:5000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry registry:2
# NOTE(Jeffrey4l): Zuul adds all changes depend on to ZUUL_CHANGES # NOTE(Jeffrey4l): Zuul adds all changes depend on to ZUUL_CHANGES
# variable. if find "openstack/kolla:" string, it means this patch depends # variable. if find "openstack/kolla:" string, it means this patch depends
@ -175,7 +175,7 @@ function prepare_images {
filename=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz filename=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz
wget -q -c -O "/tmp/$filename" \ wget -q -c -O "/tmp/$filename" \
"${NODEPOOL_TARBALLS_MIRROR}/kolla/images/${TMP_REGISTRY}${filename}" "${NODEPOOL_TARBALLS_MIRROR}/kolla/images/${TMP_REGISTRY}${filename}"
sudo tar xzf "/tmp/$filename" -C /tmp/kolla_registry sudo tar xzf "/tmp/$filename" -C /opt/kolla_registry
fi fi
} }