AWS Thinkbox Discussion Forums

identifying deadline version from python

Is there a way to identify the current version of deadline from within a job or the cpython environment running within deadline? An env variable or something like that? We have a few versions of deadline running parallel, and would like to keep jobs spawned by other jobs consistently in the right version.

cheers
laszlo

Well, there’s “GetVersion”:

c:\Program Files\Thinkbox\Deadline10\bin>deadlinecommand getversion
v10.0.10.4 Release (ffe5d2721)

From the API, there are a few ways to get it:

from Deadline.Scripting import ClientUtils

def __main__():
    version = ClientUtils.GetDeadlineVersion() # Returns a float
    print("Deadline's version is {}".format(version))
    
    # Full string output:
    version = ClientUtils.ExecuteCommandAndGetOutput("GetVersion")
    print("Deadline's version is {}".format(version))

Results in:

c:\Program Files\Thinkbox\Deadline10\bin>deadlinecommand executescript c:\Users\myname\Downloads\getversion.py
Qt: Untested Windows version 10.0 detected!
Deadline's version is 10.0

c:\Program Files\Thinkbox\Deadline10\bin>deadlinecommand executescript c:\Users\myname\Downloads\getversion.py
Qt: Untested Windows version 10.0 detected!
Deadline's version is v10.0.10.4 Release (ffe5d2721)

If you need the full version (with build and revision #s), you can also grab it straight from the Assembly through .NET code:

[code]from System.Reflection import Assembly
from Deadline.Users import UserInfo

def main( *args, **kwargs ):
entryAssembly = Assembly.GetEntryAssembly() # System.Reflection.Assembly object
assemblyName = entryAssembly.GetName() # System.Reflection.AssemblyName object
version = assemblyName.Version # System.Version object
print “Major: {}\nMinor: {}\nBuild: {}\nRev: {}”.format( version.Major, version.Minor, version.Build, version.Revision )

## Alternatively, get Assembly from any Deadline type (probably safer)
assembly = UserInfo().GetType().Assembly
# ...

[/code]

Relevant .NET class docs:
System.Assembly
System.AssemblyName
System.Version

Output (was run on 10.0.10.4):

Major: 10 Minor: 0 Build: 10 Rev: 4

Privacy | Site terms | Cookie preferences