From 201197553fe65eacbafefeee607244507fdf6ef1 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 29 Mar 2022 13:50:40 -0400 Subject: [PATCH] Cirrus: Update VM Images + env. var. name For consistency with CI in other repositories, update the variable name. Also, remove some variable definitions which are not included in the common automation library. Finally, strip off the special Fedora partition setup, as it's no-longer supported in the VM images. Signed-off-by: Chris Evich --- .cirrus.yml | 10 ++--- contrib/cirrus/add_second_partition.sh | 62 -------------------------- contrib/cirrus/lib.sh | 7 --- contrib/cirrus/setup.sh | 2 - 4 files changed, 5 insertions(+), 76 deletions(-) delete mode 100644 contrib/cirrus/add_second_partition.sh diff --git a/.cirrus.yml b/.cirrus.yml index 726acc3aef..28ad751a72 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -24,10 +24,10 @@ env: # GCE project where images live IMAGE_PROJECT: "libpod-218412" # VM Image built in containers/automation_images - _BUILT_IMAGE_SUFFIX: "c6431352024203264" - FEDORA_CACHE_IMAGE_NAME: "fedora-${_BUILT_IMAGE_SUFFIX}" - PRIOR_FEDORA_CACHE_IMAGE_NAME: "prior-fedora-${_BUILT_IMAGE_SUFFIX}" - UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${_BUILT_IMAGE_SUFFIX}" + IMAGE_SUFFIX: "c4512539143831552" + FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}" + PRIOR_FEDORA_CACHE_IMAGE_NAME: "prior-fedora-${IMAGE_SUFFIX}" + UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${IMAGE_SUFFIX}" #### #### Command variables to help avoid duplication @@ -132,7 +132,7 @@ lint_task: meta_task: container: - image: "quay.io/libpod/imgts:${_BUILT_IMAGE_SUFFIX}" + image: "quay.io/libpod/imgts:${IMAGE_SUFFIX}" cpu: 1 memory: 1 diff --git a/contrib/cirrus/add_second_partition.sh b/contrib/cirrus/add_second_partition.sh deleted file mode 100644 index 7e12ce2737..0000000000 --- a/contrib/cirrus/add_second_partition.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash - -# N/B: This script could mega f*!@up your disks if run by mistake. -# it is left without the execute-bit on purpose! - -# $SLASH_DEVICE is the disk device to be f*xtuP -SLASH_DEVICE="/dev/sda" # Always the case on GCP - -# The unallocated space results from the difference in disk-size between VM Image -# and runtime request. The check_image.sh test includes a minimum-space check, -# with the Image size set initially lower by contrib/cirrus/packer/libpod_images.yml -NEW_PART_START="50%" -NEW_PART_END="100%" - -set -eo pipefail - -source $(dirname $0)/lib.sh - -if [[ ! -r "/root" ]] || [[ -r "/root/second_partition_ready" ]] -then - echo "Warning: Ignoring attempted execution of $(basename $0)" - exit 0 -fi - -[[ -n "type -P parted" ]] || \ - die "The parted command is required." - -[[ ! -b ${SLASH_DEVICE}2 ]] || \ - die "Found unexpected block device ${SLASH_DEVICE}2" - -PPRINTCMD="parted --script ${SLASH_DEVICE} print" -FINDMNTCMD="findmnt --source=${SLASH_DEVICE}1 --mountpoint=/ --canonicalize --evaluate --first-only --noheadings" -TMPF=$(mktemp -p '' $(basename $0)_XXXX) -trap "rm -f $TMPF" EXIT - -if $FINDMNTCMD | tee $TMPF | egrep -q "^/\s+${SLASH_DEVICE}1" -then - echo "Repartitioning original partition table:" - $PPRINTCMD -else - die "Unexpected output from '$FINDMNTCMD': $(<$TMPF)" -fi - -echo "Adding partition offset within unpartitioned space." -parted --script --align optimal /dev/sda unit % mkpart primary "" "" "$NEW_PART_START" "$NEW_PART_END" - -echo "New partition table:" -$PPRINTCMD - -echo "Growing ${SLASH_DEVICE}1 meet start of ${SLASH_DEVICE}2" -growpart ${SLASH_DEVICE} 1 - -FSTYPE=$(findmnt --first-only --noheadings --output FSTYPE ${SLASH_DEVICE}1) -echo "Expanding $FSTYPE filesystem on ${SLASH_DEVICE}1" -case $FSTYPE in - ext*) resize2fs ${SLASH_DEVICE}1 ;; - *) die "Script $(basename $0) doesn't know how to resize a $FSTYPE filesystem." ;; -esac - -# Must happen last - signals completion to other tooling -echo "Recording newly available disk partition device into /root/second_partition_ready" -echo "${SLASH_DEVICE}2" > /root/second_partition_ready diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index a7b1628597..6e6323e0d3 100755 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -67,13 +67,6 @@ EPOCH_TEST_COMMIT="$CIRRUS_BASE_SHA" # Unsafe env. vars for display SECRET_ENV_RE='(IRCID)|(ACCOUNT)|(^GC[EP]..+)|(SSH)' -# GCE image-name compatible string representation of distribution name -OS_RELEASE_ID="$(source /etc/os-release; echo $ID)" -# GCE image-name compatible string representation of distribution _major_ version -OS_RELEASE_VER="$(source /etc/os-release; echo $VERSION_ID | tr -d '.')" -# Combined to ease soe usage -OS_REL_VER="${OS_RELEASE_ID}-${OS_RELEASE_VER}" - # Working with dnf + timeout/retry SHORT_DNFY='lilto dnf -y' LONG_DNFY='bigto dnf -y' diff --git a/contrib/cirrus/setup.sh b/contrib/cirrus/setup.sh index 9150df4bce..e553c739cc 100755 --- a/contrib/cirrus/setup.sh +++ b/contrib/cirrus/setup.sh @@ -12,8 +12,6 @@ cd $GOSRC msg "Setting up $OS_RELEASE_ID $OS_RELEASE_VER" case "$OS_RELEASE_ID" in fedora) - # Required on Fedora VM images - bash "$SCRIPT_BASE/add_second_partition.sh" [[ -z "$RPMS_CONFLICTING" ]] || \ $SHORT_DNFY erase $RPMS_CONFLICTING $SHORT_DNFY install zstd