Submit Deadline job
#1
Hi

I am trying to send "export particles" to deadline but I get an error "Job Submission FAILED. Deadline not detected"

3ds max 2020
Deadline 10
tyFlow v0.16113

Do you know what the problem could be?

I would like to make several versions of the simulation and run them on computers on a deadline - is it possible?

greetings
T_O
  Reply
#2
tyFlow uses the Thinkbox-provided path retrieval method, which looks for the system environment variable called "DEADLINE_PATH" in order to find where the Deadline repository exists. Inside that directory it also accesses the files "deadlinecommand.exe" and "deadlinecommandbg.exe" so those files must also exist in that root path.

Please make sure your system env vars are configured correctly to point to the proper Deadline location.
  Reply
#3
Correction:

"DEADLINE_PATH" should point to the deadline bin folder, not the repo.
  Reply
#4
Here is the script tyFlow uses to find Deadline. Perhaps it can help you debug your situation:

Code:
fn tf_waitForCommandToComplete params timeOutInSec outputFile exitCodeFile =
(
    local result = -2
    
    BinDir = systemTools.getEnvVariable( "DEADLINE_PATH" ) + "\\" --we grab the path to the binaries from the Windows Env. variable introduced in Deadline 7    
    DeadlineExec = BinDir + "deadlinecommand.exe" --this is the deadlinecommand that returns results in memory
    DeadlineBGExec = BinDir + "deadlinecommandbg.exe" --this one writes the results to files on disk
    
    ShellLaunch DeadlineBGExec (" -outputfiles \""+outputFile+"\" \""+exitCodeFile+"\" " + params)
        
    local startTimeStamp = timestamp()
    local ready = false
    while not ready do
    (
        sleep 0.15
        
        if doesFileExist exitCodeFile do
        (
            local theFile = openFile exitCodeFile
            try(result = readValue theFile)catch(result = -2)
            try(close theFile)catch()
            ready = true
        )    
        if timestamp() - startTimeStamp > timeOutInSec*1000 then
        (
            result = -3
            ready = true
        )    
    )            

    return case result of
    (
        0: #success
        (-1): #failed
        (-2): #readerror
        (-3): #timeout
    )    
)
        
fn getDeadlineNetworkRoot =
(
    try
    (
        local submitOutputFile = sysInfo.tempdir + "submitOutput.txt"
        local submitExitCodeFile = sysInfo.tempdir + "submitExitCode.txt"
        
        deleteFile submitOutputFile
        deleteFile submitExitCodeFile
        
        local result = tf_waitForCommandToComplete "-getrepositoryroot" 10 submitOutputFile submitExitCodeFile
        
        if result == #success then
        (
            local resultFile = OpenFile submitOutputFile
            local resultMsg = ""
            if (resultFile != undefined) do
            (
                try(resultMsg = readLine resultFile)catch()
                try(close resultFile)catch()
            )
        
            return resultMsg
        )
    ) catch()
    undefined    
)

getDeadlineNetworkRoot()

"getDeadlineNetworkRoot()" returns a string which is the network path of your deadline repo. Try running that script and see if the result you get is correct.
  Reply
#5
Thanks for your help and quick reply.
Unfortunately, the script you provided does not work.

It only pops up:

tf_waitForCommandToComplete ()
getDeadlineNetworkRoot ()
""
  Reply
#6
Interesting...try this version...it prints out a bunch of debug text to the listener that will hopefully allow us to track down where it's going wrong on your system:

Code:
fn tf_waitForCommandToComplete params timeOutInSec outputFile exitCodeFile =
(
    local result = -2
    
    BinDir = systemTools.getEnvVariable( "DEADLINE_PATH" ) + "\\" --we grab the path to the binaries from the Windows Env. variable introduced in Deadline 7    
    DeadlineExec = BinDir + "deadlinecommand.exe" --this is the deadlinecommand that returns results in memory
    DeadlineBGExec = BinDir + "deadlinecommandbg.exe" --this one writes the results to files on disk
    
    
    print DeadlineExec
    if (DoesFileExist(DeadlineExec)) then (print "...found") else (print "...NOT found")
    
    print DeadlineBGExec
    if (DoesFileExist(DeadlineBGExec)) then (print "...found") else (print "...NOT found")
    
    theParams = (" -outputfiles \""+outputFile+"\" \""+exitCodeFile+"\" " + params)
    print ("Launching command: " + deadlineBGExec as string + " : " + theParams as string )
    ShellLaunch DeadlineBGExec theparams
        
    local startTimeStamp = timestamp()
    local ready = false
        
    print "\nWaiting for response..."
    while not ready do
    (
        sleep 0.15
        
        
        if doesFileExist exitCodeFile do
        (
            local theFile = openFile exitCodeFile
            try(result = readValue theFile)catch(result = -2)
            try(close theFile)catch()
            ready = true
            print "...exitCodeFile found"
        )    
        if (timestamp() - startTimeStamp > timeOutInSec*1000) or keyboard.escpressed then
        (
            result = -3
            ready = true
            
            print "...exitCodeFile NOT found within timeout period"
        )    
    )            

    
    print ("Result: " + result as string)
    
    return case result of
    (
        0: #success
        (-1): #failed
        (-2): #readerror
        (-3): #timeout
    )    
)
        
fn getDeadlineNetworkRoot =
(
    try
    (
        local submitOutputFile = sysInfo.tempdir + "submitOutput.txt"
        local submitExitCodeFile = sysInfo.tempdir + "submitExitCode.txt"
        
        deleteFile submitOutputFile
        deleteFile submitExitCodeFile
        
        if (not DoesFileExist(submitExitCodeFile)) then (print "exitCodeFile successfully cleared") else (print "exitCodeFile NOT cleared")
        
        local result = tf_waitForCommandToComplete "-getrepositoryroot" 10 submitOutputFile submitExitCodeFile
        
        print "\n"
        
        if result == #success then
        (
            local resultFile = OpenFile submitOutputFile
            local resultMsg = ""
            
            if (DoesFileExist(submitOutputFile)) then (print "...result file found") else (print "...result file NOT found")
                
            if (resultFile != undefined) do
            (
                try(resultMsg = readLine resultFile)catch()
                try(close resultFile)catch()
            )
        
            return resultMsg
        )
    ) catch(print (getcurrentexception()))
    undefined    
)

clearlistener()
getDeadlineNetworkRoot()
  Reply
#7
Thanks,
something like this came up:

"exitCodeFile successfully cleared"
"C: \ Program Files \ Thinkbox \ Deadline10 \ bin \ deadlinecommand.exe"
"... found"
"C: \ Program Files \ Thinkbox \ Deadline10 \ bin \ deadlinecommandbg.exe"
"... found"
"Launching command: C: \ Program Files \ Thinkbox \ Deadline10 \ bin \ deadlinecommandbg.exe: -outputfiles" C: \ Users \ d345a \ AppData \ Local \ Temp \ submitOutput.txt "" C: \ Users \ d345a \ AppData \ Local \ Temp \ submitExitCode.txt "-getrepositoryroot"
"
Waiting for response ... "
"... exitCodeFile found"
"Result: 0"
"
"
"... result file found"

Our IT contacted you and informed you that our deadline repository is not stored locally but on the server. The question is whether it can be changed somehow so that Tyflow looks for the repository elsewhere.
  Reply
#8
Repo being on a server is fine....but the issue seems to be that deadlinecommandbg.exe is not returning the repo location. That is a Thinkbox-provided exe that can be used to query Deadline setup info. So the fact that it's returning an empty string means something in your Deadline configuration is incorrect. You'll have to contact Thinkbox for further info.

To confirm, run the following line from the windows command prompt:

Code:
"C:\Program Files\Thinkbox\Deadline10\bin\deadlinecommandbg.exe" -outputfiles "C:\Users\d345a\AppData\Local\Temp\submitOutput.txt" "C:\Users\d345a\AppData\Local\Temp\submitExitCode.txt" -getrepositoryroot

Then look at the "submitOutput.txt" file that is created. Assuming the command completes successfully from the command prompt, the "submitOutput.txt" file should contain the network path to your Deadline repo. If it does not, then it's a Deadline setup issue and you'll have to contact Thinkbox about it. If it does contain the root, then let me know and we can go from there.
  Reply
#9
thanks,

I checked the script and the files are empty. I will repeat the question to be sure that we are talking about the same: is Tyflow able to send simulations to the deadline? so we have several Tyflow in the scene and click on the tyflow right mouse button> utilities> export all (daedline)> type: tycache

Will each tycache then be computed by another computer in a deadline?
  Reply
#10
Yes, that's the purpose of that function.
  Reply
#11
thanks for the help !

Everything works.

Question:
Is it possible to do an option in Tycache that will allow you to generate several tycaches with different settings? Something like houdini ...

That's how I see it:
- next to the options that can be edited in the operators, there is a field to mark that you want to randomize the parameter
- a field with this parameter appears in the tycache and next to it the range of values from which the randomization will be taken
- in the tycache there is a field to select the number of randomization / tyflow version

So when we click "submit deadline job" a tyflow with randomized parameters is generated and sent to the deadline, then the next tyflow is generated with new parameters .... and as many times as we want.

just asking ...Wink
  Reply


Forum Jump: