def submitProbeJobs(self, ce):
   """ Submit some jobs to the CEs
   """
   
   #need credentials, should be there since the initialize
   
   from DIRAC.Interfaces.API.Dirac import Dirac
   d = Dirac()
   from DIRAC.Interfaces.API.Job import Job
   
   from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
   import DIRAC
   
   ops = Operations()
   scriptname = ops.getValue("ResourceStatus/SofwareManagementScript", self.script)
   
   j = Job()
   j.setDestinationCE(ce)
   j.setCPUTime(1000)
   j.setName("Probe %s" % ce)
   j.setJobGroup("SoftwareProbe")
   j.setExecutable("%s/GlastDIRAC/ResourceStatusSystem/Client/%s" % (DIRAC.rootPath, scriptname), 
                   logFile='SoftwareProbe.log')
   j.setOutputSandbox('*.log')
   res = d.submit(j)
   if not res['OK']:
     return res
     
   return S_OK()
Exemple #2
0
  def __submit( self, site, CE, vo ):
    """
      set the job and submit.
    """

    job = Job()
    job.setName( self.testType )
    job.setJobGroup( 'CE-Test' )
    job.setExecutable( self.executable )
    job.setInputSandbox( '%s/%s' % ( self.__scriptPath, self.executable ) )
    if site and not CE:
      job.setDestination( site )
    if CE:
      job.setDestinationCE( CE )

    LOCK.acquire()
    proxyPath = BESUtils.getProxyByVO( 'zhangxm', vo )
    if not proxyPath[ 'OK' ]:
      LOCK.release()
      return proxyPath
    proxyPath = proxyPath[ 'Value' ]
    oldProxy = os.environ.get( 'X509_USER_PROXY' )
    os.environ[ 'X509_USER_PROXY' ] = proxyPath
    result = self.dirac.submit( job )
    if oldProxy is None:
      del os.environ[ 'X509_USER_PROXY' ]
    else:
      os.environ[ 'X509_USER_PROXY' ] = oldProxy
    LOCK.release()

    return result
    def submitProbeJobs(self, ce):
        """ Submit some jobs to the CEs
    """
        #need credentials, should be there since the initialize
        from DIRAC.Interfaces.API.Dirac import Dirac
        d = Dirac()
        from DIRAC.Interfaces.API.Job import Job

        from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
        import os

        ops = Operations("glast.org")
        scriptname = ops.getValue("ResourceStatus/SofwareManagementScript",
                                  self.script)

        j = Job()
        j.setDestinationCE(ce)
        j.setCPUTime(1000)
        j.setName("Probe %s" % ce)
        j.setJobGroup("SoftwareProbe")
        j.setExecutable("%s/GlastDIRAC/ResourceStatusSystem/Client/%s" %
                        (os.environ['DIRAC'], scriptname),
                        logFile='SoftwareProbe.log')
        j.setOutputSandbox('*.log')
        res = d.submit(j)
        if not res['OK']:
            return res

        return S_OK()
Exemple #4
0
    def __submit(self, site, CE, vo):
        """
      set the job and submit.
    """

        job = Job()
        job.setName(self.testType)
        job.setJobGroup('CE-Test')
        job.setExecutable(self.executable)
        job.setInputSandbox('%s/%s' % (self.__scriptPath, self.executable))
        if site and not CE:
            job.setDestination(site)
        if CE:
            job.setDestinationCE(CE)

        LOCK.acquire()
        proxyPath = BESUtils.getProxyByVO('zhangxm', vo)
        if not proxyPath['OK']:
            LOCK.release()
            return proxyPath
        proxyPath = proxyPath['Value']
        oldProxy = os.environ.get('X509_USER_PROXY')
        os.environ['X509_USER_PROXY'] = proxyPath
        result = self.dirac.submitJob(job)
        if oldProxy is None:
            del os.environ['X509_USER_PROXY']
        else:
            os.environ['X509_USER_PROXY'] = oldProxy
        LOCK.release()

        return result
Exemple #5
0
def softinstall(args=None):

    from DIRAC.Interfaces.API.Dirac import Dirac
    from DIRAC.Interfaces.API.Job import Job

    if (len(args) < 2):
        Script.showHelp()

    version = args[0]
    site = args[1]

    if version not in ['18122013', 'v0r7p0']:
        Script.gLogger.error('Version not valid')
        Script.showHelp()

    j = Job()

    j.setInputSandbox(['cta-ctools-install.py', 'SoftwareInstallation.py'])

    j.setExecutable('./cta-ctools-install.py', version)

    j.setDestination([site])

    j.setName('ctoolsInstall')

    j.setCPUTime(100000)

    Script.gLogger.info(j._toJDL())

    if site in ['LCG.GRIF.fr', 'LCG.M3PEC.fr']:
        if site == 'LCG.GRIF.fr':
            ceList = [
                'apcce02.in2p3.fr', 'grid36.lal.in2p3.fr',
                'lpnhe-cream.in2p3.fr', 'llrcream.in2p3.fr',
                'node74.datagrid.cea.fr'
            ]
        elif site == 'LCG.M3PEC.fr':
            #      ceList = ['ce0.bordeaux.inra.fr','ce0.m3pec.u-bordeaux1.fr']
            ceList = ['ce0.bordeaux.inra.fr']
        for ce in ceList:
            j.setDestinationCE(ce)
            name = 'ctoolsInstall' + '_' + ce
            j.setName(name)
            res = Dirac().submit(j)
            print res
        DIRAC.exit()
    else:
        name = 'ctoolsInstall'

    j.setName(name)
    res = Dirac().submit(j)
    print res
Exemple #6
0
def CorsikaSimtelInstall(args=None):

    from DIRAC.Interfaces.API.Dirac import Dirac
    from DIRAC.Interfaces.API.Job import Job

    if (len(args) != 2):
        Script.showHelp()

    version = args[0]
    site = args[1]

    if version not in ['prod-2_13112014']:
        Script.gLogger.error('Version not valid')
        Script.showHelp()

    j = Job()
    CorsikaSimtelPack = os.path.join('corsika_simhessarray', version,
                                     'corsika_simhessarray')
    CorsikaSimtelLFN = 'LFN:' + os.path.join('/vo.cta.in2p3.fr/software',
                                             CorsikaSimtelPack) + '.tar.gz'
    j.setInputSandbox(['cta-corsikasimtel-install.py', CorsikaSimtelLFN])
    j.setExecutable('./cta-corsikasimtel-install.py', version)
    j.setDestination([site])
    j.setJobGroup('SoftInstall')
    j.setCPUTime(100000)

    if site in ['LCG.GRIF.fr', 'LCG.M3PEC.fr']:
        if site == 'LCG.GRIF.fr':
            ceList = [
                'apcce02.in2p3.fr', 'grid36.lal.in2p3.fr',
                'lpnhe-cream.in2p3.fr', 'llrcream.in2p3.fr',
                'node74.datagrid.cea.fr'
            ]
        if site == 'LCG.M3PEC.fr':
            ceList = ['ce0.bordeaux.inra.fr', 'ce0.m3pec.u-bordeaux1.fr']

        for ce in ceList:
            j.setDestinationCE(ce)
            name = 'corsikasimtelInstall' + '_' + ce
            j.setName(name)
            Dirac().submit(j)
        DIRAC.exit()

    j.setName('corsikasimtelInstall')
    Script.gLogger.info(j._toJDL())
    Dirac().submit(j)
    ## prepare the list of output files
    run_log = input_file_base + ".log"
    dat = input_file_base.replace('aug', 'DAT')
    datlong = dat + ".long"
    output_files= [run_log, 'fluka11.out', 'fluka15.err', dat, datlong ]

    ## prepare the output location in GRID storage; the input path will be the used also for GRID storage
    outdir = grid_basedir_output + path + "/" + str(runnr)

    ## ALWAYS, INFO, VERBOSE, WARN, DEBUG
    j.setLogLevel('debug')

    j.setName('AUGER test simulation')

    j.setDestinationCE(ce1)
    ##    j.setDestination(site_dirac)

    j.setCPUTime(345600) ## 4 days

    ## download the script for preparing corsika input file for usage with cvmfs
    j.setExecutable( 'curl', arguments = ' -fsSLkO http://issaf.spacescience.ro/adrian/AUGER/make_run4cvmfs',logFile='cmd_logs.log')
    j.setExecutable( 'chmod', arguments = ' +x make_run4cvmfs',logFile='cmd_logs.log')

    ## create the simulation script configured for use with cvmfs
    ## set the make_run4cvmfs arguments to include the corsika_version and corsika_bin
    make_run4cvmfs_arg = input_file_base + " " + corsika_version + " " + corsika_bin
    j.setExecutable( './make_run4cvmfs', arguments = make_run4cvmfs_arg, logFile='cmd_logs.log')

    ## run simulation
    j.setExecutable( './execsim',logFile='cmd_logs.log')