xenon-middleware / xenon-cli

Perform files and jobs operations with Xenon library from command line
http://nlesc.github.io/Xenon/
Apache License 2.0
2 stars 3 forks source link

How to source the entire user env? #55

Closed arnikz closed 6 years ago

arnikz commented 6 years ago

Is there a xenon equivalent to qsub -V or sbatch --export=ALL?

sverhoeven commented 6 years ago

By using the --inherit-env the job will inherit all the environment variables in your current shell.

arnikz commented 6 years ago

Oops, I just found out that this feature was needed in another scenario but not in the current execution of my workflow. Nevertheless, I've tested it but got the following error message.

xenon scheduler slurm --location local:// submit --inherit-env --stderr stderr.log --stdout stdout.log ...
cat stderr.log
/cm/local/apps/slurm/var/spool/job1773448/slurm_script: line 47: syntax error near unexpected token `('
/cm/local/apps/slurm/var/spool/job1773448/slurm_script: line 47: `export BASH_FUNC_module()="() {  eval `/cm/local/apps/environment-modules/3.2.10/Modules/$MODULE_VERSION/bin/modulecmd bash $*`
sverhoeven commented 6 years ago

Modules uses bash functions, which end up as environment variables.

Only variables names which include uppercase letters, digits and underscore should be inherited.

This means the job will not have the module function available.