On 12/16/11 13:33, Greg Ercolano wrote:
On 12/16/11 13:13, Mr. Daniel Browne wrote:
Is it possible to establish the log directory within the render portion =
of a rush script? I'm trying to set up for Nuke jobs to generate =
separate log dirs per job ID, but of course the job ID isn't assigned =
until you run the "rush -submit" command. I wasn't sure if the log =
directory had to be settled on before you issue a submit, so I thought =
I'd ask.
[Hmm, thought I'd add some clarification to that last
post..]
[added text in green, and
emphasis in red --erco]
Hi Dan,
There's two common ways of doing this:
1) Add the '%s' suffix to the "logdir" pathname during submit;
the '%s' will be replaced with the jobid on submit,
and rush will create the resulting dir for you, and
will use it as the logdir for the job. Details here:
http://www.seriss.com/rush-current/rush/rush-submit-cmds.html#LogDir
- OR -
2) Submit the job in the /pause/ state, get the jobid,
create the dir with the jobid returned, assign the job
the new logdir path you want with "rush -logdir"
and then unpause the job with "rush -cont"
#1 is probably the best approach, and certainly easiest.
So for instance:
rush -submit << EOF
..
logdir /some/path/%s
..
EOF
..assuming the directory "/some/path/" exists, rush will expand
"%s" into the jobid, and then runs a mkdir() on the expanded pathname
to create the subdir before the job actually starts running, and uses
that as the final log directory for the job.
So for instance, using the above example, if the jobid turns out
to be 'tahoe.34', then the resulting logdir pathname will be
"/some/path/tahoe.34", and rush will create that as a directory
and use it as the logdir for the job.
The logic for this %s expansion and mkdir() is all in the
rush core, not the submit scripts.
So what you can do is in the MAIN_Submit() section of the script,
you can modify the code that determines the "LogDir" default
(which is normally to create it based on the scene filename)
and use your own path with the '%s' added instead.
Warning: jobids are recycled, so they aren't guaranteed to
be unique once a job is dumped.
The other way to do it would be to submit the job in the paused
state, eg:
rush -submit << EOF
..
state pause
..
EOF
.. that get your jobid after it submits while the job is paused,
do your directory creation logic with the jobid in the submit script,
change the logdir with 'rush -logdir /new/path/whatever' with the jobid
in it, then use 'rush -cont <JOBID>' to kick the job running.
I think the %s technique is easier though.. but depends on what
you want in your directory logic.
--
Greg Ercolano, erco@(email surpressed)
Seriss Corporation
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)ext.23
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)