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:
parent
9c42f60f08
commit
bb7f82840b
|
@ -126,9 +126,16 @@ static void findJobsWrapped(EvalState & state, XMLWriter & doc,
|
||||||
xmlAttrs["longDescription"] = queryMetaFieldString(meta, "longDescription");
|
xmlAttrs["longDescription"] = queryMetaFieldString(meta, "longDescription");
|
||||||
xmlAttrs["license"] = queryMetaFieldString(meta, "license");
|
xmlAttrs["license"] = queryMetaFieldString(meta, "license");
|
||||||
xmlAttrs["homepage"] = queryMetaFieldString(meta, "homepage");
|
xmlAttrs["homepage"] = queryMetaFieldString(meta, "homepage");
|
||||||
|
|
||||||
int prio = queryMetaFieldInt(meta, "schedulingPriority", 100);
|
int prio = queryMetaFieldInt(meta, "schedulingPriority", 100);
|
||||||
xmlAttrs["schedulingPriority"] = int2String(prio);
|
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;
|
string maintainers;
|
||||||
MetaValue value = meta["maintainers"];
|
MetaValue value = meta["maintainers"];
|
||||||
if (value.type == MetaValue::tpString)
|
if (value.type == MetaValue::tpString)
|
||||||
|
|
|
@ -541,6 +541,8 @@ sub checkBuild {
|
||||||
, license => $buildInfo->{license}
|
, license => $buildInfo->{license}
|
||||||
, homepage => $buildInfo->{homepage}
|
, homepage => $buildInfo->{homepage}
|
||||||
, maintainers => $buildInfo->{maintainers}
|
, maintainers => $buildInfo->{maintainers}
|
||||||
|
, maxsilent => $buildInfo->{maxSilent}
|
||||||
|
, timeout => $buildInfo->{timeout}
|
||||||
, nixname => $buildInfo->{nixName}
|
, nixname => $buildInfo->{nixName}
|
||||||
, drvpath => $drvPath
|
, drvpath => $drvPath
|
||||||
, outpath => $outPath
|
, outpath => $outPath
|
||||||
|
|
|
@ -128,6 +128,20 @@ __PACKAGE__->table("Builds");
|
||||||
is_nullable: 1
|
is_nullable: 1
|
||||||
size: undef
|
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
|
=head2 iscurrent
|
||||||
|
|
||||||
data_type: integer
|
data_type: integer
|
||||||
|
@ -261,6 +275,20 @@ __PACKAGE__->add_columns(
|
||||||
is_nullable => 1,
|
is_nullable => 1,
|
||||||
size => undef,
|
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",
|
"iscurrent",
|
||||||
{ data_type => "integer", default_value => 0, is_nullable => 1, size => undef },
|
{ data_type => "integer", default_value => 0, is_nullable => 1, size => undef },
|
||||||
"nixexprinput",
|
"nixexprinput",
|
||||||
|
@ -435,8 +463,8 @@ __PACKAGE__->has_many(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-03-05 13:07:46
|
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-05-26 09:25:50
|
||||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sE2/zTcfETC8Eahh6NQDZA
|
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OApfteImw84nYhUvSUB4FA
|
||||||
|
|
||||||
use Hydra::Helper::Nix;
|
use Hydra::Helper::Nix;
|
||||||
|
|
||||||
|
|
|
@ -274,6 +274,10 @@
|
||||||
<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>
|
||||||
|
|
|
@ -209,8 +209,10 @@ sub sendEmailNotification {
|
||||||
sub doBuild {
|
sub doBuild {
|
||||||
my ($build) = @_;
|
my ($build) = @_;
|
||||||
|
|
||||||
my $drvPath = $build->drvpath;
|
my $drvPath = $build->drvpath;
|
||||||
my $outPath = $build->outpath;
|
my $outPath = $build->outpath;
|
||||||
|
my $maxsilent = $build->maxsilent;
|
||||||
|
my $timeout = $build->timeout;
|
||||||
|
|
||||||
my $isCachedBuild = 1;
|
my $isCachedBuild = 1;
|
||||||
my $outputCreated = 1; # i.e., the Nix build succeeded (but it could be a positive failure)
|
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
|
# to get notifications about specific build steps, the
|
||||||
# associated log files, etc.
|
# associated log files, etc.
|
||||||
my $cmd = "nix-store --realise $drvPath " .
|
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 " .
|
"--no-build-output --log-type flat --print-build-trace " .
|
||||||
"--add-root " . gcRootFor $outPath . " 2>&1";
|
"--add-root " . gcRootFor $outPath . " 2>&1";
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,8 @@ create table Builds (
|
||||||
license text, -- meta.license
|
license text, -- meta.license
|
||||||
homepage text, -- meta.homepage
|
homepage text, -- meta.homepage
|
||||||
maintainers text, -- meta.maintainers (concatenated, comma-separated)
|
maintainers text, -- meta.maintainers (concatenated, comma-separated)
|
||||||
|
maxsilent integer default 3600, -- meta.maxsilent
|
||||||
|
timeout integer default 36000, -- meta.timeout
|
||||||
|
|
||||||
isCurrent integer default 0,
|
isCurrent integer default 0,
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue