shifter = op.getValue("Pipeline/Shifter","/DC=org/DC=doegrids/OU=People/CN=Stephan Zimmer 799865") shifter_group = op.getValue("Pipeline/ShifterGroup","glast_user") result = gProxyManager.downloadProxyToFile(shifter,shifter_group,requiredTimeLeft=10000) if not result['OK']: gLogger.error("No valid proxy found; ",result['Message']) dexit(1) proxy = result[ 'Value' ] os.environ['X509_USER_PROXY'] = proxy gLogger.info("using proxy %s"%proxy) j = Job(stdout="logFile.txt",stderr="logFile.txt") # specifies the logfile input_sandbox_files = [] output_sandbox_files = ["logFile.txt", "jobmeta.inf"] if pipeline: j.setExecutionEnv(pipeline_dict) # that sets the env vars if pipeline_dict.has_key("GPL_CONFIGDIR"): GPL_CONFIGDIR = pipeline_dict['GPL_CONFIGDIR'] files = [] if os.path.isdir(GPL_CONFIGDIR): files_to_copy = glob.glob("%s/*"%GPL_CONFIGDIR) for f in files_to_copy: if os.path.isfile(f): input_sandbox_files.append(os.path.abspath(f)) else: input_sandbox_files.append(f) if pipeline_dict.has_key("DIRAC_OSB"): DIRAC_OUTPUTSANDBOX = pipeline_dict["DIRAC_OSB"] files = DIRAC_OUTPUTSANDBOX.split(",") for f in files: output_sandbox_files.append(f)
"../tools/StorageElement.py" ] # these files are created by the job outputSandbox =\ [ stdout, stderr, logfile ] # the executible here '' is later set, so don't confuse users later on diracJob = Job('', stdout, stderr) # give a descriptive name diracJob.setName('ND280Custom') # set the program/executable, arguments, logFile, ... diracJob.setExecutable(exe, arguments=args, logFile=logfile) # set the job length diracJob.setCPUTime(3600) diracJob.setExecutionEnv(environmentDict) diracJob.setInputSandbox(inputSandbox) diracJob.setOutputSandbox(outputSandbox) print 'job being submitted...' dirac = Dirac() result = dirac.submit(diracJob) print 'Submission Result: ', result