Can't load "module" and can't find script file from template

Hello Everybody,
I’m running ondemand-3.1.1-1.el8.x86_64 and LSF. When I try to run a job from a template, for example python 3.10, I get two errors:
/home/dweise/.lsbatch/1718130113.29882164.shell: line 10: module: command not found
Python 2.7.5
python: can’t open file ‘hello.py’: [Errno 2] No such file or directory
/home/dweise/.lsbatch/1718130238.29882170.shell: line 10: module: command not found
Python 2.7.5
python: can’t open file ‘hello.py’: [Errno 2] No such file or directory.

I loaded this very simple job for a template was put there (as you know the number at the end changes)
/home/dweise/ondemand/data/sys/myjobs/projects/default/47

my batch_connect is as follows:
batch_connect:
basic:
script_wrapper: |
set +o posix
source /lsf/conf/profile.lsf
source /appl/Modules/current/init/bash
export LPC_MODULES=$(cat /appl/util/env/lpc_modules| grep -v ^#)
module load ${LPC_MODULES}
#module purge
%s

The files are there and If I shell to my submit host and type in “module” I get the help. Clearly the environment is not being set. But where do I set this?
Thanks,
–David

Hi and sorry for the trouble.

I think what you may want to add is copy_environment: true. The doc entry is here:
https://osc.github.io/ood-documentation/latest/reference/files/submit-yml/script.html?highlight=copy_environment

Hi,
Funny you should mention this. I just got this to work by modifying the job options to “copy environment.” Thanks for the link. But where do you put submit.yml.erb? I’ve been peppering my system with that file based on old posts for a few hours now. So that does fix the module load problem. But how about the execution of the actual module? is that work_dir or job_enviornment? I noted that it does copy the template folders over to /home/dweise/ondemand/data/sys/myjobs/projects/default/47 but then when it submits the job to the submit host it executes it in /home/dweise/. I can I execute the python (or for that matter anything) in /home/dweise/ondemand/data/sys/myjobs/projects/default or /home/dweise, I don’t care which, just so it executes and the output files are in the home directory somewhere.
Thanks,
–David

Hi,
So I put submit.yml.erb in /etc/ood/config/ondemand.d and it reads:
script:
copy_environment: true
batch_connect:
template: “basic”
header: “#!/bin/bash”

I rebooted the server and no such luck.
–David