summaryrefslogtreecommitdiff
path: root/contrib/cirrus/setup_environment.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cirrus/setup_environment.sh')
-rwxr-xr-xcontrib/cirrus/setup_environment.sh69
1 files changed, 56 insertions, 13 deletions
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh
index df510deef..eceb80b00 100755
--- a/contrib/cirrus/setup_environment.sh
+++ b/contrib/cirrus/setup_environment.sh
@@ -6,15 +6,19 @@ source $(dirname $0)/lib.sh
req_env_var USER HOME GOSRC SCRIPT_BASE SETUP_MARKER_FILEPATH
-show_env_vars
-
# Ensure this script only executes successfully once and always logs ending timestamp
-[[ ! -e "$SETUP_MARKER_FILEPATH" ]] || exit 0
+if [[ -e "$SETUP_MARKER_FILEPATH" ]]; then
+ show_env_vars
+ exit 0
+fi
+
exithandler() {
RET=$?
echo "."
echo "$(basename $0) exit status: $RET"
[[ "$RET" -eq "0" ]] && date +%s >> "$SETUP_MARKER_FILEPATH"
+ show_env_vars
+ [[ "$RET" -eq "0" ]] || warn "Non-zero exit caused by error ABOVE env. var. display."
}
trap exithandler EXIT
@@ -35,18 +39,26 @@ done
cd "${GOSRC}/"
case "${OS_RELEASE_ID}" in
ubuntu)
- CRIO_RUNC_PATH="/usr/lib/cri-o-runc/sbin/runc"
- if dpkg -L cri-o-runc | grep -m 1 -q "$CRIO_RUNC_PATH"
- then
- echo "Linking $CRIO_RUNC_PATH to /usr/bin/runc for ease of testing."
- ln -f "$CRIO_RUNC_PATH" "/usr/bin/runc"
- fi
;;
fedora)
# All SELinux distros need this for systemd-in-a-container
setsebool container_manage_cgroup true
if [[ "$ADD_SECOND_PARTITION" == "true" ]]; then
- bash "$SCRIPT_BASE/add_second_partition.sh"; fi
+ bash "$SCRIPT_BASE/add_second_partition.sh"
+ fi
+
+ warn "Switching io scheduler to 'deadline' to avoid RHBZ 1767539"
+ warn "aka https://bugzilla.kernel.org/show_bug.cgi?id=205447"
+ echo "mq-deadline" > /sys/block/sda/queue/scheduler
+ cat /sys/block/sda/queue/scheduler
+
+ if [[ "$ADD_SECOND_PARTITION" == "true" ]]; then
+ bash "$SCRIPT_BASE/add_second_partition.sh"
+ fi
+
+ warn "Forcing systemd cgroup manager"
+ X=$(echo "export CGROUP_MANAGER=systemd" | \
+ tee -a /etc/environment) && eval "$X" && echo "$X"
;;
centos) # Current VM is an image-builder-image no local podman/testing
echo "No further setup required for VM image building"
@@ -58,13 +70,41 @@ esac
# Reload to incorporate any changes from above
source "$SCRIPT_BASE/lib.sh"
+case "$CG_FS_TYPE" in
+ tmpfs)
+ warn "Forcing testing with runc instead of crun"
+ X=$(echo "export OCI_RUNTIME=/usr/bin/runc" | \
+ tee -a /etc/environment) && eval "$X" && echo "$X"
+ ;;
+ cgroup2fs)
+ # This is necessary since we've built/installed from source, which uses runc as the default.
+ warn "Forcing testing with crun instead of runc"
+ X=$(echo "export OCI_RUNTIME=/usr/bin/crun" | \
+ tee -a /etc/environment) && eval "$X" && echo "$X"
+
+ if [[ "$MOD_LIBPOD_CONF" == "true" ]]; then
+ warn "Updating runtime setting in repo. copy of libpod.conf"
+ sed -i -r -e 's/^runtime = "runc"/runtime = "crun"/' $GOSRC/libpod.conf
+ git diff $GOSRC/libpod.conf
+ fi
+
+ if [[ "$OS_RELEASE_ID" == "fedora" ]]; then
+ warn "Upgrading to the latest crun"
+ # Normally not something to do for stable testing
+ # but crun is new, and late-breaking fixes may be required
+ # on short notice
+ dnf update -y crun
+ fi
+ ;;
+ *)
+ die 110 "Unsure how to handle cgroup filesystem type '$CG_FS_TYPE'"
+ ;;
+esac
+
# Must execute before possible setup_rootless()
make install.tools
case "$SPECIALMODE" in
- cgroupv2)
- remove_packaged_podman_files # we're building from source
- ;;
none)
[[ -n "$CROSS_PLATFORM" ]] || \
remove_packaged_podman_files
@@ -72,6 +112,9 @@ case "$SPECIALMODE" in
endpoint)
remove_packaged_podman_files
;;
+ bindings)
+ remove_packaged_podman_files
+ ;;
rootless)
# Only do this once, even if ROOTLESS_USER (somehow) changes
if ! grep -q 'ROOTLESS_USER' /etc/environment