
How To Setup a Google Cloud Platform Test Bench for Mokersolver
Sometimes setting up simulations with Monkersolver might not go as smoothly as you might expect. You might not be able to run a simulation with the RAM you had budgeted for it, or you might actually need a lot less RAM than the estimate (rare, but can occur). Both of these situations can cost time and/or money, and can lead to frustration. Setting up a large server with a server hosting company can incur relatively large up front costs, and so you want to make sure that your money is well spent and that the setup process is smooth.
All of these issues can be addressed simply by setting up a test bench using Google’s Cloud Platform (GCP) and testing the proposed configuration ahead of time. Other alternatives are Amazon EC2 or Microsoft Azure, but the advantage of using GCP is that you receive $300 of free credit that you can spend without restriction.
Getting Started
Go to GCP’s home page and hit the ‘try it free’ button.
On the next page you will be prompted to sign up for an account. Complete all the steps in the form. It’s import to note that you will need a credit card to be able to use this service. You will however not be billed as long as you still have credit left in your account, which is valid from sign-up for 12 months. Billing occurs on a monthly cycle and it is possible to pre-load your account with credit and set budget restrictions.
Once you have completed registration, you will want to go to your console. A link to the console is visible at the top right on the Google Cloud Platform website.
From your console you will be able to create new instances that you can use for setting up solves. To get a better understanding of the cost of setting up instances, Google has a handy calculator that is easy to use and can give you an idea of the cost for testing whatever it is you want to test.
Here is an example of the cost of running a ‘n1-highmem-64’ instance (64 vCPUs, 416GB RAM) for 4 hours.
On the console home page you can see an overview of your current projects, billing, error reporting etc. You will want to navigate to the sidebar menu and select ‘VM instances’ under the sub-menus ‘Compute’ and ‘Compute Engine’.
Once the ‘VM instances’ page has loaded, ‘Create’ a new instance.
Configure your new instance according to your requirements and preferences. It’s important to point out that the ‘Zone’ you select for running your instance can affect the total cost. Latency is a secondary concern with solvers, so it is recommended to determine which data centre is cheapest for you. At the time of writing, us-central is the cheapest zone to run from, but it is recommended to double-check this regardless to make sure. Under the configuration point ‘Boot disk’ if you click ‘Change’ you can select your boot disk and drive. We prefer to use Debian, which is a Linux distribution, because it is free and compatible with Monkersolver (though not officially supported), but you can select from a wide range of other Linux distros and Windows Server versions.
It is important that under ‘Boot disk type’ you select ‘SSD Persistent Disk’ otherwise your save and load times will be too long. Use the smallest Size you think is necessary to get the job done. This is relevant for creating snapshots, since if you create a snapshot image of your drive and try to load it at a later point, you can’t make it smaller, but you can make it larger. Since storage costs money, it is therefore prudent to select a smaller size for reference.
Once you have the settings the way you want them, go ahead and click ‘Create’. This will forward you to your ‘VM Instances’ page, which gives you an overview over all the instances you currently have available and what their status is.
You can connect to your Linux instance through SSH on the Google Cloud Platform webpage or to a Windows instance using Chrome RDP for Google Compute Engine. You can find more details here. If you need help setting up Monkersolver on Linux, for the interim you can consult our guide for setting up a Linux server on Contabo. The steps for setting up the software are mostly the same.
Creating Snapshots
Once you are done testing, it is recommended to create a snapshot of your current installation for later usage. Google charges a monthly fee for hosting snapshots, however the pricing is very reasonable for our use case at 2.6 USD per 100GB of Snapshot per month (varies based on the datacentre selected).
First go ahead and stop the instance you want to create a snapshot of.
Then from the Compute Engine sidebar menu, select ‘Snapshots’.
Then on the next page select the ‘Source disk’ you want to create a snapshot of and hit ‘Create’. You can now head back to your VM instances overview and delete the instance you just stopped. You will no longer be charged for the instance after you have deleted it.
Now any time you want to create a new test bench, all you need to do is select your snapshot as ‘Boot disk’ when creating an instance from the ‘Snapshots’ tab.
Hopefully this guide was helpful. Please leave any comments or questions regarding this article below, and subscribe for more future updates like these.
I have tried to install both Gnome or xfce multiple times, both got stuck in “dbus” at 80% when installing.
I’ve followed this guide exactly and have followed the Contabo guide to successfully get monker running.
Any idea on how to solve the “dbus” problem?
problem solved by adding “apt-get install -y dbus”
I’m glad you were able to resolve this and thanks for sharing your solution.