top | item 46649786

Hands-On Introduction to Unikernels

107 points| valyala | 1 month ago |labs.iximiuz.com

41 comments

order

bregma|1 month ago

So, if I understand correctly, a "unikernel" is what we used to call an "executive" except it is intended to be run as a guest on a virtual machine provided by a full-fledged traditional kernel/userspace OS instead of on bare metal.

The article does reintroduce some concepts that were commonplace when I was first learning computers and it gives them some new names. I like that good ideas can still be useful after years of not being the latest fad, and it's great that someone can get new credit for an old idea with just a little bit of marketing spin.

valyala|1 month ago

There is no need in the operating system to run Unikernels. Every Unikernel includes parts of operating system needed for interacting with the underlying hardware. So Unikernels can run on bare metal if they know how to interact with the underlying hardware (i.e. if they have drivers for that hardware). Usually Unikernels are targeted to run on virtual machines because virtual machines have unified virtualised hardware. This allows running the same Unikernel on virtual machines across multiple cloud providers, since they have similar virtual hardware.

fulafel|1 month ago

Amiga: https://wiki.amigaos.net/wiki/Introduction_to_Exec

> The Multitasking Executive, better known as Exec, is the heart of the Amiga's operating system.

> All other systems in the Amiga rely on it to control multitasking, to manage the message-based interprocess communications system, and to arbitrate access to system resources.

g-b-r|1 month ago

They can generally be run on bare metal, to my knowledge.

I personally don't remember exactly what was meant with "executive".

deivid|1 month ago

This is really well written, thanks for sharing.

I didn't understand the point of using Unikraft though, if you can boot linux in much less than 150ms, with a far less exotic environment

nderjung|1 month ago

Hey! Co-founder of Unikraft here.

Unikraft aims to offer a Linux-compatible environment (so it feels familiar) with the ability to strip out unnecessary internal components in order to improve both boot-time/runtime performance and operational security.

Why would you need a memory allocator and garbage collector if you serve static content? Why would you need a scheduler if your app is run-to-completion?

Linux gives you the safety-net of generality and if you want to do anything remotely performant, you by-pass/hack it altogether.

In the article, Unikraft cold-boots in 150ms in an emulated environment (TCG). If it was running natively with virtualization hardware extensions, it can be even shorter, and without the need for snapshots which means you don't need to store this separately either.

pjmlp|1 month ago

Security, it isn't only memory footprint.

iberator|1 month ago

Which architecture can boot it in 150ms ?!

victorbjorklund|1 month ago

Because it will be slightly faster and you will use less resources? For a lot of use cases that probably does not matter but for some it does.

hun3|1 month ago

Hypervisor as a microkernel

pjmlp|1 month ago

Yes, there is a certain irony when you look at the cloud workloads with a type 1 hypervisor managing either serverless or container workloads.

tuananh|1 month ago

the missing piece of unikernel is debuggability & observability

- it need to be easy to replicate on dev machine & easy to debug - it needs to integrate well with current obs stack. easy to debug in production.

without clear debuggability & observability, i would never put it into production

imiric|1 month ago

This is a common myth. Debugging unikernels is indeed possible[1][2]. It may not be the type of debugging you're already used to, but then again, unikernels are very different from containers and VMs, so some adjustment is expected.

As for observability, why is that the concern of unikernels? That's something your application should do. You're free to hook it up to any observability stack you want.

[1]: https://nanovms.com/dev/tutorials/debugging-nanos-unikernels...

[2]: https://unikraft.org/docs/internals/debugging

pjmlp|1 month ago

Easy the very same kind of mechanisms for rootless/no-ssh containers are available.

traxler|1 month ago

I've found the idea of unikernels interesting for several years now, is there a tl;dr on why they don't seem to have taken off, like at all? Or is it all happening behind some doors I don't have access to?

pjmlp|1 month ago

They kind of did, that is basically how serverless works.

Managed runtimes on top of hypervisors.

meehai|1 month ago

[deleted]

rantingdemon|1 month ago

I would like to follow the tutorial but it mentions a playground.

Am I missing something as I cannot find a link or instructions for the playground.

chloeburbank|1 month ago

once you login with github there's a start button on top left for that