PyTasks code seems recorded in MongoDB. Is it possible to modify it ?
30 views
Skip to first unread message
David Michéa
unread,
Jul 27, 2017, 9:49:23 AM7/27/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fireworkflows
Hi,
I use a lot of PyTask to implement my fireworks.
Sometimes, tasks are FIZZLED because of a bug in the function passed to the PyTask. But when I fix the bug and re_run the FW, It ends up with the same error message : the bug seems not fixed, althought the python module as been updated.
I suppose this is due to the fact that the code of the function seems to have been registered in MongoDB ... Am I wrong ?
Is it possible to fix the code in MongoDB so that I can rerun these FWs without error ? Or is there a way to force the FW to reload the function from its module ?
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mic...@unistra.fr, fireworkflows
Hi David
PyTask shouldn't be storing the function contents, only the function name (e.g. "my_module.my_function") and the desired arguments and keyword arguments into that function (e.g., param1="bob"). If this is incorrect, can you send me the contents that you are seeing in MongoDB regarding storing the code of the function itself?
If you update the code on your Worker, it should also update when you rerun a PyTask. You should confirm that the updated version of your code is indeed being loaded when you load the same function name manually, i.e., not through FWS. If it still seems like a FWS problem, then maybe send me a dump of the JSON of the FW that is causing problem from your MongoDB.
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Anubhav Jain, fireworkflows
Hi Anubhav,
For exemple, here is a stacktrace of a FIZZLED PyTask after correction of the bug:
"_stacktrace": "Traceback (most recent call last):\n File \"/b/home/ipgs/dmichea/venv_a2s/lib/python3.6/site-packages/fireworks/core/rocket.py\", line 224, in run\n m_action = t.run_task(my_spec)\n File \"/b/home/ipgs/dmichea/venv_a2s/lib/python3.6/site-packages/fireworks/user_objects/firetasks/a2s_tasks.py\", line 44, in run_task\n coregis_wf = coregis_S2.get_coregis_wf(src_id)\n File \"/b/home/ipgs/dmichea/A2S/code/WFlows/coregis_S2.py\", line 220, in get_coregis_wf\n coregis_fws = create_coregis_fws(src_id)\n File \"/b/home/ipgs/dmichea/A2S/code/WFlows/coregis_S2.py\", line 205, in create_coregis_fws\n fw_coregis = Firework([check_scratch_task, do_coregis_task], name=\"coregistration\", spec={\"_category\": \"multiseq\"})\nNameError: name 'fw_check_scratch' is not defined\n"
Here is the line 205 of /b/home/ipgs/dmichea/A2S/code/WFlows/coregis_S2.py before correction :
As you can see, the stacktrace print the line 205, and there is no more 'parents' parameter in it (fw_coregis = Firework([check_scratch_task, do_coregis_task], name=\"coregistration\", spec={\"_category\": \"multiseq\"})). I can check it importing the module manually : the code is correct now
And it stops on the same bug ...
But I was wrong in my first post : this is not a PyTask, it is a custom Task : class AppendCoregisTask in module a2s_tasks:
A2S_logger.fatal("coregis_S2.get_coregis_wf failed : no co-registration workflow created for src id %s" % str(src_id))
return FWAction()
...
So could it be linked to my problem ?
PS: The JSON of the FW (seen from the web GUI, I don't now how to have this info from CLI ...)
Firework 2359 : append Coregistration WF
created on 07/28/2017
{
"_id": null,
"archived_launches": [ ],
"created_on": "2017-07-28T08:57:45.892309",
"fw_id": 2359,
-
"launches": [
-
{
"_id": null,
-
"action": {
"additions": [ ],
"defuse_children": false,
"defuse_workflow": false,
"detours": [ ],
"exit": true,
"mod_spec": [ ],
-
"stored_data": {
-
"_exception": {
"_details": null,
"_failed_task_n": 0,
"_stacktrace": "Traceback (most recent call last):\n File \"/b/home/ipgs/dmichea/venv_a2s/lib/python3.6/site-packages/fireworks/core/rocket.py\", line 224, in run\n m_action = t.run_task(my_spec)\n File \"/b/home/ipgs/dmichea/venv_a2s/lib/python3.6/site-packages/fireworks/user_objects/firetasks/a2s_tasks.py\", line 44, in run_task\n coregis_wf = coregis_S2.get_coregis_wf(src_id)\n File \"/b/home/ipgs/dmichea/A2S/code/WFlows/coregis_S2.py\", line 220, in get_coregis_wf\n coregis_fws = create_coregis_fws(src_id)\n File \"/b/home/ipgs/dmichea/A2S/code/WFlows/coregis_S2.py\", line 205, in create_coregis_fws\n fw_coregis = Firework([check_scratch_task, do_coregis_task], name=\"coregistration\", spec={\"_category\": \"multiseq\"})\nNameError: name 'fw_check_scratch' is not defined\n"
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Anubhav Jain, fireworkflows
Erratum : This is not a PyTask (as said in my first statement), it is a custom firetask which executes this code from one of its imported module.
Anubhav Jain
unread,
Jul 28, 2017, 12:53:13 PM7/28/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fireworkflows, AJ...@lbl.gov, mic...@unistra.fr
Hi David
I am not really sure how to solve this; we do update our Firetasks code all the time and upon rerun the updated version is loaded. FireWorks does not store the code anywhere.
As far as I can tell, some outdated version of coregis_S2 is being loaded.
On your worker, with the same Python environment loaded as when FWS is executing, you could try to execute the command:
Then, check text_import.txt and ensure that the printed out location of co_regis_S2 is the correct location of your code.
If you are running through qlaunch, you can also add that command to the pre_rocket field of your my_qadapter.yaml file, which will ensure that the command is executed in exactly the same Python environment as FireWorks and on the same machine, etc. Check test_import.txt again after executing the FW rerun and see what it says. Whatever file is printed out there should be the same file that FWS is finding for coregis_S2.