Skip to content

containers: Add migration module to support container upgrades#25058

Draft
ricardobranco777 wants to merge 2 commits intoos-autoinst:masterfrom
ricardobranco777:migration
Draft

containers: Add migration module to support container upgrades#25058
ricardobranco777 wants to merge 2 commits intoos-autoinst:masterfrom
ricardobranco777:migration

Conversation

@ricardobranco777
Copy link
Contributor

@ricardobranco777 ricardobranco777 commented Mar 23, 2026

Add migration module to support testing container runtime upgrades.

This tests uses docker-compose to set up a project with 2 containers with 2 networks and one volume, upgrades the container packages, restarts the service, and checks everything is ok.

The tests are run for both podman & docker, as root & rootless.

Related ticket: https://progress.opensuse.org/issues/183512

Verification runs:

Notes

@ricardobranco777 ricardobranco777 marked this pull request as draft March 23, 2026 14:10
@ricardobranco777 ricardobranco777 force-pushed the migration branch 2 times, most recently from 603eaa0 to 1692699 Compare March 23, 2026 14:23
@ricardobranco777 ricardobranco777 added the WIP Work in progress label Mar 23, 2026
@ricardobranco777 ricardobranco777 force-pushed the migration branch 2 times, most recently from 4666e9b to 620b351 Compare March 23, 2026 14:40
}

assert_script_run "rpm -qa | sort > /tmp/before", timeout => 180;
upgrade;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd split this part into two test modules (e.g. container_update_prepare.pm and container_update_validate.pm) such that we can integrate this into various workflows.

On O3 we probably can lean on https://openqa.opensuse.org/tests/5774085 and transactional/tdup and on SLES we can use patch_and_reboot.pm. I think this is needed to avoid that we have to duplicate an upgrade subroutine for every workflow we want this to integrate into the future.

Copy link
Contributor Author

@ricardobranco777 ricardobranco777 Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to the idea but note that we call validate() after setting up the compose project and then again after upgrade. What about parameterizing this module and call this upgrade only if TEST_REPOS is set?

@ricardobranco777 ricardobranco777 force-pushed the migration branch 3 times, most recently from f55dfa8 to 4eaa3ee Compare March 23, 2026 16:22
@ricardobranco777 ricardobranco777 force-pushed the migration branch 6 times, most recently from f871f40 to 89a176e Compare March 23, 2026 17:52
@m-dati
Copy link
Contributor

m-dati commented Mar 23, 2026

LGTM

Copy link
Contributor

@danishprakash danishprakash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; a few non-blocking comments.

Comment on lines +81 to +84
# Needed to avoid this error on SLES 15-SP7:
# File /usr/share/containers/mounts.conf from install of
# libcontainers-common-20260112-bp157.3.1.noarch (Virtualization:containers (15.7))
# conflicts with file from package libcontainers-sles-mounts-20240408-150600.1.1.noarch (@System)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't zypper do the right thing and prefer libcontainers-sles-mounts over the standard mounts.conf? If not, then this might be a bug.

my ($runtime, $rootless) = @_;
my $opts = $rootless ? "--user" : "";

script_run "$runtime compose down";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a timeout here?


if ($runtime eq "docker") {
assert_script_run "dockerd-rootless-setuptool.sh install" if $rootless;
systemctl "$opts enable --now docker";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so that I understand, you're using enable for Docker because it's the right thing to do, or does this affect this test functionally? I would assume in an ephemeral environment like this, both start and enable --now would more or less be the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants