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)
This commit is contained in:
@@ -64,12 +64,21 @@ def testCancel(conn, job_id, frame_number):
|
||||
else:
|
||||
return False
|
||||
|
||||
def testFile(conn, job_id, slave_id, file_index, JOB_PREFIX, file_path, main_path = None):
|
||||
job_full_path = prefixPath(JOB_PREFIX, file_path, main_path)
|
||||
def testFile(conn, job_id, slave_id, rfile, JOB_PREFIX, main_path = None):
|
||||
job_full_path = prefixPath(JOB_PREFIX, rfile.filepath, main_path)
|
||||
|
||||
found = os.path.exists(job_full_path)
|
||||
|
||||
if found:
|
||||
found_signature = hashFile(job_full_path)
|
||||
found = found_signature == rfile.signature
|
||||
|
||||
if not found:
|
||||
print("Found file %s at %s but signature mismatch!" % (rfile.filepath, job_full_path))
|
||||
|
||||
if not os.path.exists(job_full_path):
|
||||
if not found:
|
||||
temp_path = JOB_PREFIX + "slave.temp.blend"
|
||||
conn.request("GET", fileURL(job_id, file_index), headers={"slave-id":slave_id})
|
||||
conn.request("GET", fileURL(job_id, rfile.index), headers={"slave-id":slave_id})
|
||||
response = conn.getresponse()
|
||||
|
||||
if response.status != http.client.OK:
|
||||
@@ -126,14 +135,14 @@ def render_slave(engine, netsettings, threads):
|
||||
job_path = job.files[0].filepath # path of main file
|
||||
main_path, main_file = os.path.split(job_path)
|
||||
|
||||
job_full_path = testFile(conn, job.id, slave_id, 0, JOB_PREFIX, job_path)
|
||||
job_full_path = testFile(conn, job.id, slave_id, job.files[0], JOB_PREFIX)
|
||||
print("Fullpath", job_full_path)
|
||||
print("File:", main_file, "and %i other files" % (len(job.files) - 1,))
|
||||
engine.update_stats("", "Render File "+ main_file+ " for job "+ job.id)
|
||||
|
||||
for rfile in job.files[1:]:
|
||||
print("\t", rfile.filepath)
|
||||
testFile(conn, job.id, slave_id, rfile.index, JOB_PREFIX, rfile.filepath, main_path)
|
||||
testFile(conn, job.id, slave_id, rfile, JOB_PREFIX, main_path)
|
||||
|
||||
# announce log to master
|
||||
logfile = netrender.model.LogFile(job.id, slave_id, [frame.number for frame in job.frames])
|
||||
@@ -178,6 +187,10 @@ def render_slave(engine, netsettings, threads):
|
||||
# (only need to update on one frame, they are linked
|
||||
conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
|
||||
response = conn.getresponse()
|
||||
|
||||
# Also output on console
|
||||
if netsettings.slave_thumb:
|
||||
print(str(stdout, encoding='utf8'), end="")
|
||||
|
||||
stdout = bytes()
|
||||
|
||||
@@ -194,6 +207,17 @@ def render_slave(engine, netsettings, threads):
|
||||
process.terminate()
|
||||
continue # to next frame
|
||||
|
||||
# flush the rest of the logs
|
||||
if stdout:
|
||||
# Also output on console
|
||||
if netsettings.slave_thumb:
|
||||
print(str(stdout, encoding='utf8'), end="")
|
||||
|
||||
# (only need to update on one frame, they are linked
|
||||
conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
|
||||
if conn.getresponse().status == http.client.NO_CONTENT:
|
||||
continue
|
||||
|
||||
total_t = time.time() - start_t
|
||||
|
||||
avg_t = total_t / len(job.frames)
|
||||
@@ -202,13 +226,6 @@ def render_slave(engine, netsettings, threads):
|
||||
|
||||
print("status", status)
|
||||
|
||||
# flush the rest of the logs
|
||||
if stdout:
|
||||
# (only need to update on one frame, they are linked
|
||||
conn.request("PUT", logURL(job.id, first_frame), stdout, headers=headers)
|
||||
if conn.getresponse().status == http.client.NO_CONTENT:
|
||||
continue
|
||||
|
||||
headers = {"job-id":job.id, "slave-id":slave_id, "job-time":str(avg_t)}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user