robur-coop / mirage-noconfig

Try to infer config.ml for a MirageOS unikernel by looking at unikernel.ml
8 stars 0 forks source link

implementation selection #9

Open hannesm opened 5 years ago

hannesm commented 5 years ago

KV is the canonical example that has a variety of implementations we'd like to support:

in MirageOS atm the unikernel developer has to select which implementation should be used, which is wrong. instead, for any unikernel with such a KV device (KEYS : KV_RO), noconfig should offer an optional --kv-keys=[mem|unix|dns|git|fat|crunch] (no crunch if KV_RW) and emit the necessary boilerplate (including boot parameters etc.).

hannesm commented 5 years ago

taking a step back, maybe it helps to document what the current state of things is:

cfcs commented 5 years ago

We discussed storing the information what devices are available/implements which interfaces in OPAM metadata to make the information available without having to hardcode it in noconfig or mirage. This will allow library authors to self-declare, which should make it more ergonomic to develop against.

It will allow noconfig to display a list of implementations for the user to choose from.

Concretely, for device implementations we will need:

We discussed encoding this either into OPAM feature keys, or keys prefixed with x- (which we think are available).

cfcs commented 5 years ago

(continued): Some of these fields can under various circumstances be inferred, that would be nice to bring down the amount of boilerplate device implementers have to write.

hannesm commented 5 years ago

in respect to the name, I'd suggest to use the interface name -- Mirage_kv.RO -- since in the end that's what we're working on anyways ;) -- note that the opam dependency is already defined in the opam file (i.e. that it'll need the mirage-kv package), so we don't need that one.

potential examples follow:

certainly, the interface name could be part of the key (if that eases opam queries): x-mirage-implements-mirage-net-s (TODO figure out what are the allowed characters in keys)