Slave Extra Info Data

Hello,

We have been upgrading the studio to deadline 6, and our SysAdmin asked me a question. In the montitor, there is the option to specify custom information about a slave alongside the other machine details, ram, IP etc,etc,etc. Custom information can be added to the ExtraInfo sections via the modify slave properties dialog.

BUT - can this data be populated via script when deadline starts up? I want to get information from an environment variable on the slave machine so that I can use it for further identification. Is this possible via scripting or command process? I mean, it must get populated somehow as deadline gets the machine data of the slaves, can I customise it so that it gets this extra information at the same time?

Great job on 6 BTW, loving it so far.

cheers

Pete

Hey Pete,
Few options here. The API docs (pdf/chm) available via the same link you would have downloaded Deadline from, provide the functions available in the land of Deadline scripting.

  1. Slave “ExtraInfoX” column headers in the slave list panel can be renamed (not sure if you have noticed that) - go to [super-user] - repo options > Slave Settings > “Extra Properties”, so you can name the columns something more useful.

  2. Deadline Scripting API (see “Deadline-6.2.0.32-Scripting-Reference.chm/pdf”), execute Python/Python.Net (you get to use .NET via the 2nd route here) script within Deadline context - job script, plugin script, monitor script, slave script, etc OR via "DeadlineCommand.exe -ExecuteScript “my_python_script.py” will all work - “SlaveSettings.SlaveExtraInfo0” will get you the first one for example.

Here’s an example slave script which works in the context of a slave being selected in the monitor (use slightly different functions if executing outside of monitor, as you would need to grab all slaves and filter down to the ones you would want to edit via say, slaveName):

[code]from Deadline.Scripting import *

def main():
slaves = MonitorUtils.GetSelectedSlaveNames()

for slave in slaves:
	
	slaveSettings = RepositoryUtils.GetSlaveSettings(slave, True)
	
	print slaveSettings.SlaveExtraInfo0
	
	slaveSettings.SlaveExtraInfo0 = "Rafael Nadal is out!"

	RepositoryUtils.SaveSlaveSettings( slaveSettings )

	print slaveSettings.SlaveExtraInfo0[/code]
  1. Python standalone API (see “Deadline-6.2.0.32-Standalone-Python-Reference.chm/pdf”) requires Pulse to be running.

  2. Http RESTful API (see “http://www.thinkboxsoftware.com/deadline-6-httpoverview/”) requires Pulse to be running.

  3. “Pymongo” - talk directly to the MongoDB. Possible, but not supported as we provide a protected API above. :slight_smile:

I was going to write a tutorial on injecting the 3dsMax version/sp into a slave extrainfo field to help studios track all machines are running the same version. This could be done via a preJob python script in the 3dsMax plugin, for example.

Off-topic, but I assume you guys are also running the latest v6.2.0.32 release? The above will all work in v6.1; just making sure you guys know about v6.2 as it has lots of 3dsMax, VRay, DBR enhancements. Updated v6.2 license is required. sales@thinkboxsoftware.com can provide download links/updated license.

Cheers,
Mike

Thanks for the reply Mike,

I have something working now. We are running 6.2 - The Console is an awesome addition to the Deadline toolset. Would be great in the future to be able to write small scripts and plugins directly from the monitor by adding a simple python editor above the console output.

I had gone with a similar script to the one you posted, but the extrainfo stuff was the bit I didn’t know. Another quirk that I couldn’t see documented was the need to add the word execute into the cmd string when running a process on an external machine.

SlaveUtils.SendRemoteCommand( machineName, "Execute cmd /C set userID >\"" + stdOutFile + "\"" )

Didn’t work without it. I am getting an environment variable from the remote machine, writing it to a text file, and reading it back in where I set the extraInfo parameter. Seems hacky but unless I’m missing something, I couldn’t see another way of returning the stOut from the machine’s remote process (well not using SlaveUtils.SendRemoteCommand anyway)

thanks again

Pete

Hi Pete,

SlaveUtils.SendRemoteCommandWithResults( string machineName, string command )

returns the result and displays the command STDout in the console, yet you can’t actually get your mitts on it…Annoying, putting a feature request in now… I just checked our API document and it explains how the “Execute” [COMMAND] or “ExecuteNoWait” [COMMAND] should be used.

If you download the *.chm file, do a search for “SlaveUtils.SendRemoteCommandWithResults” and it should return: