Question about workflow of the interactive app

I have a question about the interactive app.
Templates of interactive app are composed of before, script, and after scripts.
Where is running location of before.sh and after.sh and who are users of that scripts?
As far as I know, it is the submit.yml(at open ondemand server) → Scheduler(at head node) → before-script-after.sh(at one of compute node).
And the user is known as the user of the job.
(neither root or slurmctld user)
Is this right?

  1. If so, what should I do if I want to do something before submitting to the scheduler?
    (I know the scheduler has its own prolog epilog function. What I’m curious about is whether it’s possible to implement in open ondemand.)

  2. What if I want to run before.sh on all compute nodes instead of one?

  1. I don’t think there is such a hook.
    Also, you mention prolog/epilog (I’m guessing you are a SLURM user then) but, those aren’t run before submitting to the scheduler. If what you were truly after was running things as root on the compute node, then no; you definitely can’t do that with OOD apps (it would be a horrendous privilege escalation)

  2. Just like with any job, if you want to specify commands to run on several nodes, then pdsh/srun/mpirun those commands. So, even if you can’t specify “before.sh” itself, you should still be able to achieve whatever you wish by means of pdsh/srun (even possibly running a full custom bash script if that’s what you wanted)