Installing and configuring your own runbot

Hi guys,

In this tutorial I will learn you how to install and configure a runbot. A runbot is a very handy module that is integrated in Odoo to provide build statusses from the Github code. By deploying a runbot you can easily see what recent code changes do and if they will work fine.

Important note!
A runbot uses A LOT of resources and its best to deploy one on a server that is seperated from your default Odoo’s.

1. Required resources

    – Atleast 10GB RAM! Even better is 32GB-64GB.
    – Atleast 50GB of HDD, preferred 100GB+.
    – Atleast 4 cores, 6 or 8 would be ideal.

2. Pre-configuring your server

Because the runbot needs a few extra libaries we will first install them. Open up a terminal and install the following packages:

You now have the required packages installed, its now time to configure your SSH key!

3. Configuring the Github SSH key

Because the runbot module uses a lot of features from Github and fetches the code from Github you need an SSH key attached to your Github account and an SSH key on your server.
IMPORTANT: Because the runbot runs under a specific Ubuntu user you should configure the SSH key for the same Ubuntu user! Otherwise authentication will fail!
I personally have my Odoo running under an Ubuntu user named Odoo, so I will first switch to the user running the Odoo process:
Ubuntu user
The next step is to make a new folder for the SSH key and to give this the correct rights. This folder should always have the rights 700.

Now, create the sshkey in this folder with your e-mail:

You will now need to give in a path (the default suggestion is fine, it puts it under your local ssh folder) and a passphrase. Leave this passphrase empty! otherwise you will need to authenticate yourself every time and this will interfere with the automatically running processes in Odoo..
Here are the steps in a screenshot:
Configure SSH key
You have now configured an SSH key locally but have to connect this with your Github account. Open up the id_rsa.pub file with an editor (in my example VIM) and copy it.

When you’ve opened the file you will see a text-like code, which is the key that you need. Copy everything from the first character up to where your e-mail starts. So copy everything that is within the red field that I’ve drawn in this example:
SSH key
Now head to Github, click on your profile, open settings and then open the menu item ‘SSH keys’.
Github SSH key screen
Now click on ‘Add SSH key’, give it a name and paste your code in the ‘key’ field.
SSH key
Now click on the button ‘add key’. A new screen will show up, where you need to fill in your password, do so and confirm.
Congratulations, your SSH key is added on Github now!
The final step is to check your key works fine. Go back to your terminal, where you’re authenticated with the Odoo user, and check your SSH key by typing the following command:

You will now get a notification that the authenticy can’t be established. Simply type ‘yes’ to continue connecting. And you will now see your Github username and the message that you’ve succesfully authenticated!
Succesfully authenticated on Github/SSH
Tip: did your authentication fail? Check out the help from Github!
Lets now continue with installing the module inside Odoo!

4. Installing the runbot module

Download the runbot module from Github, which you can find here. The module is named ‘runbot’ and should be installed under addons, like this:
Runbot location
Tip: make sure that the folder ‘runbot’ and all files in it have all rights for the user where Odoo runs under, otherwise you will not be able to get the runbot working!
Open your Odoo, go to settings and click on ‘Update Modules List’. After you’ve updated your list search for ‘runbot’ in the list and you will see it showing up:
Install runbot
Click on install and give it a minute to configure everything. After it is done you will be redirect to the website and you will see a message saying ‘No Repository yet’. Now go back to the back-end and you will see there is a new menu ‘Runbot’, open it. You will now see the following screen:
Runbot module
The next, and last step, is to configure repositories.

5. Configuring repositories

Phew, you’re almost there! Lets add the official Odoo repository now so we have the basis setup for the runbot.
Click on ‘Create’ to add a new repository. You will see a new screen where you need to configure a few things:

Repository:

    You should add the path to the official Odoo repository here, which is git@github.com:odoo/odoo

Auto:

    When you check this it will automatically check and run the repository on your runbot, so check this.

Modules to install:

      • These are all the modules you want to have installed automatically by the runbot. This is up to you, I usually add account,sales,purchase. You can ignore all the other fields for now.

This is the result:

Odoo repository configuration
Now save this configuration and then click on ‘Update’. After clicking on ‘Update’ the runbot will automatically fetch all data from Github and download it to your server, so this will take quite some time. Have yourself a break and go take a coffee!
Wondering where all this data is saved? Have a look at addons/runbot/static and you will see a folder repo. In this folder everything is stored for the runbot to do its job.

After some time Odoo should be done with fetching and configuring everything and the loading screen will be gone. When this is done open up your website and you will see that the repository is added on your website and you will see a lot of different tests. For example:
Basic runbot screen
The best thing to do is to let this run until all the tests are done and you have all databases running. Otherwise you have the risk of getting warnings/errors in your Odoo and/or problems. When these are all done everything will run a lot smoother and you can start adding your own repository for testing.

6. Configuring your own repository

So you also want to test your own module(s) on your runbot? Go back to the back-end and add a new repository for your own module.
You simply add the path to your own Github account and where the module is and add an extra dependency to git@github.com:odoo/odoo. The result:
Configure own repository
Save this repository and then click on ‘Update’. When you now go to the website again you will see there is a second repository added for your own Github module.

7. Conclusion

A runbot has quite some handy purposes. You can use the runbot to have a lot of test databases, to give your sales guy access to testing environments, to show prototypes to customers,.. But even better, the runbot will give you detailed logs where you can see what failed or what can cause you problems! This is a great addition for any Odoo developer.
While this tutorial explains you how to set up a runbot its by far not everything you should know and do. The possibilities from here on are endless and you can optimalize this a lot.
If you want to relieve your postgreSQL database from some work and want to speed up testing you should have a look at the postgreSQL configuration file. (under /etc/postgresql/9.3/main/postgresql.conf). You can for example set the parameter fsync to false, which results in faster speed due to the way of writing. From the official postgreSQL docs:

For more information and details you can always check out the official presentation about runbots from Odoo. It contains a lot of information about how to configure a runbot and what to think about.

Has this tutorial helped you, did you like it or do you have some extra ideas? Be sure to post them here! 🙂




Odoo Experts