4
4
import os
5
5
import sys
6
6
import uuid
7
+ from warnings import warn
7
8
8
9
from .base import (GraphPluginBase , logger )
9
10
@@ -14,16 +15,17 @@ class CondorDAGManPlugin(GraphPluginBase):
14
15
"""Execute using Condor DAGMan
15
16
16
17
The plugin_args input to run can be used to control the DAGMan execution.
18
+ The value of any argument can be a literal string or a filename, where in
19
+ the latter case the content of the file will be used as the argument value.
20
+
17
21
Currently supported options are:
18
22
19
- - template : submit spec template for individual jobs in a DAG. All
20
- generated submit spec components (e.g. executable name and
21
- arguments) are appended to this template. This can be a str or
22
- a filename. In the latter case the file content is used as a
23
- template.
24
- - submit_specs : additional submit specs that are appended to the generated
25
- submit specs to allow for overriding or extending the defaults.
26
- This can be a str or a filename.
23
+ - submit_template : submit spec template for individual jobs in a DAG (see
24
+ CondorDAGManPlugin.default_submit_template for the default.
25
+ - initial_specs : additional submit specs that are prepended to any job's
26
+ submit file
27
+ - override_specs : additional submit specs that are appended to any job's
28
+ submit file
27
29
- dagman_args : arguments to be prepended to the job execution script in the
28
30
dagman call
29
31
"""
@@ -53,23 +55,26 @@ def _get_str_or_file(self, arg):
53
55
# actually have to run. would be good to be able to decide whether they
54
56
# actually have to be scheduled (i.e. output already exist).
55
57
def __init__ (self , ** kwargs ):
56
- self ._template = self .default_submit_template
57
- self ._initial_specs = ""
58
- self ._override_specs = ""
59
- self ._dagman_args = ""
60
- if 'plugin_args' in kwargs and not kwargs ['plugin_args' ] is None :
58
+ for var , id_ , val in \
59
+ (('_template' , 'submit_template' , self .default_submit_template ),
60
+ ('_initial_specs' , 'template' , '' ),
61
+ ('_initial_specs' , 'initial_specs' , '' ),
62
+ ('_override_specs' , 'submit_specs' , '' ),
63
+ ('_override_specs' , 'override_specs' , '' ),
64
+ ('_dagman_args' , 'dagman_args' , '' )):
65
+ if 'plugin_args' in kwargs \
66
+ and not kwargs ['plugin_args' ] is None \
67
+ and id_ in kwargs ['plugin_args' ]:
68
+ val = self ._get_str_or_file (kwargs ['plugin_args' ][id_ ])
69
+ setattr (self , var , val )
70
+ # TODO remove after some time
71
+ if 'plugin_args' in kwargs \
72
+ and not kwargs ['plugin_args' ] is None :
61
73
plugin_args = kwargs ['plugin_args' ]
62
74
if 'template' in plugin_args :
63
- self ._template = \
64
- self ._get_str_or_file (plugin_args ['template' ])
65
- if 'initial_specs' in plugin_args :
66
- self ._initial_specs = \
67
- self ._get_str_or_file (plugin_args ['initial_specs' ])
68
- if 'override_specs' in plugin_args :
69
- self ._override_specs = \
70
- self ._get_str_or_file (plugin_args ['override_specs' ])
71
- if 'dagman_args' in plugin_args :
72
- self ._dagman_args = plugin_args ['dagman_args' ]
75
+ warn ("the 'template' argument is deprecated, use 'initial_specs' instead" )
76
+ if 'submit_specs' in plugin_args :
77
+ warn ("the 'submit_specs' argument is deprecated, use 'override_specs' instead" )
73
78
super (CondorDAGManPlugin , self ).__init__ (** kwargs )
74
79
75
80
def _submit_graph (self , pyfiles , dependencies , nodes ):
0 commit comments