Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
Fix #271: Add job history details
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson committed May 23, 2017
1 parent db02ed4 commit 9d1e291
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions atmo/jobs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ class SparkJobRun(EditedAtModel):

class Meta:
get_latest_by = 'created_at'
ordering = ['-created_at']

__str__ = autostr('{self.jobflow_id}')

Expand Down
33 changes: 33 additions & 0 deletions atmo/templates/atmo/jobs/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ <h2>
<a href="#notebook" class="btn btn-sm btn-default active" aria-controls="notebook" role="tab" data-toggle="tab">Notebook</a>
<a href="#results" class="btn btn-sm btn-default" aria-controls="results" role="tab" data-toggle="tab">Results</a>
<a href="#logs" class="btn btn-sm btn-default" aria-controls="logs" role="tab" data-toggle="tab">Logs</a>
<a href="#runs" class="btn btn-sm btn-default" aria-controls="runs" role="tab" data-toggle="tab">Runs</a>
</div>
<div class="btn-group"
role="group"
Expand Down Expand Up @@ -163,6 +164,38 @@ <h4>
{% endfor %}
</ul>
</div>
<div role="tabpanel" class="tab-pane" id="runs">
{% if spark_job.has_never_run %}
<p>No job run history yet.</p>
{% else %}
<table class="table table-striped">
<thead>
<tr>
<th>Jobflow ID</th>
<th>EMR version</th>
<th>Cluster size</th>
<th>Last status</th>
<th>Scheduled</th>
<th>Ran</th>
<th>Finished</th>
</tr>
</thead>
<tbody>
{% for run in spark_job.runs.all %}
<tr>
<td><a href="https://{{ settings.AWS_CONFIG.AWS_REGION }}.console.aws.amazon.com/elasticmapreduce/home?region={{ settings.AWS_CONFIG.AWS_REGION }}#cluster-details:{{ run.jobflow_id }}">{{ run.jobflow_id }}</a></td>
<td>{{ run.emr_release_version }}</td>
<td>{{ run.size|default:"n/a" }}</td>
<td>{{ run.status }}</td>
<td>{{ run.scheduled_date|default:"n/a" }}</td>
<td>{{ run.run_date|default:"n/a" }}</td>
<td>{{ run.finished_at|default:"n/a" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</div>
</div>
</div>
<div class="col-sm-3">
Expand Down

0 comments on commit 9d1e291

Please sign in to comment.