Skip to content

Commit a2f0a44

Browse files
Merge pull request #21410 from ashley-cui/cnici
Do not test CNI in CI
2 parents 8be1ce2 + 26cd01e commit a2f0a44

File tree

20 files changed

+236
-280
lines changed

20 files changed

+236
-280
lines changed

.cirrus.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,11 @@ build_task:
105105
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
106106
# ID for re-use of build output
107107
CI_DESIRED_RUNTIME: crun
108-
CI_DESIRED_NETWORK: netavark
109108
- env:
110109
DISTRO_NV: ${PRIOR_FEDORA_NAME}
111110
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
112111
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
113112
CI_DESIRED_RUNTIME: crun
114-
CI_DESIRED_NETWORK: cni
115113
CI_DESIRED_DATABASE: boltdb
116114
CI_DESIRED_STORAGE: vfs
117115
# Catch invalid "TMPDIR == /tmp" assumptions; PR #19281
@@ -125,7 +123,6 @@ build_task:
125123
DISTRO_NV: ${DEBIAN_NAME}
126124
VM_IMAGE_NAME: ${DEBIAN_CACHE_IMAGE_NAME}
127125
CI_DESIRED_RUNTIME: runc
128-
CI_DESIRED_NETWORK: netavark
129126
env:
130127
TEST_FLAVOR: build
131128
# NOTE: The default way Cirrus-CI clones is *NOT* compatible with
@@ -186,7 +183,6 @@ build_aarch64_task:
186183
VM_IMAGE_NAME: ${FEDORA_AARCH64_AMI}
187184
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
188185
CI_DESIRED_RUNTIME: crun
189-
CI_DESIRED_NETWORK: netavark
190186
TEST_FLAVOR: build
191187
clone_script: *full_clone
192188
prebuild_script: *prebuild
@@ -682,13 +678,11 @@ container_integration_test_task:
682678
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
683679
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
684680
CI_DESIRED_RUNTIME: crun
685-
CI_DESIRED_NETWORK: netavark
686681
- env:
687682
DISTRO_NV: ${PRIOR_FEDORA_NAME}
688683
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
689684
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
690685
CI_DESIRED_RUNTIME: crun
691-
CI_DESIRED_NETWORK: cni
692686
CI_DESIRED_DATABASE: boltdb
693687
gce_instance: *standardvm
694688
timeout_in: 50m
@@ -746,7 +740,6 @@ podman_machine_task:
746740
PRIV_NAME: "rootless" # intended use-case
747741
DISTRO_NV: "${FEDORA_NAME}"
748742
VM_IMAGE_NAME: "${FEDORA_AMI}"
749-
CI_DESIRED_NETWORK: netavark
750743
clone_script: *get_gosrc
751744
setup_script: *setup
752745
main_script: *main
@@ -772,7 +765,6 @@ podman_machine_aarch64_task:
772765
PRIV_NAME: "rootless" # intended use-case
773766
DISTRO_NV: "${FEDORA_AARCH64_NAME}"
774767
VM_IMAGE_NAME: "${FEDORA_AARCH64_AMI}"
775-
CI_DESIRED_NETWORK: netavark
776768
clone_script: *get_gosrc_aarch64
777769
setup_script: *setup
778770
main_script: *main
@@ -922,7 +914,6 @@ rootless_remote_system_test_task:
922914
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
923915
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
924916
CI_DESIRED_RUNTIME: crun
925-
CI_DESIRED_NETWORK: netavark
926917
<<: *local_system_test_task
927918
alias: rootless_remote_system_test
928919
gce_instance: *standardvm
@@ -1007,37 +998,6 @@ buildah_bud_test_task:
1007998
main_script: *main
1008999
always: *int_logs_artifacts
10091000

1010-
upgrade_test_task:
1011-
name: "Upgrade test: from $PODMAN_UPGRADE_FROM"
1012-
alias: upgrade_test
1013-
# Docs: ./contrib/cirrus/CIModes.md
1014-
only_if: *not_tag_magic
1015-
depends_on:
1016-
- build
1017-
- local_system_test
1018-
matrix:
1019-
- env:
1020-
PODMAN_UPGRADE_FROM: v2.1.1
1021-
CI_DESIRED_NETWORK: cni
1022-
- env:
1023-
PODMAN_UPGRADE_FROM: v3.1.2
1024-
CI_DESIRED_NETWORK: cni
1025-
- env:
1026-
PODMAN_UPGRADE_FROM: v3.4.4
1027-
CI_DESIRED_NETWORK: cni
1028-
gce_instance: *standardvm
1029-
env:
1030-
TEST_FLAVOR: upgrade_test
1031-
DISTRO_NV: ${FEDORA_NAME}
1032-
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
1033-
# FIXME: remove this once we have VMs with podman >= 4.8
1034-
CI_DESIRED_DATABASE: boltdb
1035-
clone_script: *get_gosrc
1036-
setup_script: *setup
1037-
main_script: *main
1038-
always: *logs_artifacts
1039-
1040-
10411001
# This task is critical. It updates the "last-used by" timestamp stored
10421002
# in metadata for all VM images. This mechanism functions in tandem with
10431003
# an out-of-band pruning operation to remove disused VM images.
@@ -1111,7 +1071,6 @@ success_task:
11111071
- minikube_test
11121072
- farm_test
11131073
- buildah_bud_test
1114-
- upgrade_test
11151074
- meta
11161075
container: &smallcontainer
11171076
image: ${CTR_FQIN}

contrib/cirrus/lib.sh

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ EPOCH_TEST_COMMIT="$CIRRUS_BASE_SHA"
9595
# contexts, such as host->container or root->rootless user
9696
#
9797
# List of envariables which must be EXACT matches
98-
PASSTHROUGH_ENV_EXACT='CGROUP_MANAGER|DEST_BRANCH|DISTRO_NV|GOCACHE|GOPATH|GOSRC|NETWORK_BACKEND|OCI_RUNTIME|ROOTLESS_USER|SCRIPT_BASE|SKIP_USERNS|EC2_INST_TYPE|PODMAN_DB|STORAGE_FS'
98+
PASSTHROUGH_ENV_EXACT='CGROUP_MANAGER|DEST_BRANCH|DISTRO_NV|GOCACHE|GOPATH|GOSRC|OCI_RUNTIME|ROOTLESS_USER|SCRIPT_BASE|SKIP_USERNS|EC2_INST_TYPE|PODMAN_DB|STORAGE_FS'
9999

100100
# List of envariable patterns which must match AT THE BEGINNING of the name.
101101
PASSTHROUGH_ENV_ATSTART='CI|LANG|LC_|TEST'
@@ -202,61 +202,6 @@ install_test_configs() {
202202
install -v -D -m 644 ./test/registries.conf /etc/containers/
203203
}
204204

205-
use_cni() {
206-
req_env_vars OS_RELEASE_ID PACKAGE_DOWNLOAD_DIR SCRIPT_BASE
207-
# Defined by common automation library
208-
# shellcheck disable=SC2154
209-
if [[ "$OS_RELEASE_ID" =~ "debian" ]]; then
210-
# Supporting it involves swapping the rpm & dnf commands below
211-
die "Testing debian w/ CNI networking currently not supported"
212-
fi
213-
214-
msg "Forcing NETWORK_BACKEND=cni for all subsequent environments."
215-
echo "NETWORK_BACKEND=cni" >> /etc/ci_environment
216-
export NETWORK_BACKEND=cni
217-
# While it's possible a user may want both installed, for CNI CI testing
218-
# purposes we only care about backward-compatibility, not forward.
219-
# If both CNI & netavark are present, in some situations where --root
220-
# is used it's possible for podman to pick the "wrong" networking stack.
221-
msg "Force-removing netavark and aardvark-dns"
222-
# Other packages depend on nv/av, but we're testing with podman
223-
# binaries built from source, so it's safe to ignore these deps.
224-
#
225-
# Do not fail when netavark and aardvark-dns are not installed.
226-
for pkg in aardvark-dns netavark
227-
do
228-
[ -z "$(rpm -qa | grep $pkg)" ] && echo "$pkg not installed" || rpm -e --nodeps $pkg
229-
done
230-
msg "Installing default CNI configuration"
231-
showrun dnf install -y $PACKAGE_DOWNLOAD_DIR/podman-plugins*
232-
cd $GOSRC || exit 1
233-
rm -rvf /etc/cni/net.d
234-
mkdir -p /etc/cni/net.d
235-
showrun install -v -D -m 644 ./cni/87-podman-bridge.conflist \
236-
/etc/cni/net.d/
237-
# This config must always sort last in the list of networks (podman picks
238-
# first one as the default). This config prevents allocation of network
239-
# address space used by default in google cloud.
240-
# https://cloud.google.com/vpc/docs/vpc#ip-ranges
241-
showrun install -v -D -m 644 $SCRIPT_BASE/99-do-not-use-google-subnets.conflist \
242-
/etc/cni/net.d/
243-
}
244-
245-
use_netavark() {
246-
req_env_vars OS_RELEASE_ID PRIOR_FEDORA_NAME DISTRO_NV
247-
local magickind repokind
248-
msg "Unsetting NETWORK_BACKEND for all subsequent environments."
249-
echo "export -n NETWORK_BACKEND" >> /etc/ci_environment
250-
echo "unset NETWORK_BACKEND" >> /etc/ci_environment
251-
export -n NETWORK_BACKEND
252-
unset NETWORK_BACKEND
253-
msg "Removing any/all CNI configuration"
254-
showrun rm -rvf /etc/cni/net.d/*
255-
# N/B: The CNI packages are still installed and available. This is
256-
# on purpose, since CI needs to verify the selection mechanisms are
257-
# functional when both are available.
258-
}
259-
260205
# Remove all files provided by the distro version of podman.
261206
# All VM cache-images used for testing include the distro podman because (1) it's
262207
# required for podman-in-podman testing and (2) it somewhat simplifies the task

contrib/cirrus/setup_environment.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,6 @@ case "$OS_RELEASE_ID" in
158158
*) die_unknown OS_RELEASE_ID
159159
esac
160160

161-
# Networking: force CNI or Netavark as requested in .cirrus.yml
162-
# (this variable is mandatory).
163-
# shellcheck disable=SC2154
164-
showrun echo "about to set up for CI_DESIRED_NETWORK [=$CI_DESIRED_NETWORK]"
165-
case "$CI_DESIRED_NETWORK" in
166-
netavark) use_netavark ;;
167-
cni) use_cni ;;
168-
*) die_unknown CI_DESIRED_NETWORK ;;
169-
esac
170-
171161
# Database: force SQLite or BoltDB as requested in .cirrus.yml.
172162
# If unset, will default to SQLite.
173163
# shellcheck disable=SC2154

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/checkpoint-restore/go-criu/v7 v7.0.0
1212
github.com/containernetworking/plugins v1.4.0
1313
github.com/containers/buildah v1.34.1-0.20240201124221-b850c711ff5c
14-
github.com/containers/common v0.57.1-0.20240130143645-b26099256b92
14+
github.com/containers/common v0.57.1-0.20240205132223-de5cb00e891c
1515
github.com/containers/conmon v2.0.20+incompatible
1616
github.com/containers/gvisor-tap-vsock v0.7.2
1717
github.com/containers/image/v5 v5.29.2-0.20240130233108-e66a1ade2efc
@@ -93,7 +93,7 @@ require (
9393
github.com/chenzhuoyu/iasm v0.9.0 // indirect
9494
github.com/chzyer/readline v1.5.1 // indirect
9595
github.com/containerd/cgroups/v3 v3.0.2 // indirect
96-
github.com/containerd/containerd v1.7.12 // indirect
96+
github.com/containerd/containerd v1.7.13 // indirect
9797
github.com/containerd/log v0.1.0 // indirect
9898
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
9999
github.com/containerd/typeurl/v2 v2.1.1 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09Zvgq
194194
github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s=
195195
github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g=
196196
github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c=
197-
github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=
198-
github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk=
197+
github.com/containerd/containerd v1.7.13 h1:wPYKIeGMN8vaggSKuV1X0wZulpMz4CrgEsZdaCyB6Is=
198+
github.com/containerd/containerd v1.7.13/go.mod h1:zT3up6yTRfEUa6+GsITYIJNgSVL9NQ4x4h1RPzk0Wu4=
199199
github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
200200
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
201201
github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
@@ -257,8 +257,8 @@ github.com/containernetworking/plugins v1.4.0 h1:+w22VPYgk7nQHw7KT92lsRmuToHvb7w
257257
github.com/containernetworking/plugins v1.4.0/go.mod h1:UYhcOyjefnrQvKvmmyEKsUA+M9Nfn7tqULPpH0Pkcj0=
258258
github.com/containers/buildah v1.34.1-0.20240201124221-b850c711ff5c h1:r+1vFyTAoXptJrsPsnOMI3G0jm4+BCfXAcIyuA33lzo=
259259
github.com/containers/buildah v1.34.1-0.20240201124221-b850c711ff5c/go.mod h1:Hw4qo2URFpWvZ2tjLstoQMpNC6+gR4PtxQefvV/UKaA=
260-
github.com/containers/common v0.57.1-0.20240130143645-b26099256b92 h1:Q60+ofGhDjVxY5lvYmmcVN8aeS9gtQ6pAn/pyLh7rRM=
261-
github.com/containers/common v0.57.1-0.20240130143645-b26099256b92/go.mod h1:Na7hGh5WnmB0RdGkKyb6JQb6DtKrs5qoIGrPucuR8t0=
260+
github.com/containers/common v0.57.1-0.20240205132223-de5cb00e891c h1:Xzo9t4eIalkeilcmYTz0YEgL7hMrGQ12GK6UlSHrEsU=
261+
github.com/containers/common v0.57.1-0.20240205132223-de5cb00e891c/go.mod h1:s1gEyucR3ryIex1aDMo1KzbfpvRl0CaGER6s5jqXRkI=
262262
github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg=
263263
github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I=
264264
github.com/containers/gvisor-tap-vsock v0.7.2 h1:6CyU5D85C0/DciRRd7W0bPljK4FAS+DPrrHEQMHfZKY=

test/e2e/info_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,23 +152,15 @@ var _ = Describe("Podman Info", func() {
152152
})
153153

154154
It("Podman info: check desired network backend", func() {
155-
// defined in .cirrus.yml
156-
want := os.Getenv("CI_DESIRED_NETWORK")
157-
if want == "" {
158-
if os.Getenv("CIRRUS_CI") == "" {
159-
Skip("CI_DESIRED_NETWORK is not set--this is OK because we're not running under Cirrus")
160-
}
161-
Fail("CIRRUS_CI is set, but CI_DESIRED_NETWORK is not! See #16389")
162-
}
163155
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.NetworkBackend}}"})
164156
session.WaitWithDefaultTimeout()
165157
Expect(session).To(ExitCleanly())
166-
Expect(session.OutputToString()).To(Equal(want))
158+
Expect(session.OutputToString()).To(Equal("netavark"))
167159

168160
session = podmanTest.Podman([]string{"info", "--format", "{{.Host.NetworkBackendInfo.Backend}}"})
169161
session.WaitWithDefaultTimeout()
170162
Expect(session).To(ExitCleanly())
171-
Expect(session.OutputToString()).To(Equal(want))
163+
Expect(session.OutputToString()).To(Equal("netavark"))
172164
})
173165

174166
It("Podman info: check desired database backend", func() {

test/system/005-info.bats

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,8 @@ host.slirp4netns.executable | $expr_path
8282
}
8383

8484
@test "podman info - confirm desired network backend" {
85-
if [[ -z "$CI_DESIRED_NETWORK" ]]; then
86-
# When running in Cirrus, CI_DESIRED_NETWORK *must* be defined
87-
# in .cirrus.yml so we can double-check that all CI VMs are
88-
# using netavark or cni as desired.
89-
if [[ -n "$CIRRUS_CI" ]]; then
90-
die "CIRRUS_CI is set, but CI_DESIRED_NETWORK is not! See #16389"
91-
fi
92-
93-
# Not running under Cirrus (e.g., gating tests, or dev laptop).
94-
# Totally OK to skip this test.
95-
skip "CI_DESIRED_NETWORK is unset--OK, because we're not in Cirrus"
96-
fi
97-
9885
run_podman info --format '{{.Host.NetworkBackend}}'
99-
is "$output" "$CI_DESIRED_NETWORK" "CI_DESIRED_NETWORK (from .cirrus.yml)"
86+
is "$output" "netavark" "netavark backend"
10087
}
10188

10289
@test "podman info - confirm desired database" {

test/upgrade/test-upgrade.bats

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ while :;do
125125
echo STOPPING
126126
podman \$opts stop -t 0 myrunningcontainer || true
127127
podman \$opts rm -f myrunningcontainer || true
128-
# sigh, network rm fails with exec: "ip": executable file not found in $PATH
129-
# we cannot change the images afterwards so we remove it manually (#11403)
130-
# hardcode /etc/cni/net.d dir for now
131-
podman \$opts network rm -f mynetwork || rm -f /etc/cni/net.d/mynetwork.conflist
132128
exit 0
133129
fi
134130
sleep 0.5
@@ -143,10 +139,7 @@ EOF
143139
# Also use --network host to prevent any netavark/cni conflicts
144140
$PODMAN run --rm --network host $OLD_PODMAN true
145141

146-
# Podman 4.0 might no longer use cni so /run/cni and /run/containers will no be created in this case
147-
# Create directories manually to fix this. Also running with netavark can
148-
# cause connectivity issues since cni and netavark should never be mixed.
149-
mkdir -p /run/netns /run/cni /run/containers /var/lib/cni /etc/cni/net.d
142+
mkdir -p /run/netns
150143

151144
# Containers-common around release 1-55 no-longer supplies this file
152145
sconf=/etc/containers/storage.conf
@@ -165,7 +158,6 @@ EOF
165158
#
166159
# mount /etc/containers/storage.conf to use the same storage settings as on the host
167160
# mount /dev/shm because the container locks are stored there
168-
# mount /var/lib/cni, /run/cni and /etc/cni/net.d for cni networking
169161
# mount /run/containers for the dnsname plugin
170162
#
171163
$PODMAN run -d --name podman_parent --pid=host \
@@ -178,9 +170,6 @@ EOF
178170
-v /run/crun:/run/crun \
179171
-v /run/netns:/run/netns:rshared \
180172
-v /run/containers:/run/containers \
181-
-v /run/cni:/run/cni \
182-
-v /var/lib/cni:/var/lib/cni \
183-
-v /etc/cni/net.d:/etc/cni/net.d \
184173
-v /dev/shm:/dev/shm \
185174
-v $pmroot:$pmroot:rshared \
186175
$OLD_PODMAN $pmroot/setup
@@ -200,10 +189,8 @@ EOF
200189
}
201190

202191
@test "info" {
203-
# check network backend, since this is an old version we should use CNI
204-
# when we start testing from 4.0 we should have netavark as backend
205192
run_podman info --format '{{.Host.NetworkBackend}}'
206-
is "$output" "cni" "correct network backend"
193+
is "$output" "netavark" "correct network backend"
207194
}
208195

209196
@test "images" {

vendor/github.com/containers/common/libnetwork/cni/cni_conversion.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/containers/common/libnetwork/cni/cni_exec.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)