Changes between Version 25 and Version 26 of Development/Templates/ClientSideDepsCheck


Ignore:
Timestamp:
Apr 1, 2009, 3:32:51 PM (17 years ago)
Author:
/C=IE/O=Grid-Ireland/OU=cs.tcd.ie/L=RA-TCD/CN=Stephen O. Childs
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Development/Templates/ClientSideDepsCheck

    v25 v26  
    11= Checking Package Dependencies in a Profile =
    2 [[TracNav]]
    32
    4 [[TOC(inline)]]
    5 
    6 One of the annoying things about Quattor is that you can't check that a package set defined in a profile is consistent, i.e. that it doesn't require any more packages added to resolve dependencies. This can result in a frustrating sequence of "tweak package list, deploy profiles, run SPMA, check for dependency errors". The problem is that dependency information is not available when compiling profiles.
    7 
    8 However, there is a tool that's very good at resolving dependency problems, and it's called YUM. The following recipe gives details of using YUM and a python utility called {{{checkdeps}}} (available at [source:SCDB/trunk/utils/profiles/checkdeps.py src/utils/profiles/checkdeps]) to detect dependency problems and suggest a solution. I've found that it takes about 30 seconds to check a profile, so you probably only want to do this for profiles that are causing problems, or as a final pre-deployment check.
    9 
    10 = Create YUM repositories =
    11 You will need to turn your existing Quattor repositories into YUM repositories. Make sure that {{{createrepo}}} is installed on your repository server and then issue this command for every directory used as a target for a Quattor software repository:
    12 
    13 {{{createrepo <repository root>}}}
    14 
    15 For example, to convert the repository {{{ca}}} rooted at {{{/var/www/html/ca}}} issue this command:
    16 
    17 {{{createrepo /var/www/html/ca}}}
    18 
    19 == Set up YUM on your development machine ==
    20 
    21 === Install YUM ===
    22 
    23 If YUM isn't installed, you will need to install it on the machine where
    24 you normally develop Quattor profiles. Note that that checkdeps.py has
    25 been tested with YUM version 3.2.8 and requires at least this version
    26 (as used in Fedora 8).
    27 
    28 ''Note: if you don't have YUM or the version in your distribution is too
    29 old (below 3.2.8), you'll have to
    30 [http://ftp.scientificlinux.org/linux/scientific/52/x86_64/SL/yum-3.2.8-10.sl.noarch.rpm upgrade Yum]
    31 or you can manage your Quattor server with quattor,
    32 adding [source:templates/trunk/standard/quattor/server/service.tpl quattor/server/service.tpl]
    33 to the profile.''
    34 
    35 === Set up a directory for YUM ===
    36 
    37 You will need to create a directory for YUM to store its metadata in. Any directory will do. This will be passed in to checkdeps as its working directory.
    38 
    39 === Create a YUM config file ===
    40 This can be very basic. The minimum we need is the location of the directory where the YUM templates describing the repositories are stored.
    41 
    42 {{{
    43 [main]
    44 reposdir=/home/username/yumroot
    45 installroot=/home/myusername/yumroot
    46 }}}
    47 
    48 === Generate YUM repository files ===
    49 For each Quattor repository, you will need to define YUM files describing the repository. '''These must have the same names in YUM and Quattor.''' The easiest thing is to let checkdeps generate these for you for the profile you're trying to check. If you pass checkdeps the {{{-g}}} flag it will do this for you.
    50 
    51 == Get checkdeps ==
    52 checkdeps is available in the SCDB distribution at [source:SCDB/trunk/src/utils/profiles/checkdeps.py src/utils/profiles/checkdeps.py]
    53 
    54 == Run checkdeps ==
    55 Here is the output when your profile is consistent:
    56 {{{
    57 [childss@frascati checkdeps]$ ./checkdeps.py -x gridgate.cs.tcd.ie.xml -c yum.quattor.conf -r ~/yumroot/ -g
    58 checkdeps: Reading package list from target file gridgate.cs.tcd.ie.xml
    59 checkdeps: Adding 1007 packages to install list
    60 checkdeps: Calling YUM to check dependencies for package list
    61 checkdeps: YUM didn't need to add any packages, profile seems OK.
    62 }}}
    63 
    64 If we remove a package from the profile and run again, we get this:
    65 {{{
    66 [childss@frascati checkdeps]$ ./checkdeps.py -x gridgate.cs.tcd.ie.broken.xml -c yum.quattor.conf -r ~/yumroot/ -g
    67 checkdeps: Reading package list from target file gridgate.cs.tcd.ie.broken.xml
    68 checkdeps: Adding 1006 packages to install list
    69 checkdeps: Calling YUM to check dependencies for package list
    70 YUM wants to add 1 new packages that are missing from profile:
    71 
    72 Package                             Version                      Needed by
    73 ================================================================================
    74 glite-security-voms-admin-interface 1.0.5-1.noarch               lcg-CE_torque
    75 }}}
    76 
    77 YUM detects a dependency problem and suggests a solution. The list of
    78 enabled repositories was generated from those contained in the profile,
    79 so the package suggested should be sensible.
    80 
    81 If you add the -p flag, then the program will output Pan lines adding
    82 the package (using {{{pkg_repl}}}) for easy cut-and-paste into the
    83 offending profile!
    84 
    85 == Troubleshooting ==
    86 
    87 === No handlers could be found... ===
    88 
    89 Yum changes the API from one version to another. This means, that you
    90 are using an old version and you should upgrade. This script has been
    91 tested on Yum versions for Fedora 8 and 9. You should use, at least,
    92 version 3.2.8, shipped with SL 5.2.
    93 
    94 
    95 === Errors on packages while checking dependencies ===
    96 
    97 First, check your yum configuration. If it's all right, it means that
    98 you upgraded Yum following the steps above, but the repository metadata
    99 was created with an older version of createrepo. Update your
    100 createrepo to an stable version.
    101 
    102 Please note that yum 3.2.19 used in combination with createrepo 0.9.5 are known to cause
    103 problems.
    104 
     3Content now migrated to [http://apps.sourceforge.net/mediawiki/quattor/index.php?title=Client_dependencies_check quattor.org wiki]