Fizzled firework - dynamically re-run

43 views
Skip to first unread message

Zachary Ball

unread,
Mar 10, 2016, 1:14:30 AM3/10/16
to fireworkflows
Hi

Is there a way that based upon a fizzled firework one can instruct the firework to re-run itself? I could always dynamically write cases for a firework to re-run itself like so:

def rerun_firework(current_fw, fw_spec, name):
    fw_spec['fail_count'] += 1
    max_retries = fw_spec['max_retries']
    fail_count = fw_spec['fail_count']
    if fail_count == max_retries:
        # Could not succeed in passing this firework with retries
        return FWAction(defuse_workflow=True)
    failed_workflow = Workflow.from_Firework(Firework(current_fw, spec=fw_spec, name=name))
    return FWAction(detours=[failed_workflow])

Although I am not quite sure that this is the best way of achieving what I am trying to achieve?

Basically I am looking for a way for a Firework to fizzle, as caused by an exception or failure, and then for the firework to retry itself a certain amount of times with changed parameters.

Thanks again!

Anubhav Jain

unread,
Mar 10, 2016, 1:53:41 PM3/10/16
to Zachary Ball, fireworkflows
Hi Zachary,

Currently, you must rerun fizzled FireWorks either through the command line (e.g., by typing the lpad rerun_fws command) or through a Python script (e.g., by programming some conditions to detect fizzled FireWorks that need a rerun and rerunning those through the LaunchPad rerun function). But, neither of those methods will add in the condition of "max_retries" like you stated.

So, basically the solution you wrote is the correct way forward. If you are feeling ambitious, you can write it into Rocket.run() so that the "_max_retries" is a reserved FW spec keyword, and that any Firework with that keyword will have a FIZZLED FWAction modified to add in a detour of that Firework with the number of retries incremented. I could then merge those commits into the main FWS software (but that is up to you).

Good luck!
Anubhav

--
You received this message because you are subscribed to the Google Groups "fireworkflows" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireworkflow...@googlegroups.com.
To post to this group, send email to firewo...@googlegroups.com.
Visit this group at https://groups.google.com/group/fireworkflows.
To view this discussion on the web visit https://groups.google.com/d/msgid/fireworkflows/917cb34b-6bdd-49e1-b173-391cfbcc8a9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages