* Store info about all the build actions and allow them to be
[?]
Nov 11, 2008, 5:49 PM
CLJQCY2XHIDNNMFBJ5PK3GQEN6RFALEFKXBJRWZPEIKR4PR5ZQ5ACDependencies
- [2]
WHAFVCEI - [3]
GWCV3TQV* BuildInputs table: link to dependencies, include store paths. - [4]
UVMFS73T* Some jQuery / CSS hackery. - [5]
M552HLIA* Support variant builds. - [6]
7YBYT2LQ - [7]
BVOPAMLS - [8]
X27GNHDV* Basic job info in the database. - [9]
WYN733ST* Store build duration, handle cached builds. - [10]
J5UVLXOK* Start of a basic Catalyst web interface. - [11]
L2E6EVE2* Merged the Build and Job tables. - [12]
K5BEBWKM - [13]
DVNWJXWW* Generic declaration of build products. - [14]
PHX2HIVG* Store info about the build inputs in the build record. - [15]
67P45PY4 - [16]
VCOSLZRP - [17]
ZEHSSVFG - [*]
N22GPKYT* Put info about logs / build products in the DB.
Change contents
- replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 40
, where => "finished != 0 and timestamp = (select max(timestamp) from Builds where project == me.project and attrName == me.attrName)", where => "finished != 0 and timestamp = (select max(timestamp) from Builds where project == me.project and attrName == me.attrName and finished != 0)" - edit in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 106
}sub nixlog :Local {my ( $self, $c, $id, $stepnr ) = @_;my $build = getBuild($c, $id);return error($c, "Build with ID $id doesn't exist.") if !defined $build;my $step = $build->buildsteps->find({stepnr => $stepnr});return error($c, "Build $id doesn't have a build step $stepnr.") if !defined $step;$c->stash->{template} = 'log.tt';$c->stash->{id} = $id;$c->stash->{step} = $step;# !!! should be done in the view (as a TT plugin).$c->stash->{logtext} = loadLog($step->logfile); - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm at line 41
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dKMSSomUN+gJX57Z5e295w# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MtL3cwH9upjNmhaZkGszRA - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm at line 24
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZOxJeT+ltgyc/zuDl9aEDQ# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vvyGq3BeKyyK7K6uDxJHyQ - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm at line 24
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rZPTilX/PAiIoxffxc0nJw# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:et00AvSBi5LZUoIrIUOKFQ - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm at line 28
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2Vfqs9RUhbDrje18yZb3AA# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8zXrs7iT2h3xp6C/2q37uQ - edit in src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm at line 73
__PACKAGE__->has_many("buildsteps","HydraFrontend::Schema::Buildsteps",{ "foreign.id" => "self.id" },); - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm at line 80
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1GZeB3YVr064AZrGargmFg# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c8feWTpKijITXXSdJICuFg - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm at line 26
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rN7v2+MnC8TkrEHUzt2Gqg# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Z65HteUghCT7sXfXpsHYXg - file addition: Buildsteps.pm[3.3332]
package HydraFrontend::Schema::Buildsteps;use strict;use warnings;use base 'DBIx::Class';__PACKAGE__->load_components("Core");__PACKAGE__->table("BuildSteps");__PACKAGE__->add_columns("id",{ data_type => "integer", is_nullable => 0, size => undef },"stepnr",{ data_type => "integer", is_nullable => 0, size => undef },"type",{ data_type => "integer", is_nullable => 0, size => undef },"drvpath",{ data_type => "text", is_nullable => 0, size => undef },"outpath",{ data_type => "text", is_nullable => 0, size => undef },"logfile",{ data_type => "text", is_nullable => 0, size => undef },"busy",{ data_type => "integer", is_nullable => 0, size => undef },"status",{ data_type => "integer", is_nullable => 0, size => undef },"errormsg",{ data_type => "text", is_nullable => 0, size => undef },"starttime",{ data_type => "integer", is_nullable => 0, size => undef },"stoptime",{ data_type => "integer", is_nullable => 0, size => undef },);__PACKAGE__->set_primary_key("id", "stepnr");__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GmvM5Rhj4MY7eNQpqTz7bw# You can replace this text with custom content, and it will be preserved on regeneration1; - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm at line 36
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bvEulSFMDlAMs39sIyHgZQ# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mng7GAPMDxsznKupYdhwQw - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm at line 46
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:54xK3D1D0Jm5oKgRelXN7Q# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vEXBbzKUTBQmGmL8uh9mIA - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm at line 51
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JHirlq7Jc8dQOy+Op/VflA# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hMYI8zT3UB/k9IbddK1X4g - replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm at line 27
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7Ag5ZfYVgfw3MJZkNUmBYw# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1DTnCjRw929OuAfeJ5gsXA - replacement in src/HydraFrontend/lib/HydraFrontend/Schema.pm at line 11
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1AgCf4sf5h2RU24Slo0sTA# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gS2Lp7T6IZ160iYQbEhd+g - replacement in src/HydraFrontend/root/build.tt at line 36
<strong>Build returned a non-zero exit code</strong><strong class="error-msg">Build returned a non-zero exit code</strong> - replacement in src/HydraFrontend/root/build.tt at line 39
<strong>Build failed</strong><strong class="error-msg">Build failed</strong> - edit in src/HydraFrontend/root/build.tt at line 135
- edit in src/HydraFrontend/root/build.tt at line 137
[% IF build.buildsteps %] - edit in src/HydraFrontend/root/build.tt at line 139
<h2>Build steps</h2><table class="tablesorter"><thead><tr><th>Nr</th><th>What</th><th>Status</th></tr></thead><tbody>[% FOREACH step IN build.buildsteps -%]<tr><td>[% step.stepnr %]</td><td>Build of <tt>[% step.outpath %]</tt></td><td>[% IF step.busy == 1 %]<strong>Building</strong>[% ELSIF step.status == 0 %]Succeeded[% ELSE %]<strong class="error-msg">Failed: [% step.errormsg %]</strong>[% END %](<a href="[% c.uri_for('/nixlog' build.id step.stepnr) %]">log</a>)</td></tr>[% END %]</tbody></table>[% END %] - replacement in src/HydraFrontend/root/hydra.css at line 146
span.error-msg {.error-msg { - replacement in src/HydraFrontend/root/log.tt at line 3
<h1>Build log <tt>[% log.logphase %] of build ID [% id %]</h1><h1>Build log [% IF step %] of step [% step.stepnr %] [% ELSE %]<tt>[% log.logphase %]</tt>[% END %] of build ID [% id %]</h1> - replacement in src/build.pl at line 35
my $res = system("nix-store --realise $drvPath");# Run Nix to perform the build, and monitor the stderr output# to get notifications about specific build steps, the# associated log files, etc.my $cmd = "nix-store --keep-going --no-build-output " ."--log-type flat --print-build-trace --realise $drvPath 2>&1";my $buildStepNr = 1;open OUT, "$cmd |" or die;while (<OUT>) {unless (/^@\s+/) {print STDERR "$_";next;}print STDERR "GOT $_";if (/^@\s+build-started\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/) {$db->txn_do(sub {$db->resultset('Buildsteps')->create({ id => $build->id, stepnr => $buildStepNr++, type => 0 # = build, drvpath => $1, outpath => $2, logfile => $4, busy => 1});});}if (/^@\s+build-succeeded\s+(\S+)\s+(\S+)$/) {$db->txn_do(sub {my $drvPath = $1;(my $step) = $db->resultset('Buildsteps')->search({id => $build->id, type => 0, drvpath => $drvPath}, {});die unless $step;$step->busy(0);$step->status(0);$step->update;});}if (/^@\s+build-failed\s+(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/) {$db->txn_do(sub {my $drvPath = $1;(my $step) = $db->resultset('Buildsteps')->search({id => $build->id, type => 0, drvpath => $drvPath}, {});die unless $step;$step->busy(0);$step->status(1);$step->errormsg($4);$step->update;});}}close OUT;my $res = $?; - replacement in src/build.pl at line 126
print "found log $logPath\n";print STDERR "found log $logPath\n"; - replacement in src/build.pl at line 139
print "found log $logPath\n";print STDERR "found log $logPath\n"; - replacement in src/build.pl at line 181
print "performing build $buildId\n";print STDERR "performing build $buildId\n"; - edit in src/hydra.sql at line 60
- edit in src/hydra.sql at line 62
create table BuildSteps (id integer not null,stepnr integer not null, - edit in src/hydra.sql at line 66
type integer not null, -- 0 = build, 1 = substitutiondrvPath text,outPath text,logfile text,busy integer not null,status integer,errorMsg text,startTime integer, -- in Unix time, 0 = used cached build resultstopTime integer,primary key (id, stepnr),foreign key (id) references Builds(id) on delete cascade -- ignored by sqlite); - edit in src/runner.pl at line 19
print $job, "\n";