solo-io / unik

The Unikernel & MicroVM Compilation and Deployment Platform
Apache License 2.0
2.72k stars 191 forks source link

Implement dynamic OSv compiler #99

Closed miha-plesko closed 8 years ago

miha-plesko commented 8 years ago

Added dynamic OSV compiler that uses forked Capstan tool to create OSv unikernels. This Capstan is able to set arbitrary logical image size during compose (as opposed to default 10GB). Therefore a --size argument was added to the 'unik build' command.

Testing

You can use these three example applications to test the new funcionality: dynamic-compiler-examples.zip Just navigate to project folder and run ./unik_openstack_up.sh to create OSv unikernel, upload it to OpenStack and run it.

miha-plesko commented 8 years ago

@ilackarms @gberginc could you please make a review on this PR? So the idea is, once we merge it, to then use this same forked Capstan for Java compiler. Because then user will be able to run it with arbitrary size, not just the default 10 gigs, as we've discussed some time ago.

miha-plesko commented 8 years ago

So I've modified this PR according to the discussion above:

Also, I've added a compiler for the NodeJS that understands same manifest for NodeJS than rump. Same example application works for Rumprun and OSv:

$ cd docs/examples/example-nodejs-app
$ unik build --name imgExample --path ./ --base osv --language node --provider openstack
$ unik run --instanceName instExample --imageName imgExample

@ilackarms, I'm looking forward to hear your opinion :)

ilackarms commented 8 years ago

Following the convention that we use with Rumprun, the size of the boot volume should be dynamically calculated (based on the size of the kernel + all files the user put in the project directory + an extra 20mb for grub). If the user wants additional storage for data, that's what data volumes are intended for (which you create by specifying a --size flag). I know this doesn't fit all use cases (some apps may want everything on a single volume), but in the case of rumprun, you can mount additional volumes (i believe up to 8) anywhere you like, so the application can just refer to the mount point without having to know that it belongs to a different piece of storage.

miha-plesko commented 8 years ago

Closing this PR temporarily until we get dependent PR's merged: #111. and #110.