This page describes how to set up your computer as a buildbot slave for LegUp. The following instructions worked for Ubuntu 14.04 x86_64, but may need to be modified for your system.
$ sudo apt-get install buildbot buildbot-slave
$ sudo adduser --disabled-login --home /home/buildslave buildslave $ sudo chown -R buildslave /home/buildslave $ sudo su buildslave $ cd ~
$ vim .bashrc
The lines may look something like:
export LM_LICENSE_FILE=1802@ra.eecg.toronto.edu export MGLS_LICENSE_FILE=8056@localhost:7056@localhost:6056@localhost:18056@localhost:17056@localhost:16056@localhost export PATH=$PATH:/home/<your_user_name>/altera/11.1/quartus/bin/ # Quartus export PATH=$PATH:/home/<your_user_name>/altera/11.1/quartus/sopc_builder/bin/ # SOPC Builder export PATH=$PATH:/home/<your_user_name>/altera/11.1/modelsim_ase/bin/ # ModelSim (free version) export PATH=$PATH:/home/<your_user_name>/mentor/modeltech/bin/ # ModelSim (full version) export PATH=$PATH:/home/<your_user_name>/clang+llvm-2.9-i686-linux/bin/ # Clang
Note: You only need one of the two ModelSim lines. If you have the full version of ModelSim, use that. Make sure to replace <your_user_name> with your user name.
$ mkdir buildbot $ buildslave create-slave -r --umask=022 buildbot legup.org:3462 buildslave-name buildslave-password
Where buildslave-name and buildslave-password are the name and password of your choice. Send these to Andrew so he can add them to the buildmaster configuration file.
Once Andrew has added your buildslave, you can start it:
$ buildslave start buildbot
If the buildslave started successfully the output should look similar to the following:
Following twistd.log until startup finished.. 2014-09-30 11:06:00-0400 [-] Log opened. 2014-09-30 11:06:00-0400 [-] twistd 13.2.0 (/usr/bin/python 2.7.6) starting up. 2014-09-30 11:06:00-0400 [-] reactor class: twisted.internet.epollreactor.EPollReactor. 2014-09-30 11:06:00-0400 [-] Starting BuildSlave -- version: 0.8.8 2014-09-30 11:06:00-0400 [-] recording hostname in twistd.hostname 2014-09-30 11:06:00-0400 [-] Starting factory <buildslave.bot.BotFactory instance at 0x7f704a979cf8> 2014-09-30 11:06:00-0400 [-] Connecting to legup.org:3462 2014-09-30 11:06:00-0400 [Broker,client] message from master: attached The buildslave appears to have (re)started correctly.
You can also check the LegUp buildslaves page: http://www.legup.org:9100/buildslaves to see if your buildslave is connected.
Perform the following as the buildslave user.
Create the file start_buildslave.sh and make it executable:
$ touch start_buildslave.sh $ chmod u+x start_buildslave.sh $ vim start_buildslave.sh
Add the following lines to set up the paths you put in the ~/.bashrc earlier, and start buildbot:
#!/bin/bash export LM_LICENSE_FILE=1802@ra.eecg.toronto.edu export MGLS_LICENSE_FILE=8056@localhost:7056@localhost:6056@localhost:18056@localhost:17056@localhost:16056@localhost export PATH=$PATH:/home/<your_user_name>/altera/11.1/quartus/bin/ # Quartus export PATH=$PATH:/home/<your_user_name>/altera/11.1/quartus/sopc_builder/bin/ # SOPC Builder export PATH=$PATH:/home/<your_user_name>/altera/11.1/modelsim_ase/bin/ # ModelSim (free version) export PATH=$PATH:/home/<your_user_name>/mentor/modeltech/bin/ # ModelSim (full version) export PATH=$PATH:/home/<your_user_name>/clang+llvm-2.9-i686-linux/bin/ # Clang buildslave start /home/buildslave/buildbot
Note: Once again, only use one of the ModelSim lines, and make sure to substitute your user name.
Now, edit the crontab:
$ crontab -e
And add the following line at the bottom:
@reboot /bin/sleep 60 ; /home/buildslave/start_buildslave.sh
This crontab entry will automatically run the start_buildslave.sh script one minute after your computer is started. It is advisable that you reboot your computer and make sure this actually works.
The LegUp hybrid flow requires X11 for sopc_builder. To give X11 access to the buildslave user you need to run the command:
xhost + SI:localuser:buildslave
as a user that already has X11 access (your normal user account should work). This needs to be run every time you reboot your computer, so it may be convenient to put in in the crontab:
crontab -e
and add the following line:
@reboot /bin/sleep 30 ; xhost + SI:localuser:buildslave
Next, login as the buildslave user and navigate to the home directory:
sudo su buildslave cd
Edit .bashrc or start_buildbot.sh and add the following line:
export DISPLAY=:0.0
It may be necessary to restart your buildslave for this to take effect.
Note: It may also be possible to use xvfb for this purpose.