Thoughts on EC2 & virtuerl
Posted: January 28th, 2008 | Author: kevin | Filed under: Erlang | View CommentsI’ve been spending the last few evenings working on an Erlang AMI image. I want to make deploying Erlang nodes into EC2 as easy as possible. A quick perusal of the public images didn’t yield what I was looking for so I’ve been digging in and learning the ins and outs of EC2 and S3. There are a few rough edges but I think Amazon has done a great job overall.
When I’m done the image will make it drop-dead simple to deploy Erlang nodes into EC2’s grid. I’m basing the image on Ubuntu 7.10 server and the latest Erlang sources along with a few changes to allow distributed Erlang to work over a single SSL socket (hat tip to Michael McDaniel for the excellent wiki article). The image will be free and publicly available once I’ve shook out most of the bugs.
The next thing I want to do is create infrastructure to harness the power of Erlang nodes on EC2. That’s where virtuerl and MochiWeb come into the picture. MochiWeb is a web server construction kit of sorts. I intend to use it to create a “Erlang aware” proxy which delegates requests to the nodes running inside EC2 like so:
The proxy will use virtuerl to automatically start and stop nodes as needed, within limits, to handle the requests.
virtuerl, when it’s all grown up, will be much more than a wrapper around the EC2 APIs. virtuerl will be a full-fledged management library for EC2 nodes. My goal is to be able to start a node and remotely deploy an application onto it in just a few lines of code. Of course virtuerl will cooperate with existing Erlang features like the code server to make deployment as compatible as possible with existing Erlang applications. Why reinvent tools when the language comes with such nice tools already built in?
I think this design is a compelling way to use the EC2 infrastructure and would be compelling to businesses ranging in size from startups to more established companies. I’m pretty sure Joel Reymont has done something similar before but is prevented from giving the details due to NDAs. So while I’m not the first guy to think of this nor the first one to even do it, my goal is to implement this all out in the open so more projects can leverage the power of grid computing and Erlang.