Template multiple application versions

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • 17th April 2020 at 10:55 am #32065

    Are there any good examples of how to support multiple application versions in a template?

    For example we’re currently running multiple versions of nuke and would like to specify which version should be used on the farm when rendering depending on the project and or an environmental variable.

    How flexible is the version system, ie do we have to hardcode each version one by one and point to the exe path?
    or is it possible to add/inject an arbitrary path/variable with the exe path we want to use for this specific render.

    When we launch nuke we store the exe path as an env var and it would be nice to then use that so the farm renders with the matching version, ie use the exe path from the already existing env var instead of the templates baked in exe path.

    17th April 2020 at 2:32 pm #32075

    Hi Alex,

    The base implementation of multi versioning is very simple. You just define a new version in the template editor dialog, and from that point, you get multiple selectors on the clients for the executable path. Our implementation ends there, meaning that Muster just points to a different executable depending on the version you select.

    Now, starting from this setup, you can change stuff depending on your pipeline. The effective executable is stored in the client preferences, but it’s always loaded from the template and nothing can prevent you to read an environmental variable in the job or somewhere else, and pass back a different executable.

    If you already use an env var, I may think that you launch Nuke though a bat or script file, in that case, it may be better to just continue to launch your script file with a custom template.

    If you can go deeper explaining your implementation, I can guide you on the best path.

    17th April 2020 at 2:49 pm #32076

    Ah, didn’t know about the versions tab under the details tab for each template.

    – So basically what we’re doing is launching nuke from fTrack with our own custom Actions.

    – The user can pick which version of nuke to launch, ie 12.0v4 or v6 aso,
    and the path to the executable gets stored in a custom env var upon launch.

    – The user then wants to submit a job to muster through our custom submitter and this picks up our custom template.
    This template then has the following variables:

            exePath_Nuke = MTemplateAPI.MTemplateItemFile('EXEPATH_NUKE','Nuke executable','Path to Nuke render.exe application batch render','C:\\Program Files\\Nuke12.0v4\\Nuke12.0.exe',0,0,1,'*.exe')
            self.platformWindows.addClientConfigurationItem(exePath_Nuke)
            softwarePath_Nuke = MTemplateAPI.MTemplateItemFolder('SOFTWAREPATH_NUKE','Starting folder','Specify the starting folder for the nuke','C:\\Program Files\\Nuke12.0v4',0,0,1)
            self.platformWindows.addClientConfigurationItem(softwarePath_Nuke)
            exePath_Python = MTemplateAPI.MTemplateItemFile('EXEPATH_PYTHON','Python executable','Path to python.exe','\\\\fs\\data\\_pipeline\\_bin\\python\\2.7.11_64bit\\python.exe',0,0,1,'*.exe')
            self.platformWindows.addClientConfigurationItem(exePath_Python)
            softwarePath_Python = MTemplateAPI.MTemplateItemFolder('SOFTWAREPATH_PYTHON','Python software folder','Specify the software folder for python','\\\\fs\\data\\_pipeline\\_bin\\python\\2.7.11_64bit',0,0,1)
            self.platformWindows.addClientConfigurationItem(softwarePath_Python)

    – In the onBuildEnvironment it then reads in a bunch of custom env vars from a file on disk that contains custom env vars for this job including which nuke version it should run.

    – We would like to dynamically switch the version being used to match the version the user picked when launching through fTrack without having to have multiple templates and/or a manual selection process.
    Basically we would like to use our env vars instead of the hard coded paths to the EXEs.

    17th April 2020 at 8:51 pm #32089

    make the same you are doing into onBuildEnvironment by reading the vars from a file, but do it it on onGetApplicationPath and onGetApplicationStartingFolder. There you can switch the exe depending on your environment and job data. Also check the onBuildEnvironment, you may need to prepare your environment too according.

    Cheers!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.