From: Gary Jaeger <gary@(email surpressed)>
Subject: log directory
   Date: Mon, 09 Jul 2007 15:01:44 -0400
Msg# 1596
View Complete Thread (9 articles) | All Threads
Last Next
when rendering maya scenes, by default the logs are written to the scene directory. rush will make a sub folder for each scene rendered. But when I choose a different place to store the logs, rush doesn't create the sub directory. Is this by design or a bug?


. . . . . . . . . . . .
Gary Jaeger // Core Studio
86 Graham Street, Suite 120
San Francisco, CA 94129
415 543 8140



   From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: log directory
   Date: Mon, 09 Jul 2007 15:08:44 -0400
Msg# 1597
View Complete Thread (9 articles) | All Threads
Last Next
Gary Jaeger wrote:
> when rendering maya scenes, by default the logs are written to the  
> scene directory. rush will make a sub folder for each scene rendered.  
> But when I choose a different place to store the logs, rush doesn't  
> create the sub directory. Is this by design or a bug?

	I think it's documented behavior; the little '?' help button
	next to the Log Directory field says:

"If you specify your own log directory, the directory must already exist."

	I could try to have it post a prompt if the directory doesn't
	exist asking the user if they want to create it.

-- 
Greg Ercolano, erco@(email surpressed)
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)

   From: Gary Jaeger <gary@(email surpressed)>
Subject: Re: log directory
   Date: Mon, 09 Jul 2007 15:18:09 -0400
Msg# 1598
View Complete Thread (9 articles) | All Threads
Last Next
On Jul 9, 2007, at 12:08 PM, Greg Ercolano wrote:

	I think it's documented behavior; the little '?' help button
	next to the Log Directory field says:

you're right, it's documented which I noticed after I sent the mail


"If you specify your own log directory, the directory must already exist."

	I could try to have it post a prompt if the directory doesn't
	exist asking the user if they want to create it.

actually, that's not the issue. Let's say I'm going to render "scene1.ma", "scene2.ma" and "scene3.ma"

If I leave the behavior as default, in the /Scenes directory I get:

"scene1.ma.log"
"scene2.ma.log"
"scene3.ma.log"

with the appropriate logs inside each directory. however, if point rush to create logs in a /logs directory that I create, rush will just start filling up that directory with log files. So no sub directories with scene name prefixes are created. I would like those to be created automatically just as they are if I leave it at the default.


. . . . . . . . . . . .
Gary Jaeger // Core Studio
86 Graham Street, Suite 120
San Francisco, CA 94129
(Tel# suppressed)
http://corestudio.com	



   From: Kym Watts <kwatts@(email surpressed)>
Subject: Re: log directory
   Date: Mon, 09 Jul 2007 15:37:22 -0400
Msg# 1599
View Complete Thread (9 articles) | All Threads
Last Next
Hey,

We had fun working this out when we moved our logs to a standard location.
As long as the base dir exists: "//sledgehammer1/share/rush/farmlogs/$project/renders/"
And then you use the "_%s" after say the jobname, it will create the log folder.

Thou we are injecting this information to an .in and submitting it via the command line to rush, so it may handle things differently.
ie:
    LogDirectory: //sledgehammer1/share/rush/farmlogs/project/renders/testrender_%s

Hope this helps.

Cheers
Kym

Gary Jaeger wrote:
[posted to rush.general]

On Jul 9, 2007, at 12:08 PM, Greg Ercolano wrote:

    I think it's documented behavior; the little '?' help button
    next to the Log Directory field says:

you're right, it's documented which I noticed after I sent the mail


"If you specify your own log directory, the directory must already exist."

    I could try to have it post a prompt if the directory doesn't
    exist asking the user if they want to create it.

actually, that's not the issue. Let's say I'm going to render "scene1.ma", "scene2.ma" and "scene3.ma"

If I leave the behavior as default, in the /Scenes directory I get:

"scene1.ma.log"
"scene2.ma.log"
"scene3.ma.log"

with the appropriate logs inside each directory. however, if  point rush to create logs in a /logs directory that I create, rush will just start filling up that directory with log files. So no sub directories with scene name prefixes are created. I would like those to be created automatically just as they are if I leave it at the default.


. . . . . . . . . . . .
Gary Jaeger // Core Studio
86 Graham Street, Suite 120
San Francisco, CA 94129
(Tel# suppressed)
http://corestudio.com   



   From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: log directory
   Date: Mon, 09 Jul 2007 16:15:07 -0400
Msg# 1601
View Complete Thread (9 articles) | All Threads
Last Next
Kym Watts wrote:
> Hey,
> 
> We had fun working this out when we moved our logs to a standard location.
> As long as the base dir exists: 
> "//sledgehammer1/share/rush/farmlogs/$project/renders/"
> And then you use the "_%s" after say the jobname, it will create the log 
> folder. 
> [..]
>  LogDirectory: //sledgehammer1/share/rush/farmlogs/project/renders/testrender_%s

	Yes, the newer submit scripts will handle that %s correctly,
	replacing the %s with the jobid of the job, and creating the
	resulting directory automatically, so that the /jobid/ is encoded
	into the log directory's pathname.

	The %s thing is handled internally by Rush to avoid the catch-22
	situation where you can't know the jobid until you submit the job,
	but can't submit the job with the jobid in the path until you know
	the jobid. By handling this internally, Rush correctly times the
	creation of the pathname and directory.

	More info on the '%s' trick here:
	http://www.seriss.com/rush-current/rush/rush-submit-cmds.html#LogDir

	The %s trick works in most cases without any modification to the
	submit scripts, except in special cases where certain scripts try
	to save scene info into the log directory before the job is submitted.
	In that case the %s trick won't work, or has to be handled carefully.

	However, to get what Gary was requesting, where the scene filename
	gets inserted into the log directory as opposed to the jobid.. that
	code snippet I sent him should do the trick.

-- 
Greg Ercolano, erco@(email surpressed)
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)

   From: Antoine Durr <antoine@(email surpressed)>
Subject: Re: log directory
   Date: Tue, 10 Jul 2007 00:59:35 -0400
Msg# 1602
View Complete Thread (9 articles) | All Threads
Last Next
On 2007-07-09 13:15:07 -0700, Greg Ercolano <erco@(email surpressed)> said:

Kym Watts wrote:
Hey,

We had fun working this out when we moved our logs to a standard location.
As long as the base dir exists:
"//sledgehammer1/share/rush/farmlogs/$project/renders/"
And then you use the "_%s" after say the jobname, it will create the log
folder.
[..]
LogDirectory: //sledgehammer1/share/rush/farmlogs/project/renders/testrender_%s

	Yes, the newer submit scripts will handle that %s correctly,
	replacing the %s with the jobid of the job, and creating the
	resulting directory automatically, so that the /jobid/ is encoded
	into the log directory's pathname.


It would be nice if all the submit scripts had a call in them to go determine the place for Rush logs, and the setting of which were all in a single file that had entries for each type of submission. I found that in doing the above, namely moving logs to a standard location, I ended up with very similar code in multiple submit scripts. It would be (IMO) cleaner to already have done that, and in that secondary perl module, provide different ways of locating the log files. It's just that not every shop should have to recode the same thing.

-- Antoine

Floq FX Inc.
10839 Washington Blvd.
Culver City, CA 90232
310/430-2473


   From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: log directory
   Date: Tue, 10 Jul 2007 13:38:49 -0400
Msg# 1603
View Complete Thread (9 articles) | All Threads
Last Next
Antoine Durr wrote:
> It would be nice if all the submit scripts had a call in them to go 
> determine the place for Rush logs, and the setting of which were all in 
> a single file that had entries for each type of submission.

	At one point I had a $G::logdir variable in the .common.pl
	file that one could set where all jobs would dump their logs.

	So if that variable was set, it would use that directory
	instead of the subdirectory where the scene files are located..
	using jobids encoded into the log directory filenames.

	Thing is, I had to back it out, because there were some technical
	issues that caused problems; can't remember what they were at
	the moment.. I think it had to do with how some of the scripts
	save setting files into the log directory before the job is submitted,
	preventing the jobid trick from working. My solution was going to
	be to submit the job in the paused state, so that the jobid encoded
	filename could then be used to save the info file, then the job
	unpaused. But then there were sticky situations about unpausing
	a job that might have been submitted in the 'pause' or 'wait' state,
	and it started getting too complicated.. so I backed it out.

> that in doing the above, namely moving logs to a standard location, I 
> ended up with very similar code in multiple submit scripts.  It would 
> be (IMO) cleaner to already have done that, and in that secondary perl 
> module, provide different ways of locating the log files.  It's just 
> that not every shop should have to recode the same thing.

	I have to be careful that whatever I implement doesn't have ill
	effects on the other features of the system.

	I'll have to revisit it, as I think I've made some changes in the
	core that might make the above $G::logdir stuff possible.

-- 
Greg Ercolano, erco@(email surpressed)
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)

   From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: log directory
   Date: Mon, 09 Jul 2007 16:00:37 -0400
Msg# 1600
View Complete Thread (9 articles) | All Threads
Last Next
Gary Jaeger wrote:
> if [I] point rush to create logs in a /logs directory that I create, rush will  
> just start filling up that directory with log files. So no sub  
> directories with scene name prefixes are created.

	Correct; if you type in a path, then it uses that exact path
	to the logs.. no frills.

> I would like those [scene specific directories]
> to be created automatically just as they are if I leave it at the  
> default.

	I see.

	There would need to be a way to do both, since some folks
	would want it to be the exact path specified, others would
	want the behavior you're requesting.

	I could set it up so that you can append on a suffix to the
	log directory (like %scene%) so that it automatically tacks on
	the scene file's basename.

	So for instance, the user would specify:

//some/path/logs/%scene%

	..and assuming the '//some/path/logs/' directory existed,
	the submit script would automatically replace %scene% with
	the scene's basename, and create that directory, e.g:

//some/path/to/logs/my_scene.log/

	..and then would submit the job to use that.

	You can definitely tweak the submit script to do this.
	For instance, try making a copy of your production submit-maya.pl script,
	and edit the copy by finding these lines:

--- snip
    # LOGDIR BASED ON SCENE PATH
    if ( $in{LogDirectory} eq "" )
--- snip

	..and /insert/ the following code between the two lines:

--- snip
    if ( $in{LogDirectory} =~ s/[\/\\]%scene%[\s]*$/\// )
    {
        # HANDLE A CUSTOM LOG DIRECTORY WITH %scene% SUFFIX
        if ( ! -d $in{LogDirectory} )
        {
            print STDERR "$in{LogDirectory}: does not exist ".
                         "(please create it first)\n";
            exit(1);
        }
        # PARSE OUT THE BASENAME OF THE SCENE FILENAME,
        if ( $in{ScenePath} =~ m%[\\/]([^/\\]*$)% )
            { $in{LogDirectory} .= "$1.log"; }
        if ( ! -d $in{LogDirectory} )
        {
            unless ( mkdir($in{LogDirectory}, 0777) )
            {
                print STDERR "mkdir($in{LogDirectory}): $!\n" .
                            "Can't make log directory.\n";
                exit(1);
            }
            # WINDOWS: OPEN ACLS FOR THE LOG DIRECTORY
            if ( $G::iswindows )
            {
                my $dirname = $in{LogDirectory}; $dirname =~ s%/%\\%g;
                system("cacls $dirname /e /c /g everyone:f");
            }
        }
    }
--- snip

	..worked for me! ;)

-- 
Greg Ercolano, erco@(email surpressed)
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)

   From: Gary Jaeger <gary@(email surpressed)>
Subject: Re: log directory
   Date: Thu, 12 Jul 2007 17:10:59 -0400
Msg# 1604
View Complete Thread (9 articles) | All Threads
Last Next
works a treat! my scene directories are all nice and clean once again.

On Jul 9, 2007, at 1:00 PM, Greg Ercolano wrote:

	..and /insert/ the following code between the two lines:



. . . . . . . . . . . .
Gary Jaeger // Core Studio
86 Graham Street, Suite 120
San Francisco, CA 94129
(Tel# suppressed)
http://corestudio.com