wiki:Development/Templates/ClientSideDepsCheck

Version 9 (modified by /C=IE/O=Grid-Ireland/OU=cs.tcd.ie/L=RA-TCD/CN=Stephen O. Childs, 16 years ago) (diff)

--

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.

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 src/utils/profiles/checkdeps).

Create YUM repositories

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:

{{{createrepo <repository root>}

For example, to convert the repository ca rooted at /var/www/html/ca issue this command:

createrepo /var/www/html/ca

Set up YUM on your development machine

Install YUM

If YUM isn't installed, you will need to install it on the machine where you normally develop Quattor profiles. Note that that checkdeps.py has been tested with YUM version 3.2.8 (as used in Fedora 8).

Set up a directory for YUM

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.

Create a YUM config file

This can be very basic. The minimum we need is the location of the directory where the YUM templates describing the repositories are stored.

[main]
reposdir=/home/username/yumroot
installroot=/home/myusername/yumroot

Generate YUM repository files

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.

Get checkdeps

checkdeps is available in the SCDB distribution at src/utils/profiles/checkdeps

Run checkdeps

Here is the output when your profile is consistent:

[childss@frascati checkdeps]$ ./checkdeps.py -x gridgate.cs.tcd.ie.xml -c yum.quattor.conf -r ~/yumroot/ -g
checkdeps: Reading package list from target file gridgate.cs.tcd.ie.xml
checkdeps: Adding 1007 packages to install list
checkdeps: Calling YUM to check dependencies for package list
checkdeps: YUM didn't need to add any packages, profile seems OK.

If we remove a package from the profile and run again, we get this:

[childss@frascati checkdeps]$ ./checkdeps.py -x gridgate.cs.tcd.ie.broken.xml -c yum.quattor.conf -r ~/yumroot/ -g
checkdeps: Reading package list from target file gridgate.cs.tcd.ie.broken.xml
checkdeps: Adding 1006 packages to install list
checkdeps: Calling YUM to check dependencies for package list
YUM wants to add 1 new packages that are missing from profile:

Package                             Version                      Needed by
================================================================================
glite-security-voms-admin-interface 1.0.5-1.noarch               lcg-CE_torque

YUM detects a dependency problem and suggests a solution. The list of enabled repositories was generated from those contained in the profile, so the package suggested should be sensible.

TODO

  • Tool for automatically running createrepo on all Quattor repositories on the server
  • Output Pan code for adding the missing packages
  • Remove the need for a YUM config file
  • Convince YUM to look at 64-bit packages on a non-64-bit machine