Commit 306bb4c1 authored by Christopher Gearhart's avatar Christopher Gearhart

Added GNU, improved 'frameRange' verification, added write permissions…

Added GNU, improved 'frameRange' verification, added write permissions verification, and removed 'samples on host' info
parent 462773b5
#!/usr/bin/env python
bl_info = {
"name" : "Server Farm Client",
"author" : "Christopher Gearhart <chris@bblanimation.com>",
"version" : (0, 7, 4),
"version" : (0, 7, 5),
"blender" : (2, 78, 0),
"description" : "Render your scene on a custom server farm with this addon.",
"location" : "View3D > Tools > Render",
......@@ -12,6 +10,28 @@ bl_info = {
"tracker_url" : "",
"category" : "Render"}
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
Created by Christopher Gearhart
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import bpy
from bpy.types import Operator
from bpy.props import *
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
Created by Christopher Gearhart
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import bpy
import subprocess
import os
import json
import io
import json
import os
import subprocess
import time
from bpy.types import Operator
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
Created by Christopher Gearhart
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import bpy
import subprocess
import os
import sys
import fnmatch
import itertools
import operator
import os
import subprocess
import sys
from .setupServers import *
def getFrames(projectName, archiveFiles=False, frameRange=False):
......@@ -47,16 +67,19 @@ def buildFrameRangesString(frameRanges):
for string in frameRangeList:
try:
newInt = int(string)
newFrameRangeList.append(newInt)
if newInt >= 0 and newInt <= 500000:
newFrameRangeList.append(newInt)
else:
return invalidDict
except:
if "-" in string:
newString = string.split("-")
if len(newString) > 2:
if len(newString) != 2:
return invalidDict
try:
newInt1 = int(newString[0])
newInt2 = int(newString[1])
if newInt1 <= newInt2:
if newInt1 <= newInt2 and newInt2 <= 500000:
newFrameRangeList.append([newInt1, newInt2])
else:
return invalidDict
......@@ -303,13 +326,12 @@ def updateServerPrefs():
else:
return newServerPrefs
if bpy.props.serverPrefs != oldServerPrefs:
# verify host server login, built from user entries, correspond to a responsive server
try:
subprocess.call("ssh -T -oBatchMode=yes -oStrictHostKeyChecking=no -x {login} 'echo hi'".format(login=bpy.props.serverPrefs["login"]), shell=True)
except:
return {"valid":False, "errorMessage":"ssh to '{login}' failed. Check your settings and ensure ssh keys are setup".format(login=bpy.props.serverPrefs["login"])}
# verify host server login, built from user entries, correspond to a responsive server, and that defined renderFarm path is writable
rc = subprocess.call("ssh -T -oBatchMode=yes -oStrictHostKeyChecking=no -oConnectTimeout=10 -x {login} 'mkdir -p {remotePath}; touch {remotePath}test'".format(login=bpy.props.serverPrefs["login"], remotePath=bpy.props.serverPrefs["path"]), shell=True)
if rc != 0:
return {"valid":False, "errorMessage":"ssh to '{login}' failed (return code: {rc}). Check your settings, ensure ssh keys are setup, and verify your write permissions for '{remotePath}' (see error in terminal)".format(login=bpy.props.serverPrefs["login"], rc=rc, remotePath=bpy.props.serverPrefs["path"])}
if bpy.props.serverPrefs != oldServerPrefs:
# initialize server groups enum property
groupNames = [("All Servers", "All Servers", "Render on all servers")]
for groupName in bpy.props.serverPrefs["servers"]:
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
import bpy, sys, os, numpy, fnmatch, time
Created by Christopher Gearhart
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import bpy
import fnmatch
import numpy
import os
from . import getRenderDumpFolder
def averageFrames(classObject, outputFileName, verbose=0):
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
Created by Christopher Gearhart
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import bpy
def jobIsValid(jobType, classObject):
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
import bpy, os, json
Created by Christopher Gearhart
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import bpy
import json
import os
def getLibraryPath():
# Full path to module directory
......@@ -49,10 +71,12 @@ def setupServerPrefs():
# set SSH login information for host server
try:
username = readFileFor(serverFile, "SSH USERNAME").replace("\"", "")
test = username[0] # fails if username is empty string
except:
return {"valid":False, "errorMessage":invalidEntry("SSH USERNAME")}
try:
hostServer = readFileFor(serverFile, "HOST SERVER").replace("\"", "")
test = hostServer[0] # fails if hostServer is empty string
except:
return {"valid":False, "errorMessage":invalidEntry("HOST SERVER")}
try:
......@@ -71,7 +95,7 @@ def setupServerPrefs():
return {"valid":False, "errorMessage":invalidEntry("HOST SERVER PATH")}
# format host server path
path = path.replace(" ", "_")
path = path.replace(" ", "_").replace("$username$", username)
if not path.endswith("/") and path != "":
path += "/"
......
......@@ -54,46 +54,29 @@ you're ready to render on your remote servers!
### BEGIN SSH USERNAME ###
cgearhar
### END SSH USERNAME ###
### BEGIN HOST SERVER ###
john
### END HOST SERVER ###
### BEGIN EXTENSION ###
.cse.taylor.edu
### END EXTENSION ###
### BEGIN HOST SERVER PATH ###
/tmp/renderFarm/
/tmp/renderFarm-$username$/
### END HOST SERVER PATH ###
### BEGIN REMOTE SERVERS DICTIONARY ###
{"cse217": [
"cse21701","cse21702","cse21703","cse21704","cse21705","cse21706",
"cse21707","cse21708","cse21709","cse21710","cse21711","cse21712",
"cse21713","cse21714","cse21715","cse21716"
],"cse218": [
"cse21801","cse21803","cse21804","cse21805","cse21806",
"cse21807","cse21808","cse21809","cse21810","cse21811","cse21812"
],"cse103": [
"cse10301","cse10302","cse10303","cse10304","cse10305","cse10306",
"cse10307","cse10308","cse10309","cse10310","cse10311","cse10312",
"cse10313","cse10314","cse10315","cse10316","cse10317","cse10318",
"cse10319","cse103podium"
],"cse201": [
"cse20101","cse20102","cse20103","cse20104","cse20105","cse20106",
"cse20107","cse20108","cse20109","cse20110","cse20111","cse20112",
"cse20113","cse20114","cse20115","cse20116","cse20117","cse20118",
"cse20119","cse20120","cse20121","cse20122","cse20123","cse20124"
]}
### END REMOTE SERVERS DICTIONARY ###
#!/usr/bin/python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
Created by Christopher Gearhart
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import bpy
import random
......
#!/usr/bin/python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
import threading
Created by Christopher Gearhart and Nathan White
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import telnetlib
import threading
import time
from supporting_methods import *
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
from JobHost import *
Created by Christopher Gearhart and Nathan White
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import time
from JobHost import *
class JobHostManager():
""" Manages and distributes jobs for all available hosts """
......
# system imports
import argparse
# Thanks to: http://stackoverflow.com/questions/6076690/verbose-level-with-argparse-and-multiple-v-options
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
Created by Christopher Gearhart and Nathan White
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
from __future__ import print_function
import argparse
import os
import fnmatch
import getpass
import sys
import subprocess
import telnetlib
import json
import os
import re
import fnmatch
import json
import signal
import subprocess
import sys
import telnetlib
from JobHost import *
from JobHostManager import *
from VerboseAction import verbose_action
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
import os
import sys
Created by Christopher Gearhart and Nathan White
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import json
import numpy
import os
import re
import shlex
import sys
import subprocess
import re
import numpy
def pflush(string):
""" Helper function that prints and flushes a string """
......
#!/usr/bin/env python
"""
Copyright (C) 2017 Bricks Brought to Life
http://bblanimation.com/
chris@bblanimation.com
Created by Christopher Gearhart
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
# system imports
import bpy
import math
from bpy.types import Panel
......@@ -61,24 +81,6 @@ class renderOnServersPanel(Panel):
if "animation" in scn.renderType:
row.operator("scene.open_rendered_animation", text="View Animation", icon="FILE_MOVIE")
def menu_draw(self, context):
layout = self.layout
scn = context.scene
if scn.render.engine == "CYCLES" and not scn.cycles.progressive == "BRANCHED_PATH":
# Basic Render Samples Info
col = layout.column(align=True)
row = col.row(align=True)
sampleSize = scn.cycles.samples
if scn.cycles.use_square_samples:
sampleSize = sampleSize**2
if sampleSize < 10:
row.label("Too few samples")
else:
row.label("Samples on Servers: {numSamples}".format(numSamples=str(math.floor(sampleSize*scn.availableServers))))
bpy.types.CyclesRender_PT_sampling.append(menu_draw)
class frameRangePanel(Panel):
bl_space_type = "VIEW_3D"
bl_region_type = "TOOLS"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment