Frequently Asked Questions

@home with Windows Azure Project

Q. What is the Folding@home project?

A. Folding@home is a distributed computing project organized by Stanford University researchers to help study the mysteries of protein folding in hopes of finding cures for many diseases. The Folding@home client application models complex protein folding. By distributing the process intensive work across many machines across the Internet, they are able to have more work performed than if they used a supercomputer.

Q. Where can I learn more about the Folding@home project?

A. Visit Stanford University’s Folding@home website.

Q. Why did you do this project again?

A. Because it was crazy cool! All that power...

Racks Of Computing Power!

...at the tips of our fingers! Talk about an adrenaline rush!

Q. Why Did The Chicken Cross The Road?

A. Because the Folding@home application needed more protein.

Windows Azure Accounts

Q. Why Windows Azure?

A. Windows Azure consists of datacenters built from a massive amount of commodity hardware, hardware not too much different from what you might be running at home. Since Folding@home was designed to make user of idle time on your own machine at home, the ability to leverage the scale of the cloud and transfer the work there was just too enticing to pass up!

Q. Don't I need to pay for my Azure compute time?

A. In most cases, no! We designed this exercise so that you can leverage the free allotment of services that are now part of the 3-month free trial and MSDN subscriber benefits. By default, these accounts have a spending limit of $0, which means your account will automatically suspended for the remainder of any month in which your account has exceeded the complimentary allotment for that month. If you leave this spending limit in place, you will never be charged for overages. If you are using a different type of account or have removed the spending limits, then do be aware you will be charged for the usage of compute and storage resources consumed by your deployment of @home with Windows Azure.

@home with Windows Azure Application

Q. Am I limited to using a small VM role size? What about medium, large, and extra-large?

A. The Folding@home client application we distribute only makes use of one core, so there is no benefit in scaling the CPU size upwards. You can increase the number of instances associated with the application; however, that will result in a quicker depletion of complimentary services (for trial and MSDN accounts) and additional charges to pay-as-you-go accounts.

Stanford also distributes a SMP client as a 'beta' release that could be used with a larger role instance. Doing so would require modest changes to the application code.

Q. Can I deploy more than one instance of the @home with Windows Azure application?

A. Yes you can increase the number of instances associated with the application.  However, that will result in a quicker depletion of your free allottment of compute usage (for trial and MSDN accounts) or additional charges to pay-as-you-go accounts.

We designed the @home with Windows Azure project around the free allottment of compute usage included with the free 90-day Windows Azure trial account. The 90-day trial provides 750 hours of "Small" instance compute per month.  That is enough to run a single "Small" instance 24x7 each month during the trial period.  The @home with Windows Azure application is configured by default to use a single "Small" instance.

If you increase the instance count in the @home with Windows Azure application's ServiceConfiguration.Cloud.cscfg file, the application (and thus, the Folding@home client) will run in multiple parallel VMs at once.  For example, if you configure two instances to run, the Folding@home client would be running on two VMs, but you would then be accruing 2 hours of usage per hour.  That means that your 750 hour allottment would be depleted within a little over two weeks. 

The 90-day free trial and MSDN Subscriber accounts are gated at 20 instances.  If you increased the application configuration to use the maximum of 20 instances, you would deplete your 750 hour allottment in about 36 hours! 

By default, the 90-day free trial accounts and the MSDN Subscriber accounts have a spending limit of $0 set on them.  If your free allottment of compute usage is reached during the month, your Windows Azure subscription will be be disabled until the next billing cycle. Or, if it is the third month of your 90-day free trial, your Windows Azure subscription will expire automatically. 

In addition, when the account is re-enabled at the beginning of the next billing cycle, you would have to log in and re-deploy the @home with Windows Azure application to restart it.

Note: For details on how the Windows Azure spending cap works, see Jim O'Neil's post: Windows Azure Trial Account Spending Limit

While it might seem beneficial to throw more computing power at the problem for a shorter period of time, that is not always the case.  Due to the nature of how the Folding@home client works, it can actually be detrimental in this scenario. The individual simulations processed by the Folding@home client can take up to, and even over, 24 hours to complete.  If the process is interupted before the simulation is complete, that workload is lost. 

Therefore, we recommend that the @home with Windows Azure application be run in a single instance to maximize contributions to the Folding@home project without requiring additional administration by you.  That being said, now that you are aware of how the system works, if you know what you are doing, have at it!

Q. How do I test the @home with Windows Azure application in the Windows Azure emulator????

A. Simply run the solution (which you download here) inside of Visual Studio using F5 or Ctrl+F5. This will automatically launch the application in the Windows Azure emulator. If this is the first time you've executed a Windows Azure application on your local machine, you'll see a dialog indicating that development storage has been initialized as well prior to the application beginning execution.

Q. When I try to run my application locally, I get an error indicating "Failed to start Development Storage." What do I do?

A. The Windows Azure emulator relies (by default) on a local SQL Server Express instance to emulate cloud storage (blobs, tables, and queues). If you did not install SQL Server Express or a different instance of SQL Server is your default instance, you'll need to explicitly indicate the server you wish to handle the emulation duties. You can do this via the dsinit utility that's part of the Windows Azure SDK.

For example, executing dsinit /sqlInstance:. from the Windows Azure SDK command prompt will set up your default SQL Server instance as the backing store for emulated cloud storage.

Q. How are contributions measured?

A. The Folding@home application downloads work units and computes them over a period of time. The more Azure instances running, the more work that can be done. The instances report their work back to Stanford's Folding@home servers, which compile the statistics. Additionally, your deployment of @home with Windows Azure reports progress to this main site to display contributors on an interactive map.

Q. How do I get back to the default @home with Windows Azure page after I've started folding?

The application uses the presence of a "client record" in Windows Azure storage as the trigger to invoke Stanford's Folding@home executable within the cloud application. That client record is created when you first enter your name and location and press the Start Folding button on the default web page. After that point, the presence of that records cause the web application to always redirect to the status page.

If you'd like to reset your cloud application to its original status, you can do so by manually entering the URL:

http://<yourappname>.cloudapp.net/?reset=1

This will erase the client record, as well as the history of work units your application has completed. Work units that are current executing will, however, complete without interruption.

Windows Azure Storage

Q. How do I create a Windows Azure Storage account?

A. Windows Azure offers three non-relational storage services: Blobs, Tables, and Queues.  These three storage services are collectively branded as "Windows Azure Storage" and are provisioned together in the system as a "storage account".  You can have multiple storage accounts created under a single Windows Azure subscription.  (i.e. A storage account per application or service.)

When you create a storage account, you can select the Windows Azure datacenter (region) it will be hosted in. A set of all three services will be created for you Blobs, Tables, and Queues.  To learn more about storage services in Windows Azure see: "Data Storage Offerings in Windows Azure".

To create a Windows Azure Storage account, follow these steps:

  1. Log in to the Windows Azure Management Portal.

  2. On the ribbon, click New Storage Account.

    New Storage Account Button

    This will open the Create A New Storage Account dialog.

    Create New Storage Account Window

  3. Under Enter a URL, type a subdomain name to create a set of URLs at which your Windows Azure Storage account will be available once deployed.  In the example above, three URLs will be created, one for each Windows Azure storage service:

    • myathome.blob.core.windows.net
    • myathome.table.core.windows.net
    • myathome.queue.core.windows.net

    Note: This subdomain name must be unique among all services, yours or anyone else's, running on Windows Azure.

  4. Under Choose a region or affinity group, select a region from the first drop down. This will be location of the datacenter you would like to have your storage account provisioned in. For the purpose of the Folding@home project, it does not matter which region you choose.  However, be sure to choose the same region later when creating a Hosted Service for the @home with Windows Azure application.

    Affinity groups and regions allow you to deploy your hosted service and storage account within the same geographic region for optimal performance.

    Note: For more information on affinity groups and regions, see "Windows Azure Geo Location Feature Terminology"

  5. Click OK to create the Windows Azure Storage account.  This step may take several minutes.  When the Windows Azure Management Portal indicates the storage account is "Created", your account is ready to be used.

Q. How do I configure the @home with Windows Azure application to use a Windows Azure Storage account?

A. To configure the @home with Windows Azure application to use your Windows Azure Storage account, follow these steps:

  1. Log in to the Windows Azure Management Portal.

  2. Navigate to the Windows Azure Storage account you created and then select View Access Keys from the ribbon.

    Storage Account Created

  3. Copy the Primary access key to the clipboard by clicking the Copy To Clipboard icon to the right of the key.

    Copy Key To Clipboard

  4. Open the @home with Windows Azure application solution (AzureAtHome.sln) in Visual Studio.  Right-click the "AtHomeWebRole" in the "AzureAtHome" Azure service project and select Properties.

    Right-Click AtHomeWebRole properties

  5. The AtHomeWebRole properties viewer will open.  This is a GUI to interact with the configuration settings contained in the ServiceConfiguration.Cloud.cscfg, ServiceConfiguration.Local.cscfg, and ServiceDefinition.csdef files.

    Select the Settings tab in the AtHomeWebRole Properties viewer.

    AtHomeWebRole Properties

  6. On the Settings tab, select Cloud from the Service Configuration drop down. This lets you make changes to the ServiceConfiguration.Cloud.cscfg file.

    AtHomeWebRole Settings

  7. Select ConnectionString as the Type for the DataConnectionString property.  This enables Visual Studio to recognize the value as a ConnectionString, which lets you edit it via the Storage Account Connection String dialog in the next step.

    Select DataConnectionString Type

  8. Click the ellipsis (...) in the Value field for the DataConnectionString setting.  This will open the Storage Account Connection String dialog.

    Select DataConnection String

  9. In the Storage Account Connection String dialog, select Enter storage account credentials.

    Storage Account Connection String dialog

  10.  In the Account name field, enter the name of the Windows Azure Storage account you created in the Windows Azure Management portal.

  11. In the Account key field, paste in the primary account key you copied from the Windows Azure Management portal in step #3.

  12. Click OK to close the Storage Account Connection String dialog.

  13. Save your configuration changes by selecting Save AtHomeWebRole (Role) from the File menu in Visual Studio.

    Save AtHomeWebRole Properties

    You have now successfully configured the @home with Windows Azure application to use Windows Azure Storage.

    You can verify your configuration changes by opening the ServiceConfiguration.Cloud.cscfg file in Visual Studio. You should see the account name and account key properties in the file as shown below:

    ServiceConfiguration.cscfg

Q. Why does the @home with Windows Azure app use Windows Azure Storage? I thought all of the data is sent directly to Stanford by the Folding@home client.

A. The application uses Windows Azure Storage, specifically Table storage, to keep track of work units performed. This data is then used by the main @home with Windows Azure website to generate the Status charts.

Q. Why does the Windows Azure Storage account have a primary and secondary key?

A. In the event that a key is compromised, an application can switch to a secondary key while the first one is regenerated. This way, an application can be seamlessly updated.

Deploying To The Cloud

Q. How do I create a Windows Azure deployment package for the @home with Windows Azure application in Visual Studio?

A. To deploy an application to Windows Azure, you must first create a deployment package from your Visual Studio solution. This will consist of a .cspkg file containing the contents of your application and a ServiceConfiguration.cscfg file with the Windows Azure configuration details.

If you cannot run Visual Studio with the Windows Azure tools (for instance, you are using a Mac or Windows XP), you can directly upload the .cspkg and .cscfg file we have provided in the download bits. This will allow you to upload and run the application in your Windows Azure account and contribute to the Folding @home project. You will, however, not be able to run it with the local Windows Azure Emulator for debugging or local testing/investigation.

If you do still want to create yourself a Windows Azure deployment package for the @home with Windows Azure app in Visual Studio, follow these steps:

  1. Open the "AzureAtHome.sln" solution in Visual Studio.
  2. Right-click the "AzureAtHome" project in Solution Explorer and select "Package...".

    right-clic Package option

  3. In the "Package Windows Azure Application" dialog, simply click Package to create the necessary deployment files.

    Package Windows Azure Application

  4. Windows Explorer will open to the location where Visual Studio creates the deployment package (.cspkg file) and ServiceConfiguration.Cloud.cscfg file. Copy the path from the address bar and save it for when you deploy the @home with Windows Azure app to a "Hosted Service" in Windows Azure.

    Azure Package Files in Windows Explorer

Q. How do I deploy the @home with Windows Azure app to a "Hosted Service" in Windows Azure?

A. In Windows Azure, applications are deployed to a "Hosted Service". A "Hosted Service" is a container for your service (application) deployments in Windows Azure. It can contain deployments of web, worker, and virtual machine roles in the Windows Azure environment.

In order to deploy the @home with Windows Azure app to Windows Azure, you can define a hosted service and upload your deployment package to it in one process. Once your application has been deployed to the hosted service, it begins accruing usage charges. You can remove your deployment by deleting it from the hosted service at any time through the Windows Azure Management Portal. This will leave the hosted service definition in place, so that you can re-deploy the application at a later time without having to recreate it.

To create a "Hosted Service" and deploy the @home with Windows Azure app to it, follow these steps:

  1. Log into the Windows Azure Platform Management Portal.

  2. On the ribbon, click New Hosted Service.

    This will open the Create a New Hosted Service window.

    New Hosted Service Dialog

  3. On the Create a new Hosted Service window select a subscription to add the hosted service to from the Choose a Subscription dropdown. In most cases, you'll only see one subscription available.

    Choose a subscription

  4. In Service Name, type a name for this service. "@home with Windows Azure" would be a fine idea here. This will help you identify this particular service when you have deployed multiple services.

    Choose a service name

  5. In Choose a URL for your service, type a subdomain name to create the URL at which your instance of the @home with Windows Azure app will be available once deployed.

    Note: This subdomain name must be unique among all the services, yours or anyone else's, running on Windows Azure.

    Choose a URL

  6. Under Choose a region or affinity group select a region from the Choose a region drop down. This will be location of the datacenter you would like to deploy the @home with Windows Azure app to. For the purpose of the Folding@home project, it does not matter which region you choose.

    Affinity groups and regions allow you to deploy your hosted service and storage account within the same geographic region for optimal performance.

    Note: For more information on affinity groups and regions, see "Windows Azure Geo Location Feature Terminology"

    Choose a region (datacenter)

  7. Under Deployment Options choose Deploy to production environment.

    Note: When you deploy a service you can choose to deploy to either the staging environment or the production environment. A service deployed to the production environment is assigned a cloudapp.net URL with the subdomain you specified in step 5. A service deployed to the staging environment is assigned a cloudapp.net URL with an 'obscure' subdomain prefix based on the deployment ID.

    The staging environment is useful as a test bed for your service prior to going live with it. In addition, when you are ready to go live, it is faster to swap Virtual IPs to move your service to the production environment than to deploy it directly there. For more information on swapping VIPs, see How to Swap a Service's VIPs.

    Choose a deployment option

  8. Under Deployment Name, type a name for this particular deployment. You can consider this as a version label for the deployment. It is common to include some sort of version number and the date of the deployment in this field.

    Choose a Deployment name

  9. For Package location, click Browse Locally... and navigate to the location on your file system where the application deployment package (.cspkg) you created earlier (or the one available in the download bits) is located and select it.

    Choose the package location

  10. For Configuration file, click Browse Locally... and navigate to the location on your file system where the Bot Lab ServiceConfiguration.cscfg file that you created earlier (or the one available in the download bits) is located and select it.

    Choose the configuration file location

  11. Click OK to deploy the application to Windows Azure! This step may take 5 to 10 minutes to complete.

    New Hosted Service Dialog Filled Out

    Note: After clicking OK, a warning message will appear. This message appears because the @home with Windows Azure application is configured to use only one VM instance.  The message is to remind you that to qualify for the Windows Azure Compute SLA which guarantees %99.95 uptime, you need to have a minimum of two VM instances.  For the sake of this project, we are not concerned about the SLA, so it is okay to click YES to dismiss the warning and allow the deployment to proceed.

    Azure SLA Warning

  12. When the Windows Azure Management Portal indicates the service is "Ready", launch the @home with Windows Azure app by clicking the link under DNS name on the right. This will be the URL you entered in step #5. (http://<yourSubDomain>.cloudapp.net).

    App Deployed In The Azure Management Portal

  13. Optional: The browser will open to the @home with Windows Azure start up page (as seen below).  You may optionally change the name that will represent your Folding@home client when it reports back to Stanford University. By default, it is set to the subdomain you entered in step #5.

    Set Name

    Note: If the @home with Windows Azure application opens to the "Status" page instead of the startup page, see "Why has my @home with Windows Azure application started on its own?"

  14. Optional: The @home with Windows Azure application does an IP-based look up of the location you are accessing it from. This location is represented by a push-pin on the map. This location will be used to report to Stanford University and the @home with Windows Azure site where you are contributing to the project from.

    You can change the location you will report from by right-clicking anywhere on the map.

    pick your location

  15. On the start page of the @home with Windows Azure application, click the "start folding" button.

    start folding!

    You are now making a difference in the world by contributing to the Folding@home project!

    At Home Status Page

    You can track your continuing contribution to the Folding@home project by revisiting your application's URL, or by viewing all of the contributions on the Team Stats page of the main @home with Windows Azure site.

    You can also view the World Map on our site to see where people are participating in this project.

Q. Will the @home with Windows Azure application cost me money if I leave it running in Windows Azure indefinitely?

A. If you are using a Windows Azure 90-day free trial account or your MSDN Subscription benefits with the spending cap in place, you can leave the application running 24x7 without accruing any charges. 

If your free allottment of compute usage is reached during the month, your Windows Azure subscription will be be disabled until the next billing cycle.  Or, if it is the third month of your 90-day free trial, your Windows Azure subscription will expire automatically. For details on how the Windows Azure spending cap works, see Jim O'Neil's post: Windows Azure Trial Account Spending Limit

The @home with Windows Azure application is configured by default to use a "small" VM size.  Each hour that your instance of the application is deployed in the cloud (even if it is in the "Stopped" state) it is accruing usage charges.

Each trial account type has various amounts of compute hours included with it, as listed in the following table:

90-Day FREE Trial MSDN Professional MSDN Premium MSDN Ultimate (BizSpark)
Compute Hours 750 hours of Small Instance 375 hours of Small Instance 750 hours of Small Instance 1500 hours of Small Instance

If you have an MSDN Professional subscription, you will only be able to run the application 24x7 for approximately 15 days before before using your free compute allottment each month.

If you are using your account for other Azure services, have a subscription or pay-as-you-go account, or have removed the spending cap for your Windows Azure Trial account, you will accrue usage charges ($0.12 an hour) for your instance of the @home with Windows Azure application. You may wish to remove the deployment after the application has made some contributions to the Folding@home project.

Q. How do I ensure the @home with Windows Azure application has been 'turned off' in Windows Azure so that it does not accrue usage charges?

A. The @home with Windows Azure application accrues usage charges as long as it is deployed to a Windows Azure "Hosted Service", even if it is "Stopped" in the Windows Azure portal. To remove the deployment, follow these steps:

  1. Log into the Windows Azure Management Portal

  2. Select Hosted Services, Storage Accounts, & CDN in the lower left-hand menu.

    Azure Portal with Hosted Services/Storage/CDN Selected

  3. Select Hosted Services in the upper left-hand menu.

    Hosted Services Selected

  4. Select the 'Deployment' line under the Hosted Service the application is running under (in the center), and then click Delete in the ribbon menu at the top.

    deployment selected for deletion

    At this point, you are no longer accruing Windows Azure compute usage time. Your Hosted Service definition for the @home with Windows Azure application will remain intact, ready for you to re-deploy if you want to run it again at a future time.

    No deployments in production!

Q. How do I re-deploy the @home with Windows Azure application to my existing "Hosted Service" in Windows Azure?

A. You can re-deploy the @home with Windows Azure application to an existing Hosted Service at any time in the Windows Azure Management Portal. Follow these steps:

  1. Log into the Windows Azure Management Portal.

  2. Navigate to the hosted service for the @home with Windows Azure application that you defined in the portal and then select New Production Deployment from the ribbon.

    new production deployment

    This will open the Create a new deployment dialog.

    new production deployment

  3. Under Deployment Name, type a name for this particular deployment. You can consider this as a version label for the deployment. It is common to include some sort of version number and the date of the deployment in this field.

  4. For Package location, click Browse Locally... and navigate to the location on your file system where the application deployment package (.cspkg) is located and select it.

  5. For Configuration file, click Browse Locally... and navigate to the location on your file system where the application ServiceConfiguration.cscfg file is located and select it.

  6. Click OK to re-deploy the application to Windows Azure! This step may 5 to 10 minutes to complete.

  7. When the Windows Azure Management Portal indicates the service is "Ready", the @home with Windows Azure application should be available at the URL you entered when you created the hosted service definition. (http://<yourSubDomain.cloudapp.net) You are now making a difference in the world again by contributing to the Folding@home project!

Q. How can I deploy the @home with Windows Azure application from Windows XP, Mac, or Linux?

 The @home with Windows Azure application is a .NET application written in C#.  The application launches the Stanford University Folding@home client in the Windows Azure compute environment and then stores reporting data in Windows Azure storage.

To deploy an application to Windows Azure, you must first create a deployment package for your application. This will consist of a .cspkg file containing the contents of your application and a ServiceConfiguration.cscfg file with the Windows Azure configuration details.  For .NET applications, this is done using the Visual Studio tools for Windows Azure. 

Note: Tools exist to package and deploy Node.js, PHP, and Java applications to Windows Azure also.

The tools to package applications for Windows Azure, and the Windows Azure developer emulator only run on Windows 7 or Vista.  However, you can still learn about Windows Azure and participate in the @home with Windows Azure project if you are on Windows XP, Mac, or Linux.

We have provided a set of pre-compiled package files of the @home with Windows Azure application.  This will allow you to upload and run the application in your Windows Azure account and contribute to the Folding@home project. You will, however, not be able to run it in the local Windows Azure Emulator for debugging or local testing/investigation.

To deploy the @home with Windows Azure application from Windows XP, Mac, or Linux, follow these steps:

  1. Get a free, 3-month Windows Azure trial account or activate your MSDN Subscription benefit, which includes Azure access.

  2. Download the pre-compiled package files:

    Download the bits

  3. Expand the AzureAtHomePackage.zip file using the appropriate tool on your operating system. This will reveal two files:  AzureAtHome.cspkg and ServiceConfiguration.Cloud.cscfg

    The AzureAtHome.cspkg file is a Windows Azure Package file. It is essentially a zip file containing the compiled assets of the application.  The ServiceConfiguration.Cloud.cscfg file is an XML configuration file that contains the settings needed to run the application in the Windows Azure datacenter.

    At Home Package Files in Mac Finder

  4. Create a Windows Azure Storage account via your web browser following the steps outlined here: "How do I create a Windows Azure Storage account?"

  5. In the Windows Azure Management Portal, navigate to the Windows Azure Storage account you created and then select View Access Keys from the ribbon.

    Storage Account Created

  6. Copy the Primary access key to the clipboard by clicking the Copy To Clipboard icon to the right of the key.

    Copy Key To Clipboard

  7. Open the ServiceConfiguration.Cloud.cscfg file in your favorite text editor. Note the location of the AccountName and AccountKey parameters.  It should appear as follows:

    Service Configuration file un-modified

  8. Add the storage account name you created in step 4, and paste in your account key from the clipboard. Save the changes.

    Service Configuration file with storage account name and key added

  9. Deploy the package files to Windows Azure via your web browser following the steps outlined here: "How do I deploy the @home with Windows Azure app to a Hosted Service in Windows Azure?"