github.com/AbhinandanKurakure/podman/v3@v3.4.10/test/upgrade/README.md (about) 1 Background 2 ========== 3 4 For years we've been needing a way to test podman upgrades; this 5 became much more critical on December 7, 2020, when Matt disclosed 6 a bug he had found over the weekend 7 ([#8613](https://github.com/containers/podman/issues/8613)) 8 in which reuse of a previously-defined field name would 9 result in fatal JSON decode failures if current-podman were 10 to try reading containers created with podman <= 1.8 (FIXME: confirm) 11 12 Upgrade testing is a daunting problem; but in the December 12 13 Cabal meeting Dan suggested using podman-in-podman. This PR 14 is the result of fleshing out that idea. 15 16 Overview 17 ======== 18 19 The BATS script in this directory fetches and runs an old-podman 20 container image from quay.io/podman, uses it to create and run 21 a number of containers, then uses new-podman to interact with 22 those containers. 23 24 As of 2021-02-23 the available old-podman versions are: 25 26 ```console 27 $ ./bin/podman search --list-tags quay.io/podman/stable | awk '$2 ~ /^v/ { print $2}' | sort | column -c 75 28 v1.4.2 v1.5.0 v1.6 v1.9.0 v2.0.2 v2.1.1 29 v1.4.4 v1.5.1 v1.6.2 v1.9.1 v2.0.6 v2.2.1 30 ``` 31 32 Test invocation is: 33 ```console 34 $ sudo env PODMAN=bin/podman PODMAN_UPGRADE_FROM=v1.9.0 PODMAN_UPGRADE_TEST_DEBUG= bats test/upgrade 35 ``` 36 (Path assumes you're cd'ed to top-level podman repo). `PODMAN_UPGRADE_FROM` 37 can be any of the versions above. `PODMAN_UPGRADE_TEST_DEBUG` is empty 38 here, but listed so you can set it `=1` and leave the podman_parent 39 container running. Interacting with this container is left as an 40 exercise for the reader. 41 42 The script will pull the given podman image, invoke it with a scratch 43 root directory, and have it do a small set of podman stuff (pull an 44 image, create/run some containers). This podman process stays running 45 because if it exits, it kills containers running inside the container. 46 47 We then invoke the current (host-installed) podman, using the same 48 scratch root directory, and perform operations on those images and 49 containers. Most of those operations are done in individual @tests. 50 51 The goal is to have this upgrade test run in CI, iterating over a 52 loop of known old versions. This list would need to be hand-maintained 53 and updated on new releases. There might also need to be extra 54 configuration defined, such as per-version commands (see below). 55 56 Findings 57 ======== 58 59 Well, first, `v1.6.2` won't work on default f32/f33: the image 60 does not include `crun`, so it can't work at all: 61 62 ERRO[0000] oci runtime "runc" does not support CGroups V2: use system migrate to mitigate 63 64 I realize that it's kind of stupid not to test 1.6, since that's 65 precisely the test that would've caught #8613 early, but I just 66 don't think it's worth the hassle of setting up cgroupsv1 VMs. 67 68 For posterity, in an earlier incantation of this script I tried 69 booting f32 into cgroupsv1 and ran into the following warnings 70 when running new-podman on old-containers: 71 ``` 72 ERRO[0000] error joining network namespace for container 322b66d94640e31b2e6921565445cf0dade4ec13cabc16ee5f29292bdc038341: error retrieving network namespace at /var/run/netns/cni-577e2289-2c05-2e28-3c3d-002a5596e7da: failed to Statfs "/var/run/netns/cni-577e2289 73 ``` 74 75 Where To Go From Here 76 ===================== 77 78 * Tests are still (2021-02-23) incomplete, with several failing outright. 79 See FIXMEs in the code. 80 81 * Figuring out how/if to run rootless. I think this is possible, perhaps 82 even necessary, but will be tricky to get right because of home-directory 83 mounting. 84 85 * Figuring out how/if to run variations with different config files 86 (e.g. running OLD-PODMAN that creates a user libpod.conf, tweaking 87 that in the test, then running NEW-PODMAN upgrade tests)