CMS-like Frontend config

<frontend frontend_name="UCSD-v5_2"
   advertise_delay="1" advertise_with_multiple="True" advertise_with_tcp="True" 
   loop_delay="60" restart_attempts="3" restart_interval="1800">

   <work base_dir="/home/frontend/frontstage" base_log_dir="/home/frontend/frontlogs"/>
   <stage base_dir="/var/www/html/vofrontend/stage" use_symlink="True" web_base_url="http://glidein-collector.t2.ucsd.edu:8319/vofrontend//stage"/>
   <monitor base_dir="/var/www/html/vofrontend/monitor" flot_dir="/home/frontend/javascriptrrd-0.6.1/flot" javascriptRRD_dir="/home/frontend/javascriptrrd-0.6.1" jquery_dir="/home/frontend/javascriptrrd-0.6.1/flot"/>
   <log_retention max_days="21.0" max_mbytes="8000.0" min_days="7.0"/>

   <security security_name="UCSDCMS" 
                classad_proxy="/home/frontend/.globus/x509_service_proxy" proxy_DN="/DC=org/DC=doegrids/OU=Services/CN=glidein-collector.t2.ucsd.edu" 
                proxy_selection_plugin="ProxyUserMapWRecycling" sym_key="aes_256_cbc">
      <proxies/>
   </security>
   <collectors>
      <collector DN="/DC=org/DC=doegrids/OU=Services/CN=glidein-collector.t2.ucsd.edu" node="glidein-collector.t2.ucsd.edu" secondary="False"/>
      <collector DN="/DC=org/DC=doegrids/OU=Services/CN=glidein-collector.t2.ucsd.edu" node="glidein-collector.t2.ucsd.edu:9620-9919" secondary="True"/>
   </collectors>

   <attrs>
      <attr name="GLIDECLIENT_Start" comment="In the first try, use the NormMaxWallTimeMins limit, in the next tries, use MaxWallTimeMins limit, if defined" 
               glidein_publish="False" job_publish="False" parameter="True" type="string" 
               value="ifthenelse(LastVacateTime=?=UNDEFINED,
                                 ifthenelse(NormMaxWallTimeMins=!=UNDEFINED,
                                            (NormMaxWallTimeMins*60)&lt;(GLIDEIN_ToRetire+GLIDEIN_Job_Max_Time-MyCurrentTime),
                                            (8*3600)&lt;(GLIDEIN_ToRetire+GLIDEIN_Job_Max_Time-MyCurrentTime)),
                                 ifthenelse(MaxWallTimeMins=!=UNDEFINED,
                                            (MaxWallTimeMins*60)&lt;(GLIDEIN_ToRetire+GLIDEIN_Job_Max_Time-MyCurrentTime),
                                            (16*3600)&lt;(GLIDEIN_ToRetire+GLIDEIN_Job_Max_Time-MyCurrentTime)))&amp;&amp;
                      (ImageSize&lt;=(GLIDEIN_MaxMemMBs*1024))&amp;&amp;
                      (JOB_Is_ITB =!= TRUE)"/>
      <attr name="GLIDEIN_Expose_Grid_Env" glidein_publish="True" job_publish="True" parameter="False" type="string" value="True"/>
      <attr name="GLIDEIN_Glexec_Use" comment="This will use glexec wherever available" glidein_publish="False" job_publish="False" parameter="True" type="string" value="OPTIONAL"/>
      <attr name="USE_MATCH_AUTH" glidein_publish="False" job_publish="False" parameter="True" type="string" value="True"/>
   </attrs>

   <files>
      <file absfname="/home/frontend/glideinWMS_CMS/glidein_script/discover_CMSSW.sh" after_entry="True" after_group="False" const="True" executable="True" untar="False" wrapper="False">
         <untar_options cond_attr="TRUE"/>
      </file>
      <file absfname="/home/frontend/frontstage/instance_v5_2.cfg/set_home_cms.source" after_entry="True" after_group="False" const="True" executable="False" untar="False" wrapper="True">
         <untar_options cond_attr="TRUE"/>
      </file>
   </files>

   <match    comment="Limit by time and size constraints, but only if not running (for monitoring purposes)" 
             match_expr='(job["JobStatus"]==2) or 
                         ( ( (not glidein["attrs"].has_key("GLIDEIN_Max_Walltime")) or 
                             ( ( (not job.has_key("LastVacateTime")) and 
                                 ( (not job.has_key("NormMaxWallTimeMins")) or 
                                   ((job["NormMaxWallTimeMins"]+10)&lt;((glidein["attrs"]["GLIDEIN_Max_Walltime"]-glidein["attrs"]["GLIDEIN_Retire_Time_Spread"]-glidein["attrs"]["GLIDEIN_Job_Max_Time"])/60)))) or 
                               ( (job.has_key("LastVacateTime")) and 
                                 ( (not job.has_key("MaxWallTimeMins")) or 
                                   ((job["MaxWallTimeMins"]+10)&lt;((glidein["attrs"]["GLIDEIN_Max_Walltime"]-glidein["attrs"]["GLIDEIN_Retire_Time_Spread"]-glidein["attrs"]["GLIDEIN_Job_Max_Time"])/60)))))) and 
                           ( (not job.has_key("ImageSize")) or 
                             (job["ImageSize"]&lt;=(glidein["attrs"]["GLIDEIN_MaxMemMBs"]*1024))) and 
                           ( ((not job.has_key("NumJobStarts")) or (job["NumJobStarts"]&lt;5)) or 
                             (job.has_key("LastVacateTime") and ((job["ServerTime"]-job["LastVacateTime"])&gt;3600)))
                         )'>
      <factory    query_expr='stringListMember("CMS",GLIDEIN_Supported_VOs) &amp;&amp; 
                              (GLIDEIN_Job_Max_Time=!=UNDEFINED) &amp;&amp; 
                              (GLIDEIN_Max_Walltime=!=UNDEFINED) &amp;&amp; 
                              (GLIDEIN_Retire_Time_Spread=!=UNDEFINED) &amp;&amp; 
                              (GLIDEIN_MaxMemMBs=!=UNDEFINED)'>
         <match_attrs>
            <match_attr name="GLIDEIN_Job_Max_Time" type="int"/>
            <match_attr name="GLIDEIN_MaxMemMBs" type="int"/>
            <match_attr name="GLIDEIN_Max_Walltime" type="int"/>
            <match_attr name="GLIDEIN_Retire_Time_Spread" type="int"/>
         </match_attrs>
         <collectors>
            <collector DN="/DC=org/DC=doegrids/OU=Services/CN=glidein-1.t2.ucsd.edu" factory_identity="gfactory@glidein-1.t2.ucsd.edu" my_identity="fecmsucsd@glidein-1.t2.ucsd.edu" node="glidein-1.t2.ucsd.edu"/>
            <collector DN="/DC=org/DC=doegrids/OU=Services/CN=glidein.grid.iu.edu" factory_identity="gfactory@glidein.grid.iu.edu" my_identity="fecmsucsd@glidein.grid.iu.edu" node="glidein.grid.iu.edu"/>
         </collectors>
      </factory>
      <job    query_expr="(JobUniverse==5)&amp;&amp;
                          (GLIDEIN_Is_Monitor =!= TRUE)&amp;&amp;
                          (JOB_Is_Monitor =!= TRUE)&amp;&amp;
                          (JOB_Is_ITB =!= TRUE)">
         <match_attrs>
            <match_attr name="ImageSize" type="int"/>
            <match_attr name="JobStatus" type="int"/>
            <match_attr name="LastVacateTime" type="int"/>
            <match_attr name="MaxWallTimeMins" type="int"/>
            <match_attr name="NormMaxWallTimeMins" type="int"/>
            <match_attr name="NumJobStarts" type="int"/>
            <match_attr name="ServerTime" type="int"/>
         </match_attrs>
         <schedds>
            <schedd DN="/DC=org/DC=doegrids/OU=Services/CN=glidein-2.t2.ucsd.edu" fullname="glidein-2.t2.ucsd.edu"/>
            <schedd DN="/DC=org/DC=doegrids/OU=Services/CN=submit-2.t2.ucsd.edu"  fullname="submit-2.t2.ucsd.edu"/>
            <schedd DN="/DC=org/DC=doegrids/OU=Services/CN=submit-1.t2.ucsd.edu"  fullname="submit-1.t2.ucsd.edu"/>
            <schedd DN="/DC=org/DC=doegrids/OU=Services/CN=cmsfnal01.fnal.gov"    fullname="cmsfnal01.fnal.gov"/>
            <schedd DN="/DC=ch/DC=cern/OU=computers/CN=vocms120.cern.ch"          fullname="vocms120.cern.ch"/>
         </schedds>
      </job>
   </match>

   <groups>
      <group name="main" enabled="True">
         <config>
            <idle_glideins_per_entry max="100" reserve="10"/>
            <idle_vms_per_entry curb="10" max="50"/>
            <running_glideins_per_entry max="30000" relative_to_queue="1.5"/>
            <running_glideins_total curb="90000" max="100000"/>
         </config>

         <security>
            <proxies>
               <proxy absfname="/home/frontend/.globus/x509_pilot05_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot06_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot07_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot08_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot09_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot10_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot47_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot48_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot49_cms_pilot.proxy" security_class="cmspilot"/>
               <proxy absfname="/home/frontend/.globus/x509_pilot50_cms_pilot.proxy" security_class="cmspilot"/>
            </proxies>
         </security>

         <attrs>
            <attr name="GLIDECLIENT_Group_Start" glidein_publish="False" job_publish="False" parameter="True" type="string" 
                     value='(stringListMember(GLIDEIN_SEs,DESIRED_SEs,",")=?=True) || 
                            (stringListMember(GLIDEIN_Gatekeeper,DESIRED_Gatekeepers,",")=?=True) || 
                            (stringListMember(GLIDEIN_Site,DESIRED_Sites,",")=?=True)'/>
         </attrs>
         <files>
         </files>

         <match    match_expr='(job.has_key("DESIRED_Sites") and 
                                (glidein["attrs"]["GLIDEIN_Site"] in job["DESIRED_Sites"].split(","))) or 
                               (job.has_key("DESIRED_Gatekeepers") and 
                                (glidein["attrs"]["GLIDEIN_Gatekeeper"] in job["DESIRED_Gatekeepers"].split(","))) or 
                               (job.has_key("DESIRED_SEs") and 
                                glidein["attrs"].has_key("GLIDEIN_SEs") and 
                                (glidein["attrs"]["GLIDEIN_SEs"] in job["DESIRED_SEs"].split(",")))'>
            <factory    query_expr="(GLIDEIN_Site=!=UNDEFINED) &amp;&amp; 
                                    (GLIDEIN_Gatekeeper=!=UNDEFINED) &amp;&amp; 
                                    (GLIDEIN_IsSleep=!=1)">
               <match_attrs>
                  <match_attr name="GLIDEIN_Gatekeeper" type="string"/>
                  <match_attr name="GLIDEIN_SEs" type="string"/>
                  <match_attr name="GLIDEIN_Site" type="string"/>
               </match_attrs>
               <collectors>
               </collectors>
            </factory>
            <job    query_expr='(((DESIRED_Sites=!=UNDEFINED) || 
                                  (DESIRED_Gatekeepers=!=UNDEFINED) || 
                                  (DESIRED_SEs=!=UNDEFINED)) &amp;&amp; 
                                 (IsSleep=!=1))&amp;&amp;
                                (Owner=!="sfiligoi")'>
               <match_attrs>
                  <match_attr name="DESIRED_Gatekeepers" type="string"/>
                  <match_attr name="DESIRED_SEs" type="string"/>
                  <match_attr name="DESIRED_Sites" type="string"/>
               </match_attrs>
               <schedds>
               </schedds>
            </job>
         </match>
      </group>
   </groups>
</frontend>