Skip to content

Commit

Permalink
fix: add dispatcher_debug
Browse files Browse the repository at this point in the history
Signed-off-by: zjgemi <[email protected]>
  • Loading branch information
zjgemi committed May 24, 2024
1 parent 978d0a9 commit a4eeb69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dflow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def split_headers(s):
"debug_save_copy_method": os.environ.get("DFLOW_DEBUG_SAVE_COPY_METHOD",
"symlink"),
"raise_for_group": boolize(os.environ.get("DFLOW_RAISE_FOR_GROUP", False)),
"dispatcher_debug": boolize(os.environ.get("DISPATCHER_DEBUG", False)),
}


Expand Down
4 changes: 4 additions & 0 deletions src/dflow/plugins/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,10 @@ def render(self, template):

machine_dict["local_root"] = self.work_root
new_template.script += "import json, shlex\n"
if config["dispatcher_debug"]:
new_template.script += "import logging\n"
new_template.script += "from dpdispatcher.dlog import dlog\n"
new_template.script += "dlog.setLevel(logging.DEBUG)\n"
new_template.script += "from dpdispatcher import Machine, Resources,"\
" Task, Submission\n"
new_template.script += "machine = Machine.load_from_dict(json.loads("\
Expand Down

0 comments on commit a4eeb69

Please sign in to comment.