loader-logo

How do I set up BigAdv folding on Amazon EC2?

While folding on GPU hardware is a great way to earn [email protected] points for protein research, if you do not have GPUs, or want to do a lot of folding, EC2 can be an alternate option to rack up those folding points.

For this tutorial, you need an amazon EC2 account, and a computer. This tutorial is done at a keyboard of a Windows computer. Linux and Mac OS X are extremely similar. This will be using the Oregon region. You can select other regions to test pricing. Each region requires the creation of a different private key.

Step 1:   
Log in to your EC2 account. Click on “Request Spot Instance”.

Step 2: 
Click “Select” for Ubuntu Server 14.04 LTS (PV). HVM will also work, but will perform about 1%-2% slower.

Step 3:
Choose the c3.8xlarge instance type (108 ECUs).

Step 4:
Enter the maximum per-hour price you are willing to pay. Make sure it is at least 25% greater than the above-shown “Current Price” options.

Step 5:
Click the “Launch” button.

Step 6:
Select “Create a new key pair” from the dropdown menu, then name your keypair, and click the “Download Key Pair” button. NOTE: if you have already set up one instance before, you can skip down to step 25, and just double-click on the saved instance. 

Step 7:
After downloading the private key (.pem) file, click on “Request Spot Instance”.

Step 8:
Make sure that EC2 has successfully created your Spot Instance request (A green check-mark in a green confirmation box will appear, as shown). Then click on “View Spot Requests”.

Step 9:
Click on the “Instances” option, as shown below. At first, nothing will show up. Leave this window as is for now.

Step 10:
Download PuTTYGen from http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe, then open it up. Click on the “Load” button.

Step 11:
Change the file selector to “All Files (*.*)” to allow you to choose the .pem file you downloaded from Amazon. Then browse for and select the keyfile, and open it up. 

Step 12:
You will get a message about the successful import. Click “Ok” to continue.

Step 13:
Inside of PuTTYGen, make sure the SSH-2 RSA radiobutton is selected (this is the default), and click on “Save Private Key”.

Step 14:
You will get a warning prompt about saving the private key without a password. This is fine, click “Yes”.

Step 15:
You will get a “Save As” prompt. Choose a place to save the keyfile, and name it something simple.

Step 16:
Download PuTTY from http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe and open it up. Then, click on the “Data” option under “Connection” on the left options pane.

Step 17:
On the “Auto-login username” box, enter “ubuntu”.

Step 18:
Click on the + sign next to “SSH” under “Connection” in the left options pane.

Step 19:
Click on the word “Auth” (not the plus) under “SSH” under “Connection” in the left options pane.

Step 20:
Click on the “Browse…” button next to the box for “Private key file for authentication”.

Step 21:
An “open file” dialog prompt will appear. Browse to and select the new keyfile (.ppk) that we generated with PuTTYGen. Click on the “Open” button.

Step 22:
Click on the text at the top labeled “Session” in the left options pane.

Step 23:
Type a name in the “Saved Sessions” box. Then, click the “Save” button.

Step 24:
Go back to the EC2 “Instances” page. You may need to click on the refresh button (either in the browser or on the page) in order to see your server. Note the IP.

Step 25:
Enter this IP address into PuTTY, under the “Host Name (or IP address)” box.

Step 26:
A new window will pop up. You may be asked about trusting a fingerprint, accept. Type into the window:

sudo -i

Step 27:
Now, type:

apt-get update


Step 28:
Now, type:

apt-get install htop


Step 29:
Now, type:

mkdir /etc/fahclient


Step 30:
Now, type:

wget 1.curecoinmirror.com/config.xml -O /etc/fahclient/config.xml

 


Step 31:
Now, type:

nano /etc/fahclient/config.xml


Step 32:
Now, use the arrow keys to move through the file. Enter your passkey and username as shown below.

If you want to control the machine remotely, add the following lines to the file:

 <!-- Remote Access --> <command-port v='36330'/> <command-allow v='ip address you wish to allow'/> <password v='password'/>

Step 33:
Now, type:

wget https://fah.stanford.edu/file-releases/public/release/fahclient/debian-testing-64bit/v7.4/fahclient_7.4.4_amd64.deb


Step 34:
Now, type:

sudo dpkg -i --force-depends fahclient_7.4.4_amd64.deb




Step 35:
Press the “Enter” key on your keyboard to accept <Yes> for whether FAHClient should be automatically started.


Step 36:
Wait 30 seconds.
Now, type:

nano /var/lib/fahclient/log.txt



Step 37:
Press Control + v four times to scroll down the log. Get to where it shows your Project. If it is 8101, 8102, 8103, 8104, or 8105, you successfully got a BigAdv WU. Alternately, check that is says 0xa5 to the left of the colon. Press Control + X when you are done. 

You are done setting up! However, to keep your [email protected] account in good standing, always finish your WUs. If you want to shut down your EC2 server, type:

nc 127.0.0.1 36330 finish exit


You can look in the log again, and scroll all of the way to the bottom to see the current percentage:

nano /var/lib/fahclient/log.txt


Again, use Control + X to exit.

On average, each percentage point takes 14 minutes. It takes less for faster projects such as 8104 (averaging around 12 minutes), and longer for slower projects like 8101 (17 minutes).
You can type:

htop

To see your current processor usage. When finished, all of the 32 cores will drop from full 100% utilization to near-zero. When you see this, it is safe to terminate your EC2 instance from the EC2 panel without losing any [email protected] work.

0 Points

Previous Article

Next Article