robur-coop / albatross

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

Verify devices with manifest #47

Closed reynir closed 3 years ago

reynir commented 3 years ago

WIP

This change makes albatrossd check the manifest returned by solo5-elftool query-manifest <image> with the devices specified by the client and returns an error message if they don't match up.

I am thinking it may be worthwhile to check on the client end as well before the unikernel image is sent across the wire.

Fixes #42.

hannesm commented 3 years ago

Thanks for working on this. I think it makes a lot of sense to to this check in albatross_client as well.

On the server side, I wonder whether we want to ensure that the bridge interfaces are configured on the host system, and fail with an appropriate error message if not (AFAICT atm it just calls out to ifconfig <bridge> addm <tap> or ip link set dev <tap> master <bridge>).

Block devices are slightly different: albatross_daemon reads the db_dir / block_sub at startup and pretends only albatross_daemon will do any changes to that directory hierarchy (which I think is fine for now -- esp. since the block device part is not very much tested, so let's leave it in that state).

hannesm commented 3 years ago

I implemented the suggestions above myself, and pushed two commits here.

reynir commented 3 years ago

Looks good to me! Thanks.

reynir commented 3 years ago

https://github.com/reynir/albatross/pull/1 makes it so solo5-elftool is not a hard dependency for the clients so clients can create unikernels without solo5-elftool.

hannesm commented 3 years ago

Thanks @reynir -- I'm not sure whether this is the way to go -- since it results in albatrossclient* having different semantics (in terms of which errors are displayed / whether a create is successful) depending on what things are installed on the system. I find this irritating for a user, and am not sure whether it is worth the code complexity.