[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28479] trunk/blender/release/scripts/io/ netrender: NetRender:
Martin Poirier
theeth at yahoo.com
Wed Apr 28 03:54:13 CEST 2010
Revision: 28479
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28479
Author: theeth
Date: 2010-04-28 03:54:12 +0200 (Wed, 28 Apr 2010)
Log Message:
-----------
NetRender:
- multires cache files and image .tex cache support in dependency list
- Compare md5 of files before using a local copy (not one transfered by netrender). Could be changed to a simpler CRC if speed is an issue. The goal is not to have a strong crypto signature but just to detect outdated local files.
- Reduce slave timeout to 5 minutes (down from 30). Slaves should report at most every 30s, there's no reason for a value to be that high.
- Reorder the presentation tables on the main web page (job list is more important)
- Collapse dependency list by default on job page (only show main file and headers for other files, point cache and fluid cache)
- Slave option (default: True) to also output render log to the console (as well as the usual copy to the master)
Modified Paths:
--------------
trunk/blender/release/scripts/io/netrender/client.py
trunk/blender/release/scripts/io/netrender/master.py
trunk/blender/release/scripts/io/netrender/master_html.py
trunk/blender/release/scripts/io/netrender/model.py
trunk/blender/release/scripts/io/netrender/netrender.css
trunk/blender/release/scripts/io/netrender/slave.py
trunk/blender/release/scripts/io/netrender/ui.py
trunk/blender/release/scripts/io/netrender/utils.py
Modified: trunk/blender/release/scripts/io/netrender/client.py
===================================================================
--- trunk/blender/release/scripts/io/netrender/client.py 2010-04-27 22:46:04 UTC (rev 28478)
+++ trunk/blender/release/scripts/io/netrender/client.py 2010-04-28 01:54:12 UTC (rev 28479)
@@ -125,6 +125,10 @@
file_path = bpy.utils.expandpath(image.filename)
if os.path.exists(file_path):
job.addFile(file_path)
+
+ tex_path = os.path.splitext(file_path)[0] + ".tex"
+ if os.path.exists(tex_path):
+ job.addFile(tex_path)
###########################
# FLUID + POINT CACHE
@@ -144,6 +148,9 @@
addPointCache(job, object, modifier.domain_settings.point_cache_low, default_path)
if modifier.domain_settings.highres:
addPointCache(job, object, modifier.domain_settings.point_cache_high, default_path)
+ elif modifier.type == "MULTIRES" and modifier.external:
+ file_path = bpy.utils.expandpath(modifier.filename)
+ job.addFile(file_path)
# particles modifier are stupid and don't contain data
# we have to go through the object property
Modified: trunk/blender/release/scripts/io/netrender/master.py
===================================================================
--- trunk/blender/release/scripts/io/netrender/master.py 2010-04-27 22:46:04 UTC (rev 28478)
+++ trunk/blender/release/scripts/io/netrender/master.py 2010-04-28 01:54:12 UTC (rev 28479)
@@ -27,12 +27,16 @@
import netrender.master_html
class MRenderFile(netrender.model.RenderFile):
- def __init__(self, filepath, index, start, end):
- super().__init__(filepath, index, start, end)
+ def __init__(self, filepath, index, start, end, signature):
+ super().__init__(filepath, index, start, end, signature)
self.found = False
def test(self):
self.found = os.path.exists(self.filepath)
+ if self.found:
+ found_signature = hashFile(self.filepath)
+ self.found = self.signature == found_signature
+
return self.found
@@ -74,7 +78,7 @@
# special server properties
self.last_update = 0
self.save_path = ""
- self.files = [MRenderFile(rfile.filepath, rfile.index, rfile.start, rfile.end) for rfile in job_info.files]
+ self.files = [MRenderFile(rfile.filepath, rfile.index, rfile.start, rfile.end, rfile.signature) for rfile in job_info.files]
self.resolution = None
@@ -716,7 +720,7 @@
buf = self.rfile.read(length)
# add same temp file + renames as slave
-
+
f = open(file_path, "wb")
f.write(buf)
f.close()
@@ -875,7 +879,7 @@
self.job_id = 0
self.path = path + "master_" + str(os.getpid()) + os.sep
- self.slave_timeout = 30 # 30 mins: need a parameter for that
+ self.slave_timeout = 5 # 5 mins: need a parameter for that
self.balancer = netrender.balancing.Balancer()
self.balancer.addRule(netrender.balancing.RatingUsageByCategory(self.getJobs))
Modified: trunk/blender/release/scripts/io/netrender/master_html.py
===================================================================
--- trunk/blender/release/scripts/io/netrender/master_html.py 2010-04-27 22:46:04 UTC (rev 28478)
+++ trunk/blender/release/scripts/io/netrender/master_html.py 2010-04-28 01:54:12 UTC (rev 28479)
@@ -106,53 +106,6 @@
handler.send_head(content = "text/html")
head("NetRender")
- output("<h2>Master</h2>")
-
- output("""<button title="remove all jobs" onclick="clear_jobs();">CLEAR JOB LIST</button>""")
-
- startTable(caption = "Rules", class_style = "rules")
-
- headerTable("type", "enabled", "description", "limit")
-
- for rule in handler.server.balancer.rules:
- rowTable(
- "rating",
- checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
- rule,
- rule.str_limit() +
- """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
- )
-
- for rule in handler.server.balancer.priorities:
- rowTable(
- "priority",
- checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
- rule,
- rule.str_limit() +
- """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
- )
-
- for rule in handler.server.balancer.exceptions:
- rowTable(
- "exception",
- checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
- rule,
- rule.str_limit() +
- """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
- )
-
- endTable()
-
- output("<h2>Slaves</h2>")
-
- startTable()
- headerTable("name", "address", "last seen", "stats", "job")
-
- for slave in handler.server.slaves:
- rowTable(slave.name, slave.address[0], time.ctime(slave.last_seen), slave.stats, link(slave.job.name, "/html/job" + slave.job.id) if slave.job else "None")
-
- endTable()
-
output("<h2>Jobs</h2>")
startTable()
@@ -204,7 +157,54 @@
)
endTable()
+
+ output("<h2>Slaves</h2>")
+ startTable()
+ headerTable("name", "address", "last seen", "stats", "job")
+
+ for slave in handler.server.slaves:
+ rowTable(slave.name, slave.address[0], time.ctime(slave.last_seen), slave.stats, link(slave.job.name, "/html/job" + slave.job.id) if slave.job else "None")
+
+ endTable()
+
+ output("<h2>Configuration</h2>")
+
+ output("""<button title="remove all jobs" onclick="clear_jobs();">CLEAR JOB LIST</button>""")
+
+ startTable(caption = "Rules", class_style = "rules")
+
+ headerTable("type", "enabled", "description", "limit")
+
+ for rule in handler.server.balancer.rules:
+ rowTable(
+ "rating",
+ checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
+ rule,
+ rule.str_limit() +
+ """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
+ )
+
+ for rule in handler.server.balancer.priorities:
+ rowTable(
+ "priority",
+ checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
+ rule,
+ rule.str_limit() +
+ """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
+ )
+
+ for rule in handler.server.balancer.exceptions:
+ rowTable(
+ "exception",
+ checkbox("", rule.enabled, "balance_enable('%i', '%s')" % (id(rule), str(not rule.enabled))),
+ rule,
+ rule.str_limit() +
+ """<button title="edit limit" onclick="balance_edit('%i', '%s');">edit</button>""" % (id(rule), str(rule.limit)) if hasattr(rule, "limit") else " "
+ )
+
+ endTable()
+
output("</body></html>")
elif handler.path.startswith("/html/job"):
@@ -235,13 +235,17 @@
tot_cache = 0
tot_fluid = 0
+ rowTable(job.files[0].filepath)
+ rowTable("Other Files", class_style = "toggle", extra = "onclick='toggleDisplay(".other", "none", "table-row")'")
+
for file in job.files:
if file.filepath.endswith(".bphys"):
tot_cache += 1
elif file.filepath.endswith(".bobj.gz") or file.filepath.endswith(".bvel.gz"):
tot_fluid += 1
else:
- rowTable(file.filepath)
+ if file != job.files[0]:
+ rowTable(file.filepath, class_style = "other")
if tot_cache > 0:
rowTable("%i physic cache files" % tot_cache, class_style = "toggle", extra = "onclick='toggleDisplay(".cache", "none", "table-row")'")
@@ -257,9 +261,9 @@
endTable()
- output("<h2>Blacklist</h2>")
+ if job.blacklist:
+ output("<h2>Blacklist</h2>")
- if job.blacklist:
startTable()
headerTable("name", "address")
@@ -268,8 +272,6 @@
rowTable(slave.name, slave.address[0])
endTable()
- else:
- output("<i>Empty</i>")
output("<h2>Frames</h2>")
Modified: trunk/blender/release/scripts/io/netrender/model.py
===================================================================
--- trunk/blender/release/scripts/io/netrender/model.py 2010-04-27 22:46:04 UTC (rev 28478)
+++ trunk/blender/release/scripts/io/netrender/model.py 2010-04-28 01:54:12 UTC (rev 28479)
@@ -103,8 +103,9 @@
}
class RenderFile:
- def __init__(self, filepath = "", index = 0, start = -1, end = -1):
+ def __init__(self, filepath = "", index = 0, start = -1, end = -1, signature=0):
self.filepath = filepath
+ self.signature = signature
self.index = index
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list