Skip to content
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

Docker v26 compatibility & test fixes #3097

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

apostasie
Copy link
Contributor

@apostasie apostasie commented Jun 16, 2024

This fix #3088

So far, the issues were:

  • docker is now pickier on ip ranges
  • WithMacAddress: both host networking and container networking now apparently allow passing a mac address, though it is a no-op AFAIK - the docker daemon still disallows it - hypothesis is that the new cli just discard the option silently. Anyhow, nerdctl code has been changed to align with that (somewhat abhorrent) behavior and tests have been adjusted
  • TestRunContainerWithStaticIP: see nerdctl / docker behavior divergence on --net bridge --ip-address #3101 - I am disabling the test for now (which was already broken by the way, since it wasn't testing anything for docker) - we might re-enable pending discussion in the linked ticket

tests := []struct {
Network string
WantErr bool
Expect string
}{
{"host", true, "conflicting options"},
{"none", true, "can't open '/sys/class/net/eth0/address'"},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Testing this is problematic as it does not seem to be there at all with rootless.
Replacing this by calling on ip addr.

curl -OSL https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce_26.1.4-1~ubuntu.22.04~jammy_amd64.deb
curl -OSl https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-ce-cli_26.1.4-1~ubuntu.22.04~jammy_amd64.deb
curl -OSL https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-buildx-plugin_0.14.1-1~ubuntu.22.04~jammy_amd64.deb
curl -OSL https://download.docker.com/linux/ubuntu/dists/jammy/pool/stable/amd64/docker-compose-plugin_2.27.1-1~ubuntu.22.04~jammy_amd64.deb
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also updating the plugins

tests := []struct {
Network string
WantErr bool
Expect string
}{
{"host", true, "conflicting options"},
{"none", true, "can't open '/sys/class/net/eth0/address'"},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using /sys/class/net is problematic as it does not seem to exist for rootless in any case. Replacing with a call to ip addr to retrieve the mac address instead.

base.Cmd("start", containerName).AssertOK()
cmd = base.Cmd("logs", containerName)
cmd.AssertOK()
cmd.AssertOutContains(test.Expect)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing faulty logic resulting in multiple repeat executions.

Signed-off-by: apostasie <spam_blackhole@farcloser.world>
@apostasie apostasie changed the title [WIP] Docker v26 compatibility & test fixes Docker v26 compatibility & test fixes Jun 17, 2024
@apostasie apostasie marked this pull request as ready for review June 17, 2024 22:18
@apostasie
Copy link
Contributor Author

Besides a Windows failure that seems unrelated (can you poke it?), the CI is green on this.

As indicated in the initial comment, issues are relatively minor changes in behavior of the docker cli, that we are now aligning with, for better or worse (except for the behavior on ip + bridge which is now documented in #3106).

Tests have also been cleaned up slightly as some assumptions were wrong (availability of /sys/net, and multiple execution through testutil assert helpers), the logic has been simplified a bit, and they are now parallelized.

@AkihiroSuda and crew, PTAL at your convenience.

@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Jun 18, 2024
@AkihiroSuda AkihiroSuda added the area/ci e.g., CI failure label Jun 18, 2024
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit a074beb into containerd:main Jun 18, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ci e.g., CI failure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test-integration-docker-compatibility began to fail on June 14 (Docker was upgraded from v24 to v26)
2 participants