Repository navigation
VM tests for Archlinux - #589203
VM tests for Archlinux#589203RaitoBezarius wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Thanks for contributing to the documentation.
Follow the documentation style guide, especially:
- Show, don’t tell. Start with a minimal working example. Explain after the code.
- Avoid meta-commentary. Don’t write "This section explains how to…".
- Use present tense, imperative mood, and active voice. For example: "Run the command," not "The user should run the following command."
- Avoid vague references like "this" when the referent is unclear. Write "This command creates a folder," not "This will create a folder."
- Be direct. Avoid "should", "might", "typically", and "usually".
- Cut filler words like "simply", "just", "easily", and "basically". Use "to" instead of "in order to".
For larger changes, such as adding or removing whole sections, ask the NixOS documentation team for review.
This is Allison Karlitskaya's VM runner. https://cfp.all-systems-go.io/all-systems-go-2025/talk/MLTTHW/ It boots a stock "cloud" image and drives it entirely from the outside using: - systemd credentials over SMBIOS type 11 OEM strings - boot completion arrives as a sd_notify message over AF_VSOCK - commands are run over SSH through a AF_VSOCK listener There's no cloud-init, no guest agent, no network configuration required in the guest. Vanilla systemd. The Lix project is planning to use it to improve testing on non-NixOS distribution and present this as an alternative model for VM test frameworks than the NixOS's one. Classical packaging cleanups: FHS paths, upstream test suite using the network. The vendored workarounds and the VM Image API document are installed as package data. Once I have some time, I will try to talk with upstream to clean this further.
e50b899 to
6f9692a
Compare
|
Hi @RaitoBezarius, really nice to see this, testing installers on non-NixOS distros has been missing for a long time! We've been working (@kmein did most of it) on something closely related that might be useful to you: https://github.com/applicative-systems/nix-and-match Instead of a new tester, it plugs into As an example, I added Lix installer tests: https://github.com/applicative-systems/nix-and-match/tree/main/examples/lix-on-distros Your approach has things ours doesn't: no cloud-init and nothing installed in the guest, SSH over vsock instead of a serial shell, and a path to Darwin. |
Ma27
left a comment
There was a problem hiding this comment.
It's pretty cool to see this being moved forward. Especially with a relatively familiar UI.
I haven't given this a deeply thorough review, but reading over how it's structured this looks pretty sensible to me.
While we've chatted yesterday on this already, I guess it makes sense to summarize my general stance here I came to the conclusion that developing this outside the test driver is sensible for now We've had a large influx of nice features, but I feel like it's getting time to consolidate & clean up: non-exhaustive list, but
- the machine consolidation here seems pretty useful for when we need to expand scope, so we might work towards that
- the qemu-vm wrapper is a grown shell script that requires cleanup, I started this by porting the virtiofsd job-contro stuff to async python.
- I'm very intrigued by an async core, both the way we can implement timesout, but also to replace most of our "management" threads that are essentially watching subprocesses. I even have ideas for keeping backwards comapt with the current testScript to not have an insane migration path.
- Look into (finally) replacing the backdoor.
So yeah long story short I think it doesn't hurt to have its own codebase for this for the time being as something experimental or using the extensionn points of the test driver as @tfc does.
If it'd be helpful, I'd be happy to help set up a NixOS/ repo for that with my GitHub org owner hat on.
amazing, love it a lot |
Hi tfc, great work here but I don't think it's a good idea to tie this together to the existing test driver. It suffers from a lot of technical debt and accumulation of a rich feature set. I'm more interested into taking a step aside and build an alternative driver that can learn the lessons from the original test driver and supersede it at some point. The original test driver has some severe shortcomings that are causing a lot of issues for my usage under heavy load usage and fixing them without breaking the backward compatibility is hard. If you think that having non-NixOS support in the original test driver is a good idea, feel free, but for the reasons I mentioned, I think it's a dead end. It would be better architecturally wise to start from a blank canvas and take a look at what people wants to do with the test driver and design it from there. I'm already in collaboration with @Ma27 on a couple of these ideas and promised Allison I would make something out of this for the NixOS space already 2 years ago: we can set up a more specific room on the AFNix Zulip on this topic if you are interested.
Thank you for the support but I'd like to keep it in the monorepo as it's easier. If we want to publish it separately, we could set up monorepo exports systems but otherwise I think I'm completely fine developing it in-tree. If we wanted to have another tree, I would prefer something that is not GitHub because GitHub is painful these days but I do not see the need for it atm. |
This sounds very black-or-white, but i share this sentiment to some extent. In the past it has not been easy to drop baggage and we're constantly (politely) defending against new features that are overly specialized. At the same time so many companies depend on the test driver, so it's not easy to really rethink stuff without breaking a lot. I am interested to be in the loop on new developments, of course. Thank you for mentioning the zulip thing - |
|
What would be better or worse, if we switched to Incus (the fork of LXD) which can manage VMs and Containers in a more secure, feature rich way? Networking, Devices, Storage, etc. become easier to provision across VMs and Containers and could then later pull in Services. Incus (LXD) removes the pain of mapping and config if you take a look. Easy command structure thats perfect to be wrapped if need be. The other thing I'm thinking, is that by using Incus it might help towards better integration with Docker.sbx as it matures. Thoughts? |
Don't get me wrong, I know there's a lot to salvage and we have worked on it in the past as you know. The cost / benefit ratio is not really good I feel like.
I will ask to fix that, please wait for news early next week.
What would be the purpose of integrating with Docker.sbx? I'm not sure I understand fully the motivations of reusing Incus which is a great piece of software but is oriented towards production workloads and this is a test driver. How do you tie those two together? |
A few things that are problematic currently and Docker.sbx helping, with/without Incus:
Incus is an easier path for defining the host VMs (running many Docker.sbx's) and containers (running apps or services needed for tests). And defining the custom networks needed to tie them together. The host VMs and Containers sometimes run proprietary hardware through passthrough. Does that help? |
I don't get it, your AI agents can simply use nix-build and it does sandboxing? Could you be more precise in what are the limits you have encountered?
Why is it a goal?
This is not related to VM testing anymore, right?
OK but you can run Nix inside Docker.sbx for that, no?
I'm still not sure where you want to go with all of that, I feel like there's a mixup between isolation goals at the Nix level, VM testing and production VMs? Could you perhaps open an issue with more details? |
This is the driver behind the future `testers.runImageTest`. It boots a virtual machine image and drives it from the outside, which is what you need to test a distribution image. This is not NixOS, so there's no module system to provision the target system, no serial console shell to scrape and the image may not even run bash as /bin/sh :-). The whole API is async, because `test.thing` is async and async APIs are increasingly a good choice for these things. A side effect worth mentioning: because the script is a coroutine body, `asyncio.timeout` gives us the global test deadline instead of what the sync driver in NixOS does. The logger, the exception types and the duration coercion are imported from `nixos-test-driver` rather than copied. They are not specific to NixOS machines.
6f9692a to
c394af4
Compare
For a long time, only NixOS benefited from the marvel that the test framework represent to all of us.
I recently got into a quick hobby called Lix and we have to maintain now installers for non-NixOS distributions, including non-Linux OSes.
Enter into Allison Karlitskaya's VM runner.
It boots a stock "cloud" image and drives it entirely from the outside
using:
No need for any cloud-init, nor a guest agent, nor network. Just vanilla systemd.
Once you have this, we wrap it in a familiar API for test scripts to the NixOS test framework (but async!) and wrap it into familiar Nix code. And here you go, feeling at home like with NixOS modulo provisioning.
This was successfully tested on ~15 VM tests on Arch Linux for the Lix installer and helped me find a couple of bugs!
Limitations:
Things done
./result/bin/.passthru.tests.