Hydra: Add support for maxSilent meta attribute (also already added timeout, but not implemented the actual timeout for the build yet)

This commit is contained in:
Rob Vermaas 2010-05-26 08:03:59 +00:00
parent 9c42f60f08
commit bb7f82840b
6 changed files with 50 additions and 5 deletions

View file

@ -126,9 +126,16 @@ static void findJobsWrapped(EvalState & state, XMLWriter & doc,
xmlAttrs["longDescription"] = queryMetaFieldString(meta, "longDescription");
xmlAttrs["license"] = queryMetaFieldString(meta, "license");
xmlAttrs["homepage"] = queryMetaFieldString(meta, "homepage");
int prio = queryMetaFieldInt(meta, "schedulingPriority", 100);
xmlAttrs["schedulingPriority"] = int2String(prio);
int timeout = queryMetaFieldInt(meta, "timeout", 36000);
xmlAttrs["timeout"] = int2String(timeout);
int maxsilent = queryMetaFieldInt(meta, "maxSilent", 3600);
xmlAttrs["maxSilent"] = int2String(maxsilent);
string maintainers;
MetaValue value = meta["maintainers"];
if (value.type == MetaValue::tpString)

View file

@ -541,6 +541,8 @@ sub checkBuild {
, license => $buildInfo->{license}
, homepage => $buildInfo->{homepage}
, maintainers => $buildInfo->{maintainers}
, maxsilent => $buildInfo->{maxSilent}
, timeout => $buildInfo->{timeout}
, nixname => $buildInfo->{nixName}
, drvpath => $drvPath
, outpath => $outPath

View file

@ -128,6 +128,20 @@ __PACKAGE__->table("Builds");
is_nullable: 1
size: undef
=head2 maxsilent
data_type: integer
default_value: 3600
is_nullable: 1
size: undef
=head2 timeout
data_type: integer
default_value: 36000
is_nullable: 1
size: undef
=head2 iscurrent
data_type: integer
@ -261,6 +275,20 @@ __PACKAGE__->add_columns(
is_nullable => 1,
size => undef,
},
"maxsilent",
{
data_type => "integer",
default_value => 3600,
is_nullable => 1,
size => undef,
},
"timeout",
{
data_type => "integer",
default_value => 36000,
is_nullable => 1,
size => undef,
},
"iscurrent",
{ data_type => "integer", default_value => 0, is_nullable => 1, size => undef },
"nixexprinput",
@ -435,8 +463,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-03-05 13:07:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sE2/zTcfETC8Eahh6NQDZA
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-05-26 09:25:50
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OApfteImw84nYhUvSUB4FA
use Hydra::Helper::Nix;

View file

@ -274,6 +274,10 @@
<th>System:</th>
<td><tt>[% build.system %]</tt></td>
</tr>
<tr>
<th>Max silent / timeout:</th>
<td>[% build.maxsilent %]s / [% build.timeout %]s</td>
</tr>
<tr>
<th>Derivation store path:</th>
<td>

View file

@ -211,6 +211,8 @@ sub doBuild {
my $drvPath = $build->drvpath;
my $outPath = $build->outpath;
my $maxsilent = $build->maxsilent;
my $timeout = $build->timeout;
my $isCachedBuild = 1;
my $outputCreated = 1; # i.e., the Nix build succeeded (but it could be a positive failure)
@ -234,7 +236,7 @@ sub doBuild {
# to get notifications about specific build steps, the
# associated log files, etc.
my $cmd = "nix-store --realise $drvPath " .
"--max-silent-time 3600 --keep-going --fallback " .
"--max-silent-time $maxsilent --keep-going --fallback " .
"--no-build-output --log-type flat --print-build-trace " .
"--add-root " . gcRootFor $outPath . " 2>&1";

View file

@ -143,6 +143,8 @@ create table Builds (
license text, -- meta.license
homepage text, -- meta.homepage
maintainers text, -- meta.maintainers (concatenated, comma-separated)
maxsilent integer default 3600, -- meta.maxsilent
timeout integer default 36000, -- meta.timeout
isCurrent integer default 0,