While there have been a bunch of scripts to do this, they've all been a bit delicate against oddities in Amazon's tools. They've also required you to have Amazon's tools, have root access, and/or have another Amazon instance running.
ec2-unikernel doesn't require any of those, and should work for any PV Xen unikernel.
Binaries available for Fedora and Ubuntu; see the README on GitHub for more information.
What this will do, for those who like a summary, is:
- Find Amazon's PV-GRUB AKI for your region.
- Make an S3 bucket for storing unikernels, if you don't already have one. (You can optionally choose what this bucket is called, by the way.)
- Use the 'guestfish' tools to build a disk for your unikernel, by:
- Making a blank disk.
- Adding an ext3 file system to it.
- Adding your unikernel and any initrds/initramfs's you'd like
- Creating a grub.conf that references all this, and putting it in the right place.
- Uploads this image to S3.
- Imports it from S3 into an EC2 Snapshot.
- Creates an AMI from said Snapshot and the AKI found in the first step.
Haskellers can just use
cabal-install to get it, as I've just installed it to Hackage. Beware that the dependency chain is long, which means it takes awhile to build and may cause
cabal pain. Consider a sandbox or
new-build and friends.
Please leave any bugs or feature requests at the GitHub page. Have fun!