As far as I can tell, by default at least, shell sessions corresponding to the command
section of tasks in a WDL do not source any of the user-specific shell initialization files, such as $HOME/.profile
, $HOME/.bash_profile
, or $HOME/.bashrc
.
This makes it difficult to implement uniform set-up behaviors that should happen for all tasks.
Of course, one can always include the boilerplate line
source $HOME/.profile
at the beginning of each and every task, but this is tedious, and, therefore, error-prone.
Hence, I am looking for some alternative way to achieve the same thing globally for all the tasks in a WDL.
I stress that I am looking for a solution that (a) applies to all the tasks within the lexical scope of a single WDL file, and (b) can be achieved within the WDL itself (as opposed to through external files such as an options.json
file). The rationale is the same for both these requirements: namely, to keep the WDL self-contained.
One additional requirement is that the solution should be consistent with running the workflows through Terra.
(I do not rule out a solution at the level of the docker image itself, but I don't think it would likely. The need for sourcing a configuration file at the beginning of every shell session is to implement settings that cannot be known at build-time, and therefore must be postponed until run-time.)
EDIT: $HOME/.profile
is just an example. I don't care what the name of the file is. $HOME/setup
, $HOME/foo42
, or whatever else you like. The only requirement is that I don't have to include something like source $WHATEVER
at the beginning of every task.
Is there any chance you could have the workflow use login sessions (
bash -l
)?have you tried adding something to the cromwell configuration for your particular backend?https://github.com/broadinstitute/cromwell/blob/develop/cromwell.example.backends/cromwell.examples.conf