[core] desc.node: Use the process environment for the nodes' execution

This commit is contained in:
Candice Bentéjac 2025-06-12 11:42:05 +02:00
parent 7fc3727c7b
commit 3ae5a44666

View file

@ -277,17 +277,19 @@ class CommandLineNode(BaseNode):
return MrNodeType.COMMANDLINE
def buildCommandLine(self, chunk):
cmdPrefix = ""
cmdSuffix = ""
cmdPrefix = chunk.node.nodeDesc.plugin.processEnv.getCommandPrefix()
cmdSuffix = chunk.node.nodeDesc.plugin.processEnv.getCommandSuffix()
if chunk.node.isParallelized and chunk.node.size > 1:
cmdSuffix = " " + self.commandLineRange.format(**chunk.range.toDict())
cmdSuffix = cmdSuffix + " " + self.commandLineRange.format(**chunk.range.toDict())
return cmdPrefix + chunk.node.nodeDesc.commandLine.format(**chunk.node._cmdVars) + cmdSuffix
def processChunk(self, chunk):
cmd = self.buildCommandLine(chunk)
# TODO: Setup runtime env
self.executeChunkCommandLine(chunk, cmd)
runtimeEnv = chunk.node.nodeDesc.plugin.processEnv.getEnvDict()
print(runtimeEnv["PATH"])
self.executeChunkCommandLine(chunk, cmd, env=runtimeEnv)
# Specific command line node for AliceVision apps