This removes the "busy", "locker" and "logfile" columns, which are no longer used by the queue runner. The "Running builds" page now only shows builds that have an active build step.
TPNHTE5VJ36IPKMFENDERDBFBHLYFXOVNDLV2QSC4G5STPPMBLMAC
36V375MDMA4F5EP4CLRZ7ZH4KZKWLUBCQNRCLSL7W2MFWSOLIRBQC
V3UMEC5JQMX4WE7K2AQ7VYJTBEKMSHNQU6FGHKW5H5G2AWB3O27AC
J5ITV54PZKTD3RKFB6XETFNSAJS6NRMGXNRTUYU6ASHE3EBJKENAC
MQQ5KZV37LHW6FHJFVND72EH3N5QF64GV6JECJELLWLOZX6XDKZAC
YF3HTIPFEQKTVMGTU5JYB2VZDRHWFQJKRONR3EZJQBQXG3QOVUFQC
5JB5DKQLDAGGNLQ6CDWVYRMT4KWCKXWKE6CBDU7C7Q3JMUNQHAYAC
VZCNKQSBAQZPX7TOWCVVWCRJRNGFP2Y3B4STH4VHCAJHJ4LMSMJQC
4CQWOODYIBUEMPSLWTXZPZZTQBYYRGCORKLY4SKG2WVCVXGT654QC
53IMJNBB3E2W34UXZFNNZUGPW3FU4LRQRQAEHQTOHHY6DVE2VJRAC
MHVIT4JYWUYD4UCGB2AHLXWLX6B5SYE22BREERNGANT7RGGDUFOAC
62MQPRXCZCP7ZQKOOAFU5V36P7DBS6RCFDYK53PDCFGI4FAOQWMQC
FQQRJUO4C7655SFAKPRPILALVEVRQSIIVBLMQUFPODUBXPIMWYSAC
24BMQDZAWDQ7VNIA7TIROXSOYLOJBNZ2E4264WHWNJAEN6ZB3UOAC
BKOIYITRBRVU4D7XFAZPV5QHAPCBMIO3SBNHYJ6TVT43WR32CTHQC
R6B5CAFF3BWJPW6I5YGKXOKKCW6S7D7AHO2HLZVFUW3NL77ZW44QC
3PNG7NIBQQURUUPRVQXYL342OT7JUUYOMY2JJNP6YDX7SYJDZMYAC
WOHG5MJD5CHHBH3AJ72NG2K7FPTD6VBQBWG4BTJX2DLIOBEBKDMQC
MOX7XJ2E3XISXA7V7T4W6GEAGECGWBZ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I7ZXQX2DRSHLGAC
U4TD3AIQXBJFFUORTMIC4IHZTVBORRKL2TZ2FSP4G665ECZOEMNAC
EFWN7JBV7YIHNMCA6ZGFRSHZIUQJ2EX57SWYGVT7ZRJCHPIM2R3QC
N22GPKYTOLZLBGTGDATQDVZ4R5APZEAOIA7L32X4UXBH4XNI7MWAC
D5QIOJGPKQJIYBUCSC3MFJ3TXLPNZ2XMI37GXMFRVRFWWR2VMTFAC
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5 where id = $1 and finished = 0")
("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5 where id = $1 and finished = 0")
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $4, size = $5, closureSize = $6, releaseName = $7, isCachedBuild = $8 where id = $1")
("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, size = $5, closureSize = $6, releaseName = $7, isCachedBuild = $8 where id = $1")
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, errorMsg = $4 where id = $1 and finished = 0")
("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $3, errorMsg = $4 where id = $1 and finished = 0")
("update Builds set finished = 1, busy = 0, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = 1 where id = $1 and finished = 0")
("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $3, isCachedBuild = 1 where id = $1 and finished = 0")
};
$c->forward('Hydra::View::Plain');
}
sub nrrunning : Chained('api') PathPart('nrrunning') Args(0) {
my ($self, $c) = @_;
my $nrRunningBuilds = $c->model('DB::Builds')->search({finished => 0, busy => 1 })->count();
$c->stash->{'plain'} = {
data => "$nrRunningBuilds"
sub readNormalizedLog {
my ($file) = @_;
my $pipe = (-f "$file.bz2" ? "cat $file.bz2 | bzip2 -d" : "cat $file");
my $res = `$pipe`;
$res =~ s/\/nix\/store\/[a-z0-9]*-/\/nix\/store\/...-/g;
$res =~ s/nix-build-[a-z0-9]*-/nix-build-...-/g;
$res =~ s/[0-9]{2}:[0-9]{2}:[0-9]{2}/00:00:00/g;
return $res;
}
sub logdiff : Chained('api') PathPart('logdiff') Args(2) {
my ($self, $c, $buildid1, $buildid2) = @_;
my $diff = "";
my $build1 = getBuild($c, $buildid1);
notFound($c, "Build with ID $buildid1 doesn't exist.")
if !defined $build1;
my $build2 = getBuild($c, $buildid2);
notFound($c, "Build with ID $buildid2 doesn't exist.")
if !defined $build2;
if (-f $build1->logfile && -f $build2->logfile) {
my $logtext1 = readNormalizedLog($build1->logfile);
my $logtext2 = readNormalizedLog($build2->logfile);
$diff = diff \$logtext1, \$logtext2;
} else {
$c->response->status(404);
}
$c->response->content_type('text/x-diff');
$c->stash->{'plain'} = { data => (scalar $diff) || " " };
$c->forward('Hydra::View::Plain');
}
$c->stash->{nrRunningBuilds} = $c->model('DB::Builds')->search({ finished => 0, busy => 1 }, {})->count();
$c->stash->{nrRunningBuilds} = $c->model('DB::Builds')->search(
{ finished => 0, 'buildsteps.busy' => 1 },
{ join => 'buildsteps', select => ["id"], distinct => 1 })->count();
entity => [$c->model('DB::Builds')->search({finished => 0}, { order_by => ["globalpriority desc", "id"]})]
entity => [$c->model('DB::Builds')->search(
{ finished => 0 },
{ order_by => ["globalpriority desc", "id"],
, columns => [@buildListColumns]
})]
entity => [$c->model('DB::Builds')->search({finished => 0, busy => 1}, { order_by => ["priority DESC", "id"]})]
entity => [$c->model('DB::Builds')->search(
{ finished => 0, "buildsteps.busy" => 1 },
{ order_by => ["globalpriority DESC", "id"],
join => "buildsteps",
columns => [@buildListColumns]
})]
Readonly our @buildListColumns => ('id', 'finished', 'timestamp', 'stoptime', 'project', 'jobset', 'job', 'nixname', 'system', 'priority', 'busy', 'buildstatus', 'releasename');
Readonly our @buildListColumns => ('id', 'finished', 'timestamp', 'stoptime', 'project', 'jobset', 'job', 'nixname', 'system', 'buildstatus', 'releasename');
# Created by DBIx::Class::Schema::Loader v0.07043 @ 2015-09-10 17:34:23
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JRelp13Cyfi+QVxC92xuqQ
# Created by DBIx::Class::Schema::Loader v0.07043 @ 2015-10-27 13:54:16
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iN9vwO5i3dURKOTgaPTHxw
<td>[% IF build.busy %]<span class="label label-success">Started</span>[% ELSE %]<span class="label">Queued</span>[% END %]</td>
<td>[% IF busy %]<span class="label label-success">Started</span>[% ELSE %]<span class="label">Queued</span>[% END %]</td>
ELSIF busy %]
<img src="[% c.uri_for("/static/images/help_${size}.png") %]" alt="Busy" class="build-status" />
[% ELSE %]
<img src="[% c.uri_for("/static/images/help_${size}.png") %]" alt="Scheduled" class="build-status" />
ELSE %]
<img src="[% c.uri_for("/static/images/help_${size}.png") %]" alt="Queued" class="build-status" />
ELSIF build.busy %]
<strong>Build in progress</strong>
since [% INCLUDE renderDateTime timestamp = build.starttime;
ELSIF busy %]
<strong>Build in progress</strong>[%-
-- FIXME: remove (obsolete with the new queue runner)
busy integer not null default 0, -- true means someone is building this job now
locker text, -- !!! hostname/pid of the process building this job?
alter table Builds drop column busy, drop column locker, drop column logfile;
drop index IndexBuildsOnFinishedBusy;