PDG Afanasy Scheduler

   3146   6   3
User Avatar
Member
201 posts
Joined: Jan. 2013
Offline
Hello!
I'm trying to implement a custom scheduler under the render manager CGRU Afanasy.
https://github.com/alexwheezy/python/tree/master/houdini/afanasy_scheduler [github.com]

But I still have some questions that I still don’t understand how to do.

1) For example, after the task is completed, the status of the task “Exepted output”. What does it mean? The task was counted, but not loaded after execution.

2) If the render manager does not support requests via xmlrpclib, how can I properly embed the pdgcmd.py file? Because now I just use a dirty hack in the form of its patch with a fixed file.
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
1)
“Expected Output” corresponds to the value that was set with workitem.addExpectedResultData() when the item was generated. It's used during the cook to check if the item's result can be loaded from cache instead of re-cooking.

2)
With regard to xmlrpclib. I'm not sure what you're asking, are you saying you would like pdgcmd.py to be able to function without xmlrpclib ?
User Avatar
Member
201 posts
Joined: Jan. 2013
Offline
chrisgreb
1)
“Expected Output” corresponds to the value that was set with workitem.addExpectedResultData() when the item was generated. It's used during the cook to check if the item's result can be loaded from cache instead of re-cooking.

2)
With regard to xmlrpclib. I'm not sure what you're asking, are you saying you would like pdgcmd.py to be able to function without xmlrpclib ?

The question is that at the moment all integrated shedulers use xmlrpclib server feedback to report on the completed work. If I do nothing, then at this place I get exceptions “httplib.BadStatusLine: ‘'” and the task falls with an error and is considered not completed. I want to understand at what stage I can add my code or fix it to catch exceptions. Because as I wrote above, I have at the moment to simply replace the pdgcmd.py file after sending the task so that everything works.

Thank’s!
User Avatar
Member
603 posts
Joined: Sept. 2016
Offline
That's strange, what is your network setup? Note that recent daily builds have refactored the way scheduler do callbacks - we now have a message queue process that starts up on the farm and relays callbacks to the host over a persistent connection. This works better for many network topologies. You may consider doing the same.

Another option might be to just parse the events from the logs of the workitems.

As for catching the exception, you could do that by invoking all jobs in a wrapper script, and then detecting and handling errors as you wish. This can be done by reformatting the command that gets submitted and transferring the wrapper script itself in OnSchedule. Take a look at the Tractor binding in prtractor.py and pdgtrcmd.py in the very latest daily builds for an example of that.
User Avatar
Member
17 posts
Joined: Jan. 2006
Offline
alexwheezy
2) If the render manager does not support requests via xmlrpclib, how can I properly embed the pdgcmd.py file? Because now I just use a dirty hack in the form of its patch with a fixed file.

Hi, Alex!

You do not need to do it at all!
That "workItemStartCook" callback in pdgcmd.py needed to notify Houdini PDG graph that the item task launched a command. It is already launched by render manager and there is no need to connect the render manager here. So it is a "Houdini internal theme", not Afanasy related.

And your implementation tries to connect to Afanasy server address to notify PDG. Of course, Afanasy server can not recognize this message. And PDG thinks that tasks are not started, as it is waiting for that xmlrpc.

I just commented this two lines in your code (AfanasyScheduler class):
    def workItemResultServerAddr(self):
        return self['address'].evaluateString()
And it works!!!
We should not override this function.
Thank You!!!
Edited by TimurH - May 28, 2021 03:20:08
User Avatar
Member
17 posts
Joined: Jan. 2006
Offline
Ah, I forgot, I also modified this:
-            block.setEnv('PDG_ITEM_NAME', str('workitem_{}'.format(item_name)))
+            block.setEnv('PDG_ITEM_NAME', str(item_name))
We should not modify item_name, as it later looks for json data files, according this name.
Edited by TimurH - May 28, 2021 03:21:03
User Avatar
Member
201 posts
Joined: Jan. 2013
Offline
Thank you, Timur. I already realized that my initial approach was not entirely accurate. I was looking for a workaround, but in reality everything was simpler.
  • Quick Links