Lampros - Weird Bricks

Installing and configuring Boinc for the World Community Grid on CentOS 7.7

23 October, 2019 | CentOS

The past few months I've really enjoyed contributing spare CPU cycles to the World Community Grid. Visit their website here.

1. Install epel-release:

yum -y install epel-release

2. Install the boinc-client and the boinc-manager:

yum -y install boinc-client boinc-manager

3. Enable the boinc-client so that it starts on boot/after a reboot:

systemctl enable boinc-client

4. Set a blank password file:

touch /var/lib/boinc/gui_rpc_auth.cfg

5. Start the boinc-client so that it can initialize itself, run system benchmarks for the first time etc:

systemctl start boinc-client

6. Optional: If you don't know what your account number for World Community Grid is, you can lookup your account ID - make sure to replace your username and password to the ones you use to login to World Community Grid:

boinccmd --lookup_account http://www.worldcommunitygrid.org email@domain.com replace_with_your_password_no_quotes_needed

If this works correctly you should see output like this:

status: Success
poll status: operation in progress
poll status: operation in progress
poll status: operation in progress
account key: <your_account_id>

7. Attach to the World Community Grid project - once again replace your account ID with yours - this step doesn't require a username or a password:

boinccmd --host localhost \
--passwd "" \
--project_attach \
http://www.worldcommunitygrid.org \
replace_with_your_account_id_no_quotes_needed \
--task resume

8. Boinc will now connect to the World Community Grid for the first time, run a benchmark for the local system and then start pulling jobs. This process should take a couple of minutes. To confirm that you're connected, use the --get_project_status switch like this:

boinccmd --host localhost --passwd "" --get_project_status

This is what it looks like for me when it's connected:

======== Projects ========
1) -----------
name: World Community Grid
master URL: http://www.worldcommunitygrid.org/
user_name: <redacted>
team_name:
resource share: 100.000000
user_total_credit: 1241723.812680
user_expavg_credit: 13550.756580
host_total_credit: 0.000000
host_expavg_credit: 0.000000
nrpc_failures: 0
master_fetch_failures: 0
master fetch pending: no
scheduler RPC pending: no
trickle upload pending: no
attached via Account Manager: no
ended: no
suspended via GUI: no
don't request more work: no
disk usage: 0.000000
last RPC: Thu Oct 24 00:49:11 2019
project files downloaded: 1571892574.543879
GUI URL:
name: Research Overview
description: Learn about the projects hosted at World Community Grid
URL: https://www.worldcommunitygrid.org/research/viewAllProjects.do
GUI URL:
name: News and Updates
description: The latest information about World Community Grid and its research projects
URL: https://www.worldcommunitygrid.org/about_us/displayNews.do
GUI URL:
name: My Contribution
description: Your statistics and settings
URL: https://www.worldcommunitygrid.org/ms/viewMyMemberPage.do
GUI URL:
name: Results Status
description: View the status of your assigned work
URL: https://www.worldcommunitygrid.org/ms/viewBoincResults.do
GUI URL:
name: Device Profiles
description: Update your device settings
URL: https://www.worldcommunitygrid.org/ms/device/viewProfiles.do
GUI URL:
name: Forums
description: Visit the World Community Grid forums
URL: https://www.worldcommunitygrid.org/forumLogin.do
GUI URL:
name: Help
description: Search for help in our help system
URL: https://www.worldcommunitygrid.org/help/viewHelp.do
jobs succeeded: 0
jobs failed: 0
elapsed time: 0.000000
cross-project ID: <redacted>

 

Set CPU usage to 100:

Optional: On a host that's dedicated to running boinc-client you can set the CPU usage to 100%. Since the configuration files are XML, we can use the xq tool to edit them:

1. Install python3-pip, jq and moreutils so that we can get the sponge command:

yum -y install python3-pip moreutils jq

2. Install yq (you get xq with it):

pip3 install yq

3. Edit the preferences file so that we can use 100% of CPU:

cd /var/lib/boinc
xq --xml-output .global_preferences.cpu_usage_limit="100.0" global_prefs.xml | sudo sponge global_prefs.xml

4. Make sure the permissions are good:

chown boinc:boinc global_prefs.xml

5. Restart the boinc-client so that the configuration is applied:

systemctl restart boinc-client

Other stuff that's good to know:

1. To get the project status:

boinccmd --host localhost --passwd "" --get_project_status

2. To remove (detach) a project:

boinccmd --host localhost --passwd "" --project http://www.worldcommunitygrid.org detach

Sources: