robur-coop / albatross

Albatross: orchestrate and manage MirageOS unikernels with Solo5
ISC License
142 stars 17 forks source link

Add a way to create a block device from a file #82

Closed dinosaure closed 3 years ago

dinosaure commented 3 years ago

Currently, it's not possible to create a new block device from a file - and then, use it for many unikernels. This is a fast patch, I don't really if it's the right way to implement it, but, at least, it compiles.

dinosaure commented 3 years ago

Currently, this patch seems to work when the saved block device has the same hash than the source file.

hannesm commented 3 years ago

Since this changes the wire format (Block.add used to be an int, now a sequence of optional string, required int), this needs to be done more carefully... but the overall idea is fine (maybe a block set / block get command should be implemented in addition to the existing (previous) add).

dinosaure commented 3 years ago

A question comes with this PR. Is it possible to use the same block for multiple unikernels (in read-only mode)?

hannesm commented 3 years ago

Is it possible to use the same block for multiple unikernels (in read-only mode)?

no, the block devices, as defined by solo5 and mirageos are read-write. only one unikernel may attach the very same block device.

hannesm commented 3 years ago

another issue is that commands are transported via X.509 client certificates that are limited in size (< 16MB). So a Block set command could only work for small block devices. Maybe it is better to develop a unikernel that retrieves or generates data from somewhere and dumps it on a block device. Though, when the block device is used for small (configuration) information, 16 MB is sufficient.

hannesm commented 3 years ago

thanks for your work. please have a look at #85 for an updated version.