execution_inspect.jinja2 4.08 KB
Newer Older
Daniele Venzano's avatar
Daniele Venzano committed
1
{% extends "base_user.jinja2" %}
2
{% block title %}Inspect execution {{ e.name }}{% endblock %}
3 4

{% block custom_head %}
5 6
    <script src="{{ static_url("moment.min.js") }}" type="application/javascript"></script>
    <script src="{{ static_url("moment-timezone.min.js") }}" type="application/javascript"></script>
7
    <script>
Daniele Venzano's avatar
Daniele Venzano committed
8
    let locale = window.navigator.userLanguage || window.navigator.language;
9 10
    moment.locale(locale);

11 12 13
    function format_timestamp(ts) {
        var m = moment.utc(ts);
        m.local();
14
        document.write(m.format("L, LTS"));
15 16 17 18
    }
    </script>
{% endblock %}

19
{% block content %}
20
<h2>Detailed information for execution {{ e.name }} ({{ e.id }})</h2>
21 22 23
<div id="contents">
<ul>
    <li>Application name: {{ e.description['name'] }}</li>
Daniele Venzano's avatar
Daniele Venzano committed
24
    {% if user.role.can_operate_others %}
25
    <li>Owner: {{ e.owner.username }}</li>
26
    {% endif %}
27 28 29 30 31 32 33 34 35 36 37
    <li>Time submitted: <script>format_timestamp("{{ e.time_submit }}")</script></li>
    {% if e.time_start == None %}
    <li>Time started: not yet</li>
    {% else %}
    <li>Time started: <script>format_timestamp("{{ e.time_start }}")</script></li>
    {% endif %}
    {% if e.time_end == None %}
    <li>Time finished: not yet</li>
    {% else %}
    <li>Time finished: <script>format_timestamp("{{ e.time_end }}")</script></li>
    {%  endif %}
38
    <li>Status: <span style="font-weight: bold;">{{ e.status }}</span></li>
39
    {% if e.is_running %}
40
    <li>Will be killed at: <script>format_timestamp("{{ killed_at }}")</script></li>
41
    <li>Actions:
42
        <a href="{{ reverse_url("execution_terminate", e.id) }}">Terminate</a>
43
    </li>
44 45
    {% elif e.status == "terminated" %}
    <li>Actions:
46
        <a href="{{ reverse_url("execution_restart", e.id) }}">Restart</a>
47 48
    </li>
    {% endif %}
49 50 51 52 53
    {% if grafana_url is defined %}
    <li>
        <a href="{{ grafana_url }}">Resource usage plots</a>
    </li>
    {% endif %}
54 55 56 57
</ul>
{% if e.status == 'error' %}
<p>Error message: <code>{{ e.error_message }}</code></p>
{% endif %}
58 59 60
{% if e.status == 'terminated' %}
<p>Termination reason: <code>{{ e.error_message }}</code></p>
{% endif %}
61

62 63 64 65
<div id="endpoints">
<h3>Endpoints</h3>
{% if endpoints|length > 0 %}
<ul>
66
{% for endp in endpoints|sort %}
67
    {% if endp[2] != None %}
68
        <li><a href="{{ endp[2] }}" target="_blank">{{ endp[0] }}</a> (<a href="{{ endp[1] }}" target="_blank" title="Direct connection without proxy, works only in Eurecom">internal link</a>)</li>
69
    {% else %}
70
    <li><a href="{{ endp[1] }}" target="_blank">{{ endp[0] }}</a> ({{ endp[1] }})</li>
71
    {% endif %}
72 73 74
{% endfor %}
</ul>
{% else %}
75 76
    {% if e.status == "running" %}
        <p>This execution does not have any active endpoint</p>
77
    {% elif e.status == "submitted" or e.status == "starting" or e.status == "queued" %}
78 79 80 81
        <p>Please wait, the execution is starting up. This page will refresh automatically.</p>
    {% else %}
        <p>No endpoints are available</p>
    {% endif %}
82 83 84
{% endif %}
</div>

85 86 87 88
<div id="container_list">
{% if services_info|length > 0 %}
<h3>Services:</h3>
{% endif %}
89 90 91 92 93 94 95 96
<table class="service-list">
    <thead>
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Zoe status</th>
        <th>Backend status</th>
        <th>Host</th>
97
        <th>Labels</th>
98 99 100 101 102 103 104 105 106 107 108 109
        <th>Output logs</th>
        <th>Errors</th>
    </tr>
    </thead>
    <tbody>
    {% for s in services_info %}
        <tr>
            <td>{{ s['id'] }}</td>
            <td>{{ s['name'] }}</td>
            <td>{{ s['status'] }}</td>
            <td>{{ s['backend_status'] }}</td>
            <td>{{ s['backend_host'] }}</td>
110
            <td>{% for l in s['labels'] %}{{ l }} {% endfor %}</td>
111 112 113 114 115
            {% if s['status'] != 'created' %}
            <td><a href="{{ reverse_url("service_logs", s['id']) }}">open</a></td>
            {% else %}
            <td></td>
            {% endif %}
116 117 118 119 120 121
            <td>{{ s['error_message'] }}</td>
        </tr>
    {% endfor %}

    </tbody>
</table>
122 123 124
</div>

</div>
125
{% if e.status != 'terminated' %}
126 127 128 129 130 131
<script>
    function refresh_page() {
        document.location.reload();
    }
    setInterval(refresh_page, 15000);
</script>
132
{% endif %}
133
{% endblock %}