ducttape icon indicating copy to clipboard operation
ducttape copied to clipboard

Allow submitter variables to be omitted in tasks

Open dowobeha opened this issue 12 years ago • 5 comments

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 }

dowobeha avatar Apr 24 '12 16:04 dowobeha

see ducttape.exec.Submitter.scala

dowobeha avatar Apr 24 '12 20:04 dowobeha

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.

dowobeha avatar May 08 '12 13:05 dowobeha

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?

jhclark avatar Jun 07 '12 15:06 jhclark

I can't test this now. What do you mean the linked fix won't work?

dowobeha avatar Jun 07 '12 16:06 dowobeha

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.

jhclark avatar Jun 07 '12 16:06 jhclark