Unikraft is a fast, secure and open-source Unikernel Development Kit
unikraft.org
unikraft.org
I know DevOps for bare-metal firmware is a PITA partly because of the tightly-coupled application, kernel, and libraries. I'm hoping someone familiar with Unikraft/OSv/etc could sate my curiosity...
- Do you test your app inside a container before building your Unikraft/OSv image? Or is there a way to create a CI/CD pipeline that builds your unikernel executable + tests the whole thing as a compiled unit?
- How often do bugs appear in Unikraft that don't appear when running the app on a traditional OS? To what extent does the complexity of the app's dependencies affect this?
- In terms of convenience, how does Unikraft/OSv compare to using a highly-customizable general-purpose* OS like Gentoo?
(*edit for clarity: "general-purpose OS" in the sense that it 1) can load arbitrary data using one or more filesystems 2) can execute loaded data as a program 3) has means by which a human or human-controlled machine may cause the OS to load and execute said programs. This definition does not exclude highly-specialized Gentoo/Nix/whatever setups that are tailored to run a particular program)
2. Really great question, but mostly you can expect the same functionality of an application when it runs as a unikernel because the application "thinks" it's still running in a traditional OS environment -- as it should be. Check out this documentation[5] (after step 7) about porting, it has snippets about where the boundary sometimes breaks. Even then, you can run it in POSIX-compatibility mode[6].
3. Well, general-purposes are not suited for deployment environments (which is what Unikraft is suited for). Installing Gentoo (or Ubuntu, Debian, for that matter) is a waste of resources if you only SSH in once to install your desired application.
[0]: https://unikraft.org/docs/usage/install/#docker
[1]: https://github.com/unikraft/kraft/tree/staging/package/docke...
[2]: https://builds.unikraft.io
[3]: https://unikraft.org/docs/contributing/review-process/#stage...
[4]: https://github.com/lancs-net/wayfinder
[5]: https://unikraft.org/docs/develop/porting/#providing-build-f...
[6]: https://unikraft.org/docs/features/posix-compatibility/
Thanks for the links!
[0]: https://github.com/unikraft/unikraft/pull/244
[1]: https://xen2021.sched.com/event/jAME/cloning-unikernels-on-x...
Unikraft – Fast, Specialized Unikernels - https://news.ycombinator.com/item?id=26954547 - April 2021 (72 comments)
Unikraft: Posix-Like Unikernel - https://news.ycombinator.com/item?id=26142285 - Feb 2021 (10 comments)
Cut Your Cloud Computing Costs by Half with Unikraft - https://news.ycombinator.com/item?id=25431474 - Dec 2020 (5 comments)
Unikraft Unikernel Project - https://news.ycombinator.com/item?id=17439594 - July 2018 (14 comments)
From my fairly naive-POV it seems like UniKernels are the next logical step in computing. Docker being the last jump and unikernels sitting to be the next with some form of WASM as a host.
They're solving similar problems in terms of reducing image size, startup time, security surface area, and so on. But the mechanism is quite different, so it feels like basically none of the tooling will translate. Like, where is the Kubernetes of unikernel deployments? It would have to be built from scratch, and would probably end up looking more like Terraform than like the Kubernetes of today.
We'll be launching managed kubernetes support for Unikraft unikernels soon too at https://unikraft.io
One thing I find missing with these unikernels though is IPSec support and Firewalls. I’d love to throw a unikernel image on DigitalOcean and have a secure software-defined IPSec tunnel.
[0]: https://github.com/kohler/click/wiki/IPsecEncap (and other IPSec* elements)
[1]: https://github.com/unikraft/app-click
It could make for an interesting tutorial with a full Click-based IPSec router though! :)
so what value in requiring someone to run around the interface and open it in the firewall as well?
https://rachelbythebay.com/w/2022/01/27/scale/
It seems to me that running lots of small VMs with unikernels is inherently wasteful compared to running many processes on a single machine with a shared kernel that can make optimal use of the machine's resources. Sure, the unikernel-based VMs can be smaller than equivalent Linux VMs, but one still has to allocate a fixed amount of RAM, storage, and (for public cloud platforms) CPU to each VM. We inevitably add some padding to those allocations to ensure that we have headroom, and the total probably adds up to more than we would need to allocate to a single machine (physical or virtual) running all of those processes on a single kernel. And on public cloud platforms, we have to pay for those padded resource allocations.
I've certainly done deployments with lots of small Linux VMs in the past; in my recent migration process, I was replacing such a setup with one big box. Creating lots of small VMs is certainly a convenient and robust way to independently deploy and update several components. But it's obviously not the only way.
The home page of the forthcoming Unikraft Cloud service says, "The cloud is essential to your business but you know you are overpaying." But I think a better answer is to consolidate onto a few big VMs, using container orchestration to keep deployment manageable.
Unikraft unikernels can also be managed using the same orchestration tools as containers, check out the talk at CNCF[2].
[0]: https://github.com/unikraft/unikraft/pull/219
If I'm using a public cloud platform's hypervisor, those features may benefit the cloud provider, but not me. Or are you targeting users running a hypervisor on bare metal?
Tradeoffs between actual usage costs and devops time cost, imo
Or are they a tool to achieve simplicity/elegance? Fewer moving parts to troubleshoot at the OS layer, and smaller but more formal composition.
Kernel becomes a library the application uses instead of something that jumps over the CPU context. Application runs as root with the rump kernel or unikernel liked in. Only portions of kernel actually used need to be present. System calls become function calls. Multitasking support provided by a threading library. You shouldn't run multiple applications in a unikernel.
If you have a number of servers running a hypervisor as a base OS, and your applications on its VMs are network-centric like web servers, load balancers, database services, or microservices, and you don't really use the user-level security of a traditional OS, this can enhance performance by eliminating the user-kernel CPU context switch and consume less RAM.
Towards increasing security, however, we have just introduced native support for Rust[0] in Unikraft, paving the way for more internal libraries to be based on this secure and performant language.
I need to highlight we have separate research[1][2] which will make its way upstream soon which aims to provide hardening between internal libraries (e.g. isolating the network stack or scheduler) using gates like Intel MPK or separate hardware-accelerated services.
[0]: https://github.com/unikraft/docs/pull/32
[0] https://asplos-conference.org/program/
[1]https://sigops.org/s/conferences/hotos/2021/papers/hotos21-s...
I found also this paper that talks about estabilishing a TCB in the unikernel which was a good companion read. https://www.ssrg.ece.vt.edu/papers/spma20.pdf
Who needs a lite/minimal/headless version of an OS, when you can use this instead?
Suddenly I dont need those xeon processors, a few Raspbery Pi zero's will do and the environmentalists should be happy.
Shame the SBC link is lite on information! https://unikraft.org/docs/features/embedded/
The real potential of unikernels comes from making apps that are more self-aware and take up some of the functions previously handled by linux (such as monitoring memory usage).
[0]: https://unikraft.org/docs/concepts/architecture/
[1]: https://usoc21.unikraft.org/docs/sessions/10-high-performanc...
This is something that strikes me as an obvious question about a unikernel so I'd like to see a bigger callout in the docs.
[ERROR ] GitHub rate limit exceeded! If you have not done so already,
[ERROR ] you can tell kraft to use a personal access token when contacting
[ERROR ] the GitHub API. First, visit:
Running the server in the same address space as the (uni)kernel can have major impact on performance for I/O bound apps, cutting off system calls and context switching overhead.
Ew. I hope they mean "2.66 times as fast."
[0] https://en.wikipedia.org/wiki/Rump_kernel
[1] https://github.com/nanovms/nanos
[2] https://www.gula.tech/blog/files/135c832f92668268f1e9140a524...