Difference between revisions of "Documentation/4.0/Developers/Tutorials/DashboardSetup"

From Slicer Wiki
Jump to: navigation, search
(Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887)
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Slicer4| Back to Slicer 4]]
+
<noinclude>{{documentation/versioncheck}}</noinclude>
 
 
 
=Prerequisites=
 
=Prerequisites=
  
Use CMake version >= 2.8.5
+
Use CMake version >= 2.8.7
  
 
=Setup=
 
=Setup=
Line 15: Line 14:
 
$ cd DashboardScripts
 
$ cd DashboardScripts
 
$ wget http://svn.slicer.org/Slicer4/trunk/CMake/SlicerDashboardScript.TEMPLATE.cmake
 
$ wget http://svn.slicer.org/Slicer4/trunk/CMake/SlicerDashboardScript.TEMPLATE.cmake
$ mv SlicerDashboardScript.TEMPLATE.cmake <MachineName>_opensuse-64bits_slicer_release_nightly.cmake
+
$ mv SlicerDashboardScript.TEMPLATE.cmake <MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.cmake
 
</pre>
 
</pre>
  
Edit the file <MachineName>_opensuse_slicer_release_nightly.cmake to match
+
Edit the file <code><MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.cmake</code> to match
 
your machine settings. You should update the following variables:
 
your machine settings. You should update the following variables:
  
 
<pre>
 
<pre>
set(MY_OPERATING_SYSTEM  "*OpenSuSe*") # Windows, Linux, Darwin...
+
set(MY_OPERATING_SYSTEM  "<OperatingSystem>") # Windows, Linux, Darwin...
set(MY_COMPILER          "*g++4.4.3*")
+
set(MY_COMPILER          "g++4.4.3")
set(MY_QT_VERSION        "*4.7*")
+
set(MY_QT_VERSION        "4.7.4")
set(QT_QMAKE_EXECUTABLE  "*$ENV{HOME}/Projects/qtsdk-2010.05/qt/bin/qmake*")
+
set(QT_QMAKE_EXECUTABLE  "$ENV{HOME}/Projects/QtSDK-1.2/Desktop/Qt/474/gcc/bin/qmake")
set(CTEST_SITE            "*karakoram.kitware*")
+
set(CTEST_SITE            "karakoram.kitware")
set(CTEST_DASHBOARD_ROOT  "*$ENV{HOME}/Dashboards/*")
+
set(CTEST_DASHBOARD_ROOT  "$ENV{HOME}/Dashboards/")
set(CTEST_CMAKE_COMMAND  "*/home/jchris/Projects/cmake-2.8.4/bin/cmake*")
 
 
...
 
...
set(CTEST_BUILD_CONFIGURATION "*Release*")
+
set(CTEST_BUILD_CONFIGURATION "Release")
 
...
 
...
set(SCRIPT_MODE "*nightly*")
+
set(SCRIPT_MODE "nightly")
 
</pre>
 
</pre>
  
 
If git and svn are not in the path, make sure to set the variables CTEST_SVN_COMMAND and CTEST_GIT_COMMAND.
 
If git and svn are not in the path, make sure to set the variables CTEST_SVN_COMMAND and CTEST_GIT_COMMAND.
  
So that your dashboard can automatically start at 11pm daily, you could add an entry similar to the following one in your [http://en.wikipedia.org/wiki/Cron crontab]. (On ubuntu, I am running *crontab -e* to edit the current user cron list)
+
So that your dashboard can automatically start at 11pm daily, you could add an entry similar to the following one in your <code>[http://en.wikipedia.org/wiki/Cron crontab]</code>. (On ubuntu, I am running <code>crontab -e</code> to edit the current user cron list)
  
 
<pre>
 
<pre>
0 11 * * * */path/to/*cmake-2.8.5/bin/ctest* *-S */Users/gouttard* /DashboardScripts/*<MachineName>*_opensuse-64bits_slicer_release_nightly.cmake -VV -O */Users/JOE*/Dashboards/Logs/*<MachineName>*-64bits_slicer_release_nightly.log
+
0 11 * * * /path/to/cmake-2.8.7/bin/ctest -S /Users/JOE/DashboardScripts/<MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.cmake -VV -O /Users/JOE/Dashboards/Logs/<MachineName>-<OperatingSystem>-64bits_slicer_release_nightly.log
 
</pre>
 
</pre>
  
You can use CTEST_BUILD_FLAGS to set the number of CPUs to be used by ''make'' (eg, -j4), and CTEST_PARALLEL_LEVEL to set the number of tests to run in parallel (see comments in the [http://svn.slicer.org/Slicer4/trunk/CMake/SlicerDashboardScript.TEMPLATE.cmake configuration script]).
+
You can use <code>CTEST_BUILD_FLAGS</code> to set the number of CPUs to be used by ''make'' (eg, -j4), and CTEST_PARALLEL_LEVEL to set the number of tests to run in parallel (see comments in the [http://svn.slicer.org/Slicer4/trunk/CMake/SlicerDashboardScript.TEMPLATE.cmake configuration script]).
 +
 
 +
==Scheduling on Mac OS X==
 +
Mac OS X is deprecating the use of cron in favor of launchd. 
 +
 
 +
Create a file $HOME/Library/LaunchAgents/org.slicer.NightlyDashboard.plist
 +
 
 +
This is Jim's plist file which has extra EnvironmentVariables to get through his firewall. 
 +
<pre>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 +
<plist version="1.0">
 +
<dict>
 +
  <key>Label</key>
 +
  <string>org.slicer.NightlyDashboard</string>
 +
 
 +
  <key>ProgramArguments</key>
 +
  <array>
 +
    <string>/usr/local/bin/ctest</string>
 +
    <string>-S</string>
 +
    <string>/Users/millerjv/Projects/Slicer4-Dashboard/SlicerDashboardScript.cmake</string>
 +
  </array>
 +
 
 +
  <key>EnvironmentVariables</key>
 +
  <dict>
 +
        <key>ALL_PROXY</key>
 +
        <string>proxy.research.ge.com:8080</string>
 +
        <key>http_proxy</key>
 +
        <string>proxy.research.ge.com:8080</string>
 +
        <key>RSYNC_PROXY</key>
 +
        <string>proxy.research.ge.com:8080</string>
 +
  </dict>
 +
 
 +
  <key>Nice</key>
 +
  <integer>1</integer>
 +
 
 +
  <key>StartCalendarInterval</key>
 +
  <dict>
 +
        <key>Hour</key>
 +
        <integer>1</integer>
 +
        <key>Minute</key>
 +
        <integer>03</integer>
 +
  </dict>
 +
 
 +
  <key>StandardErrorPath</key>
 +
  <string>/tmp/org.slicer.NightlyDashboard.err</string>
 +
 
 +
  <key>StandardOutPath</key>
 +
  <string>/tmp/org.slicer.NightlyDashboard.out</string>
 +
</dict>
 +
</plist>
 +
</pre>
 +
 
 +
You can manually load this agent using
 +
<pre>
 +
$ launchctl load $HOME/Library/LaunchAgents/org.slicer.NightlyDashboard.plist
 +
</pre>
 +
and the agent will be reloaded automatically on a reboot.
  
 
==Setting up a continuous dashboard==
 
==Setting up a continuous dashboard==
Line 50: Line 105:
  
 
<pre>
 
<pre>
$ cp *<MachineName>*_opensuse-64bits_slicer_release_nightly.cmake *<MachineName>*_opensuse-64bits_slicer_release_continuous.cmake
+
$ cp <MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.cmake <MachineName>_<OperatingSystem>-64bits_slicer_release_continuous.cmake
 
</pre>
 
</pre>
  
Edit *<MachineName>*_opensuse-64bits_slicer_release_continuous.cmake and set
+
Edit <code><MachineName>_<OperatingSystem>-64bits_slicer_release_continuous.cmake</code> and set
  
 
<pre>
 
<pre>
Line 59: Line 114:
 
</pre>
 
</pre>
  
Then add the corresponding entry in crontab so that it starts everyday at 6am:
+
Then add the corresponding entry in <code>crontab</code> so that it starts everyday at 6am:
  
 
<pre>
 
<pre>
0 6 * * * */path/to/*cmake-2.8.5/bin/ctest* *-S */Users/gouttard*/DashboardScripts/*<MachineName>*_opensuse-64bits_slicer_release_continuous.cmake -VV -O */Users/JOE*/Dashboards/Logs//*<MachineName>_*opensuse-64bits_slicer_release_nightly.log
+
0 6 * * * /path/to/cmake-2.8.7/bin/ctest -S /Users/JOE/DashboardScripts/<MachineName>_<OperatingSystem>-64bits_slicer_release_continuous.cmake -VV -O /Users/JOE/Dashboards/Logs/<MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.log
 
</pre>
 
</pre>
 +
 +
The output of the build is contained in <code>ctest_package_make_package_output.txt</code> in your slicer build directory, you can check this file if something went wrong.
 +
 +
= Remarks =

Latest revision as of 07:31, 14 June 2013

Home < Documentation < 4.0 < Developers < Tutorials < DashboardSetup


For the latest Slicer documentation, visit the read-the-docs.


Prerequisites

Use CMake version >= 2.8.7

Setup

Follow the following instructions to set up dashboard: (by JC, from [1])

$ cd ~
$ mkdir Dashboards
$ mkdir DashboardScripts
$ cd DashboardScripts
$ wget http://svn.slicer.org/Slicer4/trunk/CMake/SlicerDashboardScript.TEMPLATE.cmake
$ mv SlicerDashboardScript.TEMPLATE.cmake <MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.cmake

Edit the file <MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.cmake to match your machine settings. You should update the following variables:

set(MY_OPERATING_SYSTEM   "<OperatingSystem>") # Windows, Linux, Darwin...
set(MY_COMPILER           "g++4.4.3")
set(MY_QT_VERSION         "4.7.4")
set(QT_QMAKE_EXECUTABLE   "$ENV{HOME}/Projects/QtSDK-1.2/Desktop/Qt/474/gcc/bin/qmake")
set(CTEST_SITE            "karakoram.kitware")
set(CTEST_DASHBOARD_ROOT  "$ENV{HOME}/Dashboards/")
...
set(CTEST_BUILD_CONFIGURATION "Release")
...
set(SCRIPT_MODE "nightly")

If git and svn are not in the path, make sure to set the variables CTEST_SVN_COMMAND and CTEST_GIT_COMMAND.

So that your dashboard can automatically start at 11pm daily, you could add an entry similar to the following one in your crontab. (On ubuntu, I am running crontab -e to edit the current user cron list)

0 11 * * * /path/to/cmake-2.8.7/bin/ctest -S /Users/JOE/DashboardScripts/<MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.cmake -VV -O /Users/JOE/Dashboards/Logs/<MachineName>-<OperatingSystem>-64bits_slicer_release_nightly.log

You can use CTEST_BUILD_FLAGS to set the number of CPUs to be used by make (eg, -j4), and CTEST_PARALLEL_LEVEL to set the number of tests to run in parallel (see comments in the configuration script).

Scheduling on Mac OS X

Mac OS X is deprecating the use of cron in favor of launchd.

Create a file $HOME/Library/LaunchAgents/org.slicer.NightlyDashboard.plist

This is Jim's plist file which has extra EnvironmentVariables to get through his firewall.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>org.slicer.NightlyDashboard</string>

  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/ctest</string>
    <string>-S</string>
    <string>/Users/millerjv/Projects/Slicer4-Dashboard/SlicerDashboardScript.cmake</string>
  </array>

  <key>EnvironmentVariables</key>
  <dict>
        <key>ALL_PROXY</key>
        <string>proxy.research.ge.com:8080</string>
        <key>http_proxy</key>
        <string>proxy.research.ge.com:8080</string>
        <key>RSYNC_PROXY</key>
        <string>proxy.research.ge.com:8080</string>
  </dict>

  <key>Nice</key>
  <integer>1</integer>

  <key>StartCalendarInterval</key>
  <dict>
        <key>Hour</key>
        <integer>1</integer>
        <key>Minute</key>
        <integer>03</integer>
  </dict>

  <key>StandardErrorPath</key>
  <string>/tmp/org.slicer.NightlyDashboard.err</string>

  <key>StandardOutPath</key>
  <string>/tmp/org.slicer.NightlyDashboard.out</string>
</dict>
</plist>

You can manually load this agent using

$ launchctl load $HOME/Library/LaunchAgents/org.slicer.NightlyDashboard.plist

and the agent will be reloaded automatically on a reboot.

Setting up a continuous dashboard

Similarly if you want to setup a continuous dashboard,

$ cp <MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.cmake <MachineName>_<OperatingSystem>-64bits_slicer_release_continuous.cmake

Edit <MachineName>_<OperatingSystem>-64bits_slicer_release_continuous.cmake and set

set(SCRIPT_MODE "*continuous*")

Then add the corresponding entry in crontab so that it starts everyday at 6am:

0 6 * * * /path/to/cmake-2.8.7/bin/ctest -S /Users/JOE/DashboardScripts/<MachineName>_<OperatingSystem>-64bits_slicer_release_continuous.cmake -VV -O /Users/JOE/Dashboards/Logs/<MachineName>_<OperatingSystem>-64bits_slicer_release_nightly.log

The output of the build is contained in ctest_package_make_package_output.txt in your slicer build directory, you can check this file if something went wrong.

Remarks