Fix gates out of disk space
Sometimes gates fails due lack of space,
post merge jobs gates fails always for oraclelinux
binary, not being able create a tarball registry.
This change mounts a second disk in opt and moves
registry data to opt.
Disk format commands are excepts from devstack-gate:
dc49f9e6eb/functions.sh (L306)
Closes-Bug: #1713652
Change-Id: I883e51042841709eb9ab348cfdce9fecbd4fb890
This commit is contained in:
parent
bbeda30a9d
commit
d0a5ff1050
@ -85,7 +85,7 @@ function pack_registry {
|
|||||||
|
|
||||||
FILENAME=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz
|
FILENAME=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz
|
||||||
sudo docker stop registry
|
sudo docker stop registry
|
||||||
sudo tar -zcf "images/$FILENAME" -C /tmp/kolla_registry .
|
sudo tar -zcf "images/$FILENAME" -C /opt/kolla_registry .
|
||||||
sudo docker start registry
|
sudo docker start registry
|
||||||
sudo chmod 755 -R images
|
sudo chmod 755 -R images
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
export ZUUL_REF=$ZUUL_REF
|
export ZUUL_REF=$ZUUL_REF
|
||||||
export BRANCH=$(echo "$ZUUL_BRANCH" | cut -d/ -f2)
|
export BRANCH=$(echo "$ZUUL_BRANCH" | cut -d/ -f2)
|
||||||
export TMP_REGISTRY="tmp/"
|
export TMP_REGISTRY="opt/"
|
||||||
export PUBLISHER=1
|
export PUBLISHER=1
|
||||||
export SIGNOFF_FILENAME=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.txt
|
export SIGNOFF_FILENAME=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.txt
|
||||||
export FILENAME=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz
|
export FILENAME=${BASE_DISTRO}-${INSTALL_TYPE}-registry-${BRANCH}.tar.gz
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -180,9 +180,9 @@ function setup_logging {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setup_registry {
|
function setup_registry {
|
||||||
sudo mkdir /tmp/kolla_registry
|
sudo mkdir /opt/kolla_registry
|
||||||
sudo chmod -R 644 /tmp/kolla_registry
|
sudo chmod -R 644 /opt/kolla_registry
|
||||||
docker run -d -p 4000:5000 --restart=always -v /tmp/kolla_registry/:/var/lib/registry --name registry registry:2
|
docker run -d -p 4000:5000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry registry:2
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_logging
|
setup_logging
|
||||||
|
Loading…
Reference in New Issue
Block a user