Home | Trees | Indices | Help |
---|
|
1 """LCG meta-data utilities. 2 3 N.B. This code is under development and should not generally be used or relied upon. 4 5 """ 6 7 from Ganga.Lib.MonitoringServices.Dashboard import CommonUtil 8 9 #----- client meta-data builders ----- 10 #TODO: add error handling code in following methods 1113 """Build dest_ce. Only run on client.""" 14 return CommonUtil.strip_to_none(job.backend.actualCE)15 1921 """Build grid_exit_code. Only run on client.""" 22 return CommonUtil.strip_to_none(job.backend.exitcode_lcg)2325 """Build grid_exit_reason. Only run on client.""" 26 return CommonUtil.strip_to_none(job.backend.reason)27 3133 """Build ownerdn. Only run on client.""" 34 from Ganga.GPIDev import Credentials 35 proxy = Credentials.getCredential('GridProxy') 36 ownerdn = proxy.info('-subject') 37 return CommonUtil.strip_to_none(ownerdn)3840 """Build grid_status. Only run on client.""" 41 return CommonUtil.strip_to_none(job.backend.status)4244 """Build job_id_inside_the_task. Only run on client.""" 45 if job.master is None: 46 job_id_inside_the_task = 0 47 else: 48 job_id_inside_the_task = job.id 49 return job_id_inside_the_task5052 """Build task_name. Only run on client.""" 53 # format: ganga:<job.info.uuid>:<job.name> 54 if job.master: 55 job = job.master 56 task_name = 'ganga:%s:%s' % (job.info.uuid, job.name,) 57 return task_name58 62 63 64 #----- worker node meta-data builders ----- 65 #TODO: add error handling code in following methods 6668 """Build dest_ce. Only run on worker node.""" 69 dest_ce = CommonUtil.env('GLOBUS_CE') 70 if not dest_ce: 71 dest_ce = CommonUtil.stdout('edg-brokerinfo getCE') 72 if not dest_ce: 73 dest_ce = CommonUtil.stdout('glite-brokerinfo getCE') 74 return CommonUtil.strip_to_none(dest_ce)75 79 8385 """Build grid_job_id. Only run on worker node.""" 86 grid_job_id = CommonUtil.env('EDG_WL_JOBID') 87 if not grid_job_id: 88 grid_job_id = CommonUtil.env('GLITE_WMS_JOBID') 89 return grid_job_id90
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Jun 25 10:35:25 2012 | http://epydoc.sourceforge.net |