SoftwareRequirement: environment modules changes to env not propagating to tool
See original GitHub issueExpected Behavior
If I have a CWL file with a SoftwareRequirement that is resolved by an environment module, then I would expect that the environment variables set propagate to the tool execution.
Actual Behavior
They do not: only PATH
is modified by the environment module
Workflow Code
Note this depends on having environment modules set up. Modify the cwl to load a module you have available:
env.cwl:
#!/usr/bin/env cwl-runner
# -*- mode: yaml; -*-
cwlVersion: v1.1
class: CommandLineTool
$namespaces:
cwltool: http://commonwl.org/cwltool#
hints:
SoftwareRequirement:
packages:
ncl:
version: ["6.6.2"]
inputs: []
baseCommand: env
outputs:
output:
type: stdout
modules.yml:
- type: modules
modulecmd: /usr/bin/modulecmd
cwltool runs OK:
cwltool --beta-dependency-resolvers-configuration modules.yml env.cwl
INFO /lustre/home/shared/dc118/sw/cwl/3.0.20201117141248/bin/cwltool 3.0.20201117141248
INFO Resolved 'env.cwl' to 'file:///lustre/home/dc118/nashvest/env.cwl'
INFO [job env.cwl] /tmp/7u0vetk_$ env > /tmp/7u0vetk_/d5514f0d054e63af38037aba76940ead71fd7324
Autoloading gcc/6.3.0
Autoloading gsl/2.6-gcc6
INFO [job env.cwl] completed success
{
"output": {
"location": "file:///lustre/home/dc118/nashvest/d5514f0d054e63af38037aba76940ead71fd7324",
"basename": "d5514f0d054e63af38037aba76940ead71fd7324",
"class": "File",
"checksum": "sha1$488689425380b273e1e59a0dd3fdc884a57a842c",
"size": 471,
"path": "/lustre/home/dc118/nashvest/d5514f0d054e63af38037aba76940ead71fd7324"
}
}
INFO Final process status is success
Module that should have been loaded:
$ module show ncl
-------------------------------------------------------------------
/lustre/sw/modulefiles/ncl/6.6.2:
conflict ncl
Autoloading gcc/6.3.0
module load gcc/6.3.0
Autoloading gsl/2.6-gcc6
module load gsl/2.6-gcc6
setenv NCARG_ROOT /lustre/sw/ncl/ncl-6.6.2
prepend-path PATH /lustre/sw/ncl/ncl-6.6.2/bin
prepend-path LD_LIBRARY_PATH /lustre/sw/ncl/ncl-6.6.2/lib
prepend-path LD_LIBRARY_PATH /lustre/sw/ncl/ncl-6.6.2/lib64
prepend-path MANPATH /lustre/sw/ncl/ncl-6.6.2/man
-------------------------------------------------------------------
Actual environment
$ cat d5514f0d054e63af38037aba76940ead71fd7324
PATH=/lustre/sw/ncl/ncl-6.6.2/bin:/lustre/sw/gsl/2.6/bin:/lustre/sw/gcc/6.3.0/bin:/lustre/home/shared/dc118/sw/cwl/3.0.20201117141248/bin:/lustre/sw/spack-cirrus/opt/spack/linux-centos7-x86_64/gcc-8.2.0/git-2.21.0-rcchd4zgfdherdlklrr2y3amq7p73svi/bin:/lustre/sw/epcc-utils/bin:/opt/clmgr/sbin:/opt/clmgr/bin:/opt/sgi/sbin:/opt/sgi/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/c3/bin:/sbin:/bin
HOME=/tmp/7u0vetk_
TMPDIR=/tmp/9af437kp
If I change the command to say cwltool --beta-dependency-resolvers-configuration modules.yml --preserve-environment NCARG_ROOT env.cwl
then the output of env
is unchanged
Your Environment
- cwltool version: 3.0.20201117141248
@mr-c and I have discussed briefly on gitter: https://gitter.im/common-workflow-language/common-workflow-language?at=5fbfb71303ddd74df2f90e59 Where Michael suggests pinging @jmchilton and @hmenager for comment?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Maybe instead we should:
DependencyManager
Thoughts?
Galaxy docs say:
A brief review of the resolvers suggests that they all act in the bold text manner. This make me think that the way cwltool is trying to use this feature (getting the PATH from the modified shell environment and then taking total control of the environment) is a bit wrong