= How to Use SCDB = [[TracNav]] [[TOC(inline)]] == Getting Started == To start with SCDB, you first need to install a [http://subversion.tigris.org Subversion] server, an open source product. There are in fact 2 versions of Subversion server : * http based : it is provided as an Apache module. This is the recommended version for production but is a litte bit more complex to setup than standalone version. * standalone version : this should be used for testing, as it has less features than http based version. There is no problem to start with standalone server and migrate to http server later (just the repository URL will change and it will require a new checkout) : repository are the same whatever the access method is. After you have a Subversion server installed, you need to : * Create a repository and import the basic SCDB structure from [source:SCDB]. * Import QWG templates in `cfg` directory, according to the version you need. See QWG [wiki:Download download] instructions. == Template Compilation == All the template processing needed to build machine profiles is done with {{{ant}}} tools, a Java based equivalent of {{{make}}}. {{{ant}}} brings the advantage of platform independance, allowing to do Quattor management tasks on any platform (Unix, Windows, MacOS). Specific management tasks (called {{{targets}}}) are passed as a parameter to {{{ant}}} command, in much the same way this is done with {{{make}}}. There are 3 main targets for managing Quattor (other targets are used internally by {{{ant}}}) : * {{{compile.all}}} : this task recompiles all the machine profiles affected by template changes. This is the default if no target is specified. * {{{deploy}}} : this task deploys the new machine profiles on the Quattor server. This can occurs only after successful compilation of all clusters. * {{{update.rep.templates}}} : this task updates templates describing RPM repositories contents by scanning each repository associated directory. == Checking Compilation Results == When doing changes in configuration, this is often useful to check the resulting profiles before deploying. There is a small tool to help doing that, [source:SCDB/trunk/src/utils/profiles/compare_xml src/utils/profiles/compare_xml]. This tool is part of [source:SCDB SCDB base]. To use this tool, before compiling your changes, you need to copy your current (or reference) `build` directory to something else, by example `build.saved` (default name used by the script). After the compilation, if you run the script without arguments, it will display the list of all profiles that have changed. You can inspect the changes (require a bit of knowledge of profile contents) using option `-v`. Or you can restrict the check to one specific profile with option `-p`. By example : {{{ # src/utils/profiles/compare_xml Comparing XML files (*.xml)... Differences found in build/xml/profile_grid05.xml Differences found in build/xml/profile_grid06.xml Differences found in build/xml/profile_grid07.xml # src/utils/profiles/compare_xml -v -p profile_grid05 Comparing XML files (profile_grid05.xml)... Differences found in build/xml/profile_grid05.xml --- build.saved/xml/profile_grid05.xml 2006-07-28 11:41:45.000000000 +0200 +++ build/xml/profile_grid05.xml 2006-07-28 11:50:58.000000000 +0200 @@ -960,7 +960,6 @@ - MyPrefPwd root /opt/lcg/etc/DPMCONFIG DpmMgrPwd }}}