feat(monitors): expose a configurable control socket#841
Conversation
Launch Firecracker with --api-sock instead of --no-api, keeping --config-file so the guest still boots from the config file exactly as before. The only change is that the control socket now stays open and reachable after the guest starts, so the runtime can talk to the VMM afterwards. Signed-off-by: Anamika Aggarwal <anamikaagg18@gmail.com>
Add a socket_path field under a monitor's configuration, wired through MonitorConfig, ExecArgs and the state.json annotation passthrough the same way the existing monitor fields are. Firecracker's launch command uses it when set, falling back to the per-container default /tmp/<id>.sock otherwise. Signed-off-by: Anamika Aggarwal <anamikaagg18@gmail.com>
Add a shared resolveSocketPath helper and use it across the monitors that expose a control socket. QEMU now exposes a QMP socket (-qmp unix:<path>,server,nowait) alongside the disabled human monitor, and Cloud Hypervisor exposes its REST API socket (--api-socket). Both honor socket_path, falling back to the per-container default, matching Firecracker. Extend the QEMU BuildExecCmd tests to cover the new arg. Signed-off-by: Anamika Aggarwal <anamikaagg18@gmail.com>
✅ Deploy Preview for urunc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Anamika Aggarwal <anamikaagg18@gmail.com>
74479f7 to
7bc678b
Compare
|
hi @cmainas, a couple of things on this PR i wanted to check with you. 1. socket_path and the /tmp constraint the socket_path field works, but there is a constraint: the monitor creates the socket inside its own pivoted rootfs (after changeRoot), and that rootfs only has a standard set of directories. so a custom socket_path has to be placed under /tmp, which is always present there. i verified this end to end: with is keeping socket_path scoped to /tmp fine for now, or do you want it fully configurable? 2. testing the other monitors i wired the socket for qemu (a QMP socket) and cloud hypervisor (its REST api socket) too, both honoring socket_path. for qemu i was able to test it fully end to end: i found for cloud hypervisor i could only cover it with unit tests (asserting the launch args), because i could not find an aarch64 cloud hypervisor image in the registry. i probed a few names (chttp/busybox/nginx variants of is there an aarch64 cloud hypervisor image i can use to test it end to end, or is x86 only expected there for now? |
Expose a control socket on the socket-capable monitors and let its path be configured, without changing how the guest boots.
--api-sock(instead of--no-api) while keeping--config-file, so the guest still boots from the config file and the socket stays open afterwards.socket_pathfield under[monitors.<name>], falling back to a per-container default (/tmp/<id>.sock).-qmp unix:<path>,server,nowait) and Cloud Hypervisor its REST API socket (--api-socket), both honoringsocket_path.Related issues
How was this tested?
go build ./...andgo test ./internal/... ./pkg/...pass (Ubuntu 24.04 aarch64 VM, KVM). Added QEMUBuildExecCmdtest cases for the new socket arg.make lintreports no findings in the changed files.state: Running). Verified with the default socket path and a configuredsocket_path.-qmp unix:<socket_path>,server,nowait; the QMP socket negotiates andquery-statusreturnsrunning.Checklist
make lint).