no exposure to redefined ui objects?

Ok, so I am relatively new to deadline but I am having a problem porting deadline 5 scripts to deadline 6. I have managed to update the UI in respect of PyQt but am having an issue with two dropdowns that are looking for pool items and group items. I understand that it needs to get information from the repository, so after a bit of reading, I found some reference in the documentation, which says I need to create a connection object:

import Deadline.DeadlineConnect as Connect
connectionObject = Connect.DeadlineCon(‘localhost’, 6428)
print connectionObject.Groups.GetGroupNames()

I have the localhost name and the port, however, when I run the above, I get an error:

ImportError: No module named Deadline.DeadlineConnect

Why is this? I have the right path set up so am in need of some assisstance. This has come about as there is a reference to a combobox in the script I am working with:

scriptDialog.AddControl( “Pool”, “PoolComboControl”, “animations”, dialogWidth - labelWidth - 24 - 200, -1 )

I have changed it in my sript to this:

scriptDialog.AddComboControl( “Pool”, “PoolComboControl”, “animations”, dialogWidth - labelWidth - 24 - 200, -1 )

It creates the object in the UI, but no items due to not obtaining the info from the repsitory.

I also created a version that listed the items, but this list is meaningless unless it is connected in another way.

PoolComboControl seems to be a class or redefined control that I cannot find access to. I am assuming that this has code within that does what I am looking for and populates the combobox with information from the repsitory in respect of what pool/group is required. As I had no luck in tracking this down, I went for the option at the top to see if I could get the info myself, but have hit a stumbling block.

As mentioned, I am trying to populate the pool dropdown/combo box and the group dropdown/combo box.

I created a script from the code at the top, using my local host and port number and ran this in the command prompt. I realise that there is a difference in the python, but at this point, I am trying everything:

U:>c:

C:>cd C:\Program Files\Thinkbox\Deadline\bin

C:\Program Files\Thinkbox\Deadline\bin> deadlinecommand.exe executescript mja_DeadlineCreateConnectObject.py

Oncfe done, I got an error dialog stating:

Python Error: No module named DeadlineConnect(IronPython.Runtime.Exceptions.ImportException)

I also received an error when I ran the same script in the Deadline 6 folder:

C:\Users\armstrongm>cd C:\Program Files\Thinkbox\Deadline6\bin

C:\Program Files\Thinkbox\Deadline6\bin>deadlinecommand.exe executescript mja_DeadlineCreateConnectObject.py
Error: Python Error: ImportError : No module named DeadlineConnect (Python.Runtime.PythonException)
Stack Trace:
[’ File “none”, line 1, in \n’]
(System.Exception)

So, I am not clear on whats happening here and hope that someone can shed some light on it for me.

many thanks

Hello,

I am going to have to have one of our coders look over this to see how you can best port your scripts. I hope to have more info next week.

I think you’re getting a little confused here between running a ‘normal’ python script in the context of the Deadline environment via deadlinecommand and alternatively, running a python script in the context of our recently v6.1 introduced standalone Python API, which requires the Python site-package & Pulse running.

Standalone Python API:
Copy “Deadline” directory from “//deadline_repository_path/api/python/” to “/python2.6_install_path/Lib/site-packages/”
Ensure Python2.6 is listed in your sys env $PATH and also is the first Python entry if you have multiple versions of Python installed
execute ./python shell
within python shell type:

import Deadline.DeadlineConnect as Connect Deadline = Connect.DeadlineCon('PULSE', PORT) print "Pools: %s" % Deadline.Pools.GetPoolNames()

where PULSE is the DNS name or IP address of your currently running Pulse Application and PORT is the TCP port number as assigned in Monitor > Super-User > Pulse Settings > WebService. Ensure the WebService is enabled as well.

Python Script Execution in Context of Deadline:
sys env variable: $DEADLINE_PATH should already be installed on your system.

"C:\Program Files\Thinkbox\Deadline6\bin\deadlinecommand.exe" -ExecuteScript "c:\path_to_python_script\test.py"

You do NOT make any reference to the standalone python script api (connObject) here as you are executing a python script within the native Deadline environment.
For an example, see “ScriptUIExample.py” in “//deadline_repository_path/scripts/General”. This example UI script demonstrates all the different UI elements possible via Deadline.
This is the correct syntax for a ComboControl: “scriptDialog.AddControl( “Pool”, “PoolComboControl”, “none”, dialogWidth - labelWidth - 24 - 200, -1 )”
See the scripting API reference manual for the correct syntax for all other functions: thinkboxsoftware.com/deadlin … mentation/

Hi Mike, thanks very much for the information, I hope to rectify the issue using your post.

As stated, I have managed to get the ui to work, its just the connection to the repository/web service so that I can populate the combo box controls with the pools and the blades for the groups. I have defined them in the way you stated and what is in the script ui example, which is very helpful:

scriptDialog.AddControl( “PoolLabel”, “LabelControl”, “Pool”, labelWidth, -1 )
scriptDialog.AddControl( “Pool”, “PoolComboControl”, “none”, dialogWidth - labelWidth - 24 - 200, -1 )

I have not found a reference to the PoolComboControl or the GroupComboControl in the downloadable manuals, only the comboBoxControl, which is defined in a different way, so are the two controls I am talking about classes that are not exposed?

Again, inexperience with the app may be adding to the non resolution, but I have noticed that some of the info in the manuals goes off page and does not continue on the next line, so perhaps I have missed something here.

We are using Python 2.7 here at the studio, so will I need to install python 2.6 to accommodate the Deadline 6 requirement? If so, that may have an effect on other tools that use the python 2.7 reference in the PATH variable to run other scripts. While it will be possible to script a change to the path on a needs basis, this may not be the best solution.

As a test, I copied the Deadline folder to our current Python location, and python 2.7 is referenced in our PATH. In a python shell, I can import

import Deadline.DeadlineConnect as Connect
Deadline = Connect.DeadlineCon(‘PULSE’, PORT)

But when I tried this line:

print “Pools: %s” % Deadline.Pools.GetPoolNames()

I get errors:

Traceback (most recent call last):
File “<pyshell#2>”, line 1, in
print “Pools: %s” % Deadline.Pools.GetPoolNames()
File “C:\Python27x64\lib\site-packages\Deadline\Pools.py”, line 35, in GetPoolNames
return self.get("/api/pools")
File “C:\Python27x64\lib\site-packages\Deadline\Pools.py”, line 16, in get
return DeadlineSend.send(self.address,commandString, “GET”)
File “C:\Python27x64\lib\site-packages\Deadline\DeadlineSend.py”, line 15, in send
response = conn.getresponse()
File “C:\Python27x64\lib\httplib.py”, line 1030, in getresponse
response.begin()
File “C:\Python27x64\lib\httplib.py”, line 407, in begin
version, status, reason = self._read_status()
File “C:\Python27x64\lib\httplib.py”, line 371, in _read_status
raise BadStatusLine(line)
BadStatusLine: ‘’

I am looking at the errors now, but any advice will be welcome.

Also, can you clarify the exposure to the PoolComboControl and the GroupComboControl.

Thanks again :ugeek:

The Deadline UI controls for Pools, Groups, MachineList, etc are all exposed, we just haven’t documented them! We’ll get the docs updated and I’ll update the ScriptUIExample.py to include all the built-in UI controls as a working example. This will ship with Deadline v6.2. Thanks. For examples of any of the ‘built-in’ UI controls for Deadline & their correct syntax, please take a look at any of our submission scripts for examples.

You can always use the DPython v2.6 we ship with Deadline instead of installing cPython v2.6. We currently only support v2.6, so we couldn’t provide official support outside of this. However, Deadline v7.0 will ship with support for Python v2.7.

The error message is indicating that Pulse is not running. Please take another look at my previous thread reply, detailing the requirements for Pulse to be running and correctly configured if you wish to use the standalone Python API INSTEAD of just executing a Python script via DeadlineCommand.exe.

Ok Mike, thanks for the reply. I will need to discuss the use of an earlier version of Python with the dev team.

Can you please point me to the script(s)/classes that I have queried due to the studio need for updating to Deadline 6.1 as incomplete documentation is not providing the answers we need.

Thanks very much, I look forward to seeing the updates being implemented for 6.2

I ran the same code again on an existing machine with Deadline 6 Pulse is running and the web service is running but I still get errors

import Deadline.DeadlineConnect as Connect
Deadline = Connect.DeadlineCon(‘HOST’, PORT) #HOST and PORT were input correctly at time of running
print “Pools: %s” % Deadline.Pools.GetPoolNames()

Traceback (most recent call last):
File “<pyshell#6>”, line 1, in
print “Pools: %s” % Deadline.Pools.GetPoolNames()
File “C:\Python27x64\lib\site-packages\Deadline\Pools.py”, line 35, in GetPoolNames
return self.get(“/api/pools”)
File “C:\Python27x64\lib\site-packages\Deadline\Pools.py”, line 16, in get
return DeadlineSend.send(self.address,commandString, “GET”)
File “C:\Python27x64\lib\site-packages\Deadline\DeadlineSend.py”, line 15, in send
response = conn.getresponse()
File “C:\Python27x64\lib\httplib.py”, line 1030, in getresponse
response.begin()
File “C:\Python27x64\lib\httplib.py”, line 407, in begin
version, status, reason = self._read_status()
File “C:\Python27x64\lib\httplib.py”, line 365, in _read_status
line = self.fp.readline()
File “C:\Python27x64\lib\socket.py”, line 430, in readline
data = recv(1)
error: [Errno 10054] An existing connection was forcibly closed by the remote host

So I am unsure about what I am doing wrong here.

Thanks in advance

Sorry, I don’t understand your question. Can you give an example or provide context?

Hi Mike, sorry if my post is not written in a clear way, as mentioned, I am new to this so may be writing in an odd way.

What I am asking for is where the exposure/scripts for the PoolComboControl and the GroupComboControl is/are so I can see what is happening relative to these currently undocumented control types and how I can get them to be populated with the correct information from the repository. It would be easier to gain whatever access I can instead of trawling through scripts looking for reference.

I have tried to get info from the Pulse web server, but this is not coming back with anything. The Pulse web service is running and I am using the correct syntax for our host and port. It keeps coming up with an error page stating that it is unavailable

Thanks again for the replies, they are much appreciated.

Hi Malcolm,
So, the built-in controls such as PoolComboControl don’t have anything ‘internally’ which is accessible. You just use it and it works. It’s syntax is as follows:

scriptDialog.AddControl( “Pool”, “PoolComboControl”, “none”, width, height, tooltip )

where:

scriptDialog.AddControl() - you are adding a control
“Pool” - is the text label to the left of the UI Drop-Down-List (DDL)
“PoolComboControl” - is the name you need to use to create a DDL which is auto-populated with the Deadline pools.
“none” - is the “default” selected pool from the DDL. You could enter “animations” here if you wanted.
width - width of UI control
height - height of UI control (leave as -1 for default height)
tooltip - optional string tooltip

and that’s it. No exposure beyond this. No additional scripts required. The same variables work for the other built-in controls, which can be seen in any of our submission scripts. You can simply copy’n’paste.

Sounds like you need to reserve a namespace for Pulse. See here for more documentation: thinkboxsoftware.com/deadlin … eb_Service

To confirm that you can at least connect to Pulse’s web service, try the following URL.

http://[myhost]:[myport]/

You should see the following if you connect to Pulse successfully:

Error - Not a supported command.

If Pulse is running on Windows, you may also need to add a namespace reservation for the current user that Pulse is running under, so that it can reserve namespaces for the URL connection. See the Configuring Namespace Reservations section in this MSDN Article for more information:
msdn.microsoft.com/en-us/library/ms733768.aspx

Note that Pulse listens on *:8080/, so make sure this is the URL you use when reserving the namespace. For example:

netsh http add urlacl url=http://*:8080/ user=USERNAME

Hi Mike, I have no trouble making the UI and getting it represented on screen, its the connection to the pools and groups and the population of the combo boxes that I need to resolve and that I need to work. Currently, the combo boxes are not picking up the pools and group lists, so there is an issue there, not with the creation of the UI. I have Pulse running and the web service, I have the host name and the port name, but when I run the script from the launcher, the combo boxes are still at the default. What have I left out here!!?? It is going to be something obvious, I know it, so I will double check my code and the web service again, it must be here, but its driving me bonkers. Hahahaha. :smiling_imp:

Thanks Mike

Can you post your script and provide details about how you are running it, what it’s supposed to do, and what specifically is and isn’t working with it? I sense that you are trying to execute a standalone Python script via the Pulse WebService which contains one or more of our custom UI controls, which won’t work as you need to execute this within the native Deadline environment, if you wish to use our built-in UI controls such as “PoolComboControl”.

Hi Mike, I have checked the Pulse service and it is running, so is the web service but when I run the script(s) that I have converted to deadline 6.1, the UI is fine, but the drop downs for the pools and groups are still not being populated with the information that the PoolComboControl and GroupCoboControl are supposed to find. I have placed the scripts that I have redefined using the deadline documentation in the Deadline submissions folder, which was really only a matter of updating the UI code. The rest of the functionality should be the same, should it not?

They are scripts that you wrote originally and the controls are collating the data from deadline 5 ok ( this is an educated assumption, considering Deadline 5 is working ok at the moment), I just need to know why it is not populating the lists in the deadline 6 version and what I may have not done.

Even if I add “animations” to the line for the UI control, it still only opens the UI with none and render as options for the pools drop down and none for the group drop down

scriptDialog.AddRow()
scriptDialog.AddControl( “PoolLabel”, “LabelControl”, “Pool”, labelWidth, -1 )
scriptDialog.AddControl( “Pool”, “PoolComboControl”, “animations”, dialogWidth - labelWidth - 24 - 200, -1 )
scriptDialog.EndRow()

scriptDialog.AddRow()
scriptDialog.AddControl( “GroupLabel”, “LabelControl”, “Group”, labelWidth, -1 )
scriptDialog.AddControl( “Group”, “GroupComboControl”, “none”, dialogWidth - labelWidth - 24 - 200, -1 )
scriptDialog.EndRow()

Is there anything that you can suggest that may be causing this?

Thanks

Malcom :slight_smile:

If you are executing your python submission script via launcher or monitor, then Pulse/WebService isn’t required. The WebService provides for other functionality such as the interface for the Standalone Python execution, RESTful http API. Pulse is NOT required if you simply want to execute a python UI script via Deadline Launcher, Deadline Command or Deadline Monitor to submit a job for example.

By default, Deadline ships with only “none” in both pools & groups. If the “Pools” ComboControl is also showing a 2nd pool called “render”, then this has been configured in your farm setup. In monitor, if you go to “Tools” > “Manage Pools…” (as a super-user), can you show me what pools have been created in your farm? Likewise, in “Manage Groups…”, can you show me what “Groups” have been defined in your farm? If you haven’t defined any pools or groups, then this would explain why the drop-down list is empty.

Hi Mike, just before I saw your post, I was looking at the docs which is what you have posted and which I have just been playing with.

I had not set these groups, so the code was right, I had just not added any pools or groups. What a noob, but if you don`t know, gotta keep asking. :blush:

Is there a smily that has both feet in its mouth as I feel that would be very apt at this point.

Many thanks for your help and patience, both have been much appreciated.