Ask Slashdot: Scientific Computing Workflow For the Cloud?
diab0lic writes "I have recently come into the situation where I need to run cloud computing on demand for my research. Amazon's EC2 Spot Instances are an ideal platform for this as I can requisition an appropriate instance for the given experiment {high cpu, high memory, GPU instance} depending on its needs. However I currently spin up the instance manually, set it up, run the experiment, and then terminate manually. This gets tedious monitoring experiments for completion, and I incur unnecessary costs if a job finishes while I'm sleeping, for example. The whole thing really should be automated.
I'm looking for a workflow somewhat similar to this:
- Manually create Amazon machine image (AMI) for experiment.
- Issue command to start AMI on specified spot instance type.
- Automatically connect EBS to instance for result storage.
- Automatically run specified experiment, bonus if this can be parameterized.
- Have AMI automatically terminate itself upon experiment completion.
Something like docker that spun up on-demand spot instances of a specified type for each run and terminated said instance at run completion would be absolutely perfect. I also know HTCondor can back onto EC2 spot instances but I haven't really been able to find any concise information on how to set up a personal cloud — I also think this is slight overkill. Do any other Slashdot users have similar problems? How did you solve it? What is your workflow? Thanks!"
EC2 is inherently scriptable. There's nothing stopping you from using the command-line tools to fire up an instance, and let it run, and store its results to S3, and then decommission the instance. You can even set the instances to terminate on shutdown, which deletes the instance EBS stores (if you're using EBS) and deletes the instance. Sounds like you just need to spend 30 minutes reading the docs.
Does exactly what you need and is designed explicitly for integration with third party tools. Spins up everything from disks to automating webforms and jobs and imports and exports of jobs. There really isn't anything else out there that comes close to what Workflow will do. Used to be called Altiris Workflow. Works with everything from CMDB, change management, service desk to multiple languages.
http://www.symantec.com/connect/articles/learn-about-symantec-workflow
Because your workflow is likely to be customized to your tasks, it should be straightforward to write these kinds of tools yourself, with any number of available toolkits, based on what language you're most comfortable using.
There's the straight CLI: http://aws.amazon.com/cli/
And lots of sample code for the various SDKs: http://aws.amazon.com/code
Best to just dive in. If you have any development experience at all, even just scripting, you should be able to figure it out pretty quickly.
Since my scientific workflow always includes Python it is natural for me to use boto.
https://github.com/boto/boto
http://boto.readthedocs.org/en/latest/
http://aws.amazon.com/sdkforpython/
Jenkins would probably be useful in this case, with this plugin:
https://wiki.jenkins-ci.org/display/JENKINS/Amazon+EC2+Plugin
You certainly can have a personal cloud, or an internal cloud, or a private cloud.
The term cloud is one of those that people seem to go out of their way on Slashdot in order to misconstrue or misunderstand, when in fact its simple - its a resource that you want to do X but you don't necessarily want to know the indepth details of how it goes about it. I want a website hosted, I want it redundant and I want it scalable, but I dont necessarily want to give a toss about manually balancing resources across several servers. Creating a single resource out of all of my local servers and letting the management software work out the details of where and how my redundant, scalable website is spread across those individual servers...
Old timers might call it something else, or people coming from a particular industry might call it something else, but for the rest of us its just the cloud. Its separating the physical resource from the task you need to do, hiding the complexity of the underlying resource provision so you just get the task done. In an IT department for a large company, the hardware department might create a private cloud in order to remove the task of managing the hardware from the various departments that might want to utilise them, so they just allow the web department to deploy their sites, and the analytics department to run their tasks etc etc all without worrying about hardware failing or getting gummed up by a single process, because the underlying management later spreads the load across multiple physical resources automatically.
Amazons http://aws.amazon.com/cloudformation/ can get you 95% of the way there (add a few small scripts via Boto, or some integration with http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html)
A little elbow grease will get you the rest of the way without additional costs.
-- (appended to the end of comments you post, 120 chars)
Here's how I ran my PhD simulations on EC2: .tar.gz to download, and the path to download it
- The AMI downloads a manifest file at startup.
- The manifest has one record per line, two fields per record: the s3 URL of a
- The AMI then runs a shell script (/etc/run.sh) that's been put there by a manifest entry
Shell scripts upload new files to s3 (e.g., /etc/run.sh) and have ec2 run new VMs. When the VMs are loaded, they're running everything I need, ready to go.
Other shell scripts stopped/started experiments on these VMs.
Other shell scripts shut down the VMs when I'm done.
The scripts did little more than scan the appropriate machine list from the ec2 tools and ssh into them with a specific command.
At the end, I had some of the experiment-specific scripts quickly have git clone/pull in files I was changing quickly per experiment.
All of it worked really well for me. Nothing fancier than the ec2 command-line tools, bash, ssh, & git necessary.
Care about electronic freedom? Consider donating to the EFF!
http://star.mit.edu/cluster/
The rest of it is easily scriptable. I have some ebs based AMIs that on bootup, connects to a central server, /etc/hosts).
registers itself (ticks up a text file, and adds itself to
If you combine starcluster for generic cluster management with the existing Amazon provided tools
http://blog.roozbehk.com/post/35277172460/installing-amazon-ec2-tools)
this is really only a days worth of scripting and testing.
There are also several public AMIs on Ec2 that are oriented towards scientific computing.
http://www.google.com/search?q=ec2%20ami%20scientific
This is my day job stuff.
Look up cloudify on cloudifysource.org.
It enables spinning up machines on the cloud of your choice (including EC2). Then it installs and configures your software on those VMs. Finally it monitors all processes that you request it to monitor, including listening to exposed custom metrics, e.g. over a jmx port.
In your case, when your experiment ends, if your software exposes some api or metric that can indicate that, cloudify can take that as a trigger for shutting down or spinning up the next experiment.
A nice bonus is that it can elastically scale in and out your VMs to handel varying loads and automatically restart problematic VMs or processes.
sigo ergo sum