A quick guide to utilising Google Compute (GCP)

phoenicis

[H]ard|DCer of the Year 2018
Joined
Oct 3, 2010
Messages
590
A guide to running boinc on GCP in support of our Pentathlon world domination.

Firstly, sign up to GCP here. They currently offer $300 free credit for new users. They will ask for credit card details but claim that they won't start charging beyond the $300 without further authorisation from you.

Once logged in, navigate to Compute Engine => VM Instances

Shot 1.png

Click on the 'create' button to spec out your first instance request.

Shot 2.png

  1. Select preferred Region and Zone. South Carolina, Oregon and Iowa seem to be the least expensive.
  2. Select machine type. You can select upto 96 vcpu instances with varying amounts of memory although you are imited to 24 vcpus until you request an increase here. They approved an increase for me within 10 minutes.
  3. Change the os to Ubuntu 16.04 LTS.
  4. Allow internet traffic.
  5. Click on the management, security etc link to expand it's sub-menu.

Shot 3.png

Set 'preemptibility' to 'on' then click on the 'create' button. The preemptibility setting means you're creating an interruptible spot instance for a fraction of the hourly cost of a standard instance.

Shot 4.png

About 20 seconds will pass while the new instance is set up. Once you've got a green tick in the box select SSH => Open in a browser window to connect to the instance. A new browser window will open. It normally takes between 30 seconds to a minute for the connection to be made.

Shot 5.png

You're there. Use Ctrl + C and Ctrl + V to copy commands into the instance.

Shot 6.png

A 'feature' of preemptible instances is that you will have to stop and then start them not greater than every 24 hours to stop them from being terminated. A reboot of the instance will not suffice, they must be stopped and then started again to reset the 24 hour countdown. This doesn't mean that you have to start from scratch as when started again they appear to pick up where they left off.

For those unfamiliar with linux I'll follow this post with another quick guide to setting up Boinc on your GCP instance.
 

phoenicis

[H]ard|DCer of the Year 2018
Joined
Oct 3, 2010
Messages
590
I prefer to use boinctui within aws/gcp instances to add a modicum of GUI to the CLI interface.

Return the following commands into the instance.

sudo apt-get update
sudo apt-get install boinc-client -y
sudo apt-get install boinctui
boinctui

The boinctui interface should then fill the instance view. After pressing enter to agree to the port settings, press F9 to bring up the menu function and navigate to Project => Connect to account manager.

Shot 7.png

Once connected to your BAM account you can add projects as you would normally and use the boinctui menu to cut off the network or set a project to no new tasks as a poor man's but useable alternative to boinctasks. Once up and running on a project, the visibility of running tasks and queues isn't so bad.

Shot 8.png

GCP machines aren't as fast as aws but, meh, it's free upto $300.
 
Last edited:

pututu

[H]ard DC'er of the Year 2021
Joined
Dec 27, 2015
Messages
2,573
phoenicis, after playing with boinctui, it looks like it doesn't have all the "Options" menu to change the "Computing preferences" or "read config files". The only option is via boinccmd command line option?

edit: looks like the easiest way is to change in the WCG preferences and create a new profile.
 
Last edited:

phoenicis

[H]ard|DCer of the Year 2018
Joined
Oct 3, 2010
Messages
590
phoenicis, after playing with boinctui, it looks like it doesn't have all the "Options" menu to change the "Computing preferences" or "read config files". The only option is via boinccmd command line option?

edit: looks like the easiest way is to change in the WCG preferences and create a new profile.

You got it, but I use the one of the BAM profiles and then assign that host to that profile in BAM. To read the config or info files I fall back on restarting boinc via the CLI command sudo /etc/init.d/boinc-client restart.
 

pututu

[H]ard DC'er of the Year 2021
Joined
Dec 27, 2015
Messages
2,573
A 'feature' of preemptible instances is that you will have to stop and then start them not greater than every 24 hours to stop them from being terminated. A reboot of the instance will not suffice, they must be stopped and then started again to reset the 24 hour countdown. This doesn't mean that you have to start from scratch as when started again they appear to pick up where they left off.

If I just close the boinctui, does this reset the clock (WCG tasks still running on the background)? Or should I stop the WCG tasks and then restart the tasks via running this command sudo /etc/init.d/boinc-client restart every 24 hours?

edit: I think I found the answer here. I wasn't clear of the meaning "start" and "stop" ;)
Certain actions will reset the 24 hour counter for preemptible instances. Specifically, if you stop and start an instance, Compute Engine will reset the counter because the instance transitions into a TERMINATED state. However, other actions where the instance remains in RUNNING state do not reset the counter, such as resetting an instance or running sudo reboot from within the VM.
 
Last edited:

motqalden

[H]ard|DCOTM x5
Joined
Jun 22, 2009
Messages
2,911
Some extra regarding requesting increases. When you follow the link to request increases you need to change the filtering to find what you are looking for.


1. Select the "metrics" menu and filter on CPUs and CPUs (all regions)
2. Filter on "location" and make sure that both global and the specific regions you want are checked. I believe global is not checked by default so this tripped me up for a while trying to find the global cpu increase


1.
Capture.PNG



2.
Capture.PNG
 
Top