hydra/src/root/build.tt

499 lines
18 KiB
Plaintext
Raw Normal View History

2013-02-20 14:54:33 +00:00
[% WRAPPER layout.tt title="Build $id of job $project.name:$jobset.name:$job.name" %]
2008-11-17 23:59:20 +00:00
[% PROCESS common.tt %]
2008-11-27 18:27:19 +00:00
[% PROCESS "product-list.tt" %]
2008-11-18 14:48:40 +00:00
[% USE HTML %]
[% USE Date %]
2013-08-15 11:57:47 +00:00
[% isAggregate = constituents.size > 0 %]
[% BLOCK renderOutputs %]
[% start=1; FOREACH output IN outputs %]
[% IF !start %],<br/>[% END; start=0; output.path %]
[% END %]
[% END %]
[% BLOCK renderBuildSteps %]
<table class="table table-striped table-condensed clickable-rows">
<thead>
<tr><th>Nr</th><th>What</th><th>Duration</th><th>Machine</th><th>Status</th></tr>
</thead>
<tbody>
[% FOREACH step IN build.buildsteps %]
[% IF ( type == "All" ) || ( type == "Failed" && step.status != 0 ) || ( type == "Running" && step.busy == 1 ) %]
[% has_log = buildStepLogExists(step);
2013-02-20 16:02:07 +00:00
log = c.uri_for('/build' build.id 'nixlog' step.stepnr); %]
<tr>
2013-02-20 16:02:07 +00:00
<td>[% step.stepnr %]</td>
<td>
[% IF step.type == 0 %]
Build of <tt>[% INCLUDE renderOutputs outputs=step.buildstepoutputs %]</tt>
[% ELSE %]
Substitution of <tt>[% INCLUDE renderOutputs outputs=step.buildstepoutputs %]</tt>
[% END %]
</td>
<td>
[% IF step.busy == 0;
IF step.stoptime;
INCLUDE renderDuration duration = step.stoptime - step.starttime;
ELSE;
%]?[%
END;
2013-02-20 16:02:07 +00:00
ELSIF build.finished;
INCLUDE renderDuration duration = build.stoptime - step.starttime;
ELSE;
INCLUDE renderDuration duration = curTime - step.starttime;
END %]
</td>
<td>[% step.machine.split('@').1 || step.machine %]</td>
2013-02-20 16:02:07 +00:00
<td>
[% IF step.busy == 1 %]
<strong>Building</strong>
[% ELSIF step.status == 0 %]
Succeeded
[% ELSIF step.status == 4 %]
<span class="error">Aborted</span>
[% ELSIF step.status == 7 %]
<span class="error">Timed out</span>
[% ELSIF step.status == 8 %]
<span class="error">Cached failure</span>
[% ELSIF step.status == 9 %]
<span class="error">Unsupported system type</span>
[% ELSIF step.errormsg %]
2013-02-20 16:02:07 +00:00
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
[% ELSE %]
<span class="error">Failed</span>
2013-02-20 16:02:07 +00:00
[% END %]
[%%] [%+ IF has_log; INCLUDE renderLogLinks url=log inRow=1; END %]
[%+ IF step.propagatedfrom; %](propagated from [% INCLUDE renderBuildIdLink id=step.propagatedfrom.get_column('id') %])[% END %]
2013-02-20 16:02:07 +00:00
</td>
</tr>
[% END %]
2013-02-20 16:02:07 +00:00
[% END %]
</tbody>
</table>
[% END %]
2013-02-20 16:02:07 +00:00
<ul class="nav nav-tabs">
<li class="dropdown">
<a class="dropdown-toggle actions" data-toggle="dropdown" href="#">
Actions
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
[% IF build.nixexprinput %]
<li><a href="#reproduce" data-toggle="modal">Reproduce locally</a></li>
[% END %]
[% IF c.user_exists %]
[% IF available %]
[% IF build.keep %]
<li><a href="[% c.uri_for('/build' build.id 'keep' 0) %]">Unkeep</a></li>
[% ELSE %]
<li><a href="[% c.uri_for('/build' build.id 'keep' 1) %]">Keep</a></li>
[% END %]
[% END %]
[% IF build.finished %]
<li><a href="[% c.uri_for('/build' build.id 'restart') %]">Restart</a></li>
[% ELSE %]
<li><a href="[% c.uri_for('/build' build.id 'cancel') %]">Cancel</a></li>
[% END %]
[% IF available && project.releases %]
[% INCLUDE menuItem
uri = "#add-to-release"
title = "Add to release"
modal = 1 %]
[% END %]
[% END %]
</ul>
</li>
2013-10-02 23:17:52 +00:00
2013-02-20 16:02:07 +00:00
<li class="active"><a href="#tabs-summary" data-toggle="tab">Summary</a></li>
[% IF isAggregate %]<li><a href="#tabs-constituents" data-toggle="tab">Constituents</a></li>[% END %]
2013-02-21 12:42:44 +00:00
<li><a href="#tabs-details" data-toggle="tab">Details</a></li>
2013-02-22 12:17:07 +00:00
<li><a href="#tabs-buildinputs" data-toggle="tab">Inputs</a></li>
2013-02-20 16:02:07 +00:00
[% IF build.buildsteps %]<li><a href="#tabs-buildsteps" data-toggle="tab">Build steps</a></li>[% END %]
[% IF build.dependents %]<li><a href="#tabs-usedby" data-toggle="tab">Used by</a></li>[% END%]
[% IF drvAvailable %]<li><a href="#tabs-build-deps" data-toggle="tab">Build dependencies</a></li>[% END %]
[% IF available %]<li><a href="#tabs-runtime-deps" data-toggle="tab">Runtime dependencies</a></li>[% END %]
2013-02-20 16:02:07 +00:00
</ul>
<div id="generic-tabs" class="tab-content">
<div id="tabs-summary" class="tab-pane active">
2013-02-21 12:42:44 +00:00
<table>
2013-02-20 16:02:07 +00:00
<tr>
<td>
[% INCLUDE renderBuildStatusIcon size=128, build=build %]
</td>
<td>
2013-02-21 12:42:44 +00:00
<table class="info-table">
2013-02-20 16:02:07 +00:00
<tr>
<th>Build ID:</th>
<td>[% build.id %]</td>
</tr>
<tr>
<th>Status:</th>
<td>
[% INCLUDE renderStatus build=build icon=0 %]
[% IF isAggregate;
nrConstituents = 0;
nrFinished = 0;
nrFailedConstituents = 0;
2013-08-15 01:28:21 +00:00
FOREACH b IN constituents;
nrConstituents = nrConstituents + 1;
IF b.finished; nrFinished = nrFinished + 1; END;
IF b.finished && b.buildstatus != 0; nrFailedConstituents = nrFailedConstituents + 1; END;
END;
%];
[%+ IF nrFinished == nrMembers && nrFailedConstituents == 0 %]
all [% nrConstituents %] constituent builds succeeded
[% ELSE %]
[% nrFailedConstituents %] out of [% nrConstituents %] constituent builds failed
[% IF nrFinished < nrConstituents %]
([% nrConstituents - nrFinished %] still pending)
[% END %]
[% END %]
[% END %]
</td>
2013-02-20 16:02:07 +00:00
</tr>
<tr>
<th>System:</th>
<td><tt>[% build.system %]</tt></td>
</tr>
[% IF build.releasename %]
<tr>
<th>Release name:</th>
<td><tt>[% HTML.escape(build.releasename) %]</tt></td>
</tr>
[% ELSE %]
2013-02-20 17:13:20 +00:00
<tr>
2013-02-20 16:02:07 +00:00
<th>Nix name:</th>
<td><tt>[% build.nixname %]</tt></td>
</tr>
[% END %]
[% IF eval %]
<tr>
<th>Part of:</th>
<td>
<a href="[% c.uri_for(c.controller('JobsetEval').action_for('view'), [eval.id]) %]">evaluation [% eval.id %]</a>
[% IF nrEvals > 1 +%] (and <a href="[% c.uri_for('/build' build.id 'evals') %]">[% nrEvals - 1 %] others</a>)[% END %]
</td>
</tr>
[% END %]
2013-02-20 16:02:07 +00:00
[% IF build.iscachedbuild %]
<tr>
<th>Cached from:</th>
<td>[% IF cachedBuild; INCLUDE renderFullBuildLink build=cachedBuild; ELSE %]<em>unknown</em>[% END %]</td>
2013-02-20 16:02:07 +00:00
</tr>
[% END %]
[% IF !isAggregate && build.finished %]
<tr>
<th>Duration:</th>
<td>[% actualBuild = build.iscachedbuild ? cachedBuild : build;
INCLUDE renderDuration duration = actualBuild.stoptime - actualBuild.starttime %];
finished at [% INCLUDE renderDateTime timestamp = actualBuild.stoptime %]</td>
</tr>
[% END %]
[% IF !isAggregate && buildLogExists(build) %]
2013-02-20 16:02:07 +00:00
<tr>
<th>Logfile:</th>
2013-01-22 13:41:02 +00:00
<td>
2013-02-20 16:02:07 +00:00
<a class="btn btn-mini" href="[% c.uri_for('/build' build.id 'log') %]">pretty</a>
<a class="btn btn-mini" href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>
<a class="btn btn-mini" href="[% c.uri_for('/build' build.id 'log' 'tail-reload') %]">tail</a>
2013-01-22 13:41:02 +00:00
</td>
</tr>
2013-02-20 16:02:07 +00:00
[% END %]
</table>
</td>
</tr>
</table>
[% IF build.buildproducts && !isAggregate %]
2013-01-22 13:41:02 +00:00
2013-02-20 16:02:07 +00:00
<h3>Build products</h3>
2013-01-22 13:41:02 +00:00
2013-02-20 16:02:07 +00:00
[% IF !available %]
<p class="error">Note: this build is no longer available.</p>
[% END %]
2013-01-22 13:41:02 +00:00
2013-02-20 16:02:07 +00:00
[% INCLUDE renderProductList latestRoot=['/job' build.project.name build.jobset.name build.job.name 'latest'] %]
2013-01-22 13:41:02 +00:00
2013-02-20 16:02:07 +00:00
[% END %]
2013-01-22 13:41:02 +00:00
2013-02-20 16:02:07 +00:00
[% IF build.busy %]
<h3>Running build steps</h3>
[% INCLUDE renderBuildSteps type="Running" %]
[% END %]
2013-02-20 16:02:07 +00:00
[% IF build.finished %]
2013-02-22 12:17:07 +00:00
2013-02-20 16:02:07 +00:00
[% IF build.buildsteps && build.buildstatus != 0 && build.buildstatus != 6 %]
<h3>Failed build steps</h3>
[% INCLUDE renderBuildSteps type="Failed" %]
[% END %]
[% IF otherEval %]
2013-02-20 16:02:07 +00:00
<h3>Changes</h3>
[% INCLUDE renderInputDiff inputs2=eval.jobsetevalinputs inputs1=otherEval.jobsetevalinputs %]
[% END %]
[% IF prevSuccessfulBuild %]
<h3>Previous builds</h3>
2013-02-20 16:02:07 +00:00
<table class="table table-striped table-condensed">
<thead>
<th>Last successful build [% INCLUDE renderDateTime timestamp = prevSuccessfulBuild.timestamp %]</th>
2013-02-20 16:02:07 +00:00
[% IF prevSuccessfulBuild && firstBrokenBuild && firstBrokenBuild.id != build.id %]
<th>First broken build [% INCLUDE renderDateTime timestamp = firstBrokenBuild.timestamp %]
2013-02-20 16:02:07 +00:00
<a class="btn btn-mini" href="[% c.uri_for(c.controller('API').action_for('logdiff') prevSuccessfulBuild.id firstBrokenBuild.id ) %]">log diff</a>
</th>
[% END %]
<th>This build [% INCLUDE renderDateTime timestamp = build.timestamp %]
2013-02-20 16:02:07 +00:00
<a class="btn btn-mini" href="[% c.uri_for(c.controller('API').action_for('logdiff') prevSuccessfulBuild.id build.id) %]">log diff</a>
</th>
</thead>
<tr>
2013-02-22 12:17:07 +00:00
<td valign="center">[% INCLUDE renderBuildStatusIcon build=prevSuccessfulBuild size=32 %] [% INCLUDE renderBuildLink build=prevSuccessfulBuild %]</td>
[% IF prevSuccessfulBuild && firstBrokenBuild && firstBrokenBuild.id != build.id %]
<td valign="center">[% INCLUDE renderBuildStatusIcon build=firstBrokenBuild size=32 %] [% INCLUDE renderBuildLink build=firstBrokenBuild %]</td>
[% END %]
<td>[% INCLUDE renderBuildStatusIcon build=build size=32 %] [% INCLUDE renderBuildLink build=build %]</td>
2013-02-20 16:02:07 +00:00
</tr>
<tr>
<td></td>
2013-02-22 12:17:07 +00:00
[% IF prevSuccessfulBuild && firstBrokenBuild && firstBrokenBuild.id != build.id %]
<td>[% INCLUDE renderInputDiff inputs1=prevSuccessfulBuild.inputs inputs2=firstBrokenBuild.inputs %]</td>
2013-02-22 12:17:07 +00:00
[% END %]
2013-02-20 16:02:07 +00:00
</tr>
</table>
[% END %]
[% IF build.errormsg && build.buildstatus != 5 %]
<h2 id="nix-error">Nix error output</h2>
<pre class="buildlog">[% HTML.escape(build.errormsg) %]</pre>
[% END %]
[% END %]
[% IF logtext %]
<h2>Log</h2>
<pre class="buildlog">[% HTML.escape(logtext) %]</pre>
[% END %]
2013-02-20 16:02:07 +00:00
</div>
2013-01-22 13:41:02 +00:00
[% IF isAggregate %]
2013-08-14 22:30:19 +00:00
<div id="tabs-constituents" class="tab-pane">
2013-08-14 22:30:19 +00:00
<p>This build is an aggregate of the following builds:</p>
[% INCLUDE renderBuildList builds=constituents hideProjectName=1 hideJobsetName=1 %]
2013-08-14 22:30:19 +00:00
</div>
[% END %]
2013-02-21 12:42:44 +00:00
<div id="tabs-details" class="tab-pane">
2013-02-20 16:02:07 +00:00
2013-02-21 12:42:44 +00:00
<table class="info-table">
2014-10-07 15:16:41 +00:00
<tr>
<th>Queued:</th>
<td>[% INCLUDE renderDateTime timestamp = build.timestamp %]</td>
</tr>
[% IF build.finished && !build.iscachedbuild %]
<tr>
<th>Build started:</th>
<td>[% INCLUDE renderDateTime timestamp = build.starttime %]</td>
</tr>
<tr>
<th>Build finished:</th>
<td>[% INCLUDE renderDateTime timestamp = build.stoptime %]</td>
</tr>
[% END %]
[% IF !build.finished %]
<tr>
<th>Priority:</th>
<td>[% build.priority %]</td>
</tr>
[% END %]
2013-02-20 16:02:07 +00:00
[% IF build.nixexprinput %]
<tr>
<th>Nix expression:</th>
<td>file <tt>[% HTML.escape(build.nixexprpath) %]</tt> in input <tt>[% HTML.escape(build.nixexprinput) %]</tt></td>
</tr>
[% END %]
<tr>
<th>Nix name:</th>
<td><tt>[% build.nixname %]</tt></td>
</tr>
<tr>
<th>Short description:</th>
<td>[% IF build.description %][% HTML.escape(build.description) %][% ELSE %]<em>not given</em>[% END %]</td>
2013-02-20 16:02:07 +00:00
</tr>
<tr>
<th>License:</th>
<td>[% IF build.license %][% HTML.escape(build.license) %][% ELSE %]<em>not given</em>[% END %]</td>
2013-02-20 16:02:07 +00:00
</tr>
<tr>
<th>Homepage:</th>
<td>[% IF build.homepage %]<a [% HTML.attributes(href => build.homepage) %]>[% HTML.escape(build.homepage) %]</a>[% ELSE %]<em>not given</em>[% END %]</td>
2013-02-20 16:02:07 +00:00
</tr>
<tr>
<th>Maintainer(s):</th>
<td>[% IF build.maintainers %][% HTML.escape(build.maintainers) %][% ELSE %]<em>not given</em>[% END %]</td>
2013-02-20 16:02:07 +00:00
</tr>
<tr>
<th>System:</th>
<td><tt>[% build.system %]</tt></td>
</tr>
<tr>
<th>Derivation store path:</th>
<td><tt>[% build.drvpath %]</tt></td>
2013-02-20 16:02:07 +00:00
</tr>
<tr>
<th>Output store paths:</th>
<td><tt>[% INCLUDE renderOutputs outputs=build.buildoutputs %]</tt></td>
2013-02-20 16:02:07 +00:00
</tr>
[% chartsURL = c.uri_for('/job' build.project.name build.jobset.name build.job.name) _ "#tabs-charts" %]
[% IF build.finished && build.closuresize %]
<tr>
<th>Closure size:</th>
<td>[% mibs(build.closuresize / (1024 * 1024)) %] MiB
(<a href="[%chartsURL%]">history</a>)</td>
</tr>
[% END %]
[% IF build.finished && build.closuresize %]
<tr>
<th>Output size:</th>
<td>[% mibs(build.size / (1024 * 1024)) %] MiB
(<a href="[%chartsURL%]">history</a>)</td>
</tr>
[% END %]
2013-02-20 16:02:07 +00:00
[% IF build.finished && build.buildproducts %]
<tr>
<th>Availability:</th>
<td>
[% IF !available %]
<em>Build output is no longer available</em>
[% ELSIF build.keep %]
<em>Build output will be kept permanently</em>
[% ELSE %]
<em>Build output is available, but may be garbage-collected</em>
[% END %]
</td>
</tr>
[% END %]
</table>
</div>
2013-02-20 16:02:07 +00:00
<div id="tabs-buildinputs" class="tab-pane">
[% IF build.inputs.size > 0 %]
[% INCLUDE renderInputs inputs=build.inputs %]
[% ELSIF eval %]
[% INCLUDE renderInputs inputs=eval.jobsetevalinputs %]
2013-01-22 13:41:02 +00:00
2013-02-20 16:02:07 +00:00
[% END %]
</div>
2013-02-20 16:02:07 +00:00
[% IF build.buildsteps %]
<div id="tabs-buildsteps" class="tab-pane">
[% INCLUDE renderBuildSteps type="All" %]
</div>
[% END %]
2011-03-11 08:50:42 +00:00
2013-02-20 16:02:07 +00:00
[% IF build.dependents %]
<div id="tabs-usedby" class="tab-pane">
2011-03-11 08:50:42 +00:00
2013-02-20 16:02:07 +00:00
<p>The following builds have used this build as an input:</p>
<table class="table table-condensed table-striped">
2013-02-20 16:02:07 +00:00
<thead>
<tr><th>Build</th><th>Input name</th><th>System</th><th>Timestamp</th></tr>
</thead>
<tbody>
[% FOREACH input IN build.dependents %]
<tr>
<td>[% INCLUDE renderFullBuildLink build=input.build %]</td>
<td><tt>[% input.name %]</tt></td>
<td><tt>[% input.build.system %]</tt></td>
<td>[% INCLUDE renderDateTime timestamp = input.build.timestamp %]</td>
</tr>
[% END %]
</tbody>
</table>
</div>
[% END %]
[% IF drvAvailable %]
2013-02-22 12:36:15 +00:00
[% INCLUDE makeLazyTab tabName="tabs-build-deps" uri=c.uri_for('/build' build.id 'build-deps') %]
[% END %]
[% IF available %]
2013-02-22 12:36:15 +00:00
[% INCLUDE makeLazyTab tabName="tabs-runtime-deps" uri=c.uri_for('/build' build.id 'runtime-deps') %]
[% END %]
</div>
2008-11-06 13:40:31 +00:00
2013-02-20 17:13:20 +00:00
2013-08-15 01:07:20 +00:00
[% IF c.user_exists && available && project.releases %]
<div id="add-to-release" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
<form class="form-horizontal" action="[% c.uri_for('/build' build.id 'add-to-release') %]" method="post">
<div class="modal-body">
<div class="control-group">
<label class="control-label">Add to release</label>
<div class="controls">
<select class="span2" name="name">
[% FOREACH r IN project.releases %]
<option>[% HTML.escape(r.name) %]</option>
[% END %]
</select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Add</button>
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
</form>
</div>
[% END %]
<div id="reproduce" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
[% url = c.uri_for('/build' build.id 'reproduce') %]
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>Reproduce this build</h3>
</div>
<div class="modal-body">
<p>You can reproduce this build on your own machine by downloading
<a [% HTML.attributes(href => url) %]>a script</a> that checks out
all inputs of the build and then invokes Nix to perform the build.
This script requires that you have Nix on your system.</p>
<p>To download and execute the script from the command line, run the
following command:</p>
<pre>
<span class="shell-prompt">$ </span>bash <(curl <a [% HTML.attributes(href => url) %]>[% HTML.escape(url) %]</a>)
</pre>
</div>
<div class="modal-footer">
2013-10-02 23:17:52 +00:00
<a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>
</div>
</div>
2008-11-11 12:54:37 +00:00
[% END %]