Remove the logfile and logSize columns from the database

It's pointless to store these, since Nix knows where the logs are.
Also handle (in fact require) Nix's new log storage scheme.  Also some
cleanups in the build page.
This commit is contained in:
Eelco Dolstra 2013-01-22 22:48:02 +01:00
parent 36c2bf2f52
commit 30e5185acf
30 changed files with 299 additions and 229 deletions

View file

@ -7,6 +7,7 @@ use Hydra::Helper::Nix;
use Hydra::Helper::CatalystUtils; use Hydra::Helper::CatalystUtils;
use Hydra::Helper::AddBuilds; use Hydra::Helper::AddBuilds;
use File::stat; use File::stat;
use File::Slurp;
use Data::Dump qw(dump); use Data::Dump qw(dump);
use Nix::Store; use Nix::Store;
@ -30,10 +31,6 @@ sub build : Chained('/') PathPart CaptureArgs(1) {
$c->stash->{project} = $c->stash->{build}->project; $c->stash->{project} = $c->stash->{build}->project;
} }
sub cat_log_command {
my ($path) = @_;
return ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path");
}
sub view_build : Chained('build') PathPart('') Args(0) { sub view_build : Chained('build') PathPart('') Args(0) {
my ($self, $c) = @_; my ($self, $c) = @_;
@ -48,22 +45,14 @@ sub view_build : Chained('build') PathPart('') Args(0) {
$c->stash->{pathHash} = $c->stash->{available} ? queryPathHash($build->outpath) : undef; $c->stash->{pathHash} = $c->stash->{available} ? queryPathHash($build->outpath) : undef;
if (!$build->finished && $build->busy) { if (!$build->finished && $build->busy) {
my $logfile = $build->logfile; $c->stash->{logtext} = read_file($build->logfile, err_mode => 'quiet') // "";
$c->stash->{logtext} = logContents($logfile);
} }
if ($build->finished && $build->iscachedbuild) { if ($build->finished && $build->iscachedbuild) {
(my $cachedBuildStep) = $c->model('DB::BuildSteps')->search({ outpath => $build->outpath }, {}) ; (my $cachedBuildStep) = $c->model('DB::BuildSteps')->search({ outpath => $build->outpath }, {});
$c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep; $c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep;
} }
(my $lastBuildStep) = $build->buildsteps->search({},{order_by => "stepnr DESC", rows => 1});
my $path = defined $lastBuildStep ? $lastBuildStep->logfile : "" ;
if ($build->finished && ($build->buildstatus == 1 || $build->buildstatus == 6) && !($path eq "") && -f $lastBuildStep->logfile) {
my $logtext = logContents($path, 50);
$c->stash->{logtext} = removeAsciiEscapes($logtext);
}
if ($build->finished) { if ($build->finished) {
$c->stash->{prevBuilds} = [$c->model('DB::Builds')->search( $c->stash->{prevBuilds} = [$c->model('DB::Builds')->search(
{ project => $c->stash->{project}->name { project => $c->stash->{project}->name
@ -102,40 +91,34 @@ sub view_nixlog : Chained('build') PathPart('nixlog') {
$c->stash->{step} = $step; $c->stash->{step} = $step;
showLog($c, $step->logfile, $mode); showLog($c, $step->drvpath, $mode);
} }
sub view_log : Chained('build') PathPart('log') { sub view_log : Chained('build') PathPart('log') {
my ($self, $c, $mode) = @_; my ($self, $c, $mode) = @_;
showLog($c, $c->stash->{build}->drvpath, $mode);
error($c, "Build didn't produce a log.") if !defined $c->stash->{build}->logfile;
showLog($c, $c->stash->{build}->logfile, $mode);
} }
sub showLog { sub showLog {
my ($c, $path, $mode) = @_; my ($c, $drvPath, $mode) = @_;
my $fallbackpath = -f $path ? $path : "$path.bz2"; my $logPath = getDrvLogPath($drvPath);
notFound($c, "Log file $path no longer exists.") unless -f $fallbackpath; notFound($c, "The build log of derivation $drvPath is not available.") unless defined $logPath;
$path = $fallbackpath;
if (!$mode) { if (!$mode) {
# !!! quick hack # !!! quick hack
my $pipestart = ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path") ; my $pipeline = "nix-store -l $drvPath"
my $pipeline = $pipestart
. " | nix-log2xml | xsltproc " . $c->path_to("xsl/mark-errors.xsl") . " -" . " | nix-log2xml | xsltproc " . $c->path_to("xsl/mark-errors.xsl") . " -"
. " | xsltproc " . $c->path_to("xsl/log2html.xsl") . " - | tail -n +2"; . " | xsltproc " . $c->path_to("xsl/log2html.xsl") . " - | tail -n +2";
$c->stash->{template} = 'log.tt'; $c->stash->{template} = 'log.tt';
$c->stash->{logtext} = `$pipeline`; $c->stash->{logtext} = `$pipeline`;
} }
elsif ($mode eq "raw") { elsif ($mode eq "raw") {
$c->stash->{'plain'} = { data => (scalar logContents($path)) || " " }; $c->stash->{'plain'} = { data => (scalar logContents($drvPath)) || " " };
$c->forward('Hydra::View::Plain'); $c->forward('Hydra::View::Plain');
} }
@ -145,12 +128,12 @@ sub showLog {
$c->stash->{url} = $url; $c->stash->{url} = $url;
$c->stash->{reload} = !$c->stash->{build}->finished && $c->stash->{build}->busy; $c->stash->{reload} = !$c->stash->{build}->finished && $c->stash->{build}->busy;
$c->stash->{title} = ""; $c->stash->{title} = "";
$c->stash->{contents} = (scalar logContents($path, 50)) || " "; $c->stash->{contents} = (scalar logContents($drvPath, 50)) || " ";
$c->stash->{template} = 'plain-reload.tt'; $c->stash->{template} = 'plain-reload.tt';
} }
elsif ($mode eq "tail") { elsif ($mode eq "tail") {
$c->stash->{'plain'} = { data => (scalar logContents($path, 50)) || " " }; $c->stash->{'plain'} = { data => (scalar logContents($drvPath, 50)) || " " };
$c->forward('Hydra::View::Plain'); $c->forward('Hydra::View::Plain');
} }

View file

@ -17,7 +17,7 @@ use File::Temp;
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
our @EXPORT = qw( our @EXPORT = qw(
fetchInput evalJobs checkBuild inputsToArgs captureStdoutStderr fetchInput evalJobs checkBuild inputsToArgs captureStdoutStderr
getReleaseName getBuildLog addBuildProducts restartBuild scmPath getReleaseName addBuildProducts restartBuild scmPath
getPrevJobsetEval getPrevJobsetEval
); );
@ -27,16 +27,6 @@ sub scmPath {
} }
sub getBuildLog {
my ($drvPath) = @_;
my $logPath = ($ENV{NIX_LOG_DIR} || "/nix/var/log/nix"). "/drvs/" . basename $drvPath;
return $logPath if -e $logPath;
$logPath = "$logPath.bz2";
return $logPath if -e $logPath;
return undef;
}
sub getStorePathHash { sub getStorePathHash {
my ($storePath) = @_; my ($storePath) = @_;
my $hash = `nix-store --query --hash $storePath` my $hash = `nix-store --query --hash $storePath`
@ -930,7 +920,6 @@ sub checkBuild {
, buildstatus => -f "$outPath/nix-support/failed" ? 6 : 0 , buildstatus => -f "$outPath/nix-support/failed" ? 6 : 0
, starttime => $time , starttime => $time
, stoptime => $time , stoptime => $time
, logfile => getBuildLog($drvPath)
, errormsg => "" , errormsg => ""
, releasename => getReleaseName($outPath) , releasename => getReleaseName($outPath)
); );

View file

@ -14,7 +14,7 @@ our @EXPORT = qw(
getPrimaryBuildsForView getPrimaryBuildsForView
getPrimaryBuildTotal getPrimaryBuildTotal
getViewResult getLatestSuccessfulViewResult getViewResult getLatestSuccessfulViewResult
jobsetOverview removeAsciiEscapes logContents); jobsetOverview removeAsciiEscapes getDrvLogPath logContents);
sub getHydraHome { sub getHydraHome {
@ -238,19 +238,39 @@ sub getLatestSuccessfulViewResult {
return undef; return undef;
} }
# Return the path of the build log of the given derivation, or undef
# if the log is gone.
sub getDrvLogPath {
my ($drvPath) = @_;
my $base = basename $drvPath;
my $fn =
($ENV{NIX_LOG_DIR} || "/nix/var/log/nix") . "/drvs/"
. substr($base, 0, 2) . "/"
. substr($base, 2);
return $fn if -f $fn;
$fn .= ".bz2";
return $fn if -f $fn;
return undef;
}
sub logContents { sub logContents {
my ($path, $tail) = @_; my ($drvPath, $tail) = @_;
my $logPath = getDrvLogPath($drvPath);
die unless defined $logPath;
my $cmd; my $cmd;
if ($path =~ /.bz2$/) { if ($logPath =~ /.bz2$/) {
$cmd = "cat $path | bzip2 -d"; $cmd = "bzip2 -d < $logPath";
$cmd = $cmd . " | tail -$tail" if defined $tail; $cmd = $cmd . " | tail -n $tail" if defined $tail;
} }
else { else {
$cmd = defined $tail ? "tail -$tail $path" : "cat $path"; $cmd = defined $tail ? "tail -$tail $logPath" : "cat $logPath";
} }
return `$cmd` if -e $path; return `$cmd`;
} }
sub removeAsciiEscapes { sub removeAsciiEscapes {
my ($logtext) = @_; my ($logtext) = @_;
$logtext =~ s/\e\[[0-9]*[A-Za-z]//g; $logtext =~ s/\e\[[0-9]*[A-Za-z]//g;

View file

@ -127,7 +127,12 @@ __PACKAGE__->belongs_to(
"build", "build",
"Hydra::Schema::Builds", "Hydra::Schema::Builds",
{ id => "build" }, { id => "build" },
{ join_type => "LEFT" }, {
is_deferrable => 0,
join_type => "LEFT",
on_delete => "CASCADE",
on_update => "NO ACTION",
},
); );
=head2 dependency =head2 dependency
@ -142,11 +147,16 @@ __PACKAGE__->belongs_to(
"dependency", "dependency",
"Hydra::Schema::Builds", "Hydra::Schema::Builds",
{ id => "dependency" }, { id => "dependency" },
{ join_type => "LEFT" }, {
is_deferrable => 0,
join_type => "LEFT",
on_delete => "NO ACTION",
on_update => "NO ACTION",
},
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-04-15 12:38:16 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sav9OmLm3qA/jiK5k+KIjw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:byU/SLN03zNJlSFbi/3Bcg
1; 1;

View file

@ -71,12 +71,12 @@ __PACKAGE__->belongs_to(
"hostname", "hostname",
"Hydra::Schema::BuildMachines", "Hydra::Schema::BuildMachines",
{ hostname => "hostname" }, { hostname => "hostname" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CpwMC8YMFC4B7gzGBdzh0A # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:im3sfvrv5YY3i1IAOozeiA
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -109,12 +109,12 @@ __PACKAGE__->has_many(
"buildmachinesystemtypes", "buildmachinesystemtypes",
"Hydra::Schema::BuildMachineSystemTypes", "Hydra::Schema::BuildMachineSystemTypes",
{ "foreign.hostname" => "self.hostname" }, { "foreign.hostname" => "self.hostname" },
{}, undef,
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wboDtUIBUkvEiUHpe09kkg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OST5IMcvHKsXlNMCRazXhg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -130,11 +130,16 @@ Related object: L<Hydra::Schema::Builds>
=cut =cut
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }, {}); __PACKAGE__->belongs_to(
"build",
"Hydra::Schema::Builds",
{ id => "build" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
);
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-02-29 00:47:18 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dzTKwZ7bby7kplnSgta3Gw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KHwh/Np40jxKXc3ijMImEQ
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration
1; 1;

View file

@ -49,11 +49,6 @@ __PACKAGE__->table("BuildSteps");
data_type: 'text' data_type: 'text'
is_nullable: 1 is_nullable: 1
=head2 logfile
data_type: 'text'
is_nullable: 1
=head2 busy =head2 busy
data_type: 'integer' data_type: 'integer'
@ -103,8 +98,6 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },
"outpath", "outpath",
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },
"logfile",
{ data_type => "text", is_nullable => 1 },
"busy", "busy",
{ data_type => "integer", is_nullable => 0 }, { data_type => "integer", is_nullable => 0 },
"status", "status",
@ -145,10 +138,15 @@ Related object: L<Hydra::Schema::Builds>
=cut =cut
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }, {}); __PACKAGE__->belongs_to(
"build",
"Hydra::Schema::Builds",
{ id => "build" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
);
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5H+OkGT0zQEWkAjU+OlBdg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ItI1OvxHfLTzLVEqfPRjHg
1; 1;

View file

@ -183,11 +183,6 @@ __PACKAGE__->table("Builds");
data_type: 'text' data_type: 'text'
is_nullable: 1 is_nullable: 1
=head2 logsize
data_type: 'bigint'
is_nullable: 1
=head2 size =head2 size
data_type: 'bigint' data_type: 'bigint'
@ -272,8 +267,6 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 1 }, { data_type => "integer", is_nullable => 1 },
"errormsg", "errormsg",
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },
"logsize",
{ data_type => "bigint", is_nullable => 1 },
"size", "size",
{ data_type => "bigint", is_nullable => 1 }, { data_type => "bigint", is_nullable => 1 },
"closuresize", "closuresize",
@ -310,7 +303,7 @@ __PACKAGE__->has_many(
"buildinputs_builds", "buildinputs_builds",
"Hydra::Schema::BuildInputs", "Hydra::Schema::BuildInputs",
{ "foreign.build" => "self.id" }, { "foreign.build" => "self.id" },
{}, undef,
); );
=head2 buildinputs_dependencies =head2 buildinputs_dependencies
@ -325,7 +318,7 @@ __PACKAGE__->has_many(
"buildinputs_dependencies", "buildinputs_dependencies",
"Hydra::Schema::BuildInputs", "Hydra::Schema::BuildInputs",
{ "foreign.dependency" => "self.id" }, { "foreign.dependency" => "self.id" },
{}, undef,
); );
=head2 buildproducts =head2 buildproducts
@ -340,7 +333,7 @@ __PACKAGE__->has_many(
"buildproducts", "buildproducts",
"Hydra::Schema::BuildProducts", "Hydra::Schema::BuildProducts",
{ "foreign.build" => "self.id" }, { "foreign.build" => "self.id" },
{}, undef,
); );
=head2 buildsteps =head2 buildsteps
@ -355,7 +348,7 @@ __PACKAGE__->has_many(
"buildsteps", "buildsteps",
"Hydra::Schema::BuildSteps", "Hydra::Schema::BuildSteps",
{ "foreign.build" => "self.id" }, { "foreign.build" => "self.id" },
{}, undef,
); );
=head2 job =head2 job
@ -370,7 +363,7 @@ __PACKAGE__->belongs_to(
"job", "job",
"Hydra::Schema::Jobs", "Hydra::Schema::Jobs",
{ jobset => "jobset", name => "job", project => "project" }, { jobset => "jobset", name => "job", project => "project" },
{}, { is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
); );
=head2 jobset =head2 jobset
@ -385,7 +378,7 @@ __PACKAGE__->belongs_to(
"jobset", "jobset",
"Hydra::Schema::Jobsets", "Hydra::Schema::Jobsets",
{ name => "jobset", project => "project" }, { name => "jobset", project => "project" },
{}, { is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
); );
=head2 jobsetevalinputs =head2 jobsetevalinputs
@ -400,7 +393,7 @@ __PACKAGE__->has_many(
"jobsetevalinputs", "jobsetevalinputs",
"Hydra::Schema::JobsetEvalInputs", "Hydra::Schema::JobsetEvalInputs",
{ "foreign.dependency" => "self.id" }, { "foreign.dependency" => "self.id" },
{}, undef,
); );
=head2 jobsetevalmembers =head2 jobsetevalmembers
@ -415,7 +408,7 @@ __PACKAGE__->has_many(
"jobsetevalmembers", "jobsetevalmembers",
"Hydra::Schema::JobsetEvalMembers", "Hydra::Schema::JobsetEvalMembers",
{ "foreign.build" => "self.id" }, { "foreign.build" => "self.id" },
{}, undef,
); );
=head2 project =head2 project
@ -426,7 +419,12 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
);
=head2 releasemembers =head2 releasemembers
@ -440,12 +438,12 @@ __PACKAGE__->has_many(
"releasemembers", "releasemembers",
"Hydra::Schema::ReleaseMembers", "Hydra::Schema::ReleaseMembers",
{ "foreign.build" => "self.id" }, { "foreign.build" => "self.id" },
{}, undef,
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-04-15 16:38:10 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:34:39
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AltTdmkzfwBMYToTkj84vA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wPBFqpUWncuD9xki8Pbnvg
__PACKAGE__->has_many( __PACKAGE__->has_many(
"dependents", "dependents",

View file

@ -122,7 +122,7 @@ __PACKAGE__->has_many(
"foreign.jobset" => "self.jobset", "foreign.jobset" => "self.jobset",
"foreign.project" => "self.project", "foreign.project" => "self.project",
}, },
{}, undef,
); );
=head2 jobset =head2 jobset
@ -137,7 +137,7 @@ __PACKAGE__->belongs_to(
"jobset", "jobset",
"Hydra::Schema::Jobsets", "Hydra::Schema::Jobsets",
{ name => "jobset", project => "project" }, { name => "jobset", project => "project" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
); );
=head2 project =head2 project
@ -148,10 +148,15 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZyDc4SrY9RfmsLK6VOqHhw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Vfl4QtuyeKeEk9+Ap7FP2A
1; 1;

View file

@ -130,7 +130,12 @@ __PACKAGE__->belongs_to(
"dependency", "dependency",
"Hydra::Schema::Builds", "Hydra::Schema::Builds",
{ id => "dependency" }, { id => "dependency" },
{ join_type => "LEFT" }, {
is_deferrable => 0,
join_type => "LEFT",
on_delete => "NO ACTION",
on_update => "NO ACTION",
},
); );
=head2 eval =head2 eval
@ -141,11 +146,16 @@ Related object: L<Hydra::Schema::JobsetEvals>
=cut =cut
__PACKAGE__->belongs_to("eval", "Hydra::Schema::JobsetEvals", { id => "eval" }, {}); __PACKAGE__->belongs_to(
"eval",
"Hydra::Schema::JobsetEvals",
{ id => "eval" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
);
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-04-15 16:38:10 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PNxVBdoUNeUzf5BztiIhLw # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ng+Q6tMX5EJMD7DxRWVy7Q
# You can replace this text with custom code or comments, and it will be preserved on regeneration # You can replace this text with custom code or comments, and it will be preserved on regeneration

View file

@ -75,7 +75,12 @@ Related object: L<Hydra::Schema::Builds>
=cut =cut
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }, {}); __PACKAGE__->belongs_to(
"build",
"Hydra::Schema::Builds",
{ id => "build" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
);
=head2 eval =head2 eval
@ -85,11 +90,16 @@ Related object: L<Hydra::Schema::JobsetEvals>
=cut =cut
__PACKAGE__->belongs_to("eval", "Hydra::Schema::JobsetEvals", { id => "eval" }, {}); __PACKAGE__->belongs_to(
"eval",
"Hydra::Schema::JobsetEvals",
{ id => "eval" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
);
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0K4lDPUQeK04SEXS5yBbeA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EVwSR9WBqbBdIHq1ANQMHg
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -127,7 +127,7 @@ __PACKAGE__->belongs_to(
"jobset", "jobset",
"Hydra::Schema::Jobsets", "Hydra::Schema::Jobsets",
{ name => "jobset", project => "project" }, { name => "jobset", project => "project" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
); );
=head2 jobsetevalinputs =head2 jobsetevalinputs
@ -142,7 +142,7 @@ __PACKAGE__->has_many(
"jobsetevalinputs", "jobsetevalinputs",
"Hydra::Schema::JobsetEvalInputs", "Hydra::Schema::JobsetEvalInputs",
{ "foreign.eval" => "self.id" }, { "foreign.eval" => "self.id" },
{}, undef,
); );
=head2 jobsetevalmembers =head2 jobsetevalmembers
@ -157,7 +157,7 @@ __PACKAGE__->has_many(
"jobsetevalmembers", "jobsetevalmembers",
"Hydra::Schema::JobsetEvalMembers", "Hydra::Schema::JobsetEvalMembers",
{ "foreign.eval" => "self.id" }, { "foreign.eval" => "self.id" },
{}, undef,
); );
=head2 project =head2 project
@ -168,11 +168,16 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-04-15 22:30:41 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jn81MbsAb5KZGwRpQ7qTEQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qElGj6zzuI0xo426np3r1w
__PACKAGE__->has_many( __PACKAGE__->has_many(
"buildIds", "buildIds",

View file

@ -105,11 +105,11 @@ __PACKAGE__->belongs_to(
"jobsetinput", "jobsetinput",
"Hydra::Schema::JobsetInputs", "Hydra::Schema::JobsetInputs",
{ jobset => "jobset", name => "input", project => "project" }, { jobset => "jobset", name => "input", project => "project" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-04-15 12:38:16 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M1pOjrCZ2RgULsIPZjN7sg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M3pNBRLfxgSScrPj1zaajA
1; 1;

View file

@ -88,7 +88,7 @@ __PACKAGE__->belongs_to(
"jobset", "jobset",
"Hydra::Schema::Jobsets", "Hydra::Schema::Jobsets",
{ name => "jobset", project => "project" }, { name => "jobset", project => "project" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
); );
=head2 jobsetinputalts =head2 jobsetinputalts
@ -107,7 +107,7 @@ __PACKAGE__->has_many(
"foreign.jobset" => "self.jobset", "foreign.jobset" => "self.jobset",
"foreign.project" => "self.project", "foreign.project" => "self.project",
}, },
{}, undef,
); );
=head2 jobsets =head2 jobsets
@ -126,11 +126,11 @@ __PACKAGE__->has_many(
"foreign.nixexprinput" => "self.name", "foreign.nixexprinput" => "self.name",
"foreign.project" => "self.project", "foreign.project" => "self.project",
}, },
{}, undef,
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F/eZhnWZHATn9+O6MzuPqA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xjioYUPo6visoLAVDkDZ0Q
1; 1;

View file

@ -157,7 +157,7 @@ __PACKAGE__->has_many(
"foreign.jobset" => "self.name", "foreign.jobset" => "self.name",
"foreign.project" => "self.project", "foreign.project" => "self.project",
}, },
{}, undef,
); );
=head2 jobs =head2 jobs
@ -175,7 +175,7 @@ __PACKAGE__->has_many(
"foreign.jobset" => "self.name", "foreign.jobset" => "self.name",
"foreign.project" => "self.project", "foreign.project" => "self.project",
}, },
{}, undef,
); );
=head2 jobsetevals =head2 jobsetevals
@ -193,7 +193,7 @@ __PACKAGE__->has_many(
"foreign.jobset" => "self.name", "foreign.jobset" => "self.name",
"foreign.project" => "self.project", "foreign.project" => "self.project",
}, },
{}, undef,
); );
=head2 jobsetinput =head2 jobsetinput
@ -208,7 +208,7 @@ __PACKAGE__->belongs_to(
"jobsetinput", "jobsetinput",
"Hydra::Schema::JobsetInputs", "Hydra::Schema::JobsetInputs",
{ jobset => "name", name => "nixexprinput", project => "project" }, { jobset => "name", name => "nixexprinput", project => "project" },
{}, { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
); );
=head2 jobsetinputs =head2 jobsetinputs
@ -226,7 +226,7 @@ __PACKAGE__->has_many(
"foreign.jobset" => "self.name", "foreign.jobset" => "self.name",
"foreign.project" => "self.project", "foreign.project" => "self.project",
}, },
{}, undef,
); );
=head2 project =head2 project
@ -237,10 +237,15 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ikvo8+cq03DzjEUvXSqYiQ # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9smV/zbSSxQNLiBcnADFXA
1; 1;

View file

@ -80,10 +80,15 @@ Related object: L<Hydra::Schema::Users>
=cut =cut
__PACKAGE__->belongs_to("author", "Hydra::Schema::Users", { username => "author" }, {}); __PACKAGE__->belongs_to(
"author",
"Hydra::Schema::Users",
{ username => "author" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YRMh0QI4JezFLj7nywGu6Q # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lnA5Utkwk5WTyKA/M5mlyg
1; 1;

View file

@ -68,7 +68,12 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
=head2 username =head2 username
@ -82,12 +87,12 @@ __PACKAGE__->belongs_to(
"username", "username",
"Hydra::Schema::Users", "Hydra::Schema::Users",
{ username => "username" }, { username => "username" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:09p6h8c3+hRIjw3XmX15rA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zW87n6E7xWaShcFbgFkVuw
# You can replace this text with custom content, and it will be preserved on regeneration # You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -106,7 +106,7 @@ __PACKAGE__->has_many(
"builds", "builds",
"Hydra::Schema::Builds", "Hydra::Schema::Builds",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 jobs =head2 jobs
@ -121,7 +121,7 @@ __PACKAGE__->has_many(
"jobs", "jobs",
"Hydra::Schema::Jobs", "Hydra::Schema::Jobs",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 jobsetevals =head2 jobsetevals
@ -136,7 +136,7 @@ __PACKAGE__->has_many(
"jobsetevals", "jobsetevals",
"Hydra::Schema::JobsetEvals", "Hydra::Schema::JobsetEvals",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 jobsets =head2 jobsets
@ -151,7 +151,7 @@ __PACKAGE__->has_many(
"jobsets", "jobsets",
"Hydra::Schema::Jobsets", "Hydra::Schema::Jobsets",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 owner =head2 owner
@ -162,7 +162,12 @@ Related object: L<Hydra::Schema::Users>
=cut =cut
__PACKAGE__->belongs_to("owner", "Hydra::Schema::Users", { username => "owner" }, {}); __PACKAGE__->belongs_to(
"owner",
"Hydra::Schema::Users",
{ username => "owner" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "CASCADE" },
);
=head2 projectmembers =head2 projectmembers
@ -176,7 +181,7 @@ __PACKAGE__->has_many(
"projectmembers", "projectmembers",
"Hydra::Schema::ProjectMembers", "Hydra::Schema::ProjectMembers",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 releasemembers =head2 releasemembers
@ -191,7 +196,7 @@ __PACKAGE__->has_many(
"releasemembers", "releasemembers",
"Hydra::Schema::ReleaseMembers", "Hydra::Schema::ReleaseMembers",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 releases =head2 releases
@ -206,7 +211,7 @@ __PACKAGE__->has_many(
"releases", "releases",
"Hydra::Schema::Releases", "Hydra::Schema::Releases",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 viewjobs =head2 viewjobs
@ -221,7 +226,7 @@ __PACKAGE__->has_many(
"viewjobs", "viewjobs",
"Hydra::Schema::ViewJobs", "Hydra::Schema::ViewJobs",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 views =head2 views
@ -236,12 +241,22 @@ __PACKAGE__->has_many(
"views", "views",
"Hydra::Schema::Views", "Hydra::Schema::Views",
{ "foreign.project" => "self.name" }, { "foreign.project" => "self.name" },
{}, undef,
); );
=head2 usernames
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 Type: many_to_many
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cnheEOmK/5fCX1ui4OWPog
Composing rels: L</projectmembers> -> username
=cut
__PACKAGE__->many_to_many("usernames", "projectmembers", "username");
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OCuhmxs8pZxvmk81eVLLcQ
# These lines were loaded from '/home/rbvermaa/src/hydra/src/lib/Hydra/Schema/Projects.pm' found in @INC. # These lines were loaded from '/home/rbvermaa/src/hydra/src/lib/Hydra/Schema/Projects.pm' found in @INC.
# They are now part of the custom portion of this file # They are now part of the custom portion of this file
# for you to hand-edit. If you do not either delete # for you to hand-edit. If you do not either delete

View file

@ -85,7 +85,12 @@ Related object: L<Hydra::Schema::Builds>
=cut =cut
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }, {}); __PACKAGE__->belongs_to(
"build",
"Hydra::Schema::Builds",
{ id => "build" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
=head2 project =head2 project
@ -95,7 +100,12 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
=head2 release =head2 release
@ -109,11 +119,11 @@ __PACKAGE__->belongs_to(
"release", "release",
"Hydra::Schema::Releases", "Hydra::Schema::Releases",
{ name => "release_", project => "project" }, { name => "release_", project => "project" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SBMfzENPE0BjEwc2HAK7IA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eP00w5UJp1uTtiB7D5IhTQ
1; 1;

View file

@ -81,7 +81,12 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" },
);
=head2 releasemembers =head2 releasemembers
@ -98,11 +103,11 @@ __PACKAGE__->has_many(
"foreign.project" => "self.project", "foreign.project" => "self.project",
"foreign.release_" => "self.name", "foreign.release_" => "self.name",
}, },
{}, undef,
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:W6GOMPv7hc2EAdVaBOvc3A # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UTUE3Hb89fT7prwnwwBgvQ
1; 1;

View file

@ -71,11 +71,11 @@ __PACKAGE__->belongs_to(
"username", "username",
"Hydra::Schema::Users", "Hydra::Schema::Users",
{ username => "username" }, { username => "username" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TySGsLoTpeSuThILIXUaVg # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KArPHyemtnm/siwE4x5mGQ
1; 1;

View file

@ -90,7 +90,7 @@ __PACKAGE__->has_many(
"newsitems", "newsitems",
"Hydra::Schema::NewsItems", "Hydra::Schema::NewsItems",
{ "foreign.author" => "self.username" }, { "foreign.author" => "self.username" },
{}, undef,
); );
=head2 projectmembers =head2 projectmembers
@ -105,10 +105,10 @@ __PACKAGE__->has_many(
"projectmembers", "projectmembers",
"Hydra::Schema::ProjectMembers", "Hydra::Schema::ProjectMembers",
{ "foreign.username" => "self.username" }, { "foreign.username" => "self.username" },
{}, undef,
); );
=head2 projects =head2 projects_2s
Type: has_many Type: has_many
@ -117,10 +117,10 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->has_many( __PACKAGE__->has_many(
"projects", "projects_2s",
"Hydra::Schema::Projects", "Hydra::Schema::Projects",
{ "foreign.owner" => "self.username" }, { "foreign.owner" => "self.username" },
{}, undef,
); );
=head2 userroles =head2 userroles
@ -135,12 +135,22 @@ __PACKAGE__->has_many(
"userroles", "userroles",
"Hydra::Schema::UserRoles", "Hydra::Schema::UserRoles",
{ "foreign.username" => "self.username" }, { "foreign.username" => "self.username" },
{}, undef,
); );
=head2 projects
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 Type: many_to_many
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3fmr8WMAE9Dg7TKom76YIQ
Composing rels: L</projectmembers> -> project
=cut
__PACKAGE__->many_to_many("projects", "projectmembers", "project");
# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OAUFl/teGpfeleb6D8FPlw
# These lines were loaded from '/home/rbvermaa/src/hydra/src/lib/Hydra/Schema/Users.pm' found in @INC. # These lines were loaded from '/home/rbvermaa/src/hydra/src/lib/Hydra/Schema/Users.pm' found in @INC.
# They are now part of the custom portion of this file # They are now part of the custom portion of this file
# for you to hand-edit. If you do not either delete # for you to hand-edit. If you do not either delete

View file

@ -116,7 +116,12 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
=head2 view =head2 view
@ -130,11 +135,11 @@ __PACKAGE__->belongs_to(
"view", "view",
"Hydra::Schema::Views", "Hydra::Schema::Views",
{ name => "view_", project => "project" }, { name => "view_", project => "project" },
{}, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U9/ovaBs9kFO3flG/MZ5uA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cbSUw113ENPypbd/sICfgg
1; 1;

View file

@ -82,7 +82,12 @@ Related object: L<Hydra::Schema::Projects>
=cut =cut
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" }, {}); __PACKAGE__->belongs_to(
"project",
"Hydra::Schema::Projects",
{ name => "project" },
{ is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" },
);
=head2 viewjobs =head2 viewjobs
@ -96,11 +101,11 @@ __PACKAGE__->has_many(
"viewjobs", "viewjobs",
"Hydra::Schema::ViewJobs", "Hydra::Schema::ViewJobs",
{ "foreign.project" => "self.project", "foreign.view_" => "self.name" }, { "foreign.project" => "self.project", "foreign.view_" => "self.name" },
{}, undef,
); );
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cP9XYKw4y9QL+PDJYy9M5w # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Vyd2+0RAF3XGTpq3KswfAQ
1; 1;

View file

@ -2,7 +2,16 @@ package Hydra::View::TT;
use strict; use strict;
use base 'Catalyst::View::TT'; use base 'Catalyst::View::TT';
use Hydra::Helper::Nix;
__PACKAGE__->config(TEMPLATE_EXTENSION => '.tt'); __PACKAGE__->config(
TEMPLATE_EXTENSION => '.tt',
expose_methods => [qw/log_exists/]);
sub log_exists {
my ($self, $c, $drvPath) = @_;
my $x = getDrvLogPath($drvPath);
return defined $x;
}
1; 1;

View file

@ -16,9 +16,9 @@
<tbody> <tbody>
[% FOREACH step IN build.buildsteps -%] [% FOREACH step IN build.buildsteps -%]
[% IF ( type == "All" ) || ( type == "Failed" && step.status != 0 ) || ( type == "Running" && step.busy == 1 ) -%] [% IF ( type == "All" ) || ( type == "Failed" && step.status != 0 ) || ( type == "Running" && step.busy == 1 ) -%]
[% log = c.uri_for('/build' build.id 'nixlog' step.stepnr) %] [% has_log = log_exists(step.drvpath);
<tr class="[% IF step.logfile %]clickable[% END %]" log = c.uri_for('/build' build.id 'nixlog' step.stepnr); -%]
[% IF step.logfile %] onclick="window.location = '[% log %]'" [% END %]> <tr [% IF has_log %] class="clickable" onclick="window.location = '[% log %]'" [% END %]>
<td>[% step.stepnr %]</td> <td>[% step.stepnr %]</td>
<td> <td>
[% IF step.type == 0 %] [% IF step.type == 0 %]
@ -51,7 +51,7 @@
[% ELSE %] [% ELSE %]
<span class="error">Failed: [% HTML.escape(step.errormsg) %]</span> <span class="error">Failed: [% HTML.escape(step.errormsg) %]</span>
[% END %] [% END %]
[% IF step.logfile %] [% IF has_log %]
(<a href="[% log %]">log</a>, <a href="[% "$log/raw" %]">raw</a>, <a href="[% "$log/tail-reload" %]">tail</a>) (<a href="[% log %]">log</a>, <a href="[% "$log/raw" %]">raw</a>, <a href="[% "$log/tail-reload" %]">tail</a>)
[% END %] [% END %]
</td> </td>
@ -124,11 +124,11 @@
</td> </td>
</tr> </tr>
[% END %] [% END %]
[% IF build.logfile %] [% IF log_exists(build.drvpath) %]
<tr> <tr>
<th>Logfile:</th> <th>Logfile:</th>
<td> <td>
<a class="btn btn-mini btn-primary" href="[% c.uri_for('/build' build.id 'log') %]">pretty</a> <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' 'raw') %]">raw</a>
<a class="btn btn-mini" href="[% c.uri_for('/build' build.id 'log' 'tail-reload') %]">tail</a> <a class="btn btn-mini" href="[% c.uri_for('/build' build.id 'log' 'tail-reload') %]">tail</a>
</td> </td>
@ -208,9 +208,9 @@
<pre class="buildlog">[% HTML.escape(build.errormsg) -%]</pre> <pre class="buildlog">[% HTML.escape(build.errormsg) -%]</pre>
[% END %] [% END %]
[% END %] [% END %]
[% IF logtext %] [% IF logtext %]
<h2>Log</h2> <h2>Log</h2>
<pre class="buildlog">[% HTML.escape(logtext) -%]</pre> <pre class="buildlog">[% HTML.escape(logtext) -%]</pre>
[% END %] [% END %]
</div> </div>
@ -275,16 +275,12 @@
</tr> </tr>
<tr> <tr>
<th>Maintainer(s):</th> <th>Maintainer(s):</th>
<td>[% IF build.maintainers %]<tt>[% HTML.escape(build.maintainers) %]</tt>[% ELSE %]<em>(not given)</em>[% END %]</td> <td>[% IF build.maintainers %][% HTML.escape(build.maintainers) %][% ELSE %]<em>(not given)</em>[% END %]</td>
</tr> </tr>
<tr> <tr>
<th>System:</th> <th>System:</th>
<td><tt>[% build.system %]</tt></td> <td><tt>[% build.system %]</tt></td>
</tr> </tr>
<tr>
<th>Max silent / timeout:</th>
<td>[% build.maxsilent %]s / [% build.timeout %]s</td>
</tr>
<tr> <tr>
<th>Derivation store path:</th> <th>Derivation store path:</th>
<td> <td>
@ -322,7 +318,6 @@
<td>[% INCLUDE renderFullBuildLink build=cachedBuild %]</td> <td>[% INCLUDE renderFullBuildLink build=cachedBuild %]</td>
</tr> </tr>
[% END %] [% END %]
<tr> <tr>
<th>Build started:</th> <th>Build started:</th>
<td>[% IF build.starttime %][% INCLUDE renderDateTime timestamp = build.starttime %][% ELSE %]<em>(cached build)</em>[% END %]</td> <td>[% IF build.starttime %][% INCLUDE renderDateTime timestamp = build.starttime %][% ELSE %]<em>(cached build)</em>[% END %]</td>
@ -331,26 +326,6 @@
<th>Build finished:</th> <th>Build finished:</th>
<td>[% IF build.stoptime %][% INCLUDE renderDateTime timestamp = build.stoptime %][% ELSE %]<em>(cached build)</em>[% END %]</td> <td>[% IF build.stoptime %][% INCLUDE renderDateTime timestamp = build.stoptime %][% ELSE %]<em>(cached build)</em>[% END %]</td>
</tr> </tr>
<tr>
<th>Duration:</th>
<td>
[% IF build.iscachedbuild %]
<em>(cached build)</em>
[% ELSE %]
[% INCLUDE renderDuration duration = build.stoptime - build.starttime %]
[% END %]
</td>
</tr>
[% IF build.logfile %]
<tr>
<th>Logfile:</th>
<td>
<a href="[% c.uri_for('/build' build.id 'log') %]"><strong>Available</strong></a>
(<a href="[% c.uri_for('/build' build.id 'log' 'raw') %]">raw</a>,
<a href="[% c.uri_for('/build' build.id 'log' 'tail-reload') %]">tail</a>)
</td>
</tr>
[% END %]
[% END %] [% END %]
[% IF !build.finished %] [% IF !build.finished %]
<tr> <tr>
@ -406,7 +381,7 @@
<p/> <p/>
[% IF prevBuild %] [% IF prevBuild %]
<h3>Changes since previous build : [% INCLUDE renderFullBuildLink build=prevBuild, hideProjectName=1, hideJobsetName=1 %]</h3> <h3>Changes since previous build: [% INCLUDE renderFullBuildLink build=prevBuild, hideProjectName=1, hideJobsetName=1 %]</h3>
[% INCLUDE renderInputDiff build2=build , build1=prevBuild %] [% INCLUDE renderInputDiff build2=build , build1=prevBuild %]
[% END %] [% END %]

View file

@ -156,7 +156,7 @@ sub sendEmailNotification {
$inputsTable->load(@lines); $inputsTable->load(@lines);
my $loglines = 50; my $loglines = 50;
my $logtext = logContents($build->logfile, $loglines); my $logtext = logContents($build->drvpath, $loglines);
$logtext = removeAsciiEscapes($logtext); $logtext = removeAsciiEscapes($logtext);
my $body = "Hi,\n" my $body = "Hi,\n"
@ -267,7 +267,6 @@ sub doBuild {
, drvpath => $drvPathStep , drvpath => $drvPathStep
, outpath => $2 , outpath => $2
, system => $3 , system => $3
, logfile => $4
, busy => 1 , busy => 1
, starttime => time , starttime => time
}); });
@ -314,7 +313,6 @@ sub doBuild {
, type => 0 # = build , type => 0 # = build
, drvpath => $drvPathStep , drvpath => $drvPathStep
, outpath => $2 , outpath => $2
, logfile => getBuildLog($drvPathStep)
, busy => 0 , busy => 0
, status => 1 , status => 1
, starttime => time , starttime => time
@ -376,10 +374,6 @@ sub doBuild {
} }
done: done:
my $logfile = getBuildLog($drvPath);
my $logsize = defined $logfile ? stat($logfile)->size : 0;
my $size = 0; my $size = 0;
my $closuresize = 0; my $closuresize = 0;
@ -409,8 +403,6 @@ sub doBuild {
, buildstatus => $buildStatus , buildstatus => $buildStatus
, starttime => $startTime , starttime => $startTime
, stoptime => $stopTime , stoptime => $stopTime
, logfile => $logfile
, logsize => $logsize
, size => $size , size => $size
, closuresize => $closuresize , closuresize => $closuresize
, errormsg => $errormsg , errormsg => $errormsg

View file

@ -40,9 +40,7 @@ sub unlockDeadBuilds {
} }
if ($unlock) { if ($unlock) {
print "build ", $build->id, " pid $pid died, unlocking\n"; print "build ", $build->id, " pid $pid died, unlocking\n";
$build->busy(0); $build->update({ busy => 0, locker => ""});
$build->locker("");
$build->update;
} }
} }
}); });
@ -113,11 +111,12 @@ sub checkBuilds {
my $logfile = getcwd . "/logs/" . $build->id; my $logfile = getcwd . "/logs/" . $build->id;
mkdir(dirname $logfile); mkdir(dirname $logfile);
unlink($logfile); unlink($logfile);
$build->busy(1); $build->update(
$build->locker($$); { busy => 1
$build->logfile($logfile); , locker => $$
$build->starttime(time); , logfile => $logfile
$build->update; , starttime => time()
});
push @buildsStarted, $build; push @buildsStarted, $build;
} }
} }

View file

@ -178,7 +178,6 @@ create table Builds (
errorMsg text, -- error message in case of a Nix failure errorMsg text, -- error message in case of a Nix failure
logSize bigint,
size bigint, size bigint,
closureSize bigint, closureSize bigint,
@ -201,8 +200,6 @@ create table BuildSteps (
drvPath text, drvPath text,
outPath text, outPath text,
logfile text,
busy integer not null, busy integer not null,
status integer, -- 0 = success, 1 = failed status integer, -- 0 = success, 1 = failed