Hi Anna, On Wed, Aug 04, 2021 at 04:43:01PM +0000, Anna Scaife wrote:
Is there something I can add to the run script to update that field?
There is no simple way to update this field from a job, but it can be written via the python API. I've attached an example script for doing this, which can be included in the input sandbox and run from a job script: ./update_status.py "Job is doing something..." (Note that this must be run in the default DIRAC python environment within a job, if any other python environment is used, it has to be run outside of that). Regards, Simon ### update_status.py ### #!/usr/bin/env python import os import sys from DIRAC.Core.Base import Script Script.initialize() from DIRAC.WorkloadManagementSystem.Client.JobReport import JobReport jobid = os.getenv('DIRACJOBID') if not jobid: print("This command only works from within a DIRAC job") sys.exit(1) if len(sys.argv) < 2: print("Usage: update_status.py <status message>") sys.exit(1) appstatus = sys.argv[1] jr = JobReport(int(jobid)) res = jr.setApplicationStatus(appstatus) if not res['OK']: print("Failed to update application status: %s" % str(res)) sys.exit(1) sys.exit(0)