upload_review and render publish

The HTTP & Python API
Post Reply
User avatar
pablo
Posts: 13
Joined: September 3rd, 2020, 7:14 pm

upload_review and render publish

Post by pablo »

Hello.
Working in a better integration of our deadline farm with NIM I realised that I was getting some errors from the upload draft movie to NIM job and also I'm missing some data in the NIM review items when I open them in NIM.
I found the deadline NIM plugin is using a deprecated function: upload_dailies()
Looking into the API I found the new function is upload_reviewItem().
I have some question regarding to the correct way to publish a render and it's review movie in NIM.
I suppose I first need to call to add_render(), that will log the render into NIM and should return an ID (renderID). Then later I can call upload_reviewItem() with that renderID and the taskId to upload the draft movie.
Is this correct?

How the parameter renderKey is used, it is the deadline job number, but I dont know how it is used internally.
As I said before, the current code in Deadline only calls to upload_dailies(), but Im still getting renders logged in NIM, was the old function doing both things? Logging the render and uploading the draft movie?

Also, at the moment looks like renders and reviews are missing a lot of info in NIM. Renders dont have and start/end frames logged, the user appears empty. Reviews also have the creator field empty. I suppose all fo these missing info is due to Deadline using a dreprecated function.
For reviews, how I should publish them to get the versions stack working? Is not working at the moment, it only shows the current render as the only available verision.
Finally the add_render() function, how to setup start/end frame? In the parameters they appear as start/end datetime. What is total and Avg, that refers to the total render time for all the frames ans the avg render time per frame?

Thanks, and sorry for the long message.

Pablo

User avatar
pablo
Posts: 13
Joined: September 3rd, 2020, 7:14 pm

Re: upload_review and render publish

Post by pablo »

Ok, I figured out how deadline is calling the NIM event plugin to publish the render and the preview movie, by default the DraftPlugin has preference over the NIM plugin, so the Draft plugin creates a new job for draft to make the movie, then the NIM plugin detects the rendder job as a NIM job and because the plugin in this case is Vray, publish the render.
Finally when the draft job finishes the NIM plugin detects the caller is a DraftPlugin job and publish the preview movie.
So here I have a chicken and egg problem, if I call the draft job before publishing the render it is impossible to pass the renderID to the review puyblishing in NIM and therefore link the preview to the render.

The best solution I can find is to publish the render when it is submitted to the farm. Then every time a node is rendered I can increment the version number and update the nodes in Houdini. Publishing the render on the submission process on the client, reserve de version and the ID for the render and pass it as ExtraInfo to the render job for the movie review process.

My doubt to implement this is how can I use NIM apis in a third party tool, in this case Deadline.
From what I have seen in the NIM plugin Deadline scripts just import the API as if it was in the PYTHONPATH:

Code: Select all

try:
    if sys.version_info.major == 3:
        import nim_core.py3.nim_api as nimAPI
    else:
        import nim_core.py2.nim_api as nimAPI
except:
    import nim_core.nim_api as nimAPI
But I couldnt find the NIM apy anywhere in the Deadline repo, the only setup that us needed in Deadline is just setting the API URL, so my guess is that it is using it to somewhat import the modules, but I dont have any idea how this is done.
Another options is to use the NIM_CONNECTOR envar to add the path and import the module, but Im curious to know how Deadline is loading the API.
Cheers

User avatar
andrew
Site Admin
Posts: 332
Joined: June 24th, 2014, 8:10 am

Re: upload_review and render publish

Post by andrew »

Hi Pablo,

Deadline has its own copy of the nim_core files that they dynamically unpack and make available on the fly. The best way to load and access them in Deadline submission or Draft scripts would definitely be a question for the guys at Thinkbox.

Deadline actually creates a unique ID per job which is logged onto a render item in NIM as the "renderKey". Essentially a render job in Deadline is equal to a render item in NIM. You can use the renderKey field to update the NIM render item without knowing the actual ID of the render item in NIM. I believe this chicken and egg problem was something we encounter when we wrote the original Deadline integration and we used this unique Deadline Job ID stored as the renderKey as a solution.

I know the devs at Thinkbox have changed the code for the integration since they took it over, but I believe the general workflow stayed the same.

Cheers,
Andrew

Post Reply