Thanks Jeff. That's exactly the documentation that I looked and quoted, and yes, I know that the user running the prolog is a different one (root) from the one which will be running the job (regular user submitting the job). I speculated that the sentence I quoted (again: prolog is executed with the same environment as the user tasks to be initiated) meant that root had the user environment, besides PATH for security reasons as written in that page. Apparently that is not the case, and as such I am stuck and can't solve my problem: if even I find an appropriate prolog which runs as a regular user, then it won't have the necessary permissions to unhide the licensed binary. One step forward and two steps backward, so frustrating! Thanks again and have a nice weekend
On Sat, Oct 29, 2022 at 11:06 AM Sarlo, Jeffrey S <jsa...@central.uh.edu> wrote: > > Not sure if this will help. It has which user will execute the scripts > > https://slurm.schedmd.com/prolog_epilog.html > > Maybe the variable isn't set for the user executing the > prolog/epilog/taskprolog > > Jeff > > ________________________________ > From: slurm-users <slurm-users-boun...@lists.schedmd.com> on behalf of Davide > DelVento <davide.quan...@gmail.com> > Sent: Saturday, October 29, 2022 9:37 AM > To: slurm-us...@schedmd.com <slurm-us...@schedmd.com> > Subject: [slurm-users] Prolog and job_submit > > My problem: grant licensed software availability to my users only if > they request it on slurm; for now with local licenses. > > I wrote a job_submit lua script which checks job_desc.licenses and if > it contains the appropriate strings it sets an appropriate > SOMETHING_LICENSE_REQ environmental variable. > > This part works, I can see the environmental variable correctly set in > the jobs that require the license. > > Now this licensed software is a bit tricky to manage, so the way that > I thought to use it is simply to make its binary disappear from the > nodes when not requested, with a prolog and epilog scripts which copy > it from a location in the shared filesystem accessible only by root. > Simply a copy during the prolog and a delete during the epilog. > > Something like this: > > if [[ $SOMETHING_LICENSE_REQ == 1 ]]; then > # copy the binary > fi > > After banging my head to make the prolog run (executable bit and full > path required, and not said so in the documentation and error logs > being cryptic about it) I am finally able to see it running.... only > to find out that the SOMETHING_LICENSE_REQ environmental variable is > not set, despite the documentation at > https://urldefense.com/v3/__https://slurm.schedmd.com/prolog_epilog.html__;!!LkSTlj0I!GeYFMK5LTz38C-Y5efzywysYqnEPMq4Rq9Nj77WE3gOEYPJ-rRbnBR6alpC8cPi6XJbsBhkAgFOFbEIzzx4ItgH_Ssba$ > stating > > > The task prolog is executed with the same environment as the user tasks to > > be initiated. > > Now, I'd be very happy to do this copy from the job_submit, but that > is run on the head node (I checked) and so I can't do that. It would > seem strange that the job_submit is run after the prolog, since the > latter runs on the compute node (I checked that too). > > Moreover, I also verified with additional environmental variables > which I set at submit time are available for the user job correctly, > but not in the prolog. > > So either I misinterpreted that "same environment as the user tasks" > or there is something else that I am doing wrong. > > Does anybody have any insight? >