-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to F36 CI VM Images + Testing netavark/aardvark-dns #13376
Changes from 4 commits
a73425a
3a07fc4
cd7cff6
cf449e8
d4e30b3
9c0c29f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,7 @@ EPOCH_TEST_COMMIT="$CIRRUS_BASE_SHA" | |
# testing operations on all platforms and versions. This is necessary | ||
# to avoid needlessly passing through global/system values across | ||
# contexts, such as host->container or root->rootless user | ||
PASSTHROUGH_ENV_RE='(^CI.*)|(^CIRRUS)|(^DISTRO_NV)|(^GOPATH)|(^GOCACHE)|(^GOSRC)|(^SCRIPT_BASE)|(CGROUP_MANAGER)|(OCI_RUNTIME)|(^TEST.*)|(^PODBIN_NAME)|(^PRIV_NAME)|(^ALT_NAME)|(^ROOTLESS_USER)|(SKIP_USERNS)|(.*_NAME)|(.*_FQIN)' | ||
PASSTHROUGH_ENV_RE='(^CI.*)|(^CIRRUS)|(^DISTRO_NV)|(^GOPATH)|(^GOCACHE)|(^GOSRC)|(^SCRIPT_BASE)|(CGROUP_MANAGER)|(OCI_RUNTIME)|(^TEST.*)|(^PODBIN_NAME)|(^PRIV_NAME)|(^ALT_NAME)|(^ROOTLESS_USER)|(SKIP_USERNS)|(.*_NAME)|(.*_FQIN)|(NETWORK_BACKEND)' | ||
# Unsafe env. vars for display | ||
SECRET_ENV_RE='(ACCOUNT)|(GC[EP]..+)|(SSH)|(PASSWORD)|(TOKEN)' | ||
|
||
|
@@ -216,20 +216,39 @@ setup_rootless() { | |
install_test_configs() { | ||
msg "Installing ./test/registries.conf system-wide." | ||
install -v -D -m 644 ./test/registries.conf /etc/containers/ | ||
if [[ "$TEST_ENVIRON" =~ netavark ]]; then | ||
# belt-and-suspenders: any pre-existing CNI config. will spoil | ||
# default use tof netavark (when both are installed). | ||
rm -rf /etc/cni/net.d/* | ||
else | ||
echo "Installing cni config, policy and registry config" | ||
req_env_vars GOSRC SCRIPT_BASE | ||
cd $GOSRC || exit 1 | ||
install -v -D -m 644 ./cni/87-podman-bridge.conflist /etc/cni/net.d/ | ||
# This config must always sort last in the list of networks (podman picks first one | ||
# as the default). This config prevents allocation of network address space used | ||
# by default in google cloud. https://cloud.google.com/vpc/docs/vpc#ip-ranges | ||
install -v -D -m 644 $SCRIPT_BASE/99-do-not-use-google-subnets.conflist /etc/cni/net.d/ | ||
fi | ||
} | ||
|
||
use_cni() { | ||
msg "Unsetting NETWORK_BACKEND for all subsequent environments." | ||
echo "export -n NETWORK_BACKEND" >> /etc/ci_environment | ||
echo "unset NETWORK_BACKEND" >> /etc/ci_environment | ||
export -n NETWORK_BACKEND | ||
unset NETWORK_BACKEND | ||
msg "Installing default CNI configuration" | ||
cd $GOSRC || exit 1 | ||
rm -rvf /etc/cni/net.d | ||
mkdir -p /etc/cni/net.d | ||
install -v -D -m 644 ./cni/87-podman-bridge.conflist \ | ||
/etc/cni/net.d/ | ||
# This config must always sort last in the list of networks (podman picks | ||
# first one as the default). This config prevents allocation of network | ||
# address space used by default in google cloud. | ||
# https://cloud.google.com/vpc/docs/vpc#ip-ranges | ||
install -v -D -m 644 $SCRIPT_BASE/99-do-not-use-google-subnets.conflist \ | ||
/etc/cni/net.d/ | ||
} | ||
|
||
use_netavark() { | ||
msg "Forcing NETWORK_BACKEND=netavark for all subsequent environments." | ||
echo "NETWORK_BACKEND=netavark" >> /etc/ci_environment | ||
export NETWORK_BACKEND=netavark # needed for install_test_configs() | ||
msg "Removing any/all CNI configuration" | ||
rm -rvf /etc/cni/net.d/* | ||
|
||
# TODO: Remove this when netavark/aardvark-dns development slows down | ||
warn "Updating netavark/aardvark-dns to avoid frequent VM image rebuilds" | ||
# N/B: This is coming from updates-testing repo in F36 | ||
lilto dnf update -y netavark aardvark-dns | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be installed from updates-testing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment suggests that they are, but the string There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code that does it is here: https://github.com/containers/automation_images/pull/115/files#diff-66757a985486a838bd165fde75e7f0d50de7281ceab5e044cd7625979956e65cR28-R34 log of it being done is here: https://cirrus-ci.com/task/5514692318724096?logs=main#L41 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So updates-testing repo is enabled. |
||
} | ||
|
||
# Remove all files provided by the distro version of podman. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,9 +38,6 @@ done | |
|
||
cp hack/podman-registry /bin | ||
|
||
# Make sure cni network plugins directory exists | ||
mkdir -p /etc/cni/net.d | ||
|
||
# Some test operations & checks require a git "identity" | ||
_gc='git config --file /root/.gitconfig' | ||
$_gc user.email "[email protected]" | ||
|
@@ -84,13 +81,6 @@ case "$CG_FS_TYPE" in | |
else | ||
echo "OCI_RUNTIME=runc" >> /etc/ci_environment | ||
fi | ||
|
||
# As a general policy CGv1 + runc should coincide with the "older" | ||
# VM Images in CI. Verify this is the case. | ||
if [[ -n "$VM_IMAGE_NAME" ]] && [[ ! "$VM_IMAGE_NAME" =~ prior ]] | ||
then | ||
die "Most recent distro. version should never run with CGv1" | ||
fi | ||
fi | ||
;; | ||
cgroup2fs) | ||
|
@@ -99,13 +89,6 @@ case "$CG_FS_TYPE" in | |
# which uses runc as the default. | ||
warn "Forcing testing with crun instead of runc" | ||
echo "OCI_RUNTIME=crun" >> /etc/ci_environment | ||
|
||
# As a general policy CGv2 + crun should coincide with the "newer" | ||
# VM Images in CI. Verify this is the case. | ||
if [[ -n "$VM_IMAGE_NAME" ]] && [[ "$VM_IMAGE_NAME" =~ prior ]] | ||
then | ||
die "Least recent distro. version should never run with CGv2" | ||
fi | ||
fi | ||
;; | ||
*) die_unknown CG_FS_TYPE | ||
|
@@ -130,14 +113,27 @@ case "$OS_RELEASE_ID" in | |
msg "Enabling container_manage_cgroup" | ||
setsebool container_manage_cgroup true | ||
fi | ||
|
||
# For release 36 and later, netavark/aardvark is the default | ||
# networking stack for podman. All previous releases only have | ||
# CNI networking available. Upgrading from one to the other is | ||
# not supported at this time. Support execution of the upgrade | ||
# tests in F36 and later, by disabling Netavark and enabling CNI. | ||
if [[ "$OS_RELEASE_VER" -ge 36 ]] && \ | ||
cevich marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[[ "$TEST_FLAVOR" != "upgrade_test" ]]; | ||
then | ||
use_netavark | ||
else # Fedora < 36, or upgrade testing. | ||
use_cni | ||
fi | ||
;; | ||
*) die_unknown OS_RELEASE_ID | ||
esac | ||
|
||
# Required to be defined by caller: The environment where primary testing happens | ||
# shellcheck disable=SC2154 | ||
case "$TEST_ENVIRON" in | ||
host*) | ||
host) | ||
# The e2e tests wrongly guess `--cgroup-manager` option | ||
# shellcheck disable=SC2154 | ||
if [[ "$CG_FS_TYPE" == "cgroup2fs" ]] || [[ "$PRIV_NAME" == "root" ]] | ||
|
@@ -148,43 +144,6 @@ case "$TEST_ENVIRON" in | |
warn "Forcing CGROUP_MANAGER=cgroupfs" | ||
echo "CGROUP_MANAGER=cgroupfs" >> /etc/ci_environment | ||
fi | ||
# TODO: For the foreseeable future, need to support running tests | ||
# with and without the latest netavark/aardvark. Once they're more | ||
# stable and widely supported in Fedora, they can be pre-installed | ||
# from its RPM at VM image build-time. | ||
if [[ "$TEST_ENVIRON" =~ netavark ]]; then | ||
for info in "netavark $NETAVARK_BRANCH $NETAVARK_URL $NETAVARK_DEBUG" \ | ||
"aardvark-dns $AARDVARK_BRANCH $AARDVARK_URL $AARDVARK_DEBUG"; do | ||
|
||
read _name _branch _url _debug <<<"$info" | ||
req_env_vars _name _branch _url _debug | ||
msg "Downloading latest $_name from upstream branch '$_branch'" | ||
# Use identifiable archive filename in of a get_ci_env.sh environment | ||
curl --fail --location -o /tmp/$_name.zip "$_url" | ||
|
||
# Needs to be in a specific location | ||
# ref: https://github.com/containers/common/blob/main/pkg/config/config_linux.go#L39 | ||
_pdir=/usr/local/libexec/podman | ||
mkdir -p $_pdir | ||
cd $_pdir | ||
msg "$PWD" | ||
unzip /tmp/$_name.zip | ||
if ((_debug)); then | ||
warn "Using debug $_name binary" | ||
mv $_name.debug $_name | ||
else | ||
rm $_name.debug | ||
fi | ||
chmod 0755 $_pdir/$_name | ||
cd - | ||
done | ||
|
||
restorecon -F -v $_nvdir | ||
# This is critical, it signals to all tests that netavark | ||
# use is expected. | ||
msg "Forcing NETWORK_BACKEND=netavark in all subsequent environments." | ||
echo "NETWORK_BACKEND=netavark" >> /etc/ci_environment | ||
fi | ||
;; | ||
container) | ||
if ((CONTAINER==0)); then # not yet inside a container | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but it would be nice to be able to figure out programmatically what these values should be rather than having to hard code them. That said, I don't have a good suggestion on how to pull that off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is the source of definitions for automation, so it really can't be done using imperial logic. Cirrus-CI does have support for using a scripting-language instead of YAML, but looking up the values would be complex at best, and error-prone at worst. So hard-coding the values is the least-worst solution that makes the most sense at the moment.