Skip to content

Commit

Permalink
Merge pull request containers#18545 from cevich/podman_next
Browse files Browse the repository at this point in the history
Cirrus: Add support for podman-next magic
  • Loading branch information
openshift-merge-robot authored May 18, 2023
2 parents 68a25de + d1dcb08 commit abea786
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 51 deletions.
5 changes: 0 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ bindings_task:
only_if: >-
$CIRRUS_PR != '' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:COPR.*' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:BUILD.*'
depends_on:
- build
Expand Down Expand Up @@ -459,7 +458,6 @@ docker-py_test_task:
only_if: &not_tag_branch_build_docs >-
$CIRRUS_PR != '' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:COPR.*' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:BUILD.*'

depends_on:
Expand Down Expand Up @@ -566,7 +564,6 @@ windows_smoke_test_task:
$CIRRUS_TAG == '' &&
$CIRRUS_CRON != 'multiarch' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:COPR.*' &&
$CIRRUS_BRANCH !=~ 'v[0-9\.]+-rhel' &&
$CIRRUS_BASE_BRANCH !=~ 'v[0-9\.]+-rhel'
depends_on:
Expand Down Expand Up @@ -684,7 +681,6 @@ podman_machine_task:
only_if: &not_tag_build_docs_multiarch >-
$CIRRUS_TAG == '' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:COPR.*' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:BUILD.*' &&
$CIRRUS_CRON != 'multiarch'
depends_on:
Expand Down Expand Up @@ -1090,7 +1086,6 @@ artifacts_task:
# Docs: ./contrib/cirrus/CIModes.md
only_if: >-
$CIRRUS_CHANGE_TITLE !=~ '.*CI:DOCS.*' &&
$CIRRUS_CHANGE_TITLE !=~ '.*CI:COPR.*' &&
$CIRRUS_CRON != 'multiarch' &&
$CIRRUS_BRANCH !=~ 'v[0-9\.]+-rhel' &&
$CIRRUS_BASE_BRANCH !=~ 'v[0-9\.]+-rhel'
Expand Down
19 changes: 6 additions & 13 deletions contrib/cirrus/CIModes.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ of this document, it's not possible to override the behavior of `$CIRRUS_PR`.
+ meta
+ success

### Intended `[CI:COPR]` PR Tasks:
+ *build*
+ validate
+ swagger
+ meta
+ success

### Intended `[CI:BUILD]` PR Tasks:
+ *build*
+ validate
Expand All @@ -96,13 +89,13 @@ of this document, it's not possible to override the behavior of `$CIRRUS_PR`.
+ success
+ artifacts

### Intended `[CI:NVAV=update]` or `[CI:NVAV=main]` behavior:
### Intended `[CI:NEXT]` behavior:

If and only if the PR is in **draft-mode**, either update Fedora CI VMs to the
latest Netavark/Aardvark-dns RPMs ("update" keyword), or install the most
recent package builds from their `main` branch ("main" keyword). These are
**runtime changes** only, and will not persist or impact other PRs
in any way.
If and only if the PR is in **draft-mode**, update Fedora CI VMs at runtime
to the latest packages available in the podman-next COPR repo. These packages
represent primary podman dependencies, and are regularly built from their
upstream repos. These are **runtime changes** only, and will not persist
or impact other PRs in any way.

The intent is to temporarily support testing of updates with the latest podman
code & tests. To help prevent accidents, when the PR is not in draft-mode, the
Expand Down
33 changes: 0 additions & 33 deletions contrib/cirrus/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -256,39 +256,6 @@ use_netavark() {
# N/B: The CNI packages are still installed and available. This is
# on purpose, since CI needs to verify the selection mechanisms are
# functional when both are available.

# See ./contrib/cirrus/CIModes.md.
# Vars defined by cirrus-ci
# shellcheck disable=SC2154
if [[ ! "$OS_RELEASE_ID" =~ "debian" ]] && \
[[ "$CIRRUS_CHANGE_TITLE" =~ CI:[AN]V[AN]V= ]]
then
# shellcheck disable=SC2154
if [[ "$CIRRUS_PR_DRAFT" != "true" ]]; then
die "Magic 'CI:NVAV=*' string can only be used on DRAFT PRs"
fi

magickind=$(sed -r -e 's~(.*CI:[AN]V[AN]V=)(\w+)(.*)~\2~' <<<"$CIRRUS_CHANGE_TITLE")

# The update source scheme is defined during VM image build.
# See c/automation_images repo. cache_images/fedora_packaging.sh
repokind="updates-testing" # $DISTRO_NV==$FEDORA_NAME
# shellcheck disable=SC2154
if [[ "$DISTRO_NV" =~ $PRIOR_FEDORA_NAME ]]; then
repokind="updates"
# else we're not running fedora, or .cirrus.yml env. vars are setup wrong.
fi

if [[ "$magickind" == "update" ]]; then
warn "Updating netavark/aardvark RPM packages from ***the fedora $repokind repo.***"
elif [[ "$magickind" == "main" ]]; then
warn "Installing latest netavark/aardvark packages from their main branches using ***the podman-next COPR repo***"
showrun dnf copr enable rhcontainerbot/podman-next -y
else
die "Unknown CI:NVAV= '$magickind' keyword. Only 'update' and 'main' are supported."
fi
showrun dnf upgrade -y netavark aardvark-dns
fi
}

# Remove all files provided by the distro version of podman.
Expand Down
22 changes: 22 additions & 0 deletions contrib/cirrus/setup_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,28 @@ case "$TEST_FLAVOR" in
*) die_unknown TEST_FLAVOR
esac

# See ./contrib/cirrus/CIModes.md.
# Vars defined by cirrus-ci
# shellcheck disable=SC2154
if [[ ! "$OS_RELEASE_ID" =~ "debian" ]] && \
[[ "$CIRRUS_CHANGE_TITLE" =~ CI:NEXT ]]
then
# shellcheck disable=SC2154
if [[ "$CIRRUS_PR_DRAFT" != "true" ]]; then
die "Magic 'CI:NEXT' string can only be used on DRAFT PRs"
fi

showrun dnf copr enable rhcontainerbot/podman-next -y

# DNF ignores repos that don't exist. For example, updates-testing is not
# enabled on Fedora N-1 CI VMs. Don't updated everything, isolate just the
# podman-next COPR updates.
showrun dnf update -y \
"--enablerepo=copr:copr.fedorainfracloud.org:rhcontainerbot:podman-next" \
"--disablerepo=copr:copr.fedorainfracloud.org:sbrivio:passt" \
"--disablerepo=fedora*" "--disablerepo=updates*"
fi

# Must be the very last command. Prevents setup from running twice.
echo 'SETUP_ENVIRONMENT=1' >> /etc/ci_environment
echo -e "\n# End of global variable definitions" \
Expand Down

0 comments on commit abea786

Please sign in to comment.