# Mirari, what is it, and current state: ---------------------------------------- Basically a tool "wrap the complexity of developping a Mirage unikernel". Written by Thomas Gazagnaire during its stay at the CL in the context of an OCamlPro/OcamlLabs partnership. A reminder: ----------- There are 3 possible compilers for Mirage: Unix-socket (normal compiler), Unix-direct (for use with tap interfaces to emulate ethernet), and Xen. * Unix-socket enables you to develop with the normal compiler but you don’t have access to the fancy network stack. * Unix-direct enable the full network stack but you need to have a system that supports the tun/tap virtual interface. * Xen-direct compiles into the real Xen unikernel but it do not allow debugging using UNIX tools. So basically you probably develop under Unix-direct, and deploy with Xen-direct, requiring to do frequent opam switch. ----------------------------------------------------- Now let’s see the workflow of developping unikernels: ----------------------------------------------------- 0. Install opam dependencies 1. write the code logic 2. write the boilerplate code that embed the unikernel config. This config is different according to where / in what mode you want to run the unikernel, so you have to modify that according to where you want to run it. 4. opam switch in the right compiler 5. specific steps to run/deploy it (Unix -> just run | Xen -> do additionnal steps in order to run it on your laptop/server/EC2) ------ -> All the above is tedious but for 1. -> Mirari already automatise steps 0 and 2, will do 4 and 5 in the future. ------------- How it works: ------------- With Mirari, you write the configuration in a config file, and Mirari will create boilerplate code to embed the config into the Unikernel. That’s essentially the main functionality of Mirari right now. The steps to deploy a Mirage app: - Write the Mirari config file that embed the unikernel config and information that Mirari needs in order to build and configure the app. - Use "mirari configure", that will generate an obuild config file, and boilerplate code to embed the config into the unikernel, it will also install the unikernel dependencies with OPAM. - Use "mirari build", it just build the project for now, and creates a link to the resulting exe or xen image. -------------------------------------------------------------- The missing piece: Mirari to autoswitch opam, and "mirari run" -------------------------------------------------------------- - The autoswitch idea: You put the desired mode of compilation in the mirari config file and it uses the fancy new feature of opam to launch a command a la "with_compiler_X make...". You always work under your standard (non mirage) compiler. No need to switch anymore. That has been taken care of on the opam side and require minor modification on mirari which will be done shortly. - mirari run: * Specify deployment parameters in mirari config file : * For unix-socket, just run the exe * For unix-direct, setup the tap virtual interface. This is currently done by code residing in mirage-platform, with the configuration parameters hardcoded. This will now be made by mirari using the config file parameters. * For xen, the kernel can be run locally (via xl/libvirt), on a testserver (ssh commands?), or amazon EC2. ---------------- Work to be done: ---------------- - Extend the config file syntax to take account of deployements parameters. - Isolate the tap creation code of mirage-platform into an ocaml-tuntap library. Apparently Macs need the kernel to setup its tap itself. For Linux, mirari could have taken care of creating/destroying the tunnel, which is cleaner. - Make mirari use the new opam feature to run commands under a particular compiler. - Generate config files for running xen kernels (xl config file, EC2 wrapping and config), and maybe issue the command to start it.