ebpf icon indicating copy to clipboard operation
ebpf copied to clipboard

replace virtme

Open lmb opened this issue 1 year ago • 4 comments

cmd/bpf2go: don't require internet connection in tests

Disable the checksum db and the module proxy. They aren't needed for tests
and disabling means we don't need internet access.

Signed-off-by: Lorenz Bauer <[email protected]>

replace virtme with vimto

vimto is a lightweight wrapper around qemu with the sole purpose of 
executing Go unit tests. Use it instead of virtme, which has not had a
reliable upstream for a while.

Signed-off-by: Lorenz Bauer <[email protected]>

lmb avatar Jan 30 '24 14:01 lmb

Test runs are suspiciously fast.

lmb avatar Feb 02 '24 13:02 lmb

Not sure if fully applicable, but https://github.com/arighi/virtme-ng is actually supported, and is gaining traction after an article on LWN. Maybe something to look at if we want to replace virtme

paulcacheux avatar Feb 08 '24 10:02 paulcacheux

@paulcacheux yeah, I'm aware of virtme-ng! I looked at it a while ago.

Pro:

  • Already works
  • Support for a variety of kernel sources
  • virtiofsd
  • gdb support?

Con:

  • Dependency on rust for init which makes it more difficult to install.
  • Doesn't allow distributing kernels as OCI images

So even if we use virtme-ng we need some wrapper code. vimto is easy to install when you're in the go ecosystem already, and I want to add go specific things like a delve wrapper.

Overall virtme-ng is probably the saner choice. The good news is that we can always rip out vimto if it turns out to be too much of a burden.

lmb avatar Feb 23 '24 14:02 lmb

Finally managed to get CI green. @ti-mo @dylandreimerink @rgo3 maybe you can give it a spin on your machines to see whether it works? (I know that Robin's nix setup is mysteriously broken.)

lmb avatar Feb 23 '24 14:02 lmb

Current status is that vimto needs a bit more thinking. @ti-mo how about I upstream the non-CI changes so that I can use vimto on my machine to test? Currently stranded without a viable virtme and the changes themselves are useful either way I think.

lmb avatar Mar 21 '24 11:03 lmb

Any concerns around merging this? It's at least as useable as virtme from my side.

lmb avatar Apr 29 '24 15:04 lmb

I had some issues running vimto locally initially. When I ran the command from the updated index.md to run vimto locally vimto -- go test ./... it fails with a lot of Error: exec: binary is not statically linked (did you build with CGO_ENABLED=0?) errors. Turns out its because I didn't add CGO_ENABLED=0 when installing vimto itself go install lmb.io/vimto@latest. Adding so is very unusual. It would be nice if we can look into not requiring this. Or else add warnings in docs. Because I think more people will hit this.

Other than that, everything seems to be working! I say merge

dylandreimerink avatar Apr 30 '24 09:04 dylandreimerink