Folding@Home + 128T

Contributing unused computer power to help understand the behaviors of proteins that cause human disease, including COVID-19.

Folding@Home + 128T

Folding@Home is a distributed computing project aimed at understanding protein folding for proteins that cause disease. IAMAD, but from what I understand these proteins bind to receptors in the human body, and the F@H folks develop computer modeling to understand the way that these proteins wiggle and fold. This is with the aim of identifying antibodies (therapeutic drugs) that can attach to the proteins before they attach to us.

Back at the end of February, the Folding@Home project announced that they were turning their sights on the 2019 Coronavirus, and began distributing models and work assignments. The F@H project asks volunteers to donate some of their unused computer cycles to help crunch through the immense calculations required to model protein folding. They've released software for all varieties of machines, configurations, and a bunch of operating systems, including CentOS 7 – the base operating system of the 128T platform.

This weekend I set out to learn how to install F@H on a CentOS 7 system to observe how it works. It was surprisingly easy to get going, so I thought I'd put a blog post out to inspire others to get it running on their 128T systems, to help the cause.

Disclaimer: I have not done any investigation into the security aspects of running F@H, nor have I done extensive testing on the impact of running this coresident on a running 128T system. Things look okay, but this is run-at-your-own-risk! Furthermore, be advised that this will increase the amount of power your computer consumes, which is not free. Some estimates put the cost of power at around $0.36 per day.

Installing F@H

Most installations of 128T, including my own, run on headless server platforms. This basically rules out the GUI installation of F@H. Fortunately it's really easy to install from the Linux shell.

First, we download three packages from the F@H project:

wget https://download.foldingathome.org/releases/public/release/fahclient/centos-6.7-64bit/v7.5/fahclient-7.5.1-1.x86_64.rpm
wget https://download.foldingathome.org/releases/public/release/fahcontrol/centos-6.7-64bit/v7.5/fahcontrol-7.5.1-1.noarch.rpm
wget https://download.foldingathome.org/releases/public/release/fahviewer/centos-6.7-64bit/v7.5/fahviewer-7.5.1-1.x86_64.rpm

These are the latest versions as of the posting of this blog. You can check their download site to make sure you're grabbing the latest.

Next, install them using the rpm command:

[ptimmons@labsystem1 ~]$ sudo rpm -ivh --nodeps fah*
Preparing...                          ################################# [100%]
Updating / installing...
   1:fahviewer-7.5.1-1                ################################# [ 33%]
   2:fahcontrol-7.5.1-1               ################################# [ 67%]
   3:fahclient-7.5.1-1                ################################# [100%]
Starting fahclient ... FAIL
[ptimmons@labsystem1 ~]$
Note: that Starting fahclient ... FAIL didn't seem to cause me any grief.

Configuring F@H

Out of the box, F@H should be configured adequately to contribute to the cause. However, I made a few adjustments to my setup. All of the configuration is stored in /etc/fahclient/config.xml.

I set the following properties:

  • power set to full. (The default is light.) This will spin up the computer to full power; note that the system processes use nice to avoid contending with the performance of the system. This should not affect your 128T's operation.
  • user set to my username. You can fold anonymously, if you'd like. I got my username set up when I chose my...
  • passkey. I set this to the passkey I obtained from apps.foldingathome.org/getpasskey. This is optional, and will somehow give "points" for your contributions. This also appears to have "registered" my username. There's more information about points on their FAQ site.
  • team set to 261105, a team I created called Team128T. Feel free to join!

Here's what my config.xml looks like:

[ptimmons@labsystem1 fahclient]$ sudo cat /etc/fahclient/config.xml
<config>
  <!-- Folding Slot Configuration -->
  <gpu v='false'/>

  <!-- Slot Control -->
  <power v='full'/>

  <!-- User Information -->
  <user v='ptimmons'/>
  <passkey v='[redacted]'/>
  <team v='261105'/>

  <!-- Folding Slots -->
  <slot id='0' type='CPU'/>
</config>

Starting and Stopping F@H

There's no systemd wrapper for it, so starting and stopping F@H is done using an init.d script:

[ptimmons@labsystem1 fahclient]$ sudo /etc/init.d/FAHClient start
Starting fahclient ... OK
[ptimmons@labsystem1 fahclient]$

There are other options available, too:

[ptimmons@labsystem1 init.d]$ sudo /etc/init.d/FAHClient
Syntax: /etc/init.d/FAHClient [OPTIONS] <COMMAND> [-- [OPTIONS]]
COMMANDS:
	start          Start client
	stop           Stop client
	restart        Full stop then restart client
	reload         Respawn client process
	status         Print client status
	log            Tail the client log
OPTIONS:
	-u <user>      Run as this user.
	-h <home>      Run in this directory.
	-v             Be verbose.  Show WS output

Any options after a '--' will be passed on to the client.
[ptimmons@labsystem1 init.d]$

Checking in on Things

The fahclient will open a control socket on 36330/TCP. You can use nc to connect to it and look at/control some of the runtime properties. Type nc localhost 36330 and you'll get the client command server prompt. I used options -d from this prompt to confirm all of the settings I added took properly.

There's also a logfile generated at /var/lib/fahclient/log.txt that seems fairly easy to follow. You can see how far along things are in the progress through the steps. I received a work unit with 250,000 steps and am completing 1% of them every fifteen minutes or so on my Supermicro SYS-E200-9B, with a four core N3700 at 1.6GHz.

Note: I have no idea if this is fast enough to complete a work unit within a work unit's time limit. Time will tell.

Configuring 128T

Because F@H runs within the Linux host operating system, you'll need to ensure the Linux route table has a way to get out to the internet. Like many deployments, I use kni254 to do this (following the fine Linux Host Networking document I wrote), but other deployments use user-configured KNI or have an out-of-band management interface. Suffice it to say, your F@H client will likely use the same network path that your system uses to reach its conductor. So follow the same basic principles there.

Configuring the 128T portion of it is a work in progress. My 128T's Linux host has a default route to the internet, so I'm able to send and receive work units without issue. More constrained deployments will need to ensure there is a route for the host OS to reach the servers that F@H uses. This is currently something I have not spent much time investigating; I may add it to my "Investigation in Isolation" series. For now, your system will need to reach the assignment-servers it is given, and the work-servers that the assignment-servers redirect you to.

When I originally installed F@H, I installed an older version. The default assignment-servers were assign3.foldingathome.org:8080 and assign4.foldingathome.org:80. I uninstalled it and re-installed, and got assign1.foldingathome.org:8080 and assign2.foldingathome.org:80. Thus I'm not entirely sure whether/how this is chosen by the software at runtime or at installation. Also, at the time of this writing, assign1 and assign3 resolve to the same address, as do assign2 and assign4. While it's likely feasible to statically assign these via configuration (thus making it easier to secure this traffic using the 128T data model), this is something I have not spent any time doing yet. In the meantime I created this service:

admin@labsystem1.fiedler# show config running authority service FAH

config

    authority

        service  FAH
            name                  FAH
            description           "Folding at Home assignment servers"
            address               assign1.foldingathome.org
            address               assign2.foldingathome.org
            address               assign3.foldingathome.org
            address               assign4.foldingathome.org

            access-policy         _internal_
                source      _internal_
                permission  allow
            exit

            access-policy         trusted
                source      trusted
                permission  allow
            exit
            share-service-routes  false
        exit
    exit
exit
Note: the access-policy for _internal_ is what allows traffic coming through kni254 to match the service. I also have trusted allowed, since my conductor is considered trusted as it passes through my edge 128T router.

Furthermore, I have not monitored the protocol behavior to see how it chooses which work-server to redirect to... this may also be feasible to control and constrain. If I come up with anything, I'll update this post.

Conclusion

I'm still waiting for most of my systems to report success of their first work unit. My computers' contributions may be nominal, but perhaps the blog will motivate others of you to pitch in too. Let me know your own experiences with F@H!