def reparentJobs(self, jobs): """Moves the given jobs into this group @type jobs: list<opencue.wrappers.job.Job> @param jobs: The jobs to add to this group""" jobsToReparent = [] for job in jobs: if isinstance(job, opencue.wrappers.job.NestedJob): job = job.asJob() jobsToReparent.append(job.data) jobSeq = job_pb2.JobSeq(jobs=jobsToReparent) self.stub.ReparentJobs(job_pb2.GroupReparentJobsRequest(group=self.data, jobs=jobSeq), timeout=Cuebot.Timeout)
def dataSource(self, job, preload): """Returns job information structured as needed for the attributes list.""" if isinstance(job, opencue.wrappers.job.NestedJob): job = job.asJob() d = { "job": job.data.name, "id": opencue.util.id(job), "facility": job.data.facility, "os": job.data.os, "show": job.data.show, "shot": job.data.shot, "user": job.data.user, "state": str(job.data.state), "startTime": cuegui.Utils.dateToMMDDHHMM(job.data.start_time), "stopTime": cuegui.Utils.dateToMMDDHHMM(job.data.stop_time), "priority": { "group": job.data.group, "level": job.data.priority, "minCores": "%.02f" % job.data.min_cores, "maxCores": "%.02f" % job.data.max_cores, }, "outputs": {}, "frames": { "total": job.data.job_stats.total_frames, "waiting": job.data.job_stats.waiting_frames, "dead": job.data.job_stats.dead_frames, "eaten": job.data.job_stats.eaten_frames, "depend": job.data.job_stats.depend_frames, "succeeded": job.data.job_stats.succeeded_frames, "running": job.data.job_stats.running_frames }, "stats": { "avgFrameTime": cuegui.Utils.secondsToHHMMSS(job.data.job_stats.avg_frame_sec), "totalCoreSeconds": cuegui.Utils.secondsToHHMMSS( job.data.job_stats.total_core_sec), "renderedCoreSeconds": cuegui.Utils.secondsToHHMMSS( job.data.job_stats.rendered_core_sec), "failedCoreSeconds": cuegui.Utils.secondsToHHMMSS( job.data.job_stats.failed_core_sec), "remainingCoreSeconds": cuegui.Utils.secondsToHHMMSS( job.data.job_stats.remaining_core_sec) }, "resources": { "cores": "%02.f" % job.data.job_stats.reserved_cores, "maxRss": int(job.data.job_stats.max_rss) }, "__childOrder": [ "job", "id", "facility", "os", "show", "shot", "user", "state", "startTime", "stopTime", "outputs", "depends", "frames", "resources" ], "depends": getDependsForm(preload["depends"]) } ## In the layer outputs. if job.data.job_stats.total_layers < 20: for layer in job.getLayers(): outputs = layer.getOutputPaths() if not outputs: continue entry = {} d["outputs"][layer.data.name] = entry for num, output in enumerate(outputs): # Try to formulate a unique name the output. # pylint: disable=bare-except try: # Outline only puts outputs in as filespecs, # so we're just going to assume it is. rep = output.split("/")[-2] if rep in entry: rep = "%s #%d" % (rep, num) except: rep = "output #%d" % num # pylint: enable=bare-except entry[rep] = output return d