1 """CREAM 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
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
66
71
73 """Build dest_site. Only run on worker node."""
74 return CommonUtil.env('SITE_NAME')
75
79
81 """Build grid_job_id. Only run on worker node."""
82 grid_job_id = CommonUtil.env('CREAM_JOBID')
83 if not grid_job_id:
84 grid_job_id = CommonUtil.env('EDG_WL_JOBID')
85 if not grid_job_id:
86 grid_job_id = CommonUtil.env('GLITE_WMS_JOBID')
87 return grid_job_id
88