def buildLayer(layerData, command, lastLayer=None): """Create a PyOutline Layer for the given layerData. @type layerData: ui.Layer.LayerData @param layerData: layer data from the ui @type command: str @param command: command to run @type lastLayer: outline.layer.Layer @param lastLayer: layer that this new layer should be dependent on if dependType is set. """ if float(layerData.cores) >= 2: threadable = True else: threadable = False layer = Shell(layerData.name, command=command.split(), chunk=layerData.chunk, threads=float(layerData.cores), range=str(layerData.layerRange), threadable=threadable) if layerData.services: layer.set_service(layerData.services[0]) if layerData.dependType and lastLayer: if layerData.dependType == 'Layer': layer.depend_all(lastLayer) else: layer.depend_on(lastLayer) return layer
def buildLayer(layerData, command): """Create a PyOutline Layer for the given layerData. @type layerData: ui.Layer.LayerData @param layerData: layer data from the ui @type command: str @param command: command to run """ layer = Shell(layerData.name, command=command.split(), chunk=layerData.chunk, threads=float(layerData.cores), range=str(layerData.layerRange)) if layerData.dependType and layerData.dependsOn: if layerData.dependType == 'Layer': layer.depend_all(layerData.dependsOn) else: layer.depend_all(layerData.dependsOn) return layer
# SUBMIT ############################################################ outline = Outline(jobData['name'], shot=jobData['shot'], show=jobData['show'], user=jobData['username']) layers = [] for layerData in jobData['layers']: layer = Shell(layerData.name, command=layerData.cmd.split(), chunk='1', threads=float(layerData.cores), range=str(layerData.layerRange), threadable=True) layer.set_service(layerData.services[0]) layers.append(layer) layer_count = 0 for layer in layers: if layer_count > 0: layer.depend_all(layers[layer_count - 1]) layer_count += 1 outline.add_layer(layer) jobs = cuerun.launch(outline, use_pycuerun=False, pause=True) for job in jobs: print(job.name()) job.setPriority(10) job.setMaxCores(1500) job.setMaxRetries(3)