def single_task_attempt_logs(request, jobid, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid/logs """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) try: attempt = task.get_attempt(attemptid) except KeyError: raise KeyError( _("Cannot find attempt '%(id)s' in task") % dict(id=attemptid)) try: # Add a diagnostic log diagnostic_log = ", ".join(task.diagnosticMap[attempt.attemptId]) logs = [diagnostic_log] # Add remaining logs logs += [section.strip() for section in attempt.get_task_log()] except TaskTrackerNotFoundException: # Four entries, # for diagnostic, stdout, stderr and syslog logs = [_("Failed to retrieve log. TaskTracker not found.")] * 4 return render( "attempt_logs.mako", request, { "attempt": attempt, "taskid": taskid, "joblnk": job_link, "task": task, "logs": logs })
def single_task_attempt_logs(request, jobid, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid/logs """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) try: attempt = task.get_attempt(attemptid) except KeyError: raise KeyError(_("Cannot find attempt '%(id)s' in task") % dict(id=attemptid)) try: # Add a diagnostic log diagnostic_log = ", ".join(task.diagnosticMap[attempt.attemptId]) logs = [ diagnostic_log ] # Add remaining logs logs += [ section.strip() for section in attempt.get_task_log() ] except TaskTrackerNotFoundException: # Four entries, # for diagnostic, stdout, stderr and syslog logs = [ _("Failed to retrieve log. TaskTracker not found.") ] * 4 return render("attempt_logs.mako", request, { "attempt":attempt, "taskid":taskid, "joblnk": job_link, "task": task, "logs": logs })
def single_task(request, jobid, taskid): """ We get here from /jobs/jobid/tasks/taskid """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) return render("task.mako", request, {'task': task, 'joblnk': job_link})
def task_attempt_counters(request, job, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid/counters (phew!) """ job_link = JobLinkage(request.jt, job.jobId) task = job_link.get_task(taskid) attempt = task.get_attempt(attemptid) counters = {} if attempt: counters = attempt.counters return render("counters.html", request, {'counters': counters})
def task_attempt_counters(request, jobid, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid/counters (phew!) """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) attempt = task.get_attempt(attemptid) counters = {} if attempt: counters = attempt.counters return render("counters.html", request, {'counters':counters})
def single_task_attempt(request, jobid, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) try: attempt = task.get_attempt(attemptid) except KeyError: raise KeyError(_("Cannot find attempt '%(id)s' in task") % dict(id=attemptid)) return render("attempt.mako", request, {"attempt": attempt, "taskid": taskid, "joblnk": job_link, "task": task})
def single_task_attempt(request, jobid, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) try: attempt = task.get_attempt(attemptid) except KeyError: raise KeyError( _("Cannot find attempt '%(id)s' in task") % dict(id=attemptid)) return render("attempt.mako", request, { "attempt": attempt, "taskid": taskid, "joblnk": job_link, "task": task })
def single_task_attempt(request, jobid, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) try: attempt = task.get_attempt(attemptid) except KeyError: raise KeyError("Cannot find attempt '%s' in task" % (attemptid,)) logs = [ section.strip() for section in attempt.get_task_log() ] return render("attempt.mako", request, { "attempt":attempt, "taskid":taskid, "joblnk": job_link, "task": task, "logs": logs })
def single_task_attempt(request, jobid, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) try: attempt = task.get_attempt(attemptid) except KeyError: raise KeyError("Cannot find attempt '%s' in task" % (attemptid, )) try: logs = [section.strip() for section in attempt.get_task_log()] except TaskTrackerNotFoundException: # Three entries for stdout, stderr and syslog logs = ["Failed to retrieve log. TaskTracker not found."] * 3 return render( "attempt.mako", request, { "attempt": attempt, "taskid": taskid, "joblnk": job_link, "task": task, "logs": logs })
def single_task_attempt(request, jobid, taskid, attemptid): """ We get here from /jobs/jobid/tasks/taskid/attempts/attemptid """ job_link = JobLinkage(request.jt, jobid) task = job_link.get_task(taskid) try: attempt = task.get_attempt(attemptid) except KeyError: raise KeyError("Cannot find attempt '%s' in task" % (attemptid,)) try: logs = [ section.strip() for section in attempt.get_task_log() ] except TaskTrackerNotFoundException: # Three entries for stdout, stderr and syslog logs = [ "Failed to retrieve log. TaskTracker not found." ] * 3 return render("attempt.mako", request, { "attempt":attempt, "taskid":taskid, "joblnk": job_link, "task": task, "logs": logs })