AWS Thinkbox Discussion Forums

Deadline scripting - get slave instances?

I’m trying to write a tool that will allow me to easily deploy and then kill slave instances. So I’m trolling through the documentation to see what I can and can’t do. My first step is to test to see if there are existing instances attached to the slave.

slave_instances.JPG

The problem is that I can’t seem to figure out how to query the slave for this information…or if it’s even possible. I’d love for some help in this matter if possible. :slight_smile:

Thanks!

James

There’s a bunch of different ways. My lazy preference is to use the info in the database. Just get a list of all the Slaves, filter out any Slaves that don’t start with the machine’s hostname. Whatever that count is, that’s the number of Slaves.

If you can’t trust the database because the Slaves haven’t registered themselves yet, just count the number of “ini” files in “C:\ProgramData\Thinkbox\DeadlineX\Slaves”. That’s what the Launcher itself does for now, and you could add/remove those files if you’re running on the render nodes. Otherwise, you’ll have to use SendRemoteCommand():

docs.thinkboxsoftware.com/produc … cc42c819b1

SlaveUtils.SendRemoteCommand( "myMachine", "LaunchNewSlave newSlaveName" )

Yeah I was figuring I would have to troll the “C:\ProgramData\Thinkbox\Deadline9\slaves” directory for .ini files to fully clean out the instances. Does Deadline have a way in the Python API to access and clean out that Slaves directory?

James

P.S. Thanks for the SendRemoteCommand. That was my next step for this tool! :slight_smile:

Well, the Python API just talks with the REST endpoint, and I don’t think we’ve got anything there for that…

Just in looking around the code, it seems that all of the commands are just for the data in the database. I’ll a request to get some of the control commands in there too, but for now you may need to leverage the old-school HTTP endpoints for that. Info here:
docs.thinkboxsoftware.com/produc … g-commands

+1 for python standalone access to remote commands.

We ended out wrapping calls to the command line.

I was able to simply use Python’s OS library to find and clean up the instance .ini files. I’m now trying to sort out the rest of my tool functionality.

Privacy | Site terms | Cookie preferences