= Layout of LCG2 Templates = [[TracNav]] [[TOC(inline)]] This page contains a description of the layout of templates for LCG2 provided by QWG and how the site customization should be integrated. See page on template [wiki:Doc/TemplateCustom framework] for more details on template framework structure and site customization. '''Note : QWG templates require pan compiler version 5 or later.''' == LCG2 Template Layout == QWG templates related to LCG2 middleware are organized in several directories for easier navigation into the template hierarchy. In the future these directories should be mapped to namespaces. Currently they are all equivalent from the pan perspective : '''a given template can be placed into any of the directory but should not exist in more than one directory as there is no guarantee about the search order'''. Directory used by QWG LCG2 templates are : * {{{machine-types}}} : templates defining the whole configuration of a given LCG2 machine type (e.g. WN, CE, SE, BDII...). There is one template per machine type. They all rely on template {{{pro_lcg2_machine_config_base}}} to define basic configuration of any kind of LCG2 machine. * {{{rpmlist}}} : templates defining RPMs that must be loaded for a given LCG2 service. These RPMs are generated from LCG2 middleware description and '''should not''' be edited manually (manual edits will be lost next time templates are generated). * {{{repository}}} : there is normally one template listing all the RPM repositories associated with the current version of the middleware. Each repository is defined in a template that is site specific. * {{{sources}}} : templates that define a LCG2 service configuration. These templates are maintained manually and generally need to be updated with each version of the middleware. They are centrally maintained by QWG maintainers. These templates are generic and take as input variables to define a specific site configuration. They '''should not''' (normally) be edited manually. * {{{vo-legacy}}} : templates to define VOs, using scheme used by previous version of QWG templates (until 2.7.0). They are provided for backward compatibility but should not be used anymore, after migrating to the new, much more flexible, scheme. * {{{vo}}} : templates to configure VOs. These templates and associated functions provide a flexible way of configuring VOs. They take as input the list of VOs to be configured, from variable VOS. == Site Customization of LCG2 Templates == Site customization to LCG templates is done through a small set of templates used to define variables used as input by QWG templates. This doesn't cover OS basic configurationt that is decribed in the page about [wiki:Doc/TemplateCustom template framework]. === Site parameters === All site parameters related to LCG middleware are supposed to be declared in template {{{pro_lcg2_config_site.tpl}}}. A sensible default value is provided for all required variables in template source:template/trunk/grid/lcg-2.7.0/sources/pro_lcg2_config_system_defaults.tpl provided as part of QWG templates. This template must be included as part of the site {{{pro_lcg2_config_site.tpl}}} that must provide an explicit value for at least all the variable {{{undef}}} in template source:template/trunk/grid/lcg-2.7.0/sources/pro_lcg2_config_system_defaults.tpl. === Machine types === QWG templates provide a template per machine type (CE, SE, RB, ...). They are located in {{{machine-types}}} directory and are intended to be generic templates. No modification should be needed. To configure a specific machine with LCG2 middleware, you just need to include the appropriate machine type template into the machine profile, after specifying a template containing the specific configuration for this particular machine with the variable {{{xxx_CONFIG_SITE}}} (look in the template for the exact name of the variable). Here an example for configuring a Torque based CE : {{{ object template profile_grid10; # Define specific configuration for a GRIF CE to be added to # standard configuration variable CE_TORQUE_CONFIG_SITE = "pro_ce_torque_grif"; # Configure as a CE (Torque) + Site's BDII include pro_ce_torque; # # software repositories (should be last) # include repository_common; }}} In this example, {{{CE_TORQUE_CONFIG_SITE}}} specify the name of a template defining the Torque configuration. For DPM SE servers, there is an additional variable, {{{SEDPM_SRM_SERVER}}}, that must be defined to {{{true}}} on the DPM master node. Also, if you are not using a MySQL database, you need to define variable {{{SEDPM_DB_TYPE}}} to {{{oracle}}}. All the machine types share a common basic configuration, described in template {{{pro_lcg2_machine_config_site.tpl}}}. This template allows to add site specificities to this common basic configuration (e.g. configuration of a monitoring agent). This is done by defining variable {{{LCG2_BASE_CONFIG_SITE}}} to a template containing the site specific configuration to be added to the common configuration (at the end of the common configuration). This variable can be defined, for example, in template {{{pro_site_cluster_info.tpl}}}. === VO Configuration === VO configuration consists to define variable {{{VOS}}} in {{{pro_lcg2_config_site.tpl}}}. This variable can also be redefined in the context of a specific node, if {{{pro_lcg2_config_site.tpl}}} defines {{{VOS}}} as a default value. VO configuration is done by template {{{vo/pro_vo_config.tpl}}}. Behaviour of this template can be customized with variables. Main variables are (see the template for the full list) : * NODE_VO_LIST (list) : define the list of VO to initialize on current node. Default : VOS variable defined in {{{pro_lcg2_config_site}}}. * NODE_VO_POOLACCOUNTS (boolean) : pool account must be created for each VO initialized. Default : true. * NODE_VO_GRIDMAPDIR_CONFIG (boolean) : gridmapdir entries must be initialized for pool accounts. Default : NODE_VO_POOLACCOUNTS variable. * NODE_VO_SITE_CONFIG (string) : site specific template that must be included before actually doing VO intialization. Allow for specific VO modification to default VO configuration.Default : none. * NODE_VO_WLCONFIG (boolean) : initialize workload management environment for each VO. Normally enabled only on resource brokers. Default : false. * NODE_VO_CREATEHOME (boolean) : create home directories for pool accounts. Default : true. Templates defining machine types define these variables to the value appriated for a given machine type and there should be normally no need to define these variables. Adding a new VO to standard VOs require creating 2 templates. Use an existing VO, in {{{vo}}} directory, as a template.