Rush Logo Rush Render Queue - The rush/etc/path_convert file
V 103.07b 05/11/16
(C) Copyright 2008, 2016 Seriss Corporation. All rights reserved.
(C) Copyright 1995,2000 Greg Ercolano. All rights reserved.




   File Format Description  
The path_convert file should be customized by the systems administrator.

This file can optionally be used to help rush do pathname translations from one platform to another, and to create drive mappings on windows machines for the Rushd service.

Path conversions specified here will be applied both for rush's internal use (eg. in rewriting job logdir paths) and for use by external scripts via the 'rush -pathconvert' command.

The path_convert file can be updated on the fly; simply edit a copy, make changes, then rename over the master file, and use 'rush -push path_convert +any' to send the changes to all the machines, and they'll pick up the changes within a minute. To force the daemons to reload the file right away, you can follow up with 'rush -reload path_convert +any".

Blank lines and lines that start with '#' are ignored.

Synopsis

      path_convert Synopsis
      
            <prefix>    path_convert  "//from/path"   "//to/path"         
            <prefix>    drive_map     "z:"            "//some/unc"
              

Where <prefix> is optional, and typically one of the commands in the examples shown below:

Example File

      path_convert Example File
      
          # Pathname conversions
          os=mac	path_convert   "//ourserver/jobs"   "/Volumes/jobs"
          os=mac	path_convert   "/ourserver/jobs"    "/Volumes/jobs"
          os=linux	path_convert   "//ourserver/jobs"   "/ourserver/jobs"
          os=linux	path_convert   "//Volumes/jobs"     "/ourserver/jobs"
          os=windows	path_convert   "/ourserver/jobs"    "//ourserver/jobs"
          os=windows	path_convert   "/Volumes/jobs"      "//ourserver/jobs"
      
          # Drive mappings
          os=windows	drive_map    "x:"  "//ourserver/output"
          os=windows	drive_map    "y:"  "//ourserver/admin"
          os=windows	drive_map    "z:"  "//ourserver/jobs"
              

If <prefix> is not specified, the commands will be run unconditionally on all platforms, which is probably fine if the commands result in proper pathname conversions on all the platforms you're using.

   Command Prefixes  

Prefixes

You can prefix any of the lines in path_convert with 'os=xxx', where 'xxx' can be any of:
    os=windows  -- Windows: NT, 2000, etc.
    os=unix     -- Unix: irix, linux, mac
    os=irix     -- Irix only
    os=mac      -- Mac only
    os=linux    -- Linux only
    os=all      -- All platforms
    
The 'os=xxx' prefix can be used to qualify the command to run only on the specified operating system. This way you can maintain one file, even though it has separate customizations for windows and unix operating systems. For example:
    os=windows  path_convert    "/some/path"    "//some/path"
    os=windows  drive_map       "z:"            "//some/path"
    os=unix     path_convert    "//some/path"   "/some/path"
    os=unix     path_convert    "z:"            "/some/path"
    os=all      path_convert    '//some/old"    "//some/new"
    
..which runs the first two commands only on windows machines, the second two commands on unix machines (mac or linux or sgi), and the last command on ALL machines.

Similarly, you can prefix any path_convert command with 'host=yyy' where yyy is either a hostname or a +hostgroup that the rest of the line should run on, eg:

    host=geneva   path_convert   "/Volumes/share"    "/some/path"
    host=+soft    path_convert   "/software"         "/ourserver/software"
    

You can also have the path_convert commands execute depending on the rush version number using the "version>=", "version<=", "version>" or "version<" prefixes, eg:

    version>=103.00   path_convert "/from" "/to"     # runs on versions greater or equal to 103.00
    version<=103.00   path_convert "/from" "/to"     # runs on versions less or equal to 103.00
    version>103.00    path_convert "/from" "/to"     # runs on versions greater than 103.00
    version<103.00    path_convert "/from" "/to"     # runs on versions less than 103.00
    
To make changes to this file and update this to the network, use either 'rush -push path_convert +any', or rdist/rsync/rcp commands.

   path_convert "/from/path" "/to/path"  

    "path_convert" provides a way to tell rush how to transform pathnames on that machine from one format to another, and the settings are used both internally by the rush daemon to rewrite job's logdir on each machine just before running the render, and can also be used by shell scripts (perl/python/sh/csh, etc) via the 'rush -pathconvert' command line command.

    The format of this command is:

            path_convert "/from/path" "/to/path"
        

      Note: backslashes are escape characters inside the quotes (to allow for escaping double quotes, e.g. \"). This means to specify a backslash, you have to specify two. So to specify \\ourserver\foo you'd need to actually specify "\\\\ourserver\\foo" in the path_convert command.

    For instance, let's say we have a farm of linux and windows. We want pathnames on linux to be "/ourserver/jobs", and on on Windows we want that same path to be "//ourserver/jobs". So then we'd add the following settings (shown in red) to the rush/etc/path_convert file:

        rush/etc/path_convert
        
            # Example rush/etc/path_convert file.
            # For documentation on this file's format, see:
            # http://seriss.com/rush.103.00/rush-files.html#path_convert
            # [..snip..]
            #### ADD YOUR PATHCONVERT FILE COMMANDS BELOW THIS LINE ###
            os=linux	path_convert "//ourserver/jobs"	"/ourserver/jobs"
            os=windows	path_convert "/ourserver/jobs"	"//ourserver/jobs"
                

    You would the use 'rush -push path_convert +any' to push that change to the network. Both the Perl and Python 103.xx submit scripts automatically run paths through the path conversions in this file.

    You can test how paths are converted with the 'rush -pathconvert /some/path' command, or use that command in scripts to convert paths.

    For example, using the above example, the 'rush -pathconvert' command will give these results on a Windows machine:

        	C:\> rush -pathconvert /ourserver/jobs/scenes/foo.ma
    	//ourserver/jobs/scenes/foo.ma
    
        	C:\> rush -pathconvert //ourserver/jobs/scenes/foo.ma
    	//ourserver/jobs/scenes/foo.ma
        

    ..and these results on a Linux machine:

        	fred@linux-r021 $ rush -pathconvert /ourserver/jobs/scenes/foo.ma
    	/ourserver/jobs/scenes/foo.ma
    
        	fred@linux-r021 $ rush -pathconvert //ourserver/jobs/scenes/foo.ma
    	/ourserver/jobs/scenes/foo.ma
        

    Let's also say that on Macs we want a pathname like /Volumes/jobs to be converted to "//ourserver/jobs", then we would also add this line (shown in red) to the path_convert file:

        rush/etc/path_convert
        
            # Example rush/etc/path_convert file.
            # For documentation on this file's format, see:
            # http://seriss.com/rush.103.00/rush-files.html#path_convert
            # [..snip..]
            #### ADD YOUR PATHCONVERT FILE COMMANDS BELOW THIS LINE ###
            os=linux	path_convert "//ourserver/jobs"	"/ourserver/jobs"
            os=windows	path_convert "/ourserver/jobs"	"//ourserver/jobs"
            os=all      path_convert "/Volumes/jobs"    "//ourserver/jobs"
                

    Scripting

    Scripts can use 'rush -pathconvert' to normalize pathnames. For instance, in perl:

      Perl example using 'rush -pathconvert'

              #!/usr/bin/perl
      	my $infile = "/ourserver/jobs/scenes/foo.ma";
      	print "BEFORE: '$infile'\n";	
      	$infile = `rush -pathconvert $infile`; chomp($infile);    # convert the pathname    
      	print " AFTER: '$infile'\n";
          

    With the above example path_convert file, on Windows, the above would print:

            BEFORE: '/ourserver/jobs/scenes/foo.ma'
    	 AFTER: '//ourserver/jobs/scenes/foo.ma'
        

    A python equivalent of the above would be:

      Python example using 'rush -pathconvert'

      	#!/usr/bin/env python
      	import os,sys
      	infile = "/ourserver/jobs/scenes/foo.ma"
      	print("BEFORE: '%s'" % infile)
      	infile = os.popen("rush -pathconvert " + infile).read().rstrip('\r\n')    # convert the pathname    
      	print(" AFTER: '%s'" % infile)
          

    This should give the same results as the perl script.

    And finally, an example in a csh script:

      Csh example using 'rush -pathconvert'

              #!/bin/csh -f
      	set infile = /ourserver/jobs/scenes/foo.ma
      	echo "BEFORE: '$infile'"
      	set infile = `rush -pathconvert $infile`    # convert the pathname    
      	echo " AFTER: '$infile'"
          

    This should give the same results as the perl and python scripts.

   drive_map "z:" "//unc/path"  

    "drive_map" is for windows only, and creates drive mappings when the rushd service boots* via the PreRenderInit() function in the Perl .common.pl file and the Python RushSiteSettings.py file. So for instance, the following lines in path_convert:

    	  os=windows	drive_map	"x:"	"//ourserver/output"
    	  os=windows	drive_map	"y:"	"//ourserver/admin"
    	  os=windows	drive_map	"z:"	"//ourserver/jobs"
        

    ..will cause the Rushd service* the Perl/Python PreRenderInit() function to create the following 3 drive mappings when the service starts* just before each render is started:

    	  NET USE x: \\ourserver\output /PERSISTENT:YES
    	  NET USE y: \\ourserver\admin /PERSISTENT:YES
    	  NET USE z: \\ourserver\jobs /PERSISTENT:YES
        

    * NOTE: strike out text in the above paragraphs indicates features intended to be included that haven't actually been implemented yet as of this release.

      Note: backslashes are escape characters inside the quotes (to allow for escaping double quotes, e.g. \"). This means to specify a backslash, you have to specify two. So to specify \\ourserver\jobs you'd need to actually specify "\\\\ourserver\\jobs" in the path_convert command.