Skip to content

Commit

Permalink
HUE-874 [oozie] Direct access to MR logs
Browse files Browse the repository at this point in the history
Workflow Dashboard page, add a MR logs JobBrowser link to each Oozie launcher
Fix Jobbrowser tests from HUE-873
Clean-up spacing of urls.py
  • Loading branch information
romainr committed Nov 7, 2012
1 parent 2732b43 commit 73a7db7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 41 deletions.
8 changes: 4 additions & 4 deletions apps/jobbrowser/src/jobbrowser/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,6 @@ def test_kill_job(self):
(hadoop_job_id, early_task_id, attempt_id))
assert_true('syslog' in response.content)

# Test job single logs page
response = self.client.get('/jobbrowser/jobs/%s/job_single_logs' % (hadoop_job_id))
assert_true('syslog' in response.content)

# Test dock jobs
response = self.client.get('/jobbrowser/dock_jobs/')
assert_false('completed' in response.content)
Expand Down Expand Up @@ -342,3 +338,7 @@ def test_job(self):
# Select by text
response = self.client.get('/jobbrowser/jobs/%s/tasks?tasktext=clean' % (hadoop_job_id,))
assert_true(len(response.context['page'].object_list), 1)

# Test job single logs page
response = self.client.get('/jobbrowser/jobs/%s/single_logs' % (hadoop_job_id))
assert_true('syslog' in response.content)
42 changes: 19 additions & 23 deletions apps/jobbrowser/src/jobbrowser/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,23 @@

urlpatterns = patterns('jobbrowser.views',
# "Default"
url(r'^$','jobs'),
url(r'^trackers$','trackers',name='trackers'),
url(r'^trackers/(?P<trackerid>.+)$','single_tracker',name='single_tracker'),
url(r'^jobs/$','jobs',name='jobs'),
url(r'^dock_jobs/$','dock_jobs',name='dock_jobs'),
url(r'^jobs/(?P<jobid>\w+)$','single_job',name='single_job'),
url(r'^jobs/(?P<jobid>\w+)/counters$','job_counters',name='job_counters'),
url(r'^jobs/(?P<jobid>\w+)/kill$','kill_job',name='kill_job'),
url(r'^jobs/(?P<jobid>\w+)/setpriority$','set_job_priority',name='set_job_priority'),
url(r'^jobs/(?P<jobid>\w+)/single_logs$','job_single_logs',name='job_single_logs'),
url(r'^jobs/(?P<jobid>\w+)/tasks$','tasks',name='tasks'),
url(r'^jobs/(?P<jobid>\w+)/tasks/(?P<taskid>\w+)$','single_task',name='single_task'),
url(r'^jobs/(?P<jobid>\w+)/tasks/(?P<taskid>\w+)/attempts/(?P<attemptid>\w+)$',
'single_task_attempt',name='single_task_attempt'),
url(r'^jobs/(?P<jobid>\w+)/tasks/(?P<taskid>\w+)/attempts/(?P<attemptid>\w+)/counters$',
'task_attempt_counters',name='task_attempt_counters'),
url(r'^jobs/(?P<jobid>\w+)/tasks/(?P<taskid>\w+)/attempts/(?P<attemptid>\w+)/logs$',
'single_task_attempt_logs',name='single_task_attempt_logs'),
url(r'^jobs/(\w+)/tasks/(\w+)/attempts/(?P<attemptid>\w+)/kill$',
'kill_task_attempt',name='kill_task_attempt'),
url(r'^clusterstatus$', 'clusterstatus',name='clusterstatus'),
url(r'^queues$', 'queues',name='queues'),
url(r'^jobbrowser$','jobbrowser',name='jobbrowser'),
url(r'^$', 'jobs'),
url(r'^trackers$', 'trackers', name='trackers'),
url(r'^trackers/(?P<trackerid>.+)$', 'single_tracker', name='single_tracker'),
url(r'^jobs/$', 'jobs', name='jobs'),
url(r'^dock_jobs/$', 'dock_jobs', name='dock_jobs'),
url(r'^jobs/(?P<jobid>\w+)$','single_job', name='single_job'),
url(r'^jobs/(?P<jobid>\w+)/counters$', 'job_counters', name='job_counters'),
url(r'^jobs/(?P<jobid>\w+)/kill$', 'kill_job', name='kill_job'),
url(r'^jobs/(?P<jobid>\w+)/setpriority$', 'set_job_priority', name='set_job_priority'),
url(r'^jobs/(?P<jobid>\w+)/single_logs$', 'job_single_logs', name='job_single_logs'),
url(r'^jobs/(?P<jobid>\w+)/tasks$','tasks', name='tasks'),
url(r'^jobs/(?P<jobid>\w+)/tasks/(?P<taskid>\w+)$', 'single_task', name='single_task'),
url(r'^jobs/(?P<jobid>\w+)/tasks/(?P<taskid>\w+)/attempts/(?P<attemptid>\w+)$', 'single_task_attempt', name='single_task_attempt'),
url(r'^jobs/(?P<jobid>\w+)/tasks/(?P<taskid>\w+)/attempts/(?P<attemptid>\w+)/counters$', 'task_attempt_counters', name='task_attempt_counters'),
url(r'^jobs/(?P<jobid>\w+)/tasks/(?P<taskid>\w+)/attempts/(?P<attemptid>\w+)/logs$', 'single_task_attempt_logs', name='single_task_attempt_logs'),
url(r'^jobs/(\w+)/tasks/(\w+)/attempts/(?P<attemptid>\w+)/kill$', 'kill_task_attempt', name='kill_task_attempt'),
url(r'^clusterstatus$', 'clusterstatus', name='clusterstatus'),
url(r'^queues$', 'queues', name='queues'),
url(r'^jobbrowser$', 'jobbrowser', name='jobbrowser'),
)
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ ${ layout.menubar(section='dashboard') }
<table class="table table-striped table-condensed selectable">
<thead>
<tr>
<th>${ _('Logs') }</th>
<th>${ _('Id') }</th>
<th>${ _('Name') }</th>
<th>${ _('Type') }</th>
Expand All @@ -192,6 +193,11 @@ ${ layout.menubar(section='dashboard') }
<tbody>
% for i, action in enumerate(oozie_workflow.get_working_actions()):
<tr>
<td>
% if action.externalId:
<a href="${ url('jobbrowser.views.job_single_logs', jobid=action.externalId) }" data-row-selector-exclude="true"><i class="icon-tasks"></i></a>
% endif
</td>
<td>
<a href="${ url('oozie:list_oozie_workflow_action', action=action.id) }" data-row-selector='true'>${ action.id }</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,46 @@
<%namespace name="graph" file="workflow-graph.xml.mako" />
<%namespace name="utils" file="../../utils.inc.mako" />

<%!
from django.utils.translation import ugettext as _
%>

<%def name="print_status_node(form)">
<%
is_fork = form.instance.get_full_node().node_type == 'fork'
action = actions.get(form.instance.__unicode__())
%>
% if form.instance.get_full_node().is_visible():
<div class="row-fluid">
<div class="span12 action
% if not is_fork and form.instance.__unicode__() in actions:
% if not is_fork and action:
action-link
${ utils.get_status(actions[form.instance.__unicode__()].status) }
" data-edit="${ url('oozie:list_oozie_workflow_action', action=actions[form.instance.__unicode__()].id) }
${ utils.get_status(action.status) }
" data-edit="${ url('oozie:list_oozie_workflow_action', action=action.id) }
% endif
">
<div>
% if not is_fork:
${ form.instance.__unicode__() }
% endif
</div>
<div class="row-fluid">
${ form.instance.node_type }<br/>
% if not is_fork:
${ form.instance.description }<br/>
% if form.instance.__unicode__() in actions:
${ actions[form.instance.__unicode__()].errorMessage or '' }
<div class="span10">
<div>
% if not is_fork:
${ form.instance.__unicode__() }
% endif
</div>
<div class="row-fluid">
${ form.instance.node_type }<br/>
% if not is_fork:
${ form.instance.description }<br/>
% if action:
${ action.errorMessage or '' }
% endif
% endif
</div>
</div>
<div class="span2">
% if action and action.externalId:
<a href="${ url('jobbrowser.views.job_single_logs', jobid=action.externalId) }" data-row-selector-exclude="true" id="advanced-btn">
<i class="icon-tasks"></i> ${ _('View the logs') }
</a>
% endif
</div>
</div>
Expand Down

0 comments on commit 73a7db7

Please sign in to comment.