aboutsummaryrefslogtreecommitdiff
path: root/lava_scheduler_app/templates/lava_scheduler_app/job_definition.html
blob: 96ff412996a8139ab15fce3a9a44b803d3f660e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
{% extends "layouts/content-bootstrap.html" %}
{% load utils %}
{% block styles %}
  <link href="{{ STATIC_URL }}lava_scheduler_app/css/shCore.css" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_URL }}lava_scheduler_app/css/shThemeDefault.css" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_URL }}lava_scheduler_app/css/shThemeLAVA.css" rel="stylesheet" type="text/css" />
{% endblock styles %}

{% block content %}
<h2>Job definition file - {% if job.is_multinode %}{{ job.sub_id }}{% else %}{{ job.id }}{% endif %}
 <a class="btn btn-xs btn-info" href="{% url 'lava.scheduler.job.definition.plain' job.pk %}" title="Download as text file"><span class="glyphicon glyphicon-download"></span> download</a></h2>
{% if job.is_multinode %}
     {{ job.sub_id }} is part of a multinode job. Use the Multinode Definition to resubmit.
{% endif %}

<div class="row">
  <div class="col-md-4">
    <h4 class="modal-header">Device</h4>
    <dl class="dl-horizontal">
    {% if job.actual_device %}
      <dt>Name</dt>
      <dd><a href="{{ job.actual_device.get_absolute_url }}">{{ job.actual_device.hostname }}</a>{% if not job.is_vmgroup %} <a
      href="{% url 'lava.scheduler.device_report' job.actual_device.pk %}">(reports)</a>{% endif %}</dd>
    {% endif %}

    {% if job.requested_device %}
      <dt>Type</dt>
      <dd><a href="{{ job.requested_device.device_type.get_absolute_url }}">{{ job.requested_device.device_type }}</a>{% if not job.is_vmgroup %} <a
      href="{% url 'lava.scheduler.device_type_report' job.requested_device.device_type %}">(reports)</a>{% endif %}</dd>
    {% elif job.requested_device_type %}
      <dt>Requested type</dt>
      <dd><a href="{{ job.requested_device_type.get_absolute_url }}">{{ job.requested_device_type }}</a> <a href="{% url 'lava.scheduler.device_type_report' job.requested_device_type %}">(reports)</a></dd>
    {% endif %}
    </dl>
  </div>
  <div class="col-md-4">
    <h4 class="modal-header">Logs</h4>
    <div class="row">
      <div class="col-md-6">
        <ul class="nav nav-pills nav-stacked">
        {% if job_file_present %}
          <li><a href="{{ job.get_absolute_url }}" class="btn btn-primary">Summary</a></li>
        {% endif %}
        </ul>
      </div>
      <div class="col-md-6">
        <ul class="nav nav-pills nav-stacked">
        {% if job_file_present %}
          <li><a href="{% url 'lava.scheduler.job.log_file' job.pk %}" class="btn btn-primary">Complete log</a></li>
        {% endif %}
        {% if job.results_link %}
          <li><a href="{{ job.results_link }}" class="btn btn-success">Results Bundle</a></li>
        {% endif %}
        </ul>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <h4 class="modal-header">Actions</h4>
    <div class="row">
      <div class="col-md-6">
        <ul class="nav nav-pills nav-stacked">
        {% if show_resubmit and not job.is_multinode and not job.is_vmgroup %}
          <li><a href="{% url 'lava.scheduler.job.resubmit' job.pk %}" class="btn btn-default">Resubmit</a></li>
        {% endif %}
        {% if user.is_authenticated %}
        <li><a href="{% url 'lava.scheduler.job.toggle_favorite' job.pk %}"  class="btn btn-info">
            {% if is_favorite %}
              Remove from favorites
            {% else %}
              Add to favorites
            {% endif %}
        </a></li>
        {% endif %}
        </ul>
      </div>
      <div class="col-md-6">
        <ul class="nav nav-pills nav-stacked">
        {% if job.is_multinode %}
          <li><a href="{% url 'lava.scheduler.job.multinode_definition' job.pk %}" class="btn btn-info">Multinode Definition</a></li>
        {% elif job.is_vmgroup %}
           <li><a href="{% url 'lava.scheduler.job.vmgroup_definition' job.pk %}" class="btn btn-info">VMGroup Definition</a></li>
        {% endif %}
        </ul>
      </div>
    </div>
  </div>
</div>
{% if job.is_multinode or job.is_vmgroup %}
<div class="row">
  <div class="col-md-6">
    <h4 class="modal-header">Sub jobs</h4>
    <dl class="dl-horizontal">
    {% for subjob in job.sub_jobs_list %}
      <dt><a href="{% url 'lava.scheduler.job.detail' subjob.sub_id %}">{{ subjob.sub_id }}</a>
        {% if '0' in subjob.sub_id and '0' not in job.sub_id %}
            <abbr title="view job {{ subjob.sub_id }} to see the result bundle, if any.">(?)</abbr>
        {% endif %}
      </dt>
      <dd>
    {% if subjob.actual_device.hostname %}
      on: <a href="{{ subjob.actual_device.get_absolute_url }}">{{ subjob.actual_device.hostname }}</a>
      as: {{ subjob.device_role }}&nbsp;
    {% else %}
      No device assigned as {{ subjob.device_role }}.</dd>
    {% endif %}
      </dd>
    {% endfor %}
    </dl>
  </div>
</div>
{% endif %}

{% if job.is_pipeline %}
<ul class="nav nav-tabs">
  <li class="active"><a href="#YAML" data-toggle="tab">Definition</a></li>
  <li><a href="#pipeline" data-toggle="tab">Pipeline</a></li>
</ul>
<div class="tab-content">

  <div class="tab-pane active" id="YAML">
<h4 class="modal-header">Definition</h4>
<pre class="brush: js">{{ job.display_definition }}</pre>
 </div>
  <div class="tab-pane" id="pipeline">
      <h2>Pipeline Description <a
      class="btn btn-xs btn-info" href="{% url 'lava.scheduler.job.description.yaml' job.id %}"
       title="Download YAML description"><span class="glyphicon glyphicon-download"></span> YAML</a></h2>
       <p><a href="{{ STATIC_URL }}/docs/glossary.html#term-pipeline">Pipeline</a> jobs use
       the job definition to generate a descriptive YAML file when the pipeline is validated.
       The file represents the data sent to the dispatcher at the start of the job, including
       details of the device as well as the job parameters and the details of the parameters
       sent to each of the deploy, boot and test actions in the job pipeline.</p>
       <p>Click on the Action headings below to see some of the structural information
       from the description file for this job or download the complete file as YAML using
       the link above. The name of the action can be used to change the timeout of that
       specific action. e.g.</p>
  <pre>
timeouts:
  apply-overlay-image:
    minutes: 5</pre>
       <p>The information in this pane is based on the validation step prior to the job starting
       to run. This includes checks on remote URLs but does not operations which are only done at
       runtime. Therefore, the filesize of remote downloads can be displayed, based on the headers
       when checking that the URL was correct - checksums of the actual download will not appear
       as the actual download only happens after the job has started.</p>
  {% get_pipeline_levels pipeline as levels %}
  {% get_pipeline_sections pipeline as sections %}

    <h4 id="sections" class="modal-header">Sections</h4>
    <div class="row">
      <div class="col-md-6">
        <ul class="nav nav-pills">
  {% for item in sections %}
      {% for section, level in item.items %}
      <li><a href="#{{ level }}" class="btn btn-primary">{{ section }}</a></li>
      {% endfor %}
  {% endfor %}
        </ul>
      </div>
    </div>

<h2>Pipeline</h2>
{% for level, data in levels.items %}
  [ <a href="#sections">Sections</a> ] [ <a href="#action-list">List of actions</a> ]
      <h3 id="{{ level }}">{{ level }}: {{ data.summary }}</h3>
        <dl class="dl-horizontal">
            <dt>name</dt>
            <dd>{{ data.name }}</dd>
            <dt>description</dt>
            <dd>{{ data.description }}</dd>
        {% if data.timeout %}
            <dt>timeout</dt>{% comment %}
            add a link to help content of this topic
            {% endcomment %}
            <dd>{{ data.timeout.duration|floatformat:"0" }} seconds</dd>
        {% if data.url %}
            <dt>URL</dt>
            <dd>{{ data.url|urlize }}</dd>
        {% endif %}
        {% if data.size %}
            <dt>size</dt>
            <dd>{{ data.size|filesizeformat }}</dd>
        {% endif %}
        {% endif %}
        </dl>
  {% endfor %}

    <h2 id="action-list">Pipeline actions</h2>
  <ul>
  {% for level, data in levels.items %}
      <li><a href="#{{ level }}">{{ level }} {{ data.name }}</a></li>
  {% endfor %}
  </ul>
  <a href="#sections">Pipeline sections</a>


  </div>
</div>
{% else %}
<h4 class="modal-header">Definition</h4>
<pre class="brush: js">{{ job.display_definition }}</pre>
{% endif %}
{% endblock content %}

{% block scripts %}
<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/shCore.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/shBrushJScript.min.js"></script>

<script type="text/javascript">
  $(function() {
     SyntaxHighlighter.all();
  });
</script>
{% endblock scripts %}