From d6d1ce98022c164cc0074e6eb7850f4cb80d16fb Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 30 Sep 2021 13:39:53 -0400 Subject: [PATCH 1/8] Minor Makefile fix Signed-off-by: Chris Evich --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2b8154752f..ceecda2749 100644 --- a/Makefile +++ b/Makefile @@ -893,7 +893,7 @@ uninstall: .PHONY: clean-binaries clean-binaries: ## Remove platform/architecture specific binary files rm -rf \ - bin \ + bin .PHONY: clean clean: clean-binaries ## Clean all make artifacts From 3aa7076ff3c052e88bbee84eb2cf38f153ff89d3 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 26 Oct 2021 12:05:02 -0400 Subject: [PATCH 2/8] Cirrus: Log more things in bindings and unit tests These tasks run earlier on, so it's useful to have more detail about the test VM (in general) in case something goes terribly wrong. Signed-off-by: Chris Evich --- .cirrus.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 091b376272..171f84522e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -230,12 +230,18 @@ bindings_task: clone_script: *noop # Comes from cache setup_script: *setup main_script: *main - always: &html_artifacts + always: &logs_artifacts <<: *runner_stats # Required for `contrib/cirrus/logformatter` to work properly html_artifacts: path: ./*.html type: text/html + package_versions_script: '$SCRIPT_BASE/logcollector.sh packages' + df_script: '$SCRIPT_BASE/logcollector.sh df' + audit_log_script: '$SCRIPT_BASE/logcollector.sh audit' + journal_script: '$SCRIPT_BASE/logcollector.sh journal' + podman_system_info_script: '$SCRIPT_BASE/logcollector.sh podman' + time_script: '$SCRIPT_BASE/logcollector.sh time' # Build the "libpod" API documentation `swagger.yaml` and @@ -416,7 +422,7 @@ unit_test_task: gopath_cache: *ro_gopath_cache setup_script: *setup main_script: *main - always: *runner_stats + always: *logs_artifacts apiv2_test_task: @@ -437,14 +443,8 @@ apiv2_test_task: gopath_cache: *ro_gopath_cache setup_script: *setup main_script: *main - always: &logs_artifacts - <<: *html_artifacts - package_versions_script: '$SCRIPT_BASE/logcollector.sh packages' - df_script: '$SCRIPT_BASE/logcollector.sh df' - audit_log_script: '$SCRIPT_BASE/logcollector.sh audit' - journal_script: '$SCRIPT_BASE/logcollector.sh journal' - podman_system_info_script: '$SCRIPT_BASE/logcollector.sh podman' - time_script: '$SCRIPT_BASE/logcollector.sh time' + always: *logs_artifacts + compose_test_task: name: "compose test on $DISTRO_NV ($PRIV_NAME)" From 155a443a915059a2993cf3281d998e3c3a02dafb Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 26 Oct 2021 15:13:32 -0400 Subject: [PATCH 3/8] Cirrus: Timeout bindings test after 30m During initial testing of Fedora 35beta VM images in CI, the bindings task was timing out. In order to allow time for collection of system details (logs), execution needs to timeout earlier than the task. Under normal conditions, the bindings test finishes in about 10-minutes. Use the ginkgo timeout option to limit execution, so it times out after 30 minutes. Also add the `-progress` option so the output more closely resembles how ginkgo runs the integration tests. Signed-off-by: Chris Evich --- contrib/cirrus/runner.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh index 8ef2a6e646..4c27dfa4b7 100755 --- a/contrib/cirrus/runner.sh +++ b/contrib/cirrus/runner.sh @@ -84,7 +84,8 @@ function _run_bindings() { # Subshell needed so logformatter will write output in cwd; if it runs in # the subdir, .cirrus.yml will not find the html'ized log - (cd pkg/bindings/test && ginkgo -trace -noColor -debug -r) |& logformatter + (cd pkg/bindings/test && \ + ginkgo -progress -trace -noColor -debug -timeout 30m -r -v) |& logformatter } function _run_docker-py() { From f3021f3f6eff325236d9bdeccb9d7cc58bf1ce2d Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 4 Nov 2021 10:37:38 -0400 Subject: [PATCH 4/8] Cirrus: Fix bindings test hang b/c logging config mismatch Massive thanks to @edsantiago for tracking this down. Ref: https://github.com/containers/podman/issues/12175 Signed-off-by: Chris Evich --- pkg/bindings/test/common_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/bindings/test/common_test.go b/pkg/bindings/test/common_test.go index d996595bfb..233666a480 100644 --- a/pkg/bindings/test/common_test.go +++ b/pkg/bindings/test/common_test.go @@ -151,7 +151,7 @@ func createTempDirInTempDir() (string, error) { } func (b *bindingTest) startAPIService() *gexec.Session { - cmd := []string{"--log-level=debug", "--events-backend=file", "system", "service", "--timeout=0", b.sock} + cmd := []string{"--log-level=debug", "system", "service", "--timeout=0", b.sock} session := b.runPodman(cmd) sock := strings.TrimPrefix(b.sock, "unix://") From 5bd43fbea7e79e3a9b6365263569c19ac39a9fe0 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 9 Nov 2021 11:55:14 -0500 Subject: [PATCH 5/8] Cirrus: Workaround log_driver=journald setting In F35 the hard-coded default (from containers-common-1-32.fc35.noarch) is 'journald' despite the upstream repository having this line commented-out. Containerized integration tests cannot run with 'journald' as there is no daemon/process there to receive them. Signed-off-by: Chris Evich --- contrib/cirrus/setup_environment.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh index 90d28b7ac0..80ecd89ce8 100755 --- a/contrib/cirrus/setup_environment.sh +++ b/contrib/cirrus/setup_environment.sh @@ -171,6 +171,18 @@ case "$TEST_ENVIRON" in # affected/related tests are sensitive to this variable. warn "Disabling usernamespace integration testing" echo "SKIP_USERNS=1" >> /etc/ci_environment + + # In F35 the hard-coded default + # (from containers-common-1-32.fc35.noarch) is 'journald' despite + # the upstream repository having this line commented-out. + # Containerized integration tests cannot run with 'journald' + # as there is no daemon/process there to receive them. + cconf="/usr/share/containers/containers.conf" + note="- commented-out by setup_environment.sh" + if grep -Eq '^log_driver.+journald' "$cconf"; then + warn "Patching out $cconf journald log_driver" + sed -r -i -e "s/^log_driver(.*)/# log_driver\1 $note/" "$cconf" + fi fi ;; *) die_unknown TEST_ENVIRON From 226be65bdd19b3e3eb69d6e7016980654a300b10 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Fri, 12 Nov 2021 09:09:28 -0500 Subject: [PATCH 6/8] Revert "Cirrus: Temp. disable prior-fedora testing" This reverts commit f35d7f4dc76ca02b741e37f31ddc68c1d3ca9331. Signed-off-by: Chris Evich --- .cirrus.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 171f84522e..53d854b9c5 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -148,11 +148,11 @@ build_task: CTR_FQIN: ${FEDORA_CONTAINER_FQIN} # ID for re-use of build output _BUILD_CACHE_HANDLE: ${FEDORA_NAME}-build-${CIRRUS_BUILD_ID} - # - env: &priorfedora_envvars - # DISTRO_NV: ${PRIOR_FEDORA_NAME} - # VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME} - # CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN} - # _BUILD_CACHE_HANDLE: ${PRIOR_FEDORA_NAME}-build-${CIRRUS_BUILD_ID} + - env: &priorfedora_envvars + DISTRO_NV: ${PRIOR_FEDORA_NAME} + VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME} + CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN} + _BUILD_CACHE_HANDLE: ${PRIOR_FEDORA_NAME}-build-${CIRRUS_BUILD_ID} - env: &ubuntu_envvars DISTRO_NV: ${UBUNTU_NAME} VM_IMAGE_NAME: ${UBUNTU_CACHE_IMAGE_NAME} @@ -408,7 +408,7 @@ unit_test_task: - validate matrix: - env: *stdenvars - #- env: *priorfedora_envvars + - env: *priorfedora_envvars - env: *ubuntu_envvars # Special-case: Rootless on latest Fedora (standard) VM - name: "Rootless unit on $DISTRO_NV" @@ -522,11 +522,11 @@ container_integration_test_task: _BUILD_CACHE_HANDLE: ${FEDORA_NAME}-build-${CIRRUS_BUILD_ID} VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME} CTR_FQIN: ${FEDORA_CONTAINER_FQIN} - # - env: - # DISTRO_NV: ${PRIOR_FEDORA_NAME} - # _BUILD_CACHE_HANDLE: ${PRIOR_FEDORA_NAME}-build-${CIRRUS_BUILD_ID} - # VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME} - # CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN} + - env: + DISTRO_NV: ${PRIOR_FEDORA_NAME} + _BUILD_CACHE_HANDLE: ${PRIOR_FEDORA_NAME}-build-${CIRRUS_BUILD_ID} + VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME} + CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN} gce_instance: *standardvm timeout_in: 90m env: From 3ee2d2367ac76b1448daa2562eda46d4e98c5e9a Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Wed, 17 Nov 2021 15:46:32 -0500 Subject: [PATCH 7/8] Cirrus: Partially revert catatonit --force install VM Images created as of this commit contain the new/required version. Remove the `--force` install, but retain the hack script's ability to support this in the future. Signed-off-by: Chris Evich --- contrib/cirrus/setup_environment.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh index 80ecd89ce8..1a07aeffc8 100755 --- a/contrib/cirrus/setup_environment.sh +++ b/contrib/cirrus/setup_environment.sh @@ -19,13 +19,6 @@ die_unknown() { die "Unknown/unsupported \$$var_name '$var_value'" } -msg "************************************************************" -msg "FIXME: force-install catatonit 0.17.0 until CI images are updated" -msg "************************************************************" -# FIXME: this is just a temporary workaround to force-install -# catatonit 0.17.0. Please remove once the images are updated. -./hack/install_catatonit.sh --force - msg "************************************************************" msg "Setting up runtime environment" msg "************************************************************" From 7f52bd8437dd907dec7d7a926b25b0f56b1c4c49 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Wed, 29 Sep 2021 16:47:07 -0400 Subject: [PATCH 8/8] Cirrus: Bump Fedora to release 35 The Fedora 35 cloud images have switched to UEFI boot with a GPT partition. Formerly, all Fedora images included support for runtime re-partitioning. However, the requirement to test alternate storage has since been dropped/removed. Rather than maintain a disused feature, and supporting scripts, these Fedora VM images have reverted to the default: Automatically resize to 100% on boot. Signed-off-by: Chris Evich --- .cirrus.yml | 6 +-- contrib/cirrus/add_second_partition.sh | 63 -------------------------- contrib/cirrus/setup_environment.sh | 12 +---- 3 files changed, 5 insertions(+), 76 deletions(-) delete mode 100644 contrib/cirrus/add_second_partition.sh diff --git a/.cirrus.yml b/.cirrus.yml index 53d854b9c5..961104e965 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -24,12 +24,12 @@ env: #### #### Cache-image names to test with (double-quotes around names are critical) #### - FEDORA_NAME: "fedora-34" - PRIOR_FEDORA_NAME: "fedora-33" + FEDORA_NAME: "fedora-35" + PRIOR_FEDORA_NAME: "fedora-34" UBUNTU_NAME: "ubuntu-2110" # Google-cloud VM Images - IMAGE_SUFFIX: "c4955591916388352" + IMAGE_SUFFIX: "c6226133906620416" FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}" PRIOR_FEDORA_CACHE_IMAGE_NAME: "prior-fedora-${IMAGE_SUFFIX}" UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${IMAGE_SUFFIX}" diff --git a/contrib/cirrus/add_second_partition.sh b/contrib/cirrus/add_second_partition.sh deleted file mode 100644 index 322dd25121..0000000000 --- a/contrib/cirrus/add_second_partition.sh +++ /dev/null @@ -1,63 +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! - -set -eo pipefail - -# shellcheck source=./lib.sh -source $(dirname $0)/lib.sh - -# $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. -NEW_PART_START="50%" -NEW_PART_END="100%" - - -if [[ ! -r "/root" ]] || [[ -r "/root/second_partition_ready" ]] -then - warn "Ignoring attempted execution of $(basename $0)" - exit 0 -fi - -[[ -x "$(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 - msg "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" - -msg "New partition table:" -$PPRINTCMD - -msg "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 -msg "Recording newly available disk partition device into /root/second_partition_ready" -echo "${SLASH_DEVICE}2" > /root/second_partition_ready diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh index 1a07aeffc8..8f535c7e77 100755 --- a/contrib/cirrus/setup_environment.sh +++ b/contrib/cirrus/setup_environment.sh @@ -119,12 +119,6 @@ case "$OS_RELEASE_ID" in ubuntu) ;; fedora) if ((CONTAINER==0)); then - msg "Configuring / Expanding host storage." - # VM is setup to allow flexibility in testing alternate storage. - # For general use, simply make use of all available space. - bash "$SCRIPT_BASE/add_second_partition.sh" - $SCRIPT_BASE/logcollector.sh df - # All SELinux distros need this for systemd-in-a-container msg "Enabling container_manage_cgroup" setsebool container_manage_cgroup true @@ -224,10 +218,8 @@ case "$TEST_FLAVOR" in remove_packaged_podman_files make install PREFIX=/usr ETCDIR=/etc - # TODO: Don't install stuff at test runtime! Do this from - # cache_images/fedora_packaging.sh in containers/automation_images - # and STRONGLY prefer installing RPMs vs pip packages in venv - dnf install -y python3-virtualenv python3-pytest4 + msg "Installing previously downloaded/cached packages" + dnf install -y $PACKAGE_DOWNLOAD_DIR/python3*.rpm virtualenv venv source venv/bin/activate pip install --upgrade pip