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
    })
Beispiel #2
0
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, 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})
Beispiel #4
0
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})
Beispiel #5
0
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
    })
Beispiel #6
0
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
    })
Beispiel #7
0
 def get_job_link(self, jobid):
     return JobLinkage(self.jt, jobid)