summaryrefslogtreecommitdiff
path: root/contrib/cirrus
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cirrus')
-rw-r--r--contrib/cirrus/README.md45
-rwxr-xr-xcontrib/cirrus/check_image.sh5
-rw-r--r--contrib/cirrus/lib.sh2
-rw-r--r--contrib/cirrus/packer/fedora_setup.sh1
-rw-r--r--contrib/cirrus/packer/ubuntu_setup.sh11
5 files changed, 46 insertions, 18 deletions
diff --git a/contrib/cirrus/README.md b/contrib/cirrus/README.md
index 7aa8881d6..779f95d95 100644
--- a/contrib/cirrus/README.md
+++ b/contrib/cirrus/README.md
@@ -124,35 +124,46 @@ you'll find the new image names displayed at the end of the
```
...cut...
-==> Builds finished. The artifacts of successful builds are:
---> ubuntu-18: A disk image was created: ubuntu-18-libpod-5699523102900224
---> ubuntu-18:
---> fedora-29: A disk image was created: fedora-29-libpod-5699523102900224
---> fedora-29:
---> fedora-28: A disk image was created: fedora-28-libpod-5699523102900224
+
+[+0747s] ==> Builds finished. The artifacts of successful builds are:
+[+0747s] --> ubuntu-18: A disk image was created: ubuntu-18-libpod-5664838702858240
+[+0747s] --> fedora-29: A disk image was created: fedora-29-libpod-5664838702858240
+[+0747s] --> fedora-30: A disk image was created: fedora-30-libpod-5664838702858240
+[+0747s] --> ubuntu-19: A disk image was created: ubuntu-19-libpod-5664838702858240
```
-Now edit `.cirrus.yml`, updating the `*_IMAGE_NAME` lines to reflect the
-images from above:
+Notice the suffix on all the image names comes from the env. var. set in
+*.cirrus.yml*: `BUILT_IMAGE_SUFFIX: "-${CIRRUS_REPO_NAME}-${CIRRUS_BUILD_ID}"`.
+Edit `.cirrus.yml`, in the top-level `env` section, update the suffix variable
+used at runtime to launch VMs for testing:
```yaml
env:
...cut...
####
- #### Cache-image names to test with
+ #### Cache-image names to test with (double-quotes around names are critical)
###
- FEDORA_CACHE_IMAGE_NAME: "fedora-29-libpod-5699523102900224"
- PRIOR_FEDORA_CACHE_IMAGE_NAME: "fedora-28-libpod-5699523102900224"
- UBUNTU_CACHE_IMAGE_NAME: "ubuntu-18-libpod-5699523102900224"
+ _BUILT_IMAGE_SUFFIX: "libpod-5664838702858240"
+ FEDORA_CACHE_IMAGE_NAME: "fedora-30-${_BUILT_IMAGE_SUFFIX}"
+ PRIOR_FEDORA_CACHE_IMAGE_NAME: "fedora-29-${_BUILT_IMAGE_SUFFIX}"
...cut...
```
-***NOTE:*** If re-using the same PR with new images in `.cirrus.yml`,
-take care to also *update the PR description* to remove
-the magic ``***CIRRUS: TEST IMAGES***`` string. Keeping it and
-`--force` pushing would needlessly cause Cirrus-CI to build
-and test images again.
+***NOTES:***
+* If re-using the same PR with new images in `.cirrus.yml`,
+ take care to also *update the PR description* to remove
+ the magic ``***CIRRUS: TEST IMAGES***`` string. Keeping it and
+ `--force` pushing would needlessly cause Cirrus-CI to build
+ and test images again.
+* In the future, if you need to review the log from the build that produced
+ the referenced image:
+
+ * Note the Build ID from the image name (for example `5664838702858240`).
+ * Go to that build in the Cirrus-CI WebUI, using the build ID in the URL.
+ (For example `https://cirrus-ci.com/build/5664838702858240`.
+ * Choose the *test_build_cache_images* task.
+ * Open the *build_vm_images* script section.
### `release` Task
diff --git a/contrib/cirrus/check_image.sh b/contrib/cirrus/check_image.sh
index 39f49d0a1..5423f67d6 100755
--- a/contrib/cirrus/check_image.sh
+++ b/contrib/cirrus/check_image.sh
@@ -56,6 +56,11 @@ then
item_test "On ubuntu /usr/bin/runc is /usr/lib/cri-o-runc/sbin/runc" "$SAMESAME" -eq "0" || let "NFAILS+=1"
fi
+if [[ "$OS_RELEASE_ID" == "ubuntu" ]]
+then
+ item_test "On ubuntu, no periodic apt crap is enabled" -z "$(egrep $PERIODIC_APT_RE /etc/apt/apt.conf.d/*)"
+fi
+
echo "Checking items specific to ${PACKER_BUILDER_NAME}${BUILT_IMAGE_SUFFIX}"
case "$PACKER_BUILDER_NAME" in
xfedora*)
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh
index f81a8d501..fe4c25e73 100644
--- a/contrib/cirrus/lib.sh
+++ b/contrib/cirrus/lib.sh
@@ -73,6 +73,8 @@ UPLDREL_IMAGE="quay.io/libpod/upldrel:latest"
export DEBIAN_FRONTEND="noninteractive"
SUDOAPTGET="ooe.sh sudo -E apt-get -qq --yes"
SUDOAPTADD="ooe.sh sudo -E add-apt-repository --yes"
+# Regex that finds enabled periodic apt configuration items
+PERIODIC_APT_RE='^(APT::Periodic::.+")1"\;'
# Short-cuts for retrying/timeout calls
LILTO="timeout_attempt_delay_command 24s 5 30s"
BIGTO="timeout_attempt_delay_command 300s 5 30s"
diff --git a/contrib/cirrus/packer/fedora_setup.sh b/contrib/cirrus/packer/fedora_setup.sh
index f84645a04..8e0a2b2ee 100644
--- a/contrib/cirrus/packer/fedora_setup.sh
+++ b/contrib/cirrus/packer/fedora_setup.sh
@@ -26,6 +26,7 @@ ooe.sh sudo dnf install -y \
atomic-registries \
autoconf \
automake \
+ bash-completion \
bats \
bridge-utils \
btrfs-progs-devel \
diff --git a/contrib/cirrus/packer/ubuntu_setup.sh b/contrib/cirrus/packer/ubuntu_setup.sh
index da7d457a5..c94e74a08 100644
--- a/contrib/cirrus/packer/ubuntu_setup.sh
+++ b/contrib/cirrus/packer/ubuntu_setup.sh
@@ -18,8 +18,16 @@ trap "sudo rm -rf $GOPATH" EXIT
# Ensure there are no disruptive periodic services enabled by default in image
systemd_banish
+# Stop disruption upon boot ASAP after booting
+echo "Disabling all packaging activity on boot"
+# Don't let sed process sed's temporary files
+_FILEPATHS=$(sudo ls -1 /etc/apt/apt.conf.d)
+for filename in $_FILEPATHS; do \
+ echo "Checking/Patching $filename"
+ sudo sed -i -r -e "s/$PERIODIC_APT_RE/"'\10"\;/' "/etc/apt/apt.conf.d/$filename"; done
+
echo "Updating/configuring package repositories."
-$LILTO $SUDOAPTGET update
+$BIGTO $SUDOAPTGET update
echo "Upgrading all packages"
$BIGTO $SUDOAPTGET upgrade
@@ -41,6 +49,7 @@ $BIGTO $SUDOAPTGET install \
aufs-tools \
autoconf \
automake \
+ bash-completion \
bats \
bison \
btrfs-tools \