Skip to main content
  1. Posts/

Running Folding@Home on AWS with AWS CDK

··440 words·3 mins·
DevOps Aws AWS CDK Folding@Home

Folding@Home(aka FAH) is a distributed computing project. To quote from their website,

FAH is a distributed computing project for simulating protein dynamics, including the process of protein folding and the movements of proteins implicated in a variety of diseases. Folding@Home involves you donating your spare computing power by running a small client on your computer. The client then contacts the Folding@Home Work Assignment server, gets some workunits and runs them, You can choose to have it run when only when your system is idle, or have it run all the time.

While I used to run FAH long, long back - dating back to my forum days, I eventually stopped due to lack of proper computing equipment. Recent events with the COVID-19 situation and FAH’s projects around it (see Coronavirus - What we’re doing and COVID-19 Small Molecule Screening Simulation for details) and the relatively powerful computer I built recently meant that I could run FAH on my desktop computer.

Now, I had some extra credits for AWS that were to expire soon and I figured instead of letting them go to waste, I thought to myself maybe I could spin up some EC2 instances and run Folding@Home on them. I started looking at the pricing of the GPU instances - and they were a bit pricier than what I could sustain. Considering this, I selected the c5n.large instance as I didn’t need instance and EBS-backed disks would be handy in setting up aa Auto Scaling Group.

To reduce expenses further, I started looking at Spot prices and it turned out, the spot prices were about 68% cheaper as compared to the on-demand prices. Since we don’t really care about what happens when the spot termination happens and the ASG will bring the instance count back up, I went with this option.

The spot pricing trend revealed that the prices had remained stable and just to ensure the spot bids would be fulfilled, I kept the max spot price couple of cents more than the maximum price going then. Initially, the instances were brought up by manually launching them from the AWS Console. Since long I’d been meaning to use AWS CDK, this was the perfect opportunity to learn and try to use it.

The CDK code will bring up a new VPC,a couple of subnets, an ASG and attach a security group to allow for SSH into the instance. The code is not the best, there’s a bunch of hard-coding of regions, AMIs, SSH key names, but pull requests to clean up and make it more generic is more than welcome! Check out the code on my GitHub Repo

Sathyajith Bhat
Author
Sathyajith Bhat
Author, AWS Container Hero and DevOps Specialist.

Related

DevOps Diaries: When Terminator terminates your MySQL imports onto an AWS Instance…
··627 words·3 mins
DevOps Aws
I have begun to use Terminator quite a lot. Terminator’s quite handy when you want to connect to multiple servers on a single terminal thanks to its split pane feature. (And yes I know about tmux & screen - I have screen on my servers, don’t want to get into the headache that is nested screen panes). Few days back we were preparing for a big migration & deploy and I was tasked upon to prepare a failover just in case the migration goes wrong.
At AWS re:Invent 2019
··226 words·2 mins
Events Aws ReInvent
I’ve always dreamed of being at reInvent and this year, not only do I get to be at re:Invent, I also get a chance to lead a Dev Chat. I’m really excited to be there, to present and more importantly, to meet and interact with other AWS Heroes and re:Invent participants. Last year, I was honoured to being named as one of the Community Heroes and almost made it to re:Invent 2018.
Setting up a secure Docker image scanning solution with Anchore and Drone CI
··616 words·3 mins
DevOps Anchore Container Security Containers Docker
A while back I had done a round up of a few container scanning solutions and had mentioned I wanted to take another look at Anchore. The past few days, I’ve been playing a bit with Anchore - this time, integrating it with Drone CI. Drone is a “Container-Native, Continuous Delivery Platform” built using Go. It makes use of a YAML file, .drone.yml to define and execute the pipeline. End Goal # For this project, we will be integrating Drone and Anchore.