= Generating Templates for OS and gLite = [[TracNav]] [[TOC(inline)]] == 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 [wiki:Development/Templates/Generated#RPMLists 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 [source:SCDB/trunk/src/utils/misc/buildOSTemplates 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. [source:SCDB/trunk/src/utils/misc/buildOSTemplates src/utils/misc/buildOSTemplates] is a wrapper to 3 other tools, hiding the somewhat complex option arguments : * [source:SCDB/trunk/src/utils/misc/rpmProvides.pl src/utils/misc/rpmProvides.pl]: generate a file describing features provided by each RPM in OS distribution * [source:SCDB/trunk/src/utils/misc/rpmRequires.pl 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. * [source:SCDB/trunk/src/utils/misc/comps2pan.xsl 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 [source:templates/trunk/grid/glite-3.1/glite glite/] directory, there is a list of the required RPMs for the service. This list is mainly generated from official list supplied by [http://glite.org 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 [wiki:Development/Templates/Generated#ListofupdateRPMs update related] templates. To generate the template from the gLite supplied list, you need to use [source:SCDB/trunk/src/utils/misc/createPackagesTemplate src/utils/misc/createPackagesTemplate] script provided with SCDB. The steps are : * Download the official list from [http://glite.org gLite] site. For example for gLite 3.1 WN, download http://glite.web.cern.ch/glite/packages/R3.1/deployment/glite-WN/3.1.0-1/glite-WN-3.1.0-1.html. * Process this file with [source:SCDB/trunk/src/utils/misc/createPackagesTemplate src/utils/misc/createPackagesTemplate] script : {{{ src/utils/misc/createPackagesTemplate --rpmlist glite-WN-3.1.0-1.html \ --template cfg/grid-3.1/glite/wn/rpms/i386/rpms.tpl \ --namespace glite/wn/rpms/i386 }}} === 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 [source:templates/trunk/grid/glite-3.1/components/glite 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 [http://quattor.org/software.htm 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, [source:SCDB/trunk/src/utils/misc/rpmUpdates.pl src/utils/misc/rpmUpdates.pl/rpmUpdates.pl], which is part of the [source:SCDB 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 : * For gLite : [source:templates/trunk/grid/glite-3.0.0/common/security/cas.tpl common/security/cas.tpl] This template is generated from the contents of the RPM repository containing CAs RPMS with the tools [source:SCDB/trunk/src/utils/misc/createPackagesTemplate src/utils/misc/createPackagesTemplate] which is part of [source:SCDB 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 [source:SCDB/trunk/src/utils/misc/createPackagesTemplate 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 }}}