TubeTK/Dashboard Scripts: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
 
(18 intermediate revisions by 3 users not shown)
Line 4: Line 4:


TubeTK's current dashboard is available at:
TubeTK's current dashboard is available at:
https://www.kitware.com/CDash/index.php?project=TubeTK
http://open.cdash.org/index.php?project=TubeTK


= Tutorial =
= Tutorial =


Assuming that your top-level dashboard directory is call "Dashboards" this tutorial assumes that you want a directory structure with the following hierarchy
== Assumptions ==


   Dashboards/tubetk
1. The top-level dashboard directory is at "~/src/dashboards".
   Dashboards/tubetk-${BUILD_TYPE}
This tutorial will help you create directory structure with the following hierarchy
   ~/src/dashboards/TubeTK
   ~/src/dashboards/TubeTK-${BUILD_TYPE}
where ${BUILD_TYPE} is one of Release, Debug, RelWithDebInfo, ...


where ${BUILD_TYPE} is one of Release, Debug, RelWithDebInfo, ...
2. The machine being configured is called "MyMachine"


== Background ==
== Background ==
Line 23: Line 26:
* This tutorial assumes you have some knowledge of [http://cmake.org/cmake/help/cmake-2-8-docs.html CMake] and [http://cmake.org/cmake/help/ctest-2-8-docs.html CTest]
* This tutorial assumes you have some knowledge of [http://cmake.org/cmake/help/cmake-2-8-docs.html CMake] and [http://cmake.org/cmake/help/ctest-2-8-docs.html CTest]


== Checkout a new TubeTK for your dashboard ==
== Commands ==
 
> cd Dashboards
> git clone http://git.gitorious.org/tubetk/tubetk.git
 
== Initialize local configuration file ==
 
The configuration file "tubetk_config.cmake" belongs at the top of the Dashboards directory:
Dashboards/tubetk_config.cmake
 
=== Linux ===


  > cp tubetk/CMake/DashboardScripts/TubeTK_CDashClient_Linux.cmake tubetk_config.cmake
Go to the top level of your dashboard clients
  cd ~/src/dashboards


Note that a single configuration file can control Nightly, Continuous, and Experimental build options independently.
Get a copy of all dashboard scripts, include some example scripts:
git clone https://github.com/TubeTK/DashboardScripts.git


=== Windows ===
The following script will be used to update and launch your dashboard client every night. 
WINDOWS: Use the corresponding .bat file if you are doing this on Windows:
cp TubeTK_Dashboards/EXAMPLE_TubeTK_Nightly.sh TubeTK_Nightly.sh


  > cp tubetk/CMake/DashboardScripts/tubetk_config.cmake-windows tubetk_config.cmake
Setup your machine's parameters as described in the file:
  vi TubeTK_Nightly.sh


== Edit local configuration file ==
Create a specific set of parameters for your dashboard machine:
 
cd TubeTK_Dashboards
The file has two parts. The first part contains commonly changed variables. The second part is for advanced users only.
  cp EXAMPLE_Linux.cmake MyMachine_TubeTK_Nightly.cmake
 
On Windows, copy the corresponding EXAMPLE_Windows.cmake file
=== Linux: Commonly changed variables ===
 
set( SITE_NAME "aylward@abydos.kitware" )
set( SITE_PLATFORM "Linux" )
set( SITE_BUILD_TYPE "Release" )
set( SITE_CMAKE_GENERATOR "Unix Makefiles" )
set( ENV{DISPLAY} ":0" )
set( SITE_MAKE_COMMAND "make -j3" )
set( SITE_CMAKE_COMMAND "/usr/local/bin/cmake" )
set( SITE_QMAKE_COMMAND "/usr/bin/qmake" )
set( SITE_CTEST_COMMAND "/usr/local/bin/ctest" )
set( SITE_MEMORYCHECK_COMMAND "/usr/bin/valgrind" )
set( SITE_COVERAGE_COMMAND "/usr/bin/gcov" )
set( SITE_KWSTYLE_DIR "/usr/local/bin" )
set( SITE_GIT_COMMAND "/usr/bin/git" )
set( SITE_SVN_COMMAND "/usr/bin/svn" )
set( SITE_CVS_COMMAND "/usr/bin/cvs" )
set( SITE_SOURCE_DIR "/home/aylward/src/tubetk" )
set( SITE_BINARY_DIR "/home/aylward/src/tubetk-${SITE_BUILD_TYPE}" )
set( SITE_EXPERIMENTAL_BUILD_TEST ON )
set( SITE_EXPERIMENTAL_STYLE ON )
set( SITE_EXPERIMENTAL_COVERAGE OFF )
set( SITE_EXPERIMENTAL_MEMORY OFF )
set( SITE_CONTINUOUS_BUILD_TEST ON ) # Must be ON for any Continuous to run
set( SITE_CONTINUOUS_STYLE ON )
set( SITE_CONTINUOUS_COVERAGE OFF )
set( SITE_CONTINUOUS_MEMORY OFF )
set( SITE_NIGHTLY_BUILD_TEST ON ) # Must be on for any Nightly to run
set( SITE_NIGHTLY_STYLE ON )
set( SITE_NIGHTLY_COVERAGE ON )
set( SITE_NIGHTLY_MEMORY ON )


=== Windows: Commonly changed variables ===
Setup the parameters as specified in that file:
vi MyMachine_TubeTK_Nightly.cmake


  set( SITE_NAME "ginger.aylward.org" )
By adding your script to the repo, your dashboard machine can be updated without having to log into it:
  set( SITE_PLATFORM "WindowsXP-VS2010Exp" )
  git add MyMachine_TubeTK_Nightly.cmake
set( SITE_BUILD_TYPE "Release" )
  git commit -m "ENH: Initial setup for MyMachine"
set( SITE_CMAKE_GENERATOR "Visual Studio 10" )
   
   
set( SITE_MAKE_COMMAND "${CTEST_BUILD_COMMAND}" )
Make sure you have the latest copy of the TubeTK_Dashboard directory and then submit your changes to the git repo:
set( SITE_CMAKE_COMMAND "C:\\Program Files\\CMake 2.8\\bin\\cmake" )
  git pull
set( SITE_QMAKE_COMMAND "C:\\Qt\\4.6.3\\bin\\qmake" )
  git push git@github.com:TubeTK/DashboardScripts.git
set( SITE_CTEST_COMMAND "C:\\Program Files\\CMake 2.8\\bin\\ctest" )
set( SITE_MEMORYCHECK_COMMAND "" )
set( SITE_COVERAGE_COMMAND "" )
set( SITE_STYLE_COMMAND "" )
set( SITE_CTEST_COMMAND "ctest" )
set( SITE_GIT_COMMAND
  "C:\\Program Files\\Git\\bin\\git" )
set( SITE_SVN_COMMAND
  "C:\\Program Files\\CollabNet\\Subversion Client\\svn" )
set( SITE_SOURCE_DIR
  "C:\\Documents and Settings\\aylward\\My Documents\\src\\tubetk" )
set( SITE_BINARY_DIR
  "C:\\Documents and Settings\\aylward\\My Documents\\src\\tubetk-Release" )
set( SITE_EXPERIMENTAL_BUILD_TEST ON )
set( SITE_EXPERIMENTAL_STYLE OFF )
set( SITE_EXPERIMENTAL_COVERAGE OFF )
set( SITE_EXPERIMENTAL_MEMORY OFF )
set( SITE_CONTINUOUS_BUILD_TEST ON ) # Must be ON for any Continuous to run
set( SITE_CONTINUOUS_STYLE OFF )
set( SITE_CONTINUOUS_COVERAGE OFF )
set( SITE_CONTINUOUS_MEMORY OFF )
set( SITE_NIGHTLY_BUILD_TEST ON ) # Must be ON for any Nightly to run
set( SITE_NIGHTLY_STYLE OFF )
set( SITE_NIGHTLY_COVERAGE OFF )
set( SITE_NIGHTLY_MEMORY OFF )
 
== Setup cron job ==
 
=== Linux ===
 
> crontab -l
0 23  *  *  *  /home/kitware/Dashboards/cmake-2.8.2/bin/ctest -V -VV -S /home/kitware/Dashboards/tubetk/DashboardScripts/tubetk_run_nightly.cmake 1> /home/kitware/Dashboards/tubetk_nightly.log 2&>1
0 6  *  *  *  /home/kitware/Dashboards/cmake-2.8.2/bin/ctest -V -VV -S /home/kitware/Dashboards/tubetk/DashboardScripts/tubetk_run_continuous.cmake 1> /home/kitware/Dashboards/tubetk_continuous.log 2&>1
 
=== Windows ===
 
Edit the two bat files that include the necessary vcvars.bat files for Visual Studio to work:
 
  edit Dashboards/tubetk_nightly_windows.bat
  edit Dashboards/tubetk_continuous_windows.bat
 
Setup "Scheduled Jobs" to execute those batch files.
 
== Running and submitting an experimental build ==
 
CTest's -S option runs a script:
 
> ctest -S tubetk/DashboardScripts/tubeTK_run_experimental.cmake
 
The tubeTK_run_experimental.cmake script uses the four configurations that you just specified in tubetk_config.cmake to run the test and report to the dashboard:
 
SITE_EXPERIMENTAL_BUILD_TEST
SITE_EXPERIMENTAL_STYLE
SITE_EXPERIMENTAL_COVERAGE
SITE_EXPERIMENTAL_MEMORY
 
= New Features =
 
== Testing leaks ==
 
* Use tubetk_config.cmake file to control how your working source is built. I can then edit it at any time to focus on build/test, style, coverage, or memory checks.  In the example below, I turn off all experimental options except MEMORY, and then I use the ctest command to run and test a single test and report its leaks on the dashboard:


  set( SITE_EXPERIMENTAL_BUILD_TEST OFF )
=== Setup a recurrent nightly job ===
set( SITE_EXPERIMENTAL_STYLE OFF )
* On Linux:
set( SITE_EXPERIMENTAL_COVERAGE OFF )
  crontab -e
  set( SITE_EXPERIMENTAL_MEMORY ON )
Add the following line to the crontab, but please change the start minute (20) and the start hour (0) to different values to avoid simultaneous downloads from multiple machines:
  20 0 * * * /home/me/src/dashboards/TubeTK_Nightly.sh


> ctest -S tubetk/DashboardScripts/tubetk_run_experimental.cmake -R itkMatrix
* On Windows, use the task scheduler to run your TubeTK_Nightly.bat script.


Produces a dashboard submission that displays the testing results and memory leaks for all tests containing "itkMatrix" in their names.
[[Category:TubeTK|Dashboard Scripts]]

Latest revision as of 18:39, 26 July 2013

Overview

TubeTK uses a novel configuration-file based method for installing dashboard machines. In general, you will perform an initial download of TubeTK, copy an example configuration file to the level above the TubeTK source, edit that file as appropriate, and then setup cron jobs to call script files that are distributed with TubeTK and that are controlled by your configuration file.

TubeTK's current dashboard is available at: http://open.cdash.org/index.php?project=TubeTK

Tutorial

Assumptions

1. The top-level dashboard directory is at "~/src/dashboards". This tutorial will help you create directory structure with the following hierarchy

 ~/src/dashboards/TubeTK
 ~/src/dashboards/TubeTK-${BUILD_TYPE}

where ${BUILD_TYPE} is one of Release, Debug, RelWithDebInfo, ...

2. The machine being configured is called "MyMachine"

Background

  • You must have CMake 2.8.8 or greater installed to run a TubeTK dashboard system.
  • You must have Qt 4.7 or greater installed to compile TubeTK
  • This tutorial assumes you have some knowledge of CMake and CTest

Commands

Go to the top level of your dashboard clients

cd ~/src/dashboards

Get a copy of all dashboard scripts, include some example scripts:

git clone https://github.com/TubeTK/DashboardScripts.git

The following script will be used to update and launch your dashboard client every night. WINDOWS: Use the corresponding .bat file if you are doing this on Windows:

cp TubeTK_Dashboards/EXAMPLE_TubeTK_Nightly.sh TubeTK_Nightly.sh

Setup your machine's parameters as described in the file:

vi TubeTK_Nightly.sh

Create a specific set of parameters for your dashboard machine:

cd TubeTK_Dashboards
cp EXAMPLE_Linux.cmake MyMachine_TubeTK_Nightly.cmake

On Windows, copy the corresponding EXAMPLE_Windows.cmake file

Setup the parameters as specified in that file:

vi MyMachine_TubeTK_Nightly.cmake

By adding your script to the repo, your dashboard machine can be updated without having to log into it:

git add MyMachine_TubeTK_Nightly.cmake
git commit -m "ENH: Initial setup for MyMachine"

Make sure you have the latest copy of the TubeTK_Dashboard directory and then submit your changes to the git repo:

git pull
git push git@github.com:TubeTK/DashboardScripts.git

Setup a recurrent nightly job

  • On Linux:
crontab -e

Add the following line to the crontab, but please change the start minute (20) and the start hour (0) to different values to avoid simultaneous downloads from multiple machines:

20 0 * * * /home/me/src/dashboards/TubeTK_Nightly.sh
  • On Windows, use the task scheduler to run your TubeTK_Nightly.bat script.