gvisor-tap-vsock
gvisor-tap-vsock copied to clipboard
Enable config file based configuration
This is a little rethink of how to configure. Since the previous implementation disallows to use the compiled binaries in releases, I have prepared a more flexible version. However, the legacy behavior (without configuration file) remains as is (proven by unit tests).
List of changes
- Enable
-configflag. If no such flag provided, then remain the original behavior - Partial refactoring of the initialization process
- Fix small issue what prevented multiple hypervisors connecting to the controlling socket (e.g. now you can attach more than 1 qemu VM, and they can ping each other)
Most of all changes are tested, see unit tests.
Reasons
I'm trying to enable multi-VM local lab which should support different host OS, guest OS, guest arches. With this tool I have resolved the significant problem with the proper VM networking (at least for MacOS). However, I must fix a few issues, here's the PR.
Pealse accept it and release the new version of gvproxy binary. I would appreciate.
Any news on it?
@MrEcco one thing which is missing from the PR is a signed-off-by, see https://github.com/containers/gvisor-tap-vsock/pull/484/checks?check_run_id=38666327398
Sorry to bother your GHCI minutes, I finally won this DCO requirement.
After the addition of the DCO, there is no longer a commit log to your change :-/ The initial description in the PR should be good as a commit log.
Can you also rebase this (and not merge) on top of main? There will a conflict related to https://github.com/containers/gvisor-tap-vsock/commit/4bbb832355b8d141a61694e322ce5cbb191d28c9 , I’m a bit worried of introducing a regression if I try to fix it myself :-/
There are also a number of issues reported by make lint
@cfergeau Thanks a lot for your review! I have rebased it properly (I'll never use GH UI button for it :) ), fixed all findings, cleaned up the linter's output (only for files in the scope of this PR), and have done my best with atomic commits. Please reply in the remaining threads, I don't really sure what to do there, or just resolve.
I hope it's done here :)
I’ve rebased this and squashed the commits which go together in https://github.com/cfergeau/gvisor-tap-vsock/tree/MrEcco The modified version works fine with podman-machine and macadam on a mac. I need to take a closer look at the "multiaccept" changes though.
So I’ve looked some more at this branch, rebased it and did a few more cleanups, mostly in the test code. Imo the config file commit is good to go, I’ll push it soon. Current code is in https://github.com/cfergeau/gvisor-tap-vsock/tree/MrEcco
However, the "multiple VMs" commit could use some work, for example I started gvproxy, connected 2 qemu VMs, killed one qemu with ctrl+c, and gvproxy exits. I don’t think it should be doing this. And thinking more about how this could impact existing users, it’s better to enable this using a command line/config file argument.
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: cfergeau, MrEcco
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [cfergeau]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Sorry, I forgot about this PR. Months ago, I have reimplemented your idea with appropriate configuration (or just with my own understanding of "appropriate", for my case) and CLI interface, here: https://github.com/circumspectlabs/gvswitch. This little project is a well tested by my students, they use it with this Ansible code which can start multiple VMs with a shared private network: https://github.com/circumspectlabs/kubernetes-the-mindful-way/blob/main/code/molecule/default/create.yml#L255-L272.
You can take the CLI and config implementation from this repo. It works with 6 VMs (haven't succeeded to start more on my laptop). Haven't yet tested on Windows and Linux.