예제 #1
0
    def createPilotTar(self):
        """ 
        __createPiloTar__ 

        it will create the tar ball of pilot code
        """

        #change tar to tar.gz
        fileName = self.config.PilotManagerComponent.pilotTar
        tarCommand = "tar -czvf %s/%s -C %s Pilot" %(self.tarPath, fileName, self.pilotcodeDir)

        print tarCommand
        #myThread.logging.debug(tarCommand)
        output = executeCommand(tarCommand)
예제 #2
0
    def processJob(self, taskId, sandboxUrl, specUrl, jobWF):
        """ 
        __processJob__

        process the real job   
        """
        #create logDir name
        logDate = time.strftime('%Y%m%d_%H%M%S') 
        #create script for this real job
        script = self.realTaskExecutionScript(taskId, sandboxUrl, \
                specUrl, logDate, jobWF)
        try:
            #print ('process job: need some other libraries')
             
            #currentDir = os.getcwd()
            currentDir = self.pilotDir  
            print 'currentDir: %s' % currentDir

            #scriptfile path on execution machine 
            realScriptFile = '%s/%s_real.sh' % (currentDir, taskId)
            print realScriptFile
            
            #save this script file 
            self.save(realScriptFile, script[0])
            
            #now execute this file    
            result = executeCommand ( 'sh +x %s' % realScriptFile )

            #jobdone msg, command result, job sandbox directory, logDate
            processResult = [ 'jobdone', result, script[2], logDate ]

            #print processResult
            print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")

        except IOError, ioinst:
            print ("ERROR IN workOnJob %s" % sys.exc_info()[0] )
            traceback.print_exc(file=sys.stdout)
            processResult = [ 'jobfail', str(ioinst), script[2] ]
예제 #3
0
def setupSymlinks():
    symlink_script = "create_cmsconf_links.sh"
    print executeCommand("sh +x %s" % symlink_script)
    print "updated CMS_PATH: %s" % os.environ.get('CMS_PATH')
    os.putenv("CMS_PATH","%s/%s" % (os.getcwd(),"localConf"))
    print "updated CMS_PATH: %s" % os.environ.get('CMS_PATH')