[Durian-svn] [4446] updates to renderfarm scripts from myself and brecht

campbell institute at blender.org
Thu Jun 3 16:38:14 CEST 2010


Revision: 4446
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=4446
Author:   campbell
Date:     2010-06-03 16:38:14 +0200 (Thu, 03 Jun 2010)
Log Message:
-----------
updates to renderfarm scripts from myself and brecht

Modified Paths:
--------------
    frm/blender_setup.py
    frm/master_avi_gen.py
    frm/master_ui.py
    frm/new_master.py
    frm/new_node_update_movie.sh
    frm/slideshow/preview_images_update.py

Modified: frm/blender_setup.py
===================================================================
--- frm/blender_setup.py	2010-06-03 14:36:59 UTC (rev 4445)
+++ frm/blender_setup.py	2010-06-03 14:38:14 UTC (rev 4446)
@@ -27,7 +27,7 @@
     return ip
 
 ip = get_ip()
-fpath = bpy.data.filename
+fpath = bpy.data.filepath
 fname = os.path.splitext(os.path.basename(fpath))[0]
 scene_current = bpy.context.scene
 

Modified: frm/master_avi_gen.py
===================================================================
--- frm/master_avi_gen.py	2010-06-03 14:36:59 UTC (rev 4445)
+++ frm/master_avi_gen.py	2010-06-03 14:38:14 UTC (rev 4446)
@@ -4,6 +4,7 @@
 import time
 import new_blend_2_frames
 from render_dirs import FARM_DIR
+import time
 
 
 
@@ -75,7 +76,7 @@
                 skip = True
 
         if not skip:
-            cmd = "ssh -p 22 %s@%s '%s -b -P %s -- %s %s'" % (user, ip, BIN, SCRIPT, image_dir, blendfile)
+            cmd = "ssh -p 22 %s@%s '%s -b -P %s -- %s %s; sync'" % (user, ip, BIN, SCRIPT, image_dir, blendfile)
 
             print(cmd)
             try:
@@ -83,6 +84,9 @@
             except:
                 os.system("rm %s" % os.path.join(image_dir, avi))
 
+    # wait for nfs, sync command above also helps hopefully
+    time.sleep(10)
+
     os.system("svn up " + os.path.join(FARM_DIR, "ani/render"))
 
     commit_files = ""

Modified: frm/master_ui.py
===================================================================
--- frm/master_ui.py	2010-06-03 14:36:59 UTC (rev 4445)
+++ frm/master_ui.py	2010-06-03 14:38:14 UTC (rev 4446)
@@ -51,7 +51,7 @@
 ############################ Jobs ########################
 
 class Job:
-    priority_types = ('Low', 'Medium', 'High', 'Critical')
+    priority_types = ('Low', 'Medium', 'High', 'Critical', 'Final')
     quality_types = ('Final 4K', 'Final 2K', 'Final 1K', 'Final 0.5k', 'Preview 1K', 'NoShading 1K', 'Simplified 1K')
     status_types = ('Disabled', 'In Progress', 'Done!')
 
@@ -89,14 +89,16 @@
             JOBS = []
     
     def sortkey(self):
-        if self.priority == 'Critical':
+        if self.priority == 'Final':
             return 0
+        elif self.priority == 'Critical':
+            return 1
         elif self.priority == 'High':
-            return 1
+            return 2
         elif self.priority == 'Medium':
-            return 2
+            return 3
         else:
-            return 3
+            return 4
 
 def job_set_enabled(id, enabled):
     # slaves executing a job will detect that it is disabled in the
@@ -361,7 +363,7 @@
                 checkbox('job_set_enabled', job.id, job.enabled)
                 output("</td>\n")
                 output("<td>" + job.id + "</td>\n")
-                output("<td>" + job.revision + "</td>\n")
+                output("<td>HEAD</td>\n") #" + job.revision + "</td>\n")
                 output("<td>" + job.quality + "</td>\n")
                 if job.status=='Disabled':
                         output("<td id='status-disabled'>" + job.status + "</td>\n")

Modified: frm/new_master.py
===================================================================
--- frm/new_master.py	2010-06-03 14:36:59 UTC (rev 4445)
+++ frm/new_master.py	2010-06-03 14:38:14 UTC (rev 4446)
@@ -132,7 +132,7 @@
 
     return kill_non_critical
 
-def job_find(slaves_state):
+def job_find(slaves_state, do_finals):
     # get enabled jobs sorted by priority
     sorted_jobs = []
 
@@ -144,6 +144,9 @@
 
     # get unfinished frame from sorted jobs
     for job in sorted_jobs:
+        if job.priority == 'Final' and not do_finals:
+            continue
+
         # list images for this job
         blendfile_abs = os.path.join(FARM_DIR, job.id)
 
@@ -305,9 +308,11 @@
             del slaves_state[slave.ip]
             changed = True
 
+        i = 0
         for slave in slaves:
             # retrieve state
             slave_job, slave_frame, slave_func_nr = slaves_state[slave.ip]
+            i += 1
 
             # detect if job got disabled or if another critical job takes
             # priority, and if so, stop it so other jobs can be started
@@ -336,7 +341,8 @@
 
             # find a new job
             if slave.enabled and slave_func_nr == 0:
-                slave_job, slave_frame = job_find(slaves_state)
+                do_finals = i/float(len(slaves)) > 0.5
+                slave_job, slave_frame = job_find(slaves_state, do_finals)
 
             if slave_job:
                 # call next update function

Modified: frm/new_node_update_movie.sh
===================================================================
--- frm/new_node_update_movie.sh	2010-06-03 14:36:59 UTC (rev 4445)
+++ frm/new_node_update_movie.sh	2010-06-03 14:38:14 UTC (rev 4446)
@@ -6,18 +6,21 @@
 SVN_IP="192.168.1.14"
 
 DIR="/media/data/durian_farm_svn"
+# temporarily use HEAD for the sim REV=$1
+REV="HEAD"
 
-echo "Updating SVN Production Files" > $BUSY
+echo "Updating SVN Production Files to "$REV > $BUSY
 
 if [ -d $DIR/pro ]; then
 	cd $DIR/pro
 	svn cleanup --config-dir=$FARM_DIR/svn_config
+    # TEMP DISABLE, for physics bake
 	svn revert --config-dir=$FARM_DIR/svn_config -R .
-	$FARM_DIR/new_node_command.sh svn up --config-dir=$FARM_DIR/svn_config --force -r$1
+	$FARM_DIR/new_node_command.sh svn up --config-dir=$FARM_DIR/svn_config --force -r$REV
 else
 	mkdir -p $DIR
-	# $FARM_DIR/new_node_command.sh svn co --config-dir=$FARM_DIR/svn_config --force -r$1 svn://$SVN_IP/durian/pro $DIR/pro
-    $FARM_DIR/new_node_command.sh svn co --config-dir=$FARM_DIR/svn_config --force -r$1 file:///svnroot/durian/pro $DIR/pro
+	# $FARM_DIR/new_node_command.sh svn co --config-dir=$FARM_DIR/svn_config --force -r$REV svn://$SVN_IP/durian/pro $DIR/pro
+    $FARM_DIR/new_node_command.sh svn co --config-dir=$FARM_DIR/svn_config --force -r$REV file:///svnroot/durian/pro $DIR/pro
 fi
 
 rm $BUSY

Modified: frm/slideshow/preview_images_update.py
===================================================================
--- frm/slideshow/preview_images_update.py	2010-06-03 14:36:59 UTC (rev 4445)
+++ frm/slideshow/preview_images_update.py	2010-06-03 14:38:14 UTC (rev 4446)
@@ -7,7 +7,7 @@
 CONVERT = "/shared/software/durian_farm/slideshow/exr_to_png.sh %s %s %d > /dev/null 2> /dev/null"
 PNG_FILE = "/shared/software/durian_farm/slideshow/preview"
 NUM_IMAGES = 2
-SLEEP = 360.0
+SLEEP = 60.0
 
 def remote_command(cmd, ip="192.168.1.202", user="root", passwd="guest"):
     cmd_final = "ssh -n -p 22 %s@%s 'umask 002 ; %s'" % (user, ip, cmd)
@@ -27,7 +27,10 @@
             for file in files:
                 if file.endswith('.exr'):
                     name = os.path.join(root, file)
-                    st = os.stat(name)
+                    try:
+                        st = os.stat(name)
+                    except OSError:
+                        continue
 
                     if st.st_size > 10:
                         exr_files += [(name, st.st_mtime)]



More information about the Durian-svn mailing list