initial support for multiple "executables" in a single unikernel

  • From: Antti Kantee <pooka@xxxxxx>
  • To: rumpkernel-users <rumpkernel-users@xxxxxxxxxxxxx>
  • Date: Mon, 08 Jun 2015 23:43:40 +0000

[if you want to bake only single programs into your unikernels, you can stop reading now, that works exactly like before]

Hi,

For purposes of improving the memory allocator I wanted to periodically print statistics while running real programs, and moreso without having to modify each program individually or the rumprun platform globally. Since the values I'm interested in aren't behind a syscall interface, rumpctrl wasn't really an option. So, now it's possible to bake multiple executables into a single unikernel ... I guess it would then be a multikernel ;)

Joking aside for a moment, assuming you have multiple programs fermented with rumprun-cc, now you can do:

rumpbake board output prog1 prog2 ...

And when you rumprun output, all of prog[1...] will be launched. Only once all of prog[1...] have exited, the unikernel will halt (or of course if you explicitly call reboot()).

Current limitations:
1) does not deal with symbol collisions in progs (should be easy to fix?)
2) all programs get the same argv (a bit harder to fix?)
3) there is no "job control"/"rc script", i.e. you can't say e.g. "run prog1 first, and only when it exits run prog2 and prog3 in parallel" (ditto)
4) the implementation is bit ugly (the ugliness is not exported, so it's in the "easy problems" category)
5) the "break main" debugging idiom works only for main() of prog1 (this probably can't really be fixed, but perhaps there's some trick to make it more obvious how to break at the entrypoint of prog[n])

Eventually, especially after figuring out "2" and "3", multiprogram support will give the ability to bake command utilities into unikernels so that we don't have to reimplement complicated command utilities, e.g. firewalls, in rumpconfig, or rely on rumpctrl to externally handle configuration. I've been talking about that for at least a year, so it would be nice to get it finally done. If working on some of the above issues is interesting to someone, I'm happy to donate things from my plate.

Time to get back to the memory allocator ...

- antti

Other related posts: