gvisor-tap-vsock icon indicating copy to clipboard operation
gvisor-tap-vsock copied to clipboard

Enable config file based configuration

Open MrEcco opened this issue 8 months ago • 7 comments
trafficstars

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 -config flag. 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.

MrEcco avatar Mar 09 '25 19:03 MrEcco

Any news on it?

MrEcco avatar Mar 13 '25 17:03 MrEcco

@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

cfergeau avatar Mar 18 '25 08:03 cfergeau

Sorry to bother your GHCI minutes, I finally won this DCO requirement.

MrEcco avatar Mar 21 '25 21:03 MrEcco

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 avatar Mar 24 '25 12:03 cfergeau

@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 :)

MrEcco avatar Mar 24 '25 22:03 MrEcco

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.

cfergeau avatar Apr 29 '25 15:04 cfergeau

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.

cfergeau avatar Sep 12 '25 10:09 cfergeau

/lgtm /approve

cfergeau avatar Sep 12 '25 12:09 cfergeau

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci[bot] avatar Sep 12 '25 12:09 openshift-ci[bot]

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.

MrEcco avatar Sep 13 '25 14:09 MrEcco