1 """Localhost 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
10
11
15
17 """Build execution_backend. Only run on client."""
18 return job.backend._name
19
23
25 """Build grid_exit_reason. Only run on client."""
26 return None
27
31
38
42
44 """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_task
50
52 """Build task_name. Only run on client."""
53
54 if job.master:
55 job = job.master
56 task_name = 'ganga:%s:%s' % (job.info.uuid, job.name,)
57 return task_name
58
60 """Build unique_job_id. Only run on client."""
61 return job.info.uuid
62
63
64
65
67 """Build dest_ce. Only run on worker node."""
68 return '%s_localnode' % ji['GANGA_HOSTNAME']
69
70
72 """Build dest_site. Only run on worker node."""
73 return ji['GANGA_HOSTNAME']
74
75
79
81 """Build grid_job_id. Only run on worker node."""
82 """
83 grid_job_id = CommonUtil.env('EDG_WL_JOBID')
84 if not grid_job_id:
85 grid_job_id = CommonUtil.env('GLITE_WMS_JOBID')
86 return grid_job_id
87 """
88 return CommonUtil.strip_to_none(ji['fqid'])
89