blob: 214c7778318b667a32e2b42a233975d563302d88 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001{% extends "basebuilddetailpage.html" %}
2
3{% load projecttags %}
4{% load humanize %}
5
6{% block title %} {{task.recipe.name}}_{{task.recipe.version}} {{task.task_name}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster {% endblock %}
7{% block localbreadcrumb %}
8<li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
9<li>{{task.recipe.name}}_{{task.recipe.version}} {{task.task_name}}</li>
10{% endblock %}
11
12{% block pagedetailinfomain %}
13
14<div class="row">
15 <div class="col-md-12">
16 <div class="page-header build-data">
17 <h1><a href="{%url 'recipe' build.pk task.recipe.pk %}">{{task.recipe.name}}_{{task.recipe.version}}</a> {{task.task_name}}</h1>
18 </div>
19
20{# Outcome section #}
21<h2 {{ task|task_color:True }}>
22 {{task.get_outcome_display}}
23 <span class="glyphicon glyphicon-question-sign get-help" title="{{task.get_outcome_help}}"></i>
24</h2>
25{%if task.task_executed %}
26 {# executed tasks outcome #}
27 {% if task.logfile %}
28 <a class="btn btn-default btn-lg"
29 href="{% url 'build_artifact' build.id 'tasklogfile' task.pk %}">
30 Download task log
31 </a>
32 {% endif %}
33 {# show stack trace for failed task #}
34 {% if task.outcome == task.OUTCOME_FAILED and log_head %}
35 <h3>Python stack trace</h3>
36 <div>
37 <pre style="min-height:160px;">
38 <code>{{log_head}}</code><a id="full-trace-show" data-target="#fulltrace" data-toggle="collapse" class="btn btn-xs">...</a>
39 <div id="fulltrace" class="collapse" style="margin-top: -20px; height: 0px;">
40 <code>{{log_body}}</code><br><a id="full-trace-hide" class="btn btn-xs collapsed" style="font-family:Helvetica Neue" data-target="#fulltrace" data-toggle="collapse">Collapse stack trace<i class="icon-caret-up"></i></a></div></pre>
41 </div>
42 {% endif %}
43{% else %}
44{# not executed tasks outcome #}
45 {% if task.outcome == task.OUTCOME_PREBUILT %}
46 {% if not showing_matches %}
47 <a class="btn btn-default"
48 href="javascript:reload_params({'show_matches' : 'true'
49 })">Match to tasks in previous builds <span class="glyphicon
50glyphicon-question-sign get-help" title="This shows you a list of tasks from
51previous builds with the same signature generated from the same inputs as used
52in the prebuilt task. Any of them could be the task that generated the output
53this prebuilt task is reusing"></span></a>
54 {% elif matching_tasks %}
55 <h3 class="details">Prebuilt task could be based on
56 <span class="glyphicon glyphicon-question-sign get-help" title="This
57 table shows a list of tasks from previous builds with the
58 same signature generated from the same inputs as used in the
59 prebuilt task. Any of them could be the task that generated the
60 output this prebuilt task is reusing"></span>
61 </h3>
62 <div class="table-responsive">
63 <table class="table table-bordered table-hover">
64 <thead>
65 <th>
66 <span class="glyphicon glyphicon-question-sign
67 get-help" title="The name of the recipe to which
68 each task applies"></span>
69 Recipe
70 </th>
71 <th>
72 <span class="glyphicon glyphicon-question-sign get-help" title="The name
73 of the task"></span>
74 Task
75 </th>
76 <th>
77 <span class="glyphicon glyphicon-question-sign get-help" title="This
78 value tells you if a task had to run (executed) in
79 order to generate the task output, or if the output was
80 provided by another task and therefore the task didn't need
81 to run (not executed)"></span>
82 Executed
83 </th>
84 <th>
85 <span class="glyphicon glyphicon-question-sign
86 get-help" title="This column tells you if
87 'executed' tasks succeeded or failed. The column also
88 tells you why 'not executed' tasks did not need to
89 run"></span>
90 Outcome
91 </th>
92 <th>
93 <span class="glyphicon glyphicon-question-sign
94 get-help" title="The date and time the build
95 finished"></span>
96 Build completed on
97 </th>
98 </thead>
99 <tbody>
100 {% for match in matching_tasks %}
101 <tr {{ match|task_color }}>
102 <td>
103 {{match.recipe.name}}
104 </td>
105 <td>
106 <a href="{%url "task" match.build.pk match.pk%}">{{match.task_name}}</a>
107 {% if task.get_description %}
108 <span class="glyphicon
109 glyphicon-question-sign get-help
110 hover-help"
111 title="{{task.get_description}}"></span>
112 {% endif %}
113 </td>
114 <td>
115 {{match.get_executed_display}}
116 </td>
117 <td>
118 {{match.get_outcome_display}}
119 <span class="glyphicon glyphicon-question-sign
120 get-help hover-help"
121 title="{{match.get_outcome_help}}"></span>
122 </td>
123 <td>
124 {{match.build.completed_on|date:"d/m/y H:i"}}
125 </td>
126 </tr>
127 {% endfor %}
128 </tbody>
129 </table>
130 </div>
131 {% else %}
132 <p class="alert">
133 <strong> We have found no tasks matching this prebuilt task</strong><br/>
134 The task you are looking for could belong to a build for which Toaster has no data.
135 </p>
136 {% endif %}
137 {% elif task.outcome == task.OUTCOME_COVERED %}
138 <dl class="dl-horizontal">
139 <dt>
140 <span class="glyphicon glyphicon-question-sign get-help" title="The task(s)
141 providing the outcome of this task"></span> Task covered by
142 </dt>
143 <dd>
144 <ul class="list-unstyled">
145 {% for t in covered_by %}
146 <li>
147 <a href="{%url 'task' t.build.pk t.pk%}"
148 class="task-info"
149 title="{{t.get_executed_display}} | {{t.get_outcome_display}}">
150 {{t.recipe.name}}_{{t.recipe.version}}
151 {{t.task_name}}
152 </a>
153 </li>
154 {% endfor %}
155 </ul>
156 </dd>
157 </dl>
158 {%elif task.outcome == task.OUTCOME_CACHED%}
159 {% for t in task.get_related_setscene %}
160 {% if forloop.last %}
161 <a class="btn btn-default btn-lg"
162 href="{% url 'build_artifact' build.id "tasklogfile" t.pk %}">
163 Download task log
164 </a>
165 {% endif %}
166 {% endfor %}
167
168 {%elif task.outcome == task.OUTCOME_EMPTY%}
169 <div class="alert alert-info details">
170 This task is empty because it has the <code>noexec</code> flag set to <code>1</code>, or the task function is empty
171 </div>
172 {% endif %}
173{% endif %}
174
175{# Execution section #}
176 {% if task.task_executed %}
177 <h2>
178 Executed
179 <span class="glyphicon glyphicon-question-sign get-help"
180 title="'Executed' tasks are those that need to run in order to
181 generate the task output"></span>
182 {% else %}
183 <h2>
184 Not Executed
185 <span class="glyphicon glyphicon-question-sign get-help" title="'Not
186 executed' tasks don't need to run because their outcome is provided
187 by another task"></span>
188 {% endif %}
189 </h2>
190
191<dl class="dl-horizontal">
192 <dt>
193 <span class="glyphicon glyphicon-question-sign get-help" title="To make builds more
194 efficient, the build system detects changes in the 'inputs' to a
195 given task by creating a 'task signature'. If the signature changes,
196 the build system assumes the inputs have changed and the task needs to be
197rerun"></span>
198 Task inputs signature
199 </dt>
200 <dd>
201 {{task.sstate_checksum}}
202 </dd>
203 {% if task.sstate_result != task.SSTATE_NA %}
204 </dl>
205 <div class="alert alert-info">Attempting to restore output from sstate cache
206 <span class="glyphicon glyphicon-question-sign get-help
207 get-help-blue" title="The build system is searching for the
208 task output in your <code>sstate-cache</code> directory and
209 mirrors. If the build system finds the task output, it will reuse it
210 instead of building it from scratch by running the real task. Reusing the
211 task output makes the build faster"></span>
212 </div>
213 <dl class="dl-horizontal">
214 <dt>
215 <span class="glyphicon glyphicon-question-sign get-help" title="The name of the
216 file searched for in your <code>sstate-cache</code>
217 directory and mirrors"></span>
218 File searched for
219 </dt>
220 <dd><code>{{task.path_to_sstate_obj}}</code></dd>
221 <dt>
222 <span class="glyphicon glyphicon-question-sign get-help" title="The locations
223 searched for the above file (i.e. your
224 <code>sstate-cache</code> directory and any mirrors you have
225 set up)"></span>
226 URI(s) searched
227 </dt>
228 <dd><ul class="list-unstyled">{% for uri in uri_list %}<li><code>{{uri}}</code></li>{% endfor %}</ul></dd>
229 </dl>
230 {% endif %}
231 {% if task.sstate_result == task.SSTATE_MISS %}
232 <div class="alert alert-info">
233 <strong>File not in sstate cache.</strong> Running the real task instead.
234 </div>
235 {% elif task.sstate_result == task.SSTATE_FAILED%}
236 <div class="alert alert-warning">
237 <strong>Failed</strong> to restore output from sstate cache. The file was found but could not be unpacked.
238 </div>
239 <dl class="dl-horizontal">
240 <a href="{% url 'build_artifact' build.id "tasklogfile" task.pk %}" style="margin:15px;">Download log</a>
241 </dl>
242 <div class="alert alert-info">
243 Running the real task instead.
244 </div>
245 {% elif task.sstate_result == task.SSTATE_RESTORED %}
246 <div class="alert alert-info">
247 Output <strong>successfully restored</strong> from sstate cache.
248 </div>
249 {% endif %}
250 <dl class="dl-horizontal">
251 <dt>
252 <span class="glyphicon glyphicon-question-sign get-help" title="The
253 running sequence of each task in the build"></span>
254 Task order
255 </dt>
256 <dd><a href="{%url "tasks" build.pk %}?page={{task_in_tasks_table_pg}}&limit=25#task-{{task.order}}">{{task.order}}</a></dd>
257 {% if task.task_executed %}
258 <dt>
259 <span class="glyphicon glyphicon-question-sign get-help"
260 title="Indicates if this task executes a Python or Shell
261 function(s)"></span>
262 Task script type
263 </dt>
264 <dd>{{task.get_script_type_display}}</dd>
265 {% endif %}
266<!--
267 <dt>
268 <i class="icon-question-sign get-help" title="The code executed by the task"></i>
269 Task executable output
270 </dt>
271 <dd><code>{{task.source_url}}</code></dd>
272-->
273 <dt>
274 <span class="glyphicon glyphicon-question-sign get-help" title="Task dependency chain
275 (i.e. other tasks)"></span>
276 Dependencies
277 </dt>
278 <dd>
279 <ul class="list-unstyled">
280 {% for dep in deps %}
281 <li><a href="{%url 'task' dep.build.pk dep.pk%}" class="task-info" title="{{dep.get_executed_display}} | {{dep.get_outcome_display}}">{{dep.recipe.name}}_{{dep.recipe.version}} <span class="task-name">{{dep.task_name}}</span></a></li>
282 {% empty %}
283 <li class="text-muted" style="margin-bottom: -10px;">This task has no dependencies</li>
284 {% endfor %}
285 </ul>
286 </dd>
287 <dt>
288 <span class="glyphicon glyphicon-question-sign get-help" title="Tasks that depend on this
289 task"></span>
290 Reverse dependencies
291 </dt>
292 <dd>
293 <ul class="list-unstyled">
294 {% for dep in rdeps %}
295 <li><a href="{%url 'task' dep.build.pk dep.pk%}" class="task-info" title="{{dep.get_executed_display}} | {{dep.get_outcome_display}}">{{dep.recipe.name}}_{{dep.recipe.version}} <span class="task-name">{{dep.task_name}}</span></a></li>
296 {% empty %}
297 <li class="text-muted">This task has no reverse dependencies</li>
298 {% endfor %}
299 </ul>
300</dl>
301
302{# Performance section - shown only for executed tasks #}
303{%if task.elapsed_time or task.cpu_time_user or task.cpu_time_system or task.disk_io %}
304 <h2 class="details">Performance</h2>
305{% endif %}
306 <dl class="dl-horizontal">
307 {% if task.elapsed_time %}
308 <dt>
309 <span class="glyphicon glyphicon-question-sign get-help" title="How
310 long it took the task to finish in seconds"></span>
311 Time (secs)
312 </dt>
313 <dd>{{task.elapsed_time|format_none_and_zero|floatformat:2}}</dd>
314 {% endif %}
315 {% if task.cpu_time_user > 0 %}
316 <dt>
317 <span class="glyphicon glyphicon-question-sign get-help" title="Total amount of time
318 spent executing in user mode, in seconds. Note that this time
319 can be greater than the task time due to parallel
320 execution."></span>
321 User CPU time (secs)
322 </dt>
323 <dd>{{task.cpu_time_user|format_none_and_zero|floatformat:2}}</dd>
324 {% endif %}
325 {% if task.cpu_time_system > 0 %}
326 <dt>
327 <span class="glyphicon glyphicon-question-sign get-help" title="Total amount of time
328 spent executing in kernel mode, in seconds. Note that this time
329 can be greater than the task time due to parallel
330 execution."></span>
331 System CPU time (secs)
332 </dt>
333 <dd>{{task.cpu_time_system|format_none_and_zero|floatformat:2}}</dd>
334 {% endif %}
335 {% if task.disk_io > 0 %}
336 <dt>
337 <span class="glyphicon glyphicon-question-sign get-help" title="Number of bytes
338 written to and read from the disk during the task"></span>
339 Disk I/O (bytes)
340 </dt>
341 <dd>{{task.disk_io|format_none_and_zero|intcomma}}</dd>
342 {% endif %}
343 </dl>
344
345</div>
346
347{% endblock %}
348