From f3de9d590b5acd40f30421c4b2c272986e1ed0ea Mon Sep 17 00:00:00 2001 From: Michel Jouvin Date: Thu, 7 May 2015 09:47:52 +0200 Subject: [PATCH] GIP CE: replace nlist by dict + misc. reformatting --- features/gip/ce.pan | 635 +++++++++++++++++--------------------------- 1 file changed, 243 insertions(+), 392 deletions(-) diff --git a/features/gip/ce.pan b/features/gip/ce.pan index 0490dbe..098d8c5 100644 --- a/features/gip/ce.pan +++ b/features/gip/ce.pan @@ -1,35 +1,22 @@ unique template features/gip/ce; -include { 'components/gip2/config' }; - -variable GIP_CE_GLUE2_CONFIG_FILE ?= 'glite-ce-glue2.conf'; - -variable GIP_CE_GLUE2_LDIF_PROCESSOR_DIR ?= '/usr/libexec'; - -variable GIP_CE_GLUE2_LDIF_PROCESSORS = nlist( - 'benchmark', 'glite-ce-glue2-benchmark-static', - 'endpoint', 'glite-ce-glue2-endpoint-static', - 'environment', 'glite-ce-glue2-executionenvironment-static', - 'manager', 'glite-ce-glue2-manager-static', - 'service', 'glite-ce-glue2-computingservice-static', - 'shares', 'glite-ce-glue2-share-static', - 'storage', 'glite-ce-glue2-tostorageservice-static', -); +prefix '/software/packages'; +'{bdii}' ?= nlist(); +'{glite-ce-cream-utils}' ?= nlist(); +'{glite-info-provider-service}' ?= nlist(); +'{lcg-info-dynamic-maui}' ?= nlist(); +'{lcg-info-dynamic-scheduler-pbs}' ?= nlist(); +'{lcg-info-dynamic-condor}' ?= if(CE_BATCH_SYS == 'condor'){nlist()}else{null}; + +'/software/components/gip2/staticInfoCmd' = '/usr/sbin/glite-info-static-create'; + +include { 'components/filecopy/config' }; +'/software/components/filecopy/services/{/usr/sbin/glite-info-static-create}'= + nlist('config',"#!/bin/bash \n cat $2", + 'perms' ,'0755', + 'owner' ,'root'); -variable GIP_CE_GLUE2_LDIF_FILES = nlist( - 'benchmark', 'Benchmark.ldif', - 'endpoint', 'ComputingEndpoint.ldif', - 'environment', 'ExecutionEnvironment.ldif', - 'manager', 'ComputingManager.ldif', - 'service', 'ComputingService.ldif', - 'shares', 'ComputingShare.ldif', - 'storage', 'ToStorageService.ldif', -); - -variable GIP_CE_MAUI_PLUGIN_DEFAULTS_FILE ?= '/etc/lrms/lcg-info-dynamic-maui.defaults'; - -# Must be lower case according to EGI profile -variable CE_OS_FAMILY ?= 'linux'; +include { 'components/gip2/config' }; @{ desc = define VO shares to be applied to each CE @@ -39,35 +26,10 @@ required = no } variable CE_VO_SHARES ?= undef; -@{ -desc = define default value for job maximum physical memory if not defined at the queue level -values = MB -default = 2000 -required = no -} -variable CE_DEFAULT_MAX_PHYS_MEM ?= 2000*MB; - -@{ -desc = define default value for job maximum virtual memory if not defined at the queue level -values = MB -default = 20000 -required = no -} -variable CE_DEFAULT_MAX_VIRT_MEM ?= 20000*MB; - -@{ -desc = define default value for maximum number of processors per job if not defined at the queue level -values = integer -default = 1 -required = no -} -variable CE_DEFAULT_JOB_MAX_PROCS ?= 1; - variable CREAM_CE_VERSION ?= '1.14.0'; variable CE_HOSTS_CREAM ?= list(); -variable CE_HOSTS_LCG ?= list(); variable CE_FLAVOR ?= if ( is_defined(CE_HOSTS_CREAM) && (index(FULL_HOSTNAME,CE_HOSTS_CREAM) >= 0) ) { 'cream'; @@ -82,7 +44,7 @@ variable CE_FLAVOR = { }; # Default static value for several job-related attributes (updated by dynamic info providers) -variable GLUE_FAKE_JOB_VALUE ?= 444444; +variable GLUE_FAKE_JOB_VALUE ?= 4444; # Host publishing GlueCluster and GlueSubCluster information. # This is important to ensure this is published once even though @@ -209,20 +171,6 @@ variable GIP_CE_SERVICE_PARAMS = nlist( ), ); - - -# ---------------------------------------------------------------------------- -# Add RPMs that are required by GIP on CE to update dynamic information -# ---------------------------------------------------------------------------- -'/software/packages' = { - pkg_repl('glite-ce-cream-utils'); - pkg_repl('glite-info-provider-service'); - pkg_repl('lcg-info-dynamic-scheduler-pbs'); - if ( GIP_CE_USE_MAUI ) pkg_repl('lcg-info-dynamic-maui'); - SELF; -}; - - # ---------------------------------------------------------------------------- # Compute several variables summarizing the configuration # ---------------------------------------------------------------------------- @@ -319,7 +267,6 @@ variable CE_CPU_CONFIG = { # There are 2 entries in GIP_CE_PLUGIN_COMMAND : 1 for the 'dynamic-ce' plugin, 1 for the 'dynamic-scheduler' # plugin. # NOTE: this feature is currently implemented only for MAUI-based plugins. -# FIXME: generalize this feature for all batch systems variable GIP_CE_PLUGIN_COMMAND = { # If using the standard Torque-based plugin, do nothing if ( GIP_CE_USE_MAUI ) { @@ -332,35 +279,19 @@ variable GIP_CE_PLUGIN_COMMAND = { } else { pythonbin = 'python' }; - gip_script_options = format("--max-normal-slots %d --defaults %s", CE_CPU_CONFIG['cores'], GIP_CE_MAUI_PLUGIN_DEFAULTS_FILE); + gip_script_options = "--max-normal-slots " + to_string(CE_CPU_CONFIG['cores']); SELF['ce'] = pythonbin + ' ' + LCG_INFO_SCRIPTS_DIR + "/lcg-info-dynamic-maui --host "+LRMS_SERVER_HOST+" "+gip_script_options; if ( GIP_CE_USE_CACHE ) { - SELF['ce'] = SELF['ce'] + format(' --ce-ldif %s --share-ldif %s', GIP_VAR_DIR+'/static-file-all-CE-pbs.ldif', - GIP_LDIF_DIR+'/'+GIP_CE_GLUE2_LDIF_FILES['shares']); + SELF['ce'] = SELF['ce'] + ' --ce-ldif ' + GIP_VAR_DIR + '/static-file-all-CE-pbs.ldif'; } else { - SELF['ce'] = SELF['ce'] + format(' --ce-ldif %s --share-ldif %s', GIP_LDIF_DIR+'/static-file-all-CE-pbs.ldif', - GIP_LDIF_DIR+'/'+GIP_CE_GLUE2_LDIF_FILES['shares']); + SELF['ce'] = SELF['ce'] + ' --ce-ldif ' + GIP_LDIF_DIR + '/static-file-CE-pbs.ldif'; }; }; # Define only if using cache mode if ( GIP_CE_USE_CACHE ) { - SELF['scheduler'] = ''; - foreach (jobmanager;lrms;CE_BATCH_SYS_LIST) { - # The pipe is a workaround to allow GLUE2ComputingShareFreeSlots to be computing by lcg-info-dynamic-maui rather than - # lcg-info-dynamic-scheduler - if ( (lrms == 'pbs') && GIP_CE_USE_MAUI ) { - remove_free_slots_cmd = '| grep -v GLUE2ComputingShareFreeSlots'; - } else { - remove_free_slots_cmd = ''; - }; - SELF['scheduler'] = SELF['scheduler'] + format('%s/lcg-info-dynamic-scheduler -c %s/lcg-info-dynamic-scheduler-%s.conf %s', - LCG_INFO_SCRIPTS_DIR, - GIP_SCRIPTS_CONF_DIR, - lrms, - remove_free_slots_cmd, - ); - }; + SELF['scheduler'] = LCG_INFO_SCRIPTS_DIR + "/lcg-info-dynamic-scheduler -c "+ + GIP_SCRIPTS_CONF_DIR+"/lcg-info-dynamic-scheduler-pbs.conf"; }; SELF; @@ -382,7 +313,7 @@ variable GIP_CE_PLUGIN_COMMAND = { foreach (jobmanager;lrms;CE_BATCH_SYS_LIST) { if ( lrms == "condor" ) { - contents = contents + LCG_INFO_SCRIPTS_DIR +"/lcg-info-dynamic-condor /opt/condor/bin/ "+ + contents = contents + LCG_INFO_SCRIPTS_DIR +"/lcg-info-dynamic-condor /usr/bin/ "+ GIP_LDIF_DIR + "/static-file-CE-"+lrms+".ldif "+CONDOR_HOST+"\n"; } else if ( lrms == "lsf" ) { contents = contents + LCG_INFO_SCRIPTS_DIR +"/lcg-info-dynamic-lsf /usr/local/lsf/bin/ "+ @@ -431,19 +362,8 @@ variable GIP_CE_PLUGIN_COMMAND = { # Just display the content of cache file if cache mode is used. If the file doesn't exist, error will be detected/reported by GIP. contents = contents + 'cat ' + GIP_CE_CACHE_FILE['scheduler']; } else { - # The pipe is a workaround to allow GLUE2ComputingShareFreeSlots to be computing by lcg-info-dynamic-maui rather than - # lcg-info-dynamic-scheduler - if ( (lrms == 'pbs') && GIP_CE_USE_MAUI ) { - remove_free_slots_cmd = '| grep -v GLUE2ComputingShareFreeSlots'; - } else { - remove_free_slots_cmd = ''; - }; - contents = contents + format('%s/lcg-info-dynamic-scheduler -c %s/lcg-info-dynamic-scheduler-%s.conf %s', - LCG_INFO_SCRIPTS_DIR, - GIP_SCRIPTS_CONF_DIR, - lrms, - remove_free_slots_cmd, - ); + contents = contents + LCG_INFO_SCRIPTS_DIR + "/lcg-info-dynamic-scheduler -c "+ + GIP_SCRIPTS_CONF_DIR+"/lcg-info-dynamic-scheduler-"+lrms+".conf\n"; }; }; @@ -479,9 +399,13 @@ variable GIP_CE_VOMAP ?= { if ( is_defined(CE_BATCH_SYS_LIST) ) { foreach (jobmanager;lrms;CE_BATCH_SYS_LIST) { if ( lrms == "pbs" ) { - static_ldif_dir = GIP_LDIF_DIR; + if ( GIP_CE_USE_CACHE ) { + static_ldif_dir = GIP_VAR_DIR; + } else { + static_ldif_dir = GIP_LDIF_DIR; + }; ldif_file = format("%s/static-file-all-CE-pbs.ldif\n",static_ldif_dir); - ldif_file_glue2 = format("%s/%s\n",static_ldif_dir,GIP_CE_GLUE2_LDIF_FILES['shares']); + ldif_file_glue2 = format("%s/%s\n",GIP_LDIF_DIR,GIP_CE_GLUE2_LDIF_FILES['shares']); contents = "[Main]\n" + "static_ldif_file: "+ ldif_file + @@ -538,18 +462,19 @@ variable GIP_CE_VOMAP ?= { # --------------------------------------------------------------------- -# Build LDIF entries related to the CE +# Glue cluster and subcluster information. +# Added only if the current host is the LRMS host (GIP_CLUSTER_PUBLISHER_HOST +# can be redefined to change this behaviour). +# Do not create if CE_FLAVOR is undefined (not a CE). # --------------------------------------------------------------------- # MPI-related SW tags include { if ( FULL_HOSTNAME == GIP_CLUSTER_PUBLISHER_HOST ) 'features/gip/mpi' }; -variable GIP_CE_LDIF_PARAMS = { - - # Glue cluster and subcluster information. - # Added only if the current host is the LRMS host (GIP_CLUSTER_PUBLISHER_HOST - # can be redefined to change this behaviour). - # Do not create if CE_FLAVOR is undefined (not a CE). +"/software/components/gip2/ldif" = { + if ( is_defined(SELF) && !is_nlist(SELF) ) { + error('/software/components/gip2/ldif must be an nlist'); + }; if ( FULL_HOSTNAME == GIP_CLUSTER_PUBLISHER_HOST ) { # Build service endpoint and associated foreign key for each queue based on CE type @@ -583,8 +508,8 @@ variable GIP_CE_LDIF_PARAMS = { }; }; - cluster_entries_g1 = nlist(); - cluster_entries_g1[escape('dn: GlueClusterUniqueID='+GIP_CLUSTER_PUBLISHER_HOST+',Mds-Vo-name=resource,o=grid')] = + entries = nlist(); + entries[escape('dn: GlueClusterUniqueID='+GIP_CLUSTER_PUBLISHER_HOST+',Mds-Vo-name=resource,o=grid')] = nlist( "objectClass", list('GlueClusterTop','GlueCluster','GlueInformationService','GlueKey','GlueSchemaVersion'), "GlueClusterName", list(GIP_CLUSTER_PUBLISHER_HOST), @@ -599,7 +524,7 @@ variable GIP_CE_LDIF_PARAMS = { # per cluster. average_core_num = to_double(CE_CPU_CONFIG['cores']) / CE_CPU_CONFIG['cpus']; hepspec06 = 4 * to_double(CE_SI00) / 1000; - cluster_entries_g1[escape('dn: GlueSubClusterUniqueID='+GIP_CLUSTER_PUBLISHER_HOST+', GlueClusterUniqueID='+GIP_CLUSTER_PUBLISHER_HOST+',Mds-Vo-name=resource,o=grid')] = + entries[escape('dn: GlueSubClusterUniqueID='+GIP_CLUSTER_PUBLISHER_HOST+', GlueClusterUniqueID='+GIP_CLUSTER_PUBLISHER_HOST+',Mds-Vo-name=resource,o=grid')] = nlist( 'objectClass', list('GlueClusterTop','GlueSubCluster','GlueHostApplicationSoftware','GlueHostArchitecture', 'GlueHostBenchmark','GlueHostMainMemory','GlueHostOperatingSystem','GlueHostProcessor', @@ -632,25 +557,33 @@ variable GIP_CE_LDIF_PARAMS = { 'GlueSchemaVersionMajor', list("1"), 'GlueSchemaVersionMinor', list("3"), ); - - SELF["glue1"]["lcg-info-static-cluster.conf"]['ldifFile'] = "static-file-Cluster.ldif"; - SELF["glue1"]["lcg-info-static-cluster.conf"]['entries'] = cluster_entries_g1; + + hash = nlist(); + + hash['template'] = GIP_GLUE_TEMPLATES_DIR + "/GlueCluster.template"; + hash['ldifFile'] = "static-file-Cluster.ldif"; + hash['entries'] = entries; + + SELF["lcg-info-static-cluster.conf"] = hash; }; + SELF; +}; - # Glue CE static information. - # When using GIP in cache mode and the current node is the LRMS - # server, a second LDIF file is produced with the entries for all - # CEs to be used as input by GIP plugin run in cache mode on the LRMS server. - # All CEs are assumed to share the same configuration for queue state, default SE... - # Cache mode is currently supported only for Torque/MAUI. +#--------------------------------------------------------------- +# Glue CE static information. +# When using GIP in cache mode and the current node is the LRMS +# server, a second LDIF file is produced with the entries for all +# CEs to be used as input by GIP plugin run in cache mode on the LRMS server. +# All CEs are assumed to share the same configuration for queue state, default SE... +# Cache mode is currently supported only for Torque/MAUI. +#--------------------------------------------------------------- +"/software/components/gip2/ldif" = { # iterate over all defined queues (there is one GlueCE object per queue) if ( is_defined(CE_QUEUES['vos']) ) { - # GLUE1: host_entries_g1 and all_ce_entries_g1 contain the VOView/CE DN list per LRMS - # GLUE2: all_ce_entries_g2 contain the shares and computing service descriptions (there is no host_entries_g2) - host_entries_g1 = nlist(); - all_ce_entries_g1 = nlist(); - share_entries_g2 = nlist(); + # host_entries and all_ce_entries contain the VOView/CE DN list per LRMS + host_entries = nlist(); + all_ce_entries = nlist(); foreach (queue;vos;CE_QUEUES['vos']) { if (exists(CE_QUEUES['lrms'][queue])) { @@ -660,28 +593,29 @@ variable GIP_CE_LDIF_PARAMS = { jobmanager=CE_BATCH_SYS; }; lrms = CE_BATCH_SYS_LIST[jobmanager]; - if ( GIP_CE_USE_CACHE && !is_nlist(host_entries_g1[lrms]) ) host_entries_g1[lrms] = nlist(); + if ( !is_nlist(host_entries[lrms]) ) { + host_entries[lrms] = nlist(); + }; - # FIXME: cache mode should not be specific to Torque/MAUI... - # FIXME: cluster mode (distinct CEs and LRMS master) validation with LRMS other than Torque/MAUI - if ( FULL_HOSTNAME == LRMS_SERVER_HOST ) { + if ( (lrms == 'pbs') && GIP_CE_USE_MAUI && GIP_CE_USE_CACHE && (FULL_HOSTNAME == LRMS_SERVER_HOST) ) { ce_list = CE_HOSTS; # Create only if necessary to avoid creating a useless emtpy file - if ( !is_nlist(all_ce_entries_g1[lrms]) ) all_ce_entries_g1[lrms] = nlist(); - if ( !is_nlist(share_entries_g2[lrms]) ) share_entries_g2[lrms] = nlist(); + if ( !is_nlist(all_ce_entries[lrms]) ) { + all_ce_entries[lrms] = nlist(); + }; } else { ce_list = list(FULL_HOSTNAME); }; foreach (i;ce;ce_list) { - if ( index(ce,CE_HOSTS_LCG) >= 0 ) { - ce_flavor = 'lcg'; - unique_id = ce+':'+to_string(CE_PORT[ce_flavor])+'/jobmanager-'+jobmanager+'-'+queue; - } else { + if ( index(ce,CE_HOSTS_CREAM) >= 0 ) { ce_flavor = 'cream'; # On CREAM CE, there is no distinction between lcgpbs and pbs. Reset jobmanager to lrms. jobmanager = lrms; unique_id = ce+':'+to_string(CE_PORT[ce_flavor])+'/cream-'+jobmanager+'-'+queue; + } else { + ce_flavor = 'lcg'; + unique_id = ce+':'+to_string(CE_PORT[ce_flavor])+'/jobmanager-'+jobmanager+'-'+queue; }; access = list(); @@ -710,8 +644,7 @@ variable GIP_CE_LDIF_PARAMS = { queue_status = CE_STATUS; }; - entries_g1 = nlist(); - entries_g2 = nlist(); + entries = nlist(); foreach (k;vo;vos) { vo_name = VO_INFO[vo]['name']; rule = "VO:"+ vo_name; @@ -736,141 +669,120 @@ variable GIP_CE_LDIF_PARAMS = { #FIXME: use home directory if in a shared area shared_data_dir = nlist('GlueCEInfoDataDir', list(CE_DATADIR)); - # GLUE1 GlueVOView entry (LDIF, 1/VO/CE) - entries_g1[escape('dn: GlueVOViewLocalID='+vo_name+',GlueCEUniqueID='+unique_id+',Mds-Vo-name=resource,o=grid')] = - merge(nlist('objectClass', list('GlueCETop','GlueVOView','GlueCEInfo','GlueCEState','GlueCEAccessControlBase','GlueCEPolicy', - 'GlueKey','GlueSchemaVersion'), - 'GlueVOViewLocalID', list(vo_name), - 'GlueSchemaVersionMajor', list('1'), - 'GlueSchemaVersionMinor', list('3'), - 'GlueCEAccessControlBaseRule', list(rule), - 'GlueCEStateRunningJobs', list('0'), - 'GlueCEStateWaitingJobs', list(to_string(GLUE_FAKE_JOB_VALUE)), - 'GlueCEStateTotalJobs', list('0'), - 'GlueCEStateFreeJobSlots', list('0'), - 'GlueCEStateEstimatedResponseTime', list('2146660842'), - 'GlueCEStateWorstResponseTime', list('2146660842'), - 'GlueChunkKey', list("GlueCEUniqueID="+unique_id), - ), - gluese_info_default_se, - sw_area, - shared_data_dir, - ); + entries[escape('dn: GlueVOViewLocalID='+vo_name+',GlueCEUniqueID='+unique_id+',Mds-Vo-name=resource,o=grid')] = + merge(nlist( + 'objectClass', list('GlueCETop','GlueVOView','GlueCEInfo','GlueCEState','GlueCEAccessControlBase','GlueCEPolicy', + 'GlueKey','GlueSchemaVersion'), + 'GlueVOViewLocalID', list(vo_name), + 'GlueSchemaVersionMajor', list('1'), + 'GlueSchemaVersionMinor', list('3'), + 'GlueCEAccessControlBaseRule', list(rule), + 'GlueCEStateRunningJobs', list('0'), + 'GlueCEStateWaitingJobs', list(to_string(GLUE_FAKE_JOB_VALUE)), + 'GlueCEStateTotalJobs', list('0'), + 'GlueCEStateFreeJobSlots', list('0'), + 'GlueCEStateEstimatedResponseTime', list('2146660842'), + 'GlueCEStateWorstResponseTime', list('2146660842'), + 'GlueChunkKey', list("GlueCEUniqueID="+unique_id), + ), + gluese_info_default_se, + sw_area, + shared_data_dir, + ); }; - # GLUE1 GlueCE entry (LDIF) - entries_g1[escape('dn: GlueCEUniqueID='+unique_id+',Mds-Vo-name=resource,o=grid')] = - merge(nlist('objectClass', list('GlueCETop','GlueCE','GlueCEAccessControlBase','GlueCEInfo','GlueCEPolicy', 'GlueCEState', - 'GlueInformationService','GlueKey','GlueSchemaVersion'), - 'GlueCEImplementationName', list(GLUE_CE_IMPLEMENTATION[ce_flavor]), - 'GlueCEImplementationVersion', list(CREAM_CE_VERSION), - 'GlueCEHostingCluster', list(GIP_CLUSTER_PUBLISHER_HOST), - 'GlueCEName', list(queue), - 'GlueCEUniqueID', list(unique_id), - 'GlueCEInfoGatekeeperPort', list(to_string(CE_PORT[ce_flavor])), - # This is a hack to fix a problem affecting WMS/NagiosBox that don't like a InfoHostName - # that doesn't match a CE name... InfoHostName should be FULL_HOSTNAME normally. - 'GlueCEInfoHostName', list(ce), - 'GlueCEInfoLRMSType', list(lrms), - 'GlueCEInfoLRMSVersion', list('not defined'), - 'GlueCEInfoTotalCPUs', list('0'), - 'GlueCEInfoJobManager', list(jobmanager), - 'GlueCEInfoContactString', list(unique_id), - 'GlueCEInfoApplicationDir', list("/home/"), - 'GlueCEInfoDataDir', list(CE_DATADIR), - 'GlueCEStateEstimatedResponseTime', list(to_string(2146660842)), - 'GlueCEStateFreeCPUs', list('0'), - 'GlueCEStateRunningJobs', list('0'), - 'GlueCEStateStatus', list(queue_status), - 'GlueCEStateTotalJobs', list('0'), - 'GlueCEStateWaitingJobs', list(to_string(GLUE_FAKE_JOB_VALUE)), - 'GlueCEStateWorstResponseTime', list('2146660842'), - 'GlueCEStateFreeJobSlots', list('0'), - 'GlueCEPolicyMaxCPUTime', list('0'), - 'GlueCEPolicyMaxRunningJobs', list('0'), - 'GlueCEPolicyMaxTotalJobs', list('0'), - 'GlueCEPolicyMaxWallClockTime', list('0'), - 'GlueCEPolicyPriority', list('1'), - 'GlueCEPolicyAssignedJobSlots', list('0'), - 'GlueCECapability', CE_CAPABILITIES, - 'GlueForeignKey', list('GlueClusterUniqueID='+GIP_CLUSTER_PUBLISHER_HOST), - 'GlueInformationServiceURL', list(RESOURCE_INFORMATION_URL), - 'GlueCEAccessControlBaseRule', access, - 'GlueCEPolicyMaxObtainableCPUTime', list('0'), - 'GlueCEPolicyMaxObtainableWallClockTime', list('0'), - 'GlueCEPolicyMaxSlotsPerJob', list('0'), - 'GlueCEPolicyPreemption', list('0'), - 'GlueCEPolicyMaxWaitingJobs', list('0'), - 'GlueSchemaVersionMajor', list('1'), - 'GlueSchemaVersionMinor', list('3'), - ), - gluese_info_default_se - ); + entries[escape('dn: GlueCEUniqueID='+unique_id+',Mds-Vo-name=resource,o=grid')] = + merge(nlist('objectClass', list('GlueCETop','GlueCE','GlueCEAccessControlBase','GlueCEInfo','GlueCEPolicy', 'GlueCEState', + 'GlueInformationService','GlueKey','GlueSchemaVersion'), + 'GlueCEImplementationName', list(GLUE_CE_IMPLEMENTATION[ce_flavor]), + 'GlueCEImplementationVersion', list(CREAM_CE_VERSION), + 'GlueCEHostingCluster', list(GIP_CLUSTER_PUBLISHER_HOST), + 'GlueCEName', list(queue), + 'GlueCEUniqueID', list(unique_id), + 'GlueCEInfoGatekeeperPort', list(to_string(CE_PORT[ce_flavor])), + 'GlueCEInfoHostName', list(FULL_HOSTNAME), + 'GlueCEInfoLRMSType', list(lrms), + 'GlueCEInfoLRMSVersion', list('not defined'), + 'GlueCEInfoTotalCPUs', list('0'), + 'GlueCEInfoJobManager', list(jobmanager), + 'GlueCEInfoContactString', list(unique_id), + 'GlueCEInfoApplicationDir', list("/home/"), + 'GlueCEInfoDataDir', list(CE_DATADIR), + 'GlueCEStateEstimatedResponseTime', list(to_string(2146660842)), + 'GlueCEStateFreeCPUs', list('0'), + 'GlueCEStateRunningJobs', list('0'), + 'GlueCEStateStatus', list(queue_status), + 'GlueCEStateTotalJobs', list('0'), + 'GlueCEStateWaitingJobs', list(to_string(GLUE_FAKE_JOB_VALUE)), + 'GlueCEStateWorstResponseTime', list('2146660842'), + 'GlueCEStateFreeJobSlots', list('0'), + 'GlueCEPolicyMaxCPUTime', list('0'), + 'GlueCEPolicyMaxRunningJobs', list('0'), + 'GlueCEPolicyMaxTotalJobs', list('0'), + 'GlueCEPolicyMaxWallClockTime', list('0'), + 'GlueCEPolicyPriority', list('1'), + 'GlueCEPolicyAssignedJobSlots', list('0'), + 'GlueCECapability', CE_CAPABILITIES, + 'GlueForeignKey', list('GlueClusterUniqueID='+GIP_CLUSTER_PUBLISHER_HOST), + 'GlueInformationServiceURL', list(RESOURCE_INFORMATION_URL), + 'GlueCEAccessControlBaseRule', access, + 'GlueCEPolicyMaxObtainableCPUTime', list('0'), + 'GlueCEPolicyMaxObtainableWallClockTime', list('0'), + 'GlueCEPolicyMaxSlotsPerJob', list('0'), + 'GlueCEPolicyPreemption', list('0'), + 'GlueCEPolicyMaxWaitingJobs', list('0'), + 'GlueSchemaVersionMajor', list('1'), + 'GlueSchemaVersionMinor', list('3'), + ), + gluese_info_default_se + ); # Entries are for the current host, add them to the list of DN for the GIP standard LDIF file if ( ce == FULL_HOSTNAME ) { - host_entries_g1[lrms] = merge(host_entries_g1[lrms],entries_g1); + host_entries[lrms] = merge(host_entries[lrms],entries); }; - # Also add to GLUE1 LDIF file used when cache mode is enabled (several entries in ce_list) - if ( is_nlist(all_ce_entries_g1[lrms]) ) { - all_ce_entries_g1[lrms] = merge(all_ce_entries_g1[lrms],entries_g1); - }; - - # GLUE2 entry (LDIF generator config entry). - # GLUE2 shares are independent of CEs: add only once. - share_name = replace('\.','-',format('%s_%s',queue,vo_name)); - if ( !is_defined(share_entries_g2[lrms][share_name]) ) { - glue2_var_prefix = format('SHARE_%s_',to_uppercase(share_name)); - entries_g2[share_name] = nlist(glue2_var_prefix+'QUEUENAME', list(queue), - glue2_var_prefix+'OWNER', list(vo_name), - glue2_var_prefix+'ENDPOINTS', list(ce+'_org.glite.ce.CREAM'), - glue2_var_prefix+'EXECUTIONENVIRONMENTS', list(GIP_CLUSTER_PUBLISHER_HOST), - glue2_var_prefix+'ACBRS', access, - glue2_var_prefix+'CEIDS', list(unique_id), - ); - - # GLUE2 : add entries if on the LRMS master node - if ( is_nlist(share_entries_g2[lrms]) ) { - share_entries_g2[lrms] = merge(share_entries_g2[lrms],entries_g2); - }; + # Also add to LDIF file used when cache mode is enabled (several entries in ce_list) + if ( is_nlist(all_ce_entries[lrms]) ) { + all_ce_entries[lrms] = merge(all_ce_entries[lrms],entries); }; }; # end of iteration over CEs }; # end of iteration over queues - # Create LDIF configuration entries describing CE queues (GlueCE and GlueVOView). - if ( index(FULL_HOSTNAME,CE_HOSTS) >= 0 ) { - foreach (lrms;ce_entries;host_entries_g1) { - conf_file_g1 = "lcg-info-static-ce-"+lrms+".conf"; - SELF['glue1'][conf_file_g1]['ldifFile'] = "static-file-CE-"+lrms+".ldif"; - if ( !is_defined(SELF['glue1'][conf_file_g1]['entries']) ) SELF['glue1'][conf_file_g1]['entries'] = nlist(); - SELF['glue1'][conf_file_g1]['entries'] = merge(SELF['glue1'][conf_file_g1]['entries'],ce_entries); - }; - } else { - foreach (lrms;ce_entries;all_ce_entries_g1) { - conf_file_g1 = "lcg-info-static-all-CE-"+lrms+".conf"; - SELF['glue1'][conf_file_g1]['ldifFile'] = GIP_VAR_DIR + "/static-file-all-CE-"+lrms+".ldif"; - if ( !is_defined(SELF['glue1'][conf_file_g1]['entries']) ) SELF['glue1'][conf_file_g1]['entries'] = nlist(); - SELF['glue1'][conf_file_g1]['entries'] = merge(SELF['glue1'][conf_file_g1]['entries'],ce_entries); - }; + # Create all needed LDIF files + foreach (lrms;entries;host_entries) { + conf_file = "lcg-info-static-ce-"+lrms+".conf"; + SELF[conf_file] = nlist(); + SELF[conf_file]['template'] = GIP_GLUE_TEMPLATES_DIR + "/GlueCE.template"; + SELF[conf_file]['ldifFile'] = "static-file-CE-"+lrms+".ldif"; + SELF[conf_file]['entries'] = entries; }; - foreach (lrms;share_entries;share_entries_g2) { - conf_file_g2 = "glite-ce-glue2.conf"; - if ( !is_defined(SELF['glue2']['shares']) ) SELF['glue2']['shares'] = nlist(); - SELF['glue2']['shares'] = merge(SELF['glue2']['shares'],share_entries); + foreach (lrms;entries;all_ce_entries) { + conf_file = "lcg-info-static-all-CE-"+lrms+".conf"; + SELF[conf_file] = nlist(); + SELF[conf_file]['template'] = GIP_GLUE_TEMPLATES_DIR + "/GlueCE.template"; + SELF[conf_file]['ldifFile'] = "static-file-all-CE-"+lrms+".ldif"; + SELF[conf_file]['entries'] = entries; }; + }; - - # Glue CE-SE binding static information. - # Do not create if CE_FLAVOR is undefined (not a CE). + SELF; +}; + + +#--------------------------------------------------------------- +# Glue CE-SE binding static information. +# Do not create if CE_FLAVOR is undefined (not a CE). +#--------------------------------------------------------------- +"/software/components/gip2/ldif" = { if ( is_defined(CE_FLAVOR) ) { # iterate over all defined queues (there is one GlueCE object per queue) if ( is_defined(CE_QUEUES['vos']) ) { - close_se_entries_g1 = nlist(); + entries = nlist(); foreach (queue;vos;CE_QUEUES['vos']) { if (exists(CE_QUEUES['lrms'][queue])) { @@ -910,7 +822,7 @@ variable GIP_CE_LDIF_PARAMS = { # Define list of SEs usable by this queue if ( length(queue_close_se_list) > 0 ) { - close_se_entries_g1[escape('dn: GlueCESEBindGroupCEUniqueID='+unique_id+',Mds-Vo-name=resource,o=grid')] = + entries[escape('dn: GlueCESEBindGroupCEUniqueID='+unique_id+',Mds-Vo-name=resource,o=grid')] = nlist('objectClass', list('GlueGeneralTop','GlueCESEBindGroup','GlueSchemaVersion'), 'GlueCESEBindGroupSEUniqueID', queue_close_se_list, 'GlueSchemaVersionMajor', list('1'), @@ -943,7 +855,7 @@ variable GIP_CE_LDIF_PARAMS = { }; }; - close_se_entries_g1[escape('dn: GlueCESEBindSEUniqueID='+se+',GlueCESEBindGroupCEUniqueID='+unique_id+',Mds-Vo-name=resource,o=grid')] = + entries[escape('dn: GlueCESEBindSEUniqueID='+se+',GlueCESEBindGroupCEUniqueID='+unique_id+',Mds-Vo-name=resource,o=grid')] = nlist( 'objectClass', list('GlueGeneralTop','GlueCESEBind','GlueSchemaVersion'), 'GlueSchemaVersionMajor', list('1'), @@ -959,137 +871,12 @@ variable GIP_CE_LDIF_PARAMS = { }; }; - SELF["glue1"]["lcg-info-static-cesebind.conf"]['ldifFile'] = "static-file-CESEBind.ldif"; - SELF["glue1"]["lcg-info-static-cesebind.conf"]['entries'] = close_se_entries_g1; + SELF["lcg-info-static-cesebind.conf"] = nlist(); + SELF["lcg-info-static-cesebind.conf"]['template'] = GIP_GLUE_TEMPLATES_DIR + "/GlueCESEBind.template"; + SELF["lcg-info-static-cesebind.conf"]['ldifFile'] = "static-file-CESEBind.ldif"; + SELF["lcg-info-static-cesebind.conf"]['entries'] = entries; }; - - # Create LDIF configuration entries for GLUE2 (general parameters) - # FIXME: ServingState configuration - # FIXME: Argus paramater based on actual config - # FIXME: CE_BATCH_VERSION paramater based on actual config - # FIXME: CloseSEs: set LocalPath/RemotePath - # FIXME: manage ESComputingServiceID and WorkingAreaxxx attributes - ce_acbr = list(); - foreach (i;vo;VOS) { - ce_acbr[length(ce_acbr)] = format('VO:%s',vo); - }; - ce_shares = list(); - foreach (lrms;share_entries;share_entries_g2) { - foreach (share;params;share_entries) { - ce_shares[length(ce_shares)] = to_uppercase(share); - } - }; - ce_close_ses = list(); - if ( is_defined(queue_close_se_list) ) { - foreach (i;se;queue_close_se_list) { - ce_close_ses[length(ce_close_ses)] = format('(%s none none)',se); - }; - }; - if ( CE_SHARED_HOMES ) { - working_area_shared = 'yes'; - } else { - working_area_shared = 'no'; - }; - # FIXME: check what ImplementationVersion and InterfaceVersion should be (CE version or LRMS version) - SELF['glue2']['CEParameters'] = nlist('SiteId', list(SITE_NAME), - 'ComputingServiceId', list(GIP_CLUSTER_PUBLISHER_HOST+'_ComputingElement'), - 'NumberOfEndPointType', list('3'), - 'ImplementationVersion', list(CREAM_CE_VERSION), - 'InterfaceVersion', list(CREAM_CE_VERSION), - 'HealthStateHelper', list(GIP_PROVIDER_SUBSERVICE['test']), - 'ServingState', list('production'), - 'Owner', VOS, - 'Argus', list('no'), - 'EMIES', list('no'), - 'ACBR', ce_acbr, - 'Shares', ce_shares, - 'ExecutionEnvironments', list(GIP_CLUSTER_PUBLISHER_HOST), - 'CE_BATCH_SYS', list(CE_BATCH_SYS), - 'BATCH_VERSION', list('0.0.0.0'), - 'CECapabilities', CE_CAPABILITIES, - 'CloseSEs', ce_close_ses, - 'WorkingAreaShared', list(working_area_shared), - #'WorkingAreaGuaranteed', list('no'), - #'WorkingAreaTotal', list('undefined'), - #'WorkingAreaFree', list('undefined'), - #'WorkingAreaLifeTime', list('undefined'), - #'WorkingAreaMultislotTotal', list('undefined'), - #'WorkingAreaMultislotFree', list('undefined'), - #'WorkingAreaMultislotLifeTime', list('undefined'), - #'ESComputingServiceId', list('undefined'), - ); - - - # Create LDIF configuration entries for GLUE2 (execution environment parameters) - # FIXME: SmpSize, Cores. Define separate Execution Environments for different HW? - # FIXME: ProcessorVendor. Define separate Execution Environments for different HW? - # FIXME: ProcessorModel. Define separate Execution Environments for different HW? - # FIXME: ProcessorClockSpeed. Define separate Execution Environments for different HW? - if ( FULL_HOSTNAME == GIP_CLUSTER_PUBLISHER_HOST ) { - glue2_var_prefix = format('ExecutionEnvironment_%s_',GIP_CLUSTER_PUBLISHER_HOST); - SELF['glue2']['ExecutionEnvironment'] = nlist(glue2_var_prefix+'ArchitecturePlatformType', list(CE_WN_ARCH), - glue2_var_prefix+'PhysicalCPUs', list(to_string(CE_CPU_CONFIG['cpus'])), - glue2_var_prefix+'LogicalCPUs', list(to_string(CE_CPU_CONFIG['cores'])), - glue2_var_prefix+'SmpSize', list(CE_SMPSIZE), - glue2_var_prefix+'ProcessorVendor', list(CE_CPU_VENDOR), - glue2_var_prefix+'ProcessorModel', list(CE_CPU_MODEL), - glue2_var_prefix+'ProcessorClockSpeed', list(CE_CPU_SPEED), - glue2_var_prefix+'MainMemoryRAMSize', list(CE_MINPHYSMEM), - glue2_var_prefix+'MainMemoryVirtualSize', list(CE_MINVIRTMEM), - glue2_var_prefix+'OperatingSystemFamily', list(CE_OS_FAMILY), - glue2_var_prefix+'OperatingSystemName', list(CE_OS), - glue2_var_prefix+'OperatingSystemRelease', list(CE_OS_RELEASE), - glue2_var_prefix+'NetworkAdapterInboundIP', list(CE_INBOUNDIP), - glue2_var_prefix+'NetworkAdapterOutboundIP', list(CE_OUTBOUNDIP), - glue2_var_prefix+'Benchmarks', list(format('(HEPSPEC06 %s)',to_string(hepspec06)), - format('(SF00 %s)',to_string(CE_SF00)), - format('(SI00 %s)',to_string(CE_SI00)), - ), - glue2_var_prefix+'Cores', list(to_string(average_core_num)), - ); - }; - - SELF; -}; - - -#-------------------------------------------------------------------- -# Copy GIP_CE_LDIF_PARAMS to the relevant part of the configuration. -# LDIF configuration is done differently for GLUE1 and GLUE2. -#-------------------------------------------------------------------- -"/software/components/gip2" = { - if ( is_defined(SELF) && !is_nlist(SELF) ) { - error('/software/components/gip2/ldif must be an nlist'); - }; - - if ( is_defined(GIP_CE_LDIF_PARAMS['glue1']) ) { - foreach (k;v;GIP_CE_LDIF_PARAMS['glue1']) { - SELF['ldif'][k] = v; - }; - }; - - if ( is_defined(GIP_CE_LDIF_PARAMS['glue2']) ) { - foreach (k;v;GIP_CE_LDIF_PARAMS['glue2']) { - if ( k == 'shares' ) { - foreach (k2;v2;GIP_CE_LDIF_PARAMS['glue2']['shares']) { - SELF['ldifConfEntries'][GIP_CE_GLUE2_CONFIG_FILE][k2] = v2; - }; - } else if ( match('CEParameters|ExecutionEnvironment',k) ) { - SELF['ldifConfEntries'][GIP_CE_GLUE2_CONFIG_FILE][k] = GIP_CE_LDIF_PARAMS['glue2'][k] - }; - }; - foreach (category;dummy;GIP_CE_GLUE2_LDIF_PROCESSORS) { - # When the host is not also the GIP_CLUSTER_PUBLISHER_HOST (in cluster mode), - # only the GLUE2ComputingService and the GLUE2ComputingEndpoint must be published. - if ( (FULL_HOSTNAME == GIP_CLUSTER_PUBLISHER_HOST) || match('endpoint|service',category) ) { - SELF['ldif']['glue2_'+category]['staticInfoCmd'] = format('%s/%s',GIP_CE_GLUE2_LDIF_PROCESSOR_DIR,GIP_CE_GLUE2_LDIF_PROCESSORS[category]); - SELF['ldif']['glue2_'+category]['confFile'] = GIP_CE_GLUE2_CONFIG_FILE; - SELF['ldif']['glue2_'+category]['ldifFile'] = GIP_CE_GLUE2_LDIF_FILES[category]; - }; - }; - }; - SELF; }; @@ -1158,12 +945,70 @@ variable GIP_CE_LDIF_PARAMS = { SELF; }; +include { 'components/filecopy/config' }; + +'/software/components/filecopy/services/{/etc/glite/info/service/GlueCE.template}'= nlist( + 'config',file_contents('features/gip/GlueCE.template'), + 'owner','root', + 'perms','0755', +); + +'/software/components/filecopy/services/{/etc/glite/info/service/GlueCESEBind.template}'= nlist( + 'config',file_contents('features/gip/GlueCESEBind.template'), + 'owner','root', + 'perms','0755', +); + +'/software/components/filecopy/services/{/etc/glite/info/service/GlueCluster.template}'= nlist( + 'config',file_contents('features/gip/GlueCluster.template'), + 'owner','root', + 'perms','0755', +); + +'/software/components/filecopy/services/{/var/glite/static-file-CE-pbs-glue2.ldif}' = nlist( + 'config','', + 'owner', 'root', + 'perms', '0755', +); + +'/software/components/filecopy/services/{/var/glite/static-file-all-CE-pbs-glue2.ldif}' = nlist( + 'config','', + 'owner', 'root', + 'perms', '0755', +); + + +include { 'components/symlink/config' }; +'/software/components/symlink/links' = { + append(nlist( + "name", "/opt/lcg/lib/python", + "target", "/usr/lib/python", + "replace", nlist("all", "yes"), + )); + append(nlist( + "name", "/opt/glite/var/info/"+LRMS_SERVER_HOST, + "target", "/var/glite/info", + "replace", nlist("all","yes","link", "yes") + )); + if ( FULL_HOSTNAME == GIP_CLUSTER_PUBLISHER_HOST && GIP_CE_USE_CACHE ) { + append(nlist( + "name", GIP_VAR_DIR + '/static-file-all-CE-pbs.ldif', + "target", GIP_LDIF_DIR + '/static-file-all-CE-pbs.ldif', + "replace", nlist("all", "yes"), + )); + }; + #This is more like a Workaround. We need a more proper solution. + if (CE_BATCH_SYS == 'condor' ){ + append(nlist( + "name", '/usr/libexec/lcg-info-dynamic-condor', + "target", '/opt/glite/libexec/lcg-info-dynamic-condor', + "replace", nlist("all", "yes"), + )); + }; -# Create the file defining default values for some queue attributes if using -# lcg-info-dynamic-maui. -include if ( GIP_CE_USE_MAUI && (FULL_HOSTNAME == LRMS_SERVER_HOST) ) 'features/gip/ce-maui-plugin-defaults'; + SELF; +}; -# Define permissions/owner for some key directories include { 'components/dirperm/config' }; '/software/components/dirperm/paths' = { append(nlist( @@ -1184,4 +1029,10 @@ include { 'components/dirperm/config' }; 'perm','0755', 'type','d', )); + append(nlist( + 'owner', 'root:root', + 'path', '/var/tmp/info-dynamic-scheduler-generic', + 'perm', '0755', + 'type', 'd', + )); };