0
$\begingroup$

Rosanswers logo

NOTE: I'm asking this question after going through series of web pages, ros discourse discussions, ros answers discussions and issues in github. Please note that I made a considerable effort to learn but the documentation to me seems more sparse (high level). Please understand that I'm a total noob and if something you see here looks rubbish or garbage please point it out. I'm ready to learn. Having said that here it goes.

  • What exactly I'm trying to achieve here ?

I have a git repo with me that takes in the camera images and estimates user pose, saves data and trains a classifier. I want to setup a build farm for this repo, perform continuous integration and post build steps. Oh ! and also, please let me know if this is possible with the ros buildfarm. Provide documentation that clearly explains what to do if someone like me wants to setup a buildfarm.

  • What have I done so far ?

I started off here at ros.org to learn about buildfarms and then I stumbled upon buildfarm_deployment which I tried to follow in the following ways.

  1. Fork the repo, create ssh keys in my master machine which is ubuntu 16.04 xenial and has ros kinetic which is running on a VM. I thought of having a Jetson Tx2 as my agent and a Raspberry Pi 3 B as my repo but I'm willing to change this to two more VMs having same specs as my master. Please let me know whether there are any other steps apart from setting up 3 instances which is not captured in the documentation that I have to follow.
  2. I found that the next step is to change the common.yaml file which is found [here](https://github.com/ros-infrastructure/buildfarm_deployment_config/blob/master/hiera/hieradata/common.yaml) which I directly edited on my forked repo. I have several questions on this one. Any good piece of information will be greatly appreciated.

    2.1. In [common.yaml](https://github.com/dotdotdotdash/ROS-Buildfarm-Tutorial/blob/master/hiera/hieradata/common.yaml) file, with the [comments](https://github.com/dotdotdotdash/ROS-Buildfarm-Tutorial/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/common.yaml#L1-L4) for [line5-6](https://github.com/dotdotdotdash/ROS-Buildfarm-Tutorial/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/common.yaml#L5-L6 ), I understood that I have to replace the values for `jenkins::slave::ui_user` and `jenkins::slave::ui_pass` with my jenkins username & password and I changed it. If this wrong please advise me what exactly I should be doing here.

    2.2. Next up I left [line-9](https://github.com/dotdotdotdash/ROS-Buildfarm-Tutorial/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/common.yaml#L9) as it is. [Lines 11-12](https://github.com/dotdotdotdash/ROS-Buildfarm-Tutorial/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/common.yaml#L11-L12) were simple enough that I changed the IP address to my master machine and raspi (for now, I can change this to another VM if cross compilation won't work). [Line-15](https://github.com/dotdotdotdash/ROS-Buildfarm-Tutorial/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/common.yaml#L15) is time zone and I changed it accordingly.

    2.3. [Lines 17-23](https://github.com/ros-infrastructure/buildfarm_deployment_config/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/common.yaml#L17-L23), I would like to know how to actually do this. First up, I generated a ssh keygen based on this [link](https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys), which should generate two keys, a public and a private one. In [line-21](https://github.com/ros-infrastructure/buildfarm_deployment_config/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/common.yaml#L21), should I copy paste the public key or the private key, I generated locally ?

Once I get the answers for all the questions, I will proceed with the next set of questions. Thank you for taking time in reading this.

EDIT - 1

  1. The next step is to edit the repo.yaml file and I tried to edit it in the following ways:

    1.1. According to the instructions [here](https://github.com/ros-infrastructure/buildfarm_deployment_config/blob/master/hiera/hieradata/buildfarm_role/repo.yaml), I left [lines 1-6](https://github.com/ros-infrastructure/buildfarm_deployment_config/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/buildfarm_role/repo.yaml#L1-L6), unchanged. But please advise me if I have to change anything here. An example other than the one that I'm already using will be very much appreciated.

    1.2. Next up would be [lines 7-95](https://github.com/ros-infrastructure/buildfarm_deployment_config/blob/3e1dd83cba87099dc925decfe2e26222f52c8dc1/hiera/hieradata/buildfarm_role/repo.yaml#L7-L95). I would like to know whether I have create another ssh key pair or use the one from the key pair used with the common.yaml file. Also, please let me know if I have to use a different ssh key pair, should I create it in the same way I did for the common.yaml keys.

    1.3. Should I just leave [lines 97-117] as it is ? If the answer is no, could you please explain it to me why are we having this and what should I do to make it fit for my package ?

    1.4. The last instruction given basically tells me to change the `reprepro_config`, which I have no idea on how to edit. Do I have to change [lines 120 - 131](https://github.com/ros-infrastructure/buildfarm_deployment_config/blob/master/hiera/hieradata/buildfarm_role/repo.yaml#L120-L131) ? Exhaustive answers are very much appreciated.


Originally posted by venkisagunner on ROS Answers with karma: 89 on 2018-04-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

What exactly I'm trying to achieve here ?

I have a git repo with me that takes in the camera images and estimates user pose, saves data and trains a classifier. I want to setup a build farm for this repo, perform continuous integration and post build steps. Oh ! and also, please let me know if this is possible with the ros buildfarm. Provide documentation that clearly explains what to do if someone like me wants to setup a buildfarm.

Depending on your end-goal, it may be easier to begin either without ros_buildfarm or using ros_buildfarm without a full buildfarm deployment:

A. Running your repositories tests.
If all you want is basic continuous testing, setting up an entire buildfarm might be overkill. There are examples of setting up ROS repositories in Travis. This repository provides a sample .travis.yml and information for doing exactly that. It might be a bit stale and it's not something I've worked with, but once set up, it would run your tests without the need for running your own buildfarm. MoveIt! has a CI repository with an up-to-date Travis config as well. (Hat tip to @Geoff in the comments).

B. If you also want to build binary packages for your repository, it's still possible to do without setting up a buildfarm deployment, but you will need to create suitable rosdistro and ros_buildfarm_config configuration files so that the ros_buildfarm scripts can be run on your local machines.

C. Of course, you can also set up a complete buildfarm cluster to perform run ros_buildfarm operations. This is probably the best option if you're going to be adding more custom packages down the road or building for multiple rosdistros. It's also the course of action you're already on.


ARM build agents

I thought of having a Jetson Tx2 as my agent and a Raspberry Pi 3 B as my repo but I'm willing to change this to two more VMs having same specs as my master.

I mentioned in your previous question that the buildfarm_deployment repository was originally written for x86 hosts only and that I know it doesn't support arm64 hosts out of the box and it probably won't work on a Raspberry Pi running Raspbian Stretch or even Ubuntu Xenial. I have deployed arm64 agents but I had to do the last 40% of the setup by hand which requires some experience and understanding of what the Puppet config management is doing for you so it won't be straightforward if you're new to Puppet and ros_buildfarm. You also won't be able to build for AMD64 (x86_64) targets with an arm64 agent, though you can build for arm64 with an AMD64 host using qemu, which the buildfarm_deployment sets up by default.

I would recommend using AMD64 virtual machines although they don't all need to be as powerful as your Jenkins master. This document has some recommended instances sizes using AWS instances sizes as a reference.


Jenkins user password

I understood that I have to replace the values for jenkins::slave::ui_user and jenkins::slave::ui_pass with my jenkins username & password and I changed it. If this wrong please advise me what exactly I should be doing here.

By default, these fields should match with the Jenkins admin user and password hash in the hiera config for the master. If you do change these values you need to make sure that a user with the credentials you chose exists after running the reconfigure.bash script for the master host. If you want to use the same user for both admin and agent processes but don't want to keep the default password, you can use a tool like https://github.com/gavanderhoorn/jenkins_bcrypt_pw_util or copy the password hash from the configuration of a Jenkins instance that has your desired password.

SSH keypair generation

2.3. Lines 17-23, I would like to know how to actually do this. First up, I generated a ssh keygen based on this link, which should generate two keys, a public and a private one. In line-21, should I copy paste the public key or the private key, I generated locally?

That location should hold the public key, the keys in common.yaml are going to be inserted into the ~/.ssh/authorized_keys files of the specified users. I've got an in-progress PR to update the documentation comments, you can read the updated version and let me know if it's helpful. You'll want to paste the private key in the jenkins::ssh_private_key field of master.yaml (example). That private key will be added to specific jobs by jenkins to allow the running executor to publish artifacts via SSH.

Customizing repo.yaml

1.1. According to the instructions here, I left lines 1-6, unchanged. But please advise me if I have to change anything here. An example other than the one that I'm already using will be very much appreciated.

Lines 1-5 should in general not be changed. Doing so would interfere with the desired behavior of the buildfarm cluster.

1.2. Next up would be lines 7-95. I would like to know whether I have create another ssh key pair or use the one from the key pair used with the common.yaml file. Also, please let me know if I have to use a different ssh key pair, should I create it in the same way I did for the common.yaml keys.

The Jenkins-agent key fields: jenkins-agent::gpg_key_id, jenkins-agent::gpg_private_key, and jenkins-agent::gpg_public_key are fields that you would want to change if you were handling a production buildfarm and wanted to provide secure packages for other users, but for testing it is easiest to leave both the gpg key pair and key ID as they are.

1.3. Should I just leave [lines 97-117] as it is ? If the answer is no, could you please explain it to me why are we having this and what should I do to make it fit for my package ? 1.4. The last instruction given basically tells me to change the reprepro_config, which I have no idea on how to edit. Do I have to change lines 120 - 131 ? Exhaustive answers are very much appreciated.

reprepro is the tool that the ROS buildfarm uses for managing its debian package repository. In order to facilitate common buildfarm actions we use a repository containing scripts for our common operations called reprepro-updater. The only changes that I would advise making would be to trim the platform architectures and operating system suites that you want to support.

The jenkins-agent::reprepro_updater_config and jenkins-agent::reprepro_config fields use two different formats and are used in different buildfarm situations. For straightforward deployments the two configurations should have the same information in different formats.

For example, if you only want to build for ubuntu xenial and the amd64, armhf, and arm64 architectures you would remove all other distros for each repository (ubuntu_building, ubuntu_testing, and ubuntu_main) and list only your desired platforms and source in the architectures section. An example of the ubuntu_building section only:

    [ubuntu_building]
    architectures: amd64 arm64 armhf source
    distros: xenial
    repository_path: /var/repos/ubuntu/building
    signing_key: E5944336
    upstream_config: /home/jenkins-agent/reprepro_config

The final reprepro::configwould then receive the same modifications:

    '/home/jenkins-agent/reprepro_config/ros_bootstrap.yaml':
        ensure: 'present'
        content: |
            name: ros_bootstrap
            method: http://repos.ros.org/repos/ros_bootstrap
            suites: [xenial]
            component: main
            architectures: [amd64, arm64, armhf, source]
            # filter_formula: Package (% python* )
            # needed until we deploy the gpg key
            verify_release: blindtrust

Originally posted by nuclearsandwich with karma: 906 on 2018-04-23

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Geoff on 2018-04-23:
For Travis integration the MoveIt! CI repository has been updated recently so is likely to still work.

Comment by venkisagunner on 2018-04-25:
Thank you for your detailed explanation. I'm following the steps you mentioned and yes, I'm building a buildfarm (C). I would like to know whether I have to install jenkins in my VM instance ?

Comment by nuclearsandwich on 2018-04-25:\

I would like to know whether I have to install jenkins in my VM instance ?

The buildfarm_deployment uses Puppet to install jenkins for you, it should work as long as your VM is relatively clean. Deployment instructions: https://github.com/ros-infrastructure/buildfarm_deployment#master-deployment

Comment by venkisagunner on 2018-04-27:
I took the instructions and I have configured the common.yaml file accordingly. I have added a new edit to my question. Hope you could help @nuclearsandwich. Thanks !

Comment by venkisagunner on 2018-05-03:
Puppet (err): Evaluation Error: Error while evaluating a Function Call, Error from DataBinding 'hiera' while looking up 'ntp::autoupdate': (): could not find expected ':' while scanning a simple key at line 33 column 1 at /root/buildfarm_deployment/modules/profile/manifests/ros/base.pp:8:3

Comment by venkisagunner on 2018-05-03:
I'm getting an error like the above one when I tried to run reconfigure bash script for master. Could you please help me out here ?

Comment by klausd on 2018-11-16:
The question is quite old - but I stumbled over the same issue, so it might help others. That is most likely an error in some yaml file. Look here https://answers.ros.org/question/281885/buildfarm-error-while-trying-to-run-reconfigure-script-for-master/ Download yamllint. check common.yaml, ...

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.