Setting up automated builds

From FarsightWiki
Revision as of 22:03, 24 January 2012 by Matt McCormick (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Make sure you can build Farsight on your system

See FARSIGHT HowToBuild for detailed instructions on how to build Farsight & all its prerequisites.

Write a .cmake script to drive the build process

This file's name should indicate the machine it's meant to run on, and the type of build it is performing.

You can use the examples in <farsight-trunk>/DashboardScripts to get you started.

Examine the CMakeCache.txt file in your working <farsight-build> directory to find appropriate values for any variables that you're unclear about.

Run the script manually to make sure it's working as intended

Until you iron out all these issues, you should submit Experimental builds to the dashboard instead of Nightly or Continuous.

Set up your computer to automatically run the dashboards

This involves three tasks.

  • Reboot your computer every night.
  • Automatically log back in as the dashboard user
  • Run your .cmake script using ctest.

You need to use your computer's schedule to automatically reboot and run ctest.

Scheduling tasks on Linux & Mac OSX

These two operating systems use Cron to setup automatic processes.

To edit your crontab, execute the following command from a command line prompt:

 crontab -e

Here's an example crontab to reboot your computer at 5am, and then start running a continuous build at 6am:

0 5 * * * /sbin/reboot
0 6 * * * /usr/local/bin/ctest -S /Dashboards/farsight-trunk/DashboardScripts/hesperides-dbg-static-nightly.cmake

Rebooting on most Mac/Linux systems is optional.

Scheduling tasks on Windows

On Windows, the scheduler is called "Scheduled Tasks" and can be accessed in the Control Panel.

To reboot a Windows computer, run the following program:

C:\Windows\system32\shutdown.exe /r /t 60 /f

Submitting multiple builds to the dashboard

If your computer is submitting more than one build, you should write a small script (.bat / .sh) to run the builds sequentially. Then use your scheduler to run this script. This way each only one build will be done at a time, and the system won't become overwhelmed by trying to do too much at once.

Automatically log in as the dashboard user

If you're automatically rebooting your computer every night, you also need to make sure the computer automatically logs in as the dashboard user when it boots back up.

  • Windows
    • Click Start, Run and then type
control userpasswords2
    • Select the account of the user you want to automatically login.
    • Uncheck the box labelled "Users must enter a user name and password to use this computer"
    • Click Ok.
  • Mac
    • Open System Preferences.
    • Click Security
    • Uncheck the "Disable automatic login" box in the "General" tab
  • Linux running the GNOME desktop environment
    • From the System pulldown menu, go to Administration -> Login Window
    • Select the Security tab
    • Check the box labelled "Enable Automatic Login" and supply the name of the dashboard user
Personal tools