示例#1
0
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
        })
示例#2
0
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
    })
示例#3
0
文件: views.py 项目: acnithin/hue
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})
示例#4
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})
示例#5
0
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})
示例#6
0
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})
示例#7
0
文件: views.py 项目: shreepadma/hue
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})
示例#8
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
    })
示例#9
0
文件: views.py 项目: abayer/hue
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
    })
示例#10
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
        })
示例#11
0
文件: views.py 项目: ConduitTeam/hue
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
    })