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!
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
···
On Wed, Mar 9, 2016 at 10:14 PM, Zachary Ball [email protected] wrote:
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!
–
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 [email protected].
To post to this group, send email to [email protected].
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.