Download This Virus

Written by dcollins_peak6 | Published 2020/04/03
Tech Story Tags: covid-19 | trading-platform | stock-market | computers | folding-at-home | peak6 | coronavirus | hackernoon-top-story

TLDR Kevin Newman of Simplifying Disaster Recovery with Pure ActiveCluster and VMWare MetroCluster fame had a great idea on how we might do more to fight the spread of COVID-19. He shared out some work he’d done getting [email protected] up and running in our #general chat: "I've been struggling to think about how I can help in all of this given that I know about as much about medicine or biology as I do about power tools (embarrassingly little) Kevin’s heads up in #general quickly got us thinking about how to do even better putting PEAK6 machines to work.via the TL;DR App

Donating Compute to Fight COVID-19

At PEAK6 Capital Management, we have some beefy boxes for processing intraday data as you’ve probably already read about in A Parable of Pricing, Processors, and Memory. While we’re all fighting the spread of COVID-19 by working remotely and isolating, Kevin Newman of Simplifying Disaster Recovery with Pure ActiveCluster and VMWare MetroCluster fame had a great idea on how we might do more. He shared out some work he’d done getting Folding@Home up and running in our #general chat: 
@knewman: I've been struggling to think about how I can help in all of this given that I know about as much about medicine or biology as I do about power tools (embarrassingly little). It's also hard to be "socially distant" and do something useful at the same time 😄. My mom, for instance, knows how to sew, so she's joining a community group sewing emergency facemasks. I know compute, so I was excited to hear that I can redirect my many home computers and servers at something useful: Folding@Home. 
Kevin’s heads up in #general quickly got us thinking about how we might do even better putting PEAK6 machines to work too. 

What is Folding@Home?

First, some quick background. Folding@Home is a Stanford Medicine project that uses donated compute to discover new protein folding patterns. Protein folding requires a lot of computation, so the Folding@Home project distributes the work across many different computers worldwide.
Dividing the work allows each computer to do a bit of the computation. After the computation is done, the resulting protein folding patterns give insight to scientists and doctors so they can better treat the virus. If you want to read more about the platform and how they’re helping with COVID-19, Greg Bowman of the Folding@Home project has a great write-up here

Downloading Viruses for Good

If you want to follow along and offer up some of your own compute, you can check out the Folding@Home installers site here or guides  here. Whether you’re on a mac, windows, or linux machine, there are great installation instructions to get you up and running quickly. Once you’ve got things installed, you can open up both FAHControl and FAHViewer as pictured below. 
And that’s pretty much it. You can configure how much load and when to run, but otherwise, the FAHClient runs in the background picking up new work as it’s assigned. Also, you might notice the client idling a bit before getting assigned work. There were over 400,000 new downloads of the Folding@Home software last week, so a lot more scheduling is going on and they’re working on making sure all this compute gets put to use. 

Better with a Pinch of SALT

Now, installing the Folding@Home client on a few machines is pretty easy, but what if you have to install it on a lot of machines? At PEAK6 we’re all about automation and repeatable builds, deploys, patching, etc. It allows us to quickly deliver our software as well as easily maintain all the parts and pieces that make up the various systems supporting our trading platform. It’s also really cool.  
We use SaltStack, or Salt, for our systems’ automation. It’s similar to other distributed automation platforms like Ansible and Puppet.
In Salt, configuration is expressed in a Salt State module or YAML file that describes how the system should be configured. Here’s a quick example of folding-at-home.sls: 
{# Folding At Home Defaults #} 
{%- set fah_client_version = ‘7.4.4_amd64’ %} 
{%- set fah_control_version = ‘7.4.4-1_all’ %} 

fah: 
  pkg.installed: 
    - pkgs: 
      - fahclient: {{ fah_client_version }} 
      - fahcontrol: {{ fah_control_version }} 
 
  service.running: 
    - name: FAHClient 
   
  file.managed: 
    - name: /etc/fahclient/config.xml 
    - user: fah_user 
    - group: fah_group 
    - mode: 644 
    - source: 
      - salt://ubuntu-common/files/etc/fahclient/config.xml 
The first three lines call out variables for the versions of the client and
control software. The next defines a state call `fah` with three
specifics: 1) the packages to install, 2) the services that should be
running after the install, and 3) a managed file, which in this case is a Folding@Home configuration. Once we have this state defined, we can apply it throughout our environments as needed, pretty cool huh? 

Works in Docker / K8s Too

If you’re more of a container / Kubernetes stack engineer, check out https://github.com/richstokes/fah-k8s. This has both a Dockerfile with configuration for Folding@Home and several Kubernetes configuration files for deploying. 

It's 10PM, Do You Know What Your Computers Are Doing?

We do! After automating out the Folding@Home deployment on March 22, we had a pretty good showing even though it was our first run of it. The stats show us in the top 10% of donors for the day with a rank of 198,009 out of 2,294,579!  

Finance by Day, Folding by Night 

Tom Simpson, CEO PEAK6 Capital Management, recently sent out a note to the firm reminding us of the importance of the work we’re doing in the markets. Given you might wonder what all these servers are doing during the day, I’d like to share Tom’s thoughts with you. 
PEAK6 Capital Management is a market liquidity provider. That means we commit our energy, time, talent, and capital, to provide orderly and transparent stock and option markets. These markets create the liquidity customers and the overall market desperately need especially now with all the volatility and disruption caused by COVID-19. 
Put another way, PEAK6 Capital Management ensures financial institutions
have a way to hedge their risk. When businesses big and small need to
raise cash, or companies need to finance investment or current spending,
our efforts ensure these financial institutions can confidently give access to loans and credit greatly reducing the impact of economic disruption. And, this is why, “financial markets, trading, and futures exchanges,” are near the top of the list of essential businesses and also why we work so hard to make sure our systems are online during this crisis.  
So, after our servers finish their day job in the markets, we’re now putting them to work fighting COVID-19 through protein folding. There are lots of other ways to get involved and help too, just like Kevin mentioned when he first put this idea out there. You can donate to charities and food banks, you can hack on COVID-19 AI challenges on Kaggle, or even 3d print much needed supplies. Most importantly though, the best thing you can do is take care of yourself and make sure you’re fighting the spread by staying at home! 

A Quick Note on Security

As a quick note, we set up the Folding@Home project using the same restrictions and heavily audited profile we apply to our end-user desktop group. This is neat because other than installing the software, there are no extra firewall, proxy, or security configurations you’ll need to tweak in most
cases. Folding@Home is pull-based with the client configured to direct communications to trusted servers at Stanford and digital signatures to verify the validity of all folding input and output. There is a remote access feature for expert users to enable across many clients, but out of the box, this is disabled and locks down communication to localhost. 
Although nothing is foolproof and you should always evaluate how new software impacts the security footprint of your ecosystem, we were impressed by both the ease and thoughtfulness of the solution. Kudos to the engineers! If you want more details, the Folding@Home project has security info here

Quick Update on 4/5/2020

We’ve been running the above Folding@Home setup during off hours for a little over 12 days. In that time we’ve been able to complete 858 work units for a total score of 11,256,125. Our rank after 12 days is 24,408 of 2,518,264 overall donors on Folding@Home in 2020. Awesome! 🚀

References


Published by HackerNoon on 2020/04/03