1 """Batch 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
66
67
69 """Build dest_site. Only run on worker node."""
70 return ji['GANGA_HOSTNAME']
71
75
77 """Build grid_job_id. Only run on worker node."""
78 task_name = 'ganga:%s:%s' % (ji['JOB_UUID'], ji['JOB_NAME'],)
79 return task_name
80