Ability to source an arbitrary script prior to execution of primary executable
Users typically need to set up a particular environment in order run their executable. A basic example would be a Python executable which imports modules which come from some UPS product. As of now, this requires a shell wrapper to set up the environment. The ability to source an arbitrary script prior to execution of the primary executable would enable the user run without a wrapper. The idea for this feature comes from
art_sam_wrap.sh in the
ifdh_art UPS product, where it is an indispensable tool. Sadly,
art_sam_wrap.sh doesn't handle every use case.
It looks like Condor supports something similar through +PreCmd, although I believe I've played around with it in the past to no avail. Perhaps it was that it only works in the DAG case. I also seem to recall that it doesn't export variables to the environment, i.e.
sh instead of
The simplest solution might be to build this functionality into the wrap file that
I describe the feature as "an arbitrary script", but see no reason why it shouldn't allow one or more to be supplied and run in the order which they are listed on the command line.
Ideally, the feature would also support an arbitrary number of arguments to the script. This can be complicated from the perspective command line argument parsing. In
art_sam_wrap.sh this was handled by replacing spaces with a colon (