Live data from Hacker News

MirageOS 4.0 – Self-managed internet infrastructure with unikernels

mirage.io

11–20 of 38 posts

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#11
post #3

This project mentions it’s based on the Xen hypervisor and uses EC2 as an example for running it, but haven’t AWS now moved to their own KVM based hypervisor? Would this still work?

In ancient times, only Xen was supported. Nowadays, the support moved to:

  - Xen (PVH)
  - Linux KVM, FreeBSD BHyve, OpenBSD VMM
  - SPT (seccomp, no hardware virtualization)
  - virtio (GCE, ..)
  - muen (muen.sk)
Take a look at https://github.com/solo5/solo5 which is used as the low level bits to run OCaml.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#12
post #2

I am fascinated by Unikernels. But how do they deal with things that need to fork or run multiple processes? Aren't they restricted to single processes?

We use asynchronous tasks in MirageOS (cooperative multitasking) using lwt http://ocsigen.org/lwt/latest/manual/manual, so you can serve multiple network connections at the same time.

Since there are no processes, there's no concept of "fork", but indeed you can run multiple tasks at the same time (using the same address space). Why again would you need multiple processes? Since the programming language OCaml has a semantics and is memory-safe, there's no strong reason for isolation at execution time (apart from the C bits, which we try to keep to a minimum and compile with runtime safety flags (red-zone for stack protection, mapping execute-only (seems to only reliably work on OpenBSD), etc.)).

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#13
post #7

This name is associated with a lot of nostalgia for me, as it is the same name as the shell launcher for Texas Instruments' TI-83/84 graphing calculators.

I was about to mention the same thing. Theses appear to be completely unrelated projects. And here I was about to dust of the old TI-84 to try it out.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#15
post #12
post #2

I am fascinated by Unikernels. But how do they deal with things that need to fork or run multiple processes? Aren't they restricted to single processes?

We use asynchronous tasks in MirageOS (cooperative multitasking) using lwt http://ocsigen.org/lwt/latest/manual/manual , so you can serve multiple network connections at the same time. Since there are no processes, there's no concept of "fork", but indeed you can run multiple tasks at the same time (using the same address space). Why again would you need multiple processes? Since the programming language OCaml has a…

Is this also how you deal with logging/monitoring?

Do you have a concept of logging daemon? How would I run prometheus exporter-like things?

Is there a FAQ where questions along these lines are answered?

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#16
post #12

Earlier quoted context omitted.

We use asynchronous tasks in MirageOS (cooperative multitasking) using lwt http://ocsigen.org/lwt/latest/manual/manual , so you can serve multiple network connections at the same time. Since there are no processes, there's no concept of "fork", but indeed you can run multiple tasks at the same time (using the same address space). Why again would you need multiple processes? Since the programming language OCaml has a…

Is this also how you deal with logging/monitoring? Do you have a concept of logging daemon? How would I run prometheus exporter-like things? Is there a FAQ where questions along these lines are answered?

Just substitute 'microservice' with 'unikernel' and you do broadly the same things. There's a prometheus library that you link with the MirageOS unikernel and it exports using that: https://github.com/mirage/prometheus

No FAQ for this sort of thing yet, but we should start assembling one sometime soon. Questions like this very welcome on the discussion forums: https://discuss.ocaml.org/t/ann-mirageos-4-0/9598 to help us get started.

There's a nice collection of unikernels over at: https://github.com/roburio/unikernels and https://github.com/tarides/unikernels for various infrastructure pieces (like https, smtp, dns, ip filters, etc) that are good to crib from for your own infrastructure.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#17
post #2

I am fascinated by Unikernels. But how do they deal with things that need to fork or run multiple processes? Aren't they restricted to single processes?

This all started because we wanted to _get away_ from the need to fork or run multiple processes, since that's so hard in a variety of hardware architectures (like mobile or embedded).

Other researchers also share the dislike of fork... https://www.microsoft.com/en-us/research/uploads/prod/2019/0...

A 2010 paper where I sketched out some of the early ideas around "multiscale" is here: https://anil.recoil.org/papers/2010-bcs-visions.pdf

It took a little longer than I'd planned, but thanks to the hard work of so many MirageOS contributors, now's a pretty good time to glue back personal containers and self-hosted data management infrastructure again! Unikernel-based messaging has really come together in the past couple of years: https://tarides.com/blog/2022-03-08-secure-virtual-messages-...

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#18
post #12

Earlier quoted context omitted.

We use asynchronous tasks in MirageOS (cooperative multitasking) using lwt http://ocsigen.org/lwt/latest/manual/manual , so you can serve multiple network connections at the same time. Since there are no processes, there's no concept of "fork", but indeed you can run multiple tasks at the same time (using the same address space). Why again would you need multiple processes? Since the programming language OCaml has a…

Is this also how you deal with logging/monitoring? Do you have a concept of logging daemon? How would I run prometheus exporter-like things? Is there a FAQ where questions along these lines are answered?

Maybe https://hannes.robur.coop/Posts/Monitoring sheds some light how to monitor MirageOS unikernels ;)

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#19
MirageOS is really interested when combined with Qubes OS. I've started looking at MirageOS, and since I use Qubes, being able to run things directly on Xen right next to my regular VM's is really neat.

There are also projects to replace sys-firewall with a MirageOS unikernel instead. That's something that seems very interesting.

Re: MirageOS 4.0 – Self-managed internet infrastructure with unikernels

#20
post #19

MirageOS is really interested when combined with Qubes OS. I've started looking at MirageOS, and since I use Qubes, being able to run things directly on Xen right next to my regular VM's is really neat. There are also projects to replace sys-firewall with a MirageOS unikernel instead. That's something that seems very interesting.

Qubes OS?
Post reply on HN