Peek StandardOutput equivalent in jobs submitted through DIRAC API

18 views
Skip to first unread message

Daniela Bauer

unread,
Jul 22, 2021, 10:58:21 AM7/22/21
to diracgrid-forum
Hi All,

We recently received the following query:
"I recently switched to using the API for job submission, rather than
writing a JDL and using dirac-wms-job-submit.  However, I find that when
using the API the 'Peek StandardOutput', just shows some generic info
about what I am running, rather than the actual output.  Whereas when I
used the old method I can I actually peak at my job.  If I am testing or
debugging, or if something is taking an unusually long time, the ability
to 'Peek' was a really nice feature of the GUI.
Is there a way to restore this behaviour, while still using the API to
submit ?"

As far as I am aware this is not possible and you'll have to wait for the standard output to be delivered with your output sandbox when using the API.
Did I miss something ?

Regards,
Daniela

Andrei Tsaregorodtsev

unread,
Jul 22, 2021, 11:20:22 AM7/22/21
to diracgrid-forum
I am afraid this is indeed impossible. The reason is that via the API the job is submitted wrapped in the DIRAC Workflow envelope. This allows
many nice features but unfortunately does not allow the stdout be available before the end of the user job. We can probably think about how
this can be enabled but not sure it can be done in some easy and quick way.

Regards,
 Andrei

André Sailer

unread,
Jul 22, 2021, 11:53:48 AM7/22/21
to Andrei Tsaregorodtsev, diracgrid-forum
We use the API and we can peek the output while the job is running.
It probably boils down to implementing this callback function

https://github.com/DIRACGrid/DIRAC/blob/14a63527fed6e8d5baeff1e4f7ac3af9a8ce3cda/src/DIRAC/Workflow/Modules/Script.py#L45
?

Is this what "using the API" means in vanilla DIRAC when the job is
executed?

We have this implementation in ilcdirac
https://gitlab.cern.ch/CLICdp/iLCDirac/ILCDIRAC/-/blob/Rel-v31r0/Workflow/Modules/ModuleBase.py#L582

Look in the other modules were we use this for the callbackfunction
argument. This also reduces the output to only display things like
"Simulating Event XYZ".

Cheers,
Andre
Reply all
Reply to author
Forward
0 new messages