Skip to content

Comments

containers: hostbridge and IPv6#14018

Merged
fpletz merged 4 commits intoNixOS:masterfrom
kampfschlaefer:feature/hostbridge_and_ipv6_for_containers
Apr 24, 2016
Merged

containers: hostbridge and IPv6#14018
fpletz merged 4 commits intoNixOS:masterfrom
kampfschlaefer:feature/hostbridge_and_ipv6_for_containers

Conversation

@kampfschlaefer
Copy link
Contributor

This patches achieve two things that extend containers to make them more usable (at least for me):

  • Add IPv6 addresses for containers
    With this the containers can get one IPv6 address in addition to the ipv4 address. Or only an ipv6 address;-)
  • Put the host-side of the veth-pair into an existing bridge
    Its also now possible to define the host-side bridge the containers interface should be placed in. Then only the container-side of the addresses is needed.
More

superseedes #12736

cc @fpletz

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @edolstra, @aszlig and @aristidb to be potential reviewers

@valeriangalliat valeriangalliat mentioned this pull request Mar 18, 2016
2 tasks
@joachifm joachifm added 0.kind: enhancement Add something new or improve an existing system. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Mar 18, 2016
virtualisation.pathsInNixDB = [ pkgs.stdenv ];
};

testScript =
Copy link
Member

Choose a reason for hiding this comment

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

This test fails for me because there is no nameserver available:

machine# error checking the existence of http://tarballs.nixos.org/sha256/13i04dkd709f0p5f2413sf2y9321pfi4y85ynf8wih6ryphnbk9x:
machine# curl: (6) name lookup timed out
machine# 
machine# trying http://www.docbook.org/xml/5.0/docbook-5.0.zip
machine# Warning: Transient problem: timeout Will retry in 1 seconds. 3 retries left.
machine# Warning: Transient problem: timeout Will retry in 2 seconds. 2 retries left.
machine# Warning: Transient problem: timeout Will retry in 4 seconds. 1 retries left.
machine# curl: (6) Couldn't resolve host 'www.docbook.org'
machine# error: cannot download docbook-5.0.zip from any mirror
machine# builder for ‘/nix/store/mh8hylyfkrmbhjbpz4xkz8f8lx3hcbvc-docbook-5.0.zip.drv’ failed with exit code 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

interesting. didn't fail here. I will look at this the next days. Maybe its because of the order in which the test-cases where executed? Could be that running the imperative tests standalone and before the declarative tests reveals a missing configuration…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fpletz
Hm, I re-ran these tests on three different machines (two ubuntu1404+nix, one nixos15.09) with cleaned nix-store but couldn't encounter this. Maybe the problem really was resolution of docbook.org at the time you ran the test?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for testing this on different machines. I'll give it another shot.

@kampfschlaefer
Copy link
Contributor Author

I noticed that this is yet missing a wants/after per to start containers with hostbridge option only after the network devices are started. Maybe I can integrate parts of #3021 to do that.

@kampfschlaefer kampfschlaefer force-pushed the feature/hostbridge_and_ipv6_for_containers branch from a15390d to 776accb Compare April 2, 2016 13:03
This allows the containers to have their interface in a bridge on the host.
Also this adds IPv6 addresses to the containers both with bridged and unbridged
network.
A testcase each for
- declarative ipv6-only container
  Seems odd to define the container IPs with their prefix length attached.
  There should be a better way…
- declarative bridged container

Also fix the ping test by waiting for the container to start

When the ping was executed, the container might not have finished starting. Or
the host-side of the container wasn't finished with config. Waiting for
2 seconds in between fixes this.
Without the templating (which is still present for imperative containers), it
will be possible to set individual dependencies. Like depending on the network
only if the hostbridge or hardware interfaces are used.

Ported from NixOS#3021
@kampfschlaefer kampfschlaefer force-pushed the feature/hostbridge_and_ipv6_for_containers branch from 776accb to 3c819f2 Compare April 2, 2016 15:21
@kampfschlaefer
Copy link
Contributor Author

@fpletz Extending the containers will probably be an endless endeavor. But this now has ipv6, host bridge, real service definitions and tests. I think this is ready for merging into master (would have loved to have this in 16.03).

Making the boot-dependency on network.target only for containers needing it and the macvlans are subject for the next future PRs.

PS: rebased this against the last nixos-unstable-small channel.

@fpletz fpletz self-assigned this Apr 18, 2016
@fpletz
Copy link
Member

fpletz commented Apr 24, 2016

Thanks! Tested and works as intended. Looking forward to further improvements! ;)

@fpletz fpletz merged commit 8cca66f into NixOS:master Apr 24, 2016
@edolstra
Copy link
Member

BTW, having things like sleep 2 is guaranteed to cause random test failures in our build farm.

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

Labels

0.kind: enhancement Add something new or improve an existing system. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants