ducttape
ducttape copied to clipboard
Allow submitter variables to be omitted in tasks
Certain submitter variables may only be used in advanced special circumstances, or may have reasonable default values set by the submitter administrator. It would be nice to allow the submitter block to be written in such a way that such variables are passed to the actual submitter executable iff they are defined, and tasks that use the submitter should be allowed to omit such variables in order to use the environment-specific default value.
submitter sge :: vmem .... { action run { .... if [ ${vmem} != "" ]; then echo "#$ -l virtual_free=${vmem}" >> $wrapper fi ... } }
Note the following task does NOT define .vmem
task hello :: .submitter=sge { echo hello }
see ducttape.exec.Submitter.scala
Please review https://github.com/jhclark/ducttape/commit/9514b6ec0740a1fe73139c56ff014ef487d7fd15
If you believe this issue is still a valid bug, please comment here explaining the outstanding problem.
I believe the linked fix will no longer work. I now explicitly check to make sure that all required variables have been passed so that we can do more compile-time checking and don't run into silly errors at runtime. However, I do see the use case for allowing default parameter values (including Nil?), which effectively make parameters optional. Thoughts?
I can't test this now. What do you mean the linked fix won't work?
I'm referring to https://github.com/jhclark/ducttape/commit/9514b6ec0740a1fe73139c56ff014ef487d7fd15, which uses the var_defined hack to check if "q" is defined. However, it will always defined under current semantics -- I enforce this at workflow definition time. That is, parameters are currently not optional.