Hi there
Is it possible to set up a different temp directory for each Slave instance on a machine?
I have a machine running 2 slave instances, and would like them both to have separate temp directories to access from.
Thanks
Hi there
Is it possible to set up a different temp directory for each Slave instance on a machine?
I have a machine running 2 slave instances, and would like them both to have separate temp directories to access from.
Thanks
Unfortunately, no, there is no way to configure this. Could you create sub directories in the temp directory that each slave instance uses?
That would be the next best option. Thanks Ryan.
Do you happen to know how to go about setting up temp sub directories for slaves?
The slave is copying the nuke script to the temp directory, but once an instance picks up the job, the other instance tries to do the same but errors because the file is already in use.
So having each instance copy it to separate folders, like: d:\temp\slave1 would solve the problem.
Is this a custom plugin you’re writing? If so, can you post the code where you are copying the nuke script to the temp directory? I can take a look and offer suggestions.
Thanks!
I kind of have an idea how to add the slave name into the path, but getting the slave info during the PreRenderTask is what I’m stumped on. I just added some stab-in-the-dark code where the arrows are pointing. I know it won’t work, but that’s the only way I can think of getting that kind of info. This is my first time looking at plug-in scripting.
[code]def PreRenderTasks( self ):
LogInfo( “PreRenderTasks”)
sceneFilename = CheckPathMapping( GetPluginInfoEntryWithDefault( “SceneFile”, GetDataFilename() ) )
sceneFileLines = File.ReadAllLines( sceneFilename, Encoding.Default )
if GetBooleanConfigEntryWithDefault( "EnablePathMapping", True ):
tempSceneDirectory = ""
if GetBooleanConfigEntryWithDefault( "CopyNukeFileToSystemTemp", True ):
tempSceneDirectory = Path.GetTempPath()
else:
tempSceneDirectory = GetJobsDataDirectory()
slaveName = SlaveUtils.GetCurrentSlaveInfoValue('MachineName') <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
tempSceneTag = GetConfigEntryWithDefault( "TempNukeFileTag", "_thread[THREAD]" )
tempSceneTag = tempSceneTag.replace( "[THREAD]", str(GetThreadNumber()) )
tempScenePrefix = Path.GetFileNameWithoutExtension( sceneFilename )
tempSceneExtension = Path.GetExtension( sceneFilename )
self.TempSceneFilename = Path.Combine( tempSceneDirectory + slaveName <<<<<<<<<<, tempScenePrefix + tempSceneTag + tempSceneExtension )
if IsRunningOnWindows():
self.TempSceneFilename = self.TempSceneFilename.replace( "/", "\\" )
else:
self.TempSceneFilename = self.TempSceneFilename.replace( "\\", "/" )
CheckPathMappingInFileAndReplaceSeparator( sceneFilename, self.TempSceneFilename, "\\", "/" )
else:
if IsRunningOnWindows():
self.TempSceneFilename = sceneFilename.replace( "/", "\\" )
else:
self.TempSceneFilename = sceneFilename.replace( "\\", "/" )
#self.FinishedFrameCount = 0
#SetStatusMessage( "Rendering frame " + str(GetStartFrame()) )
def PostRenderTasks( self ):
if GetBooleanConfigEntryWithDefault( "EnablePathMapping", True ):
File.Delete( self.TempSceneFilename )[/code]
Try getting the “SlaveName” property instead of the “MachineName” property.
slaveName = SlaveUtils.GetCurrentSlaveInfoValue('MachineName')
I think that should do the trick…
Just added a bit of create directory code and we’re up and running.
Thanks again Ryan!