AWS Thinkbox Discussion Forums

GetSlaves for Python?

Hi,

I know GetSlaves exists for deadlinecommand, but I need the equivalent thing for Python.

I tried for slave in RepositoryUtils.GetSlaveInfos( True ):

But it doesn’t give the same info as in deadlinecommand, and RepositoryUtils.GetSlaves doesn’t exist apparently. I can’t find it in the documentation anywhere.

Does it exist somewhere else?

Why:
We have a lot of slaves that think they’re rendering but aren’t, so as a band-aid until we can find the issue (it’s within our own custom plugin we believe), I want a script to compare the TaskID of the slave to the job, check if the task is actually rendering, and restart the machine if it isn’t (because most of the time, the slave has leaked memory). Many of the tasks on the slaves have since finished on another slave, failed, suspended, been requeued, etc…so it would be good to not have to find these manually.

Thanks,
A

Hi, here’s a couple of options for you:

[code]from Deadline.Scripting import *

def main():

slaveNames = RepositoryUtils.GetSlaveNames(True)
for slaveName in slaveNames:
	slaveInfo = RepositoryUtils.GetSlaveInfo( slaveName, True )
	print "Slave Name: %s, Slave State: %s" % (slaveInfo.SlaveName, slaveInfo.SlaveState)

slaveInfos = RepositoryUtils.GetSlaveInfos(True)
for slaveInfo in slaveInfos:
	print "Slave Name: %s, Slave State: %s" % (slaveInfo.SlaveName, slaveInfo.SlaveState)

slaveSettings = RepositoryUtils.GetSlaveSettingsList(True)
for slaveSetting in slaveSettings:
	print "Slave Name: %s, Slave Description: %s" % (slaveSetting.SlaveName, slaveSetting.SlaveDescription)[/code]

Thanks!

Now I’ve got that much working. Is there a way to get the length of time a slave thinks it has been rendering a task as well as the same information for a task from a job? This would be for currently running tasks.

Thanks,
A

Hi Mike,

As a bump to this thread, is it possible to list only the slaves that are rendering the selected job in the monitor?

I’m trying to get a monitor script to show the current rendering slave names & their frame numbers + another 3dsmax setting.

Any idea?

Thanks

Privacy | Site terms | Cookie preferences