wiki:Obsolete/Development/Templates/Generated

Version 26 (modified by /C=FR/O=CNRS/OU=UMR8607/CN=Michel Jouvin/emailAddress=jouvin@…, 17 years ago) (diff)

--

Generating Templates for OS and gLite

OS Templates

To add support for a new OS distribution, the recommended method is to copy with svn cp the template hierarchy for the last already supported version with the same architecture. Main part of templates for one specific OS version is RPM lists, with one template per RPM group. This is entirely generated from distribution description.

After generating templates for RPM groups, the following templates must be modified or reviewed :

  • repository/config.tpl : edit to point to right RPM repositories ofr the OS version. There is generally one repository per OS version/arch combination.
  • config/os/kernel_arch_version.tpl : update the kernel version and variant to match what is provided by the distribution.
  • config/glite/*/base.tpl and config/glite/*/postconfig.tpl : may require some adjustement for RPMs explicitly added/updated/removed.

RPM Lists

OS Templates describing RPM list for each OS feature goup are entirely generated from standard Red Hat (or SL) provided comps.xml file. This is done by tool src/utils/misc/buildOSTemplates. It requires 2 parameters :

  • Location of OS distribution : this must me the directory containing both a RPMS and a base directory.
  • Templates location : where to put the generated templates. If this is part of SCDB, the script takes care of adding the necessary files to SVN.

Note : before running src/utils/misc/buildOSTemplates, you need to edit comps.xml file in OS distribution and ensure the first line defining DTD is either commented out or deleted.

src/utils/misc/buildOSTemplates is a wrapper to 3 other tools, hiding the somewhat complex option arguments :

  • src/utils/misc/rpmProvides.pl: generate a file describing features provided by each RPM in OS distribution
  • src/utils/misc/rpmRequires.pl : generate a file describing for each RPM in the distribution the required dependencies. Uses file produced by previous step as input.
  • src/utils/misc/comps2pan.xsl : generate the templates from standard comps.xml file provided in OS distribution. Uses file produced by previous step as input.

gLite Templates

Base list of RPMs for gLite services

For each gLite service in glite/ directory, there is a list of the required RPMs for the service. This list is mainly generated from official list supplied by gLite with the release. It generally requires some manual tuning to solve some missing dependencies in the list provided by gLite. After the initial release, this list should not be edited, except for adding a new RPM required by an update. Replaced RPMs must be handled by update related templates.

To generate the template from the gLite supplied list, you need to use src/utils/misc/createPackagesTemplate script provided with SCDB. The steps are :

Templates for services managed by ncm-glite

Some of the gLite services are managed with a generic component, ncm-glite. For each service managed by this component, there is a directory in components/glite directory defining the supported configuration options for this service.

These per service templates are generated from file .conf.xml provided in the config RPM associated with each service. This is done by a set of tools in utils directory of ncm-glite component sources, in Quattor CVS. This tool generates 3 templates per service :

  • config.tpl : the entry point
  • schema.tpl : defines all the supported PAN resources/properties for this component
  • defaults.tpl : defines a sensible default value for each property, according to the content of XML file for the service.

Look at README file in utils directory for instructions on how to use the tools and generate these files.

Before using this tool, all the glite*-config*rpm must be installed on the machine where the tool will be run.

List of update RPMs

LCG, gLite and OS templates allow to define in a specific template a list of RPMs that must be used in replacement of standard RPMs. That means that RPMs listed in this template are installed only if the standard RPM was part of the configuration.

Generally all update RPMs for one product version are kept in one directory. There is a tool to help producing the associated template with the last version of each RPM in this directory, src/utils/misc/rpmUpdates.pl/rpmUpdates.pl, which is part of the SCDB base. This script accept one argument, the RPM repository directory, and write the template on stdout which must be redirected to a file.

Trusted CAs Template

Trusted CAs are described in a set of RPMs, updated regularly. There is one template describing all the trusted CAs RPMs that must be loaded. This is :

This template is generated from the contents of the RPM repository containing CAs RPMS with the tools src/utils/misc/createPackagesTemplate which is part of SCDB base.

Before running this tools, it is necessary to download the new CA RPMs from the location indicated in the announcement. In QWG templates, these RPMs are stored in a specific RPM repository. It is a good practice to rename the corresponding directory, create a new one with the same name and download the new RPMs in this empty directory. For example, for CA 1.9 (replace the directory in the example by the directory corresponding to CA RPMs repository) :

mv /www/htdocs/packages/ca /www/htdocs/packages/ca.old
mkdir /www/htdocs/packages/ca
cd /www/htdocs/packages/ca
wget http://glitesoft.cern.ch/LCG-CAs/current/RPMS.production/index.html
wget --force-html --no-directories --base  http://glitesoft.cern.ch/LCG-CAs/current/RPMS.production/index.html -A.rpm -i index.html

Then run src/utils/misc/createPackagesTemplate. For example, for gLite 3.0 and with previous directories :

src/utils/misc/createPackagesTemplate --namespace common/security \
                                      --template cfg/grid/glite-3.0.0/common/security/cas.tpl \
                                      /www/htdocs/packages/ca