recording the builds that are part of a jobset evaluation. We need
this to be able to answer queries such as "return the latest NixOS
ISO for which the installation test succeeded". This wasn't previously
possible because the database didn't record which builds of (say)
the isoMinimal' job and the
tests.installer.simple' job came from
the same evaluation of the nixos:trunk jobset.
Keeping a record of evaluations is also useful for logging purposes.
RFE6T5LGBFFNEPHZOPF4UNMFC2L4CGD5TPAMOXDLRPH3TZJ43UBAC
VVOAXWH4EKVYSDOOKDQN3FHU2JRNNKEG7G4E7YRB7HEVYXHVP63QC
UUGBVEGYV3FUNL7D3ECA2DIMFHE2S5UQF4ACSLESX3M3NRYYE57AC
QNDXPVCIRJRPFTYNRDCQC5KORSYB5FPX7IAM6UGACWCU6HWYT6CAC
P5X4P6VKS5CJOOLJRVL66GRJLDLVC3EKAVAHP2RJOXQJ7WTYAUBQC
OG7BEM57MXPCG56IT5GODPFG77KZXWPXZ7OVZPWQQ56CRJ7KUE2QC
IXCUNELFZBXTEZKZJXJFP3AFPRHCWJ4NEQC2FSKTOYIZDP74O3RQC
OOQ2D3KCLFPYNAN253PHWLBQMB6OMO2KYQWQXLTP65SQAYZWQ5LAC
3XTHEUMP2ZOMPQWE3S5QWHIHCEJNEXGDPQB3JUVZFPS3RFMY455QC
JM3DPYOMVNMCL5GMEYC3Y4NDRGTNIFBBFTPGPVT66GPENVPU7EVQC
L2E6EVE2RVFVDCUNRJ4CZYSQNS2DZUA5DTBETHBDUQUV2KQQRAOQC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
SJLEZFC472OWVCR7WEUUYNS6BJDDR77SHWADKDCPIS2INMTPTIVAC
D5QIOJGPKQJIYBUCSC3MFJ3TXLPNZ2XMI37GXMFRVRFWWR2VMTFAC
5SHCWE7XPQORSOLY7HGAIK2ODKBFPY4KVXRL2W7X6D4WALU544HQC
X27GNHDV5KPZ5GSH6DCAJMNCEMZLCP7M43JWF2X3O5QWXMOX273AC
FYO6NECE4YJC76HQIG35NNJABODV7KNQKREK5YKZU6O2MNNSQTMAC
ZDENAYQI5DRRNUIDVKUGC45NK6C4ZFUL5FYMACTRZOCYQXPMY63QC
N22GPKYTOLZLBGTGDATQDVZ4R5APZEAOIA7L32X4UXBH4XNI7MWAC
POPU2ATH2HHBTGHKRAV3EY2K55P664IARI3YJGLDKVJ6PQPXBQ4AC
7ZHHVD6QVZCR7OHF3OIS52DF7ZIQDIS27OXCKOGMFDO2CTIOGI5AC
FDE3BJAPDEP3BYT5A5GEGLNXPPZLA2KTGXB4ZNYRP4LJ7IFRKYXAC
A63IHCMXH3F4V56HDXJLJVVHKXRSJCJMT2PWXXI2IW3J734J6SGQC
H7CNGK4OJNRYZQGPLBGR72DULLEPFQ5UISF5J24D7IMA7SYW5LGQC
S6OISBQ3HPFHAAQ5ENG7N3MNGOPNEJPIFKSSA5N4G6KJQTQBSSLQC
IWHFLFVVP2W5E6P5R2ATDSZ66OYE3KZZY26KTFPZUPXI7SYPMMWAC
S5PV6IIMKJ7PGWIFLLXERHYF3BCP2UEGFRZEZLD6UUBLVEZXJLUAC
BTOXLRG37PPI4MPXMVGZP2GJVUHV5LFMR3EMIWZMRZEJGV23M72QC
M552HLIAP52D42AVXVC5SGROAYN2TBCEUZOXESWEMBBUX7G3U6TAC
TIOBBINAK6IEDTCFBP67QDP3U7BHPVJOHBD6FEHASSSIQGNLCUXAC
YAPITGB3ENS6PXRBFC647ESCQUYG442DKHUPM46PJKCKTMHWGVXAC
67P45PY4GTWQXZRCMR734D5YYN2OERZM57NBB2CZXEULQT2GRFNAC
RBNQKATLSAKTGW2IRNB5CRV3SEH5F6E4BPVWX4BII7MH5TCIPINQC
* Find the builds with the highest number of build steps:
select id, (select count(*) from buildsteps where build = x.id) as n from builds x order by n desc;
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 10:29:41
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yEhHeANRynKf72dp5URvZA
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-03-05 13:07:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qOU/YGv3fgPynBXovV6gfg
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 11:19:24
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oCkX9bughWPZg6JKaOxDJA
Type: has_many
Related object: L<Hydra::Schema::JobsetEvalMembers>
=cut
__PACKAGE__->has_many(
"jobsetevalmembers",
"Hydra::Schema::JobsetEvalMembers",
{ "foreign.build" => "self.id" },
);
package Hydra::Schema::JobsetEvalMembers;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 NAME
Hydra::Schema::JobsetEvalMembers
=cut
__PACKAGE__->table("JobsetEvalMembers");
=head1 ACCESSORS
=head2 eval
data_type: integer
default_value: undef
is_foreign_key: 1
is_nullable: 0
size: undef
=head2 build
data_type: integer
default_value: undef
is_foreign_key: 1
is_nullable: 0
size: undef
=head2 isnew
data_type: integer
default_value: undef
is_nullable: 0
size: undef
=cut
__PACKAGE__->add_columns(
"eval",
{
data_type => "integer",
default_value => undef,
is_foreign_key => 1,
is_nullable => 0,
size => undef,
},
"build",
{
data_type => "integer",
default_value => undef,
is_foreign_key => 1,
is_nullable => 0,
size => undef,
},
"isnew",
{
data_type => "integer",
default_value => undef,
is_nullable => 0,
size => undef,
},
);
__PACKAGE__->set_primary_key("eval", "build");
=head1 RELATIONS
=head2 eval
Type: belongs_to
Related object: L<Hydra::Schema::JobsetEvals>
=cut
__PACKAGE__->belongs_to("eval", "Hydra::Schema::JobsetEvals", { id => "eval" }, {});
=head2 build
Type: belongs_to
Related object: L<Hydra::Schema::Builds>
=cut
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }, {});
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-03-05 13:07:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vwefi8q3HolhFCkB9aEVWw
# You can replace this text with custom content, and it will be preserved on regeneration
1;
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 10:29:41
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dK9vFHXInejDW/rl1i/kFA
use Hydra::Helper::Nix;
# !!! Ugly, should be generated.
my $hydradbi = getHydraDBPath;
if ($hydradbi =~ m/^dbi:Pg/) {
__PACKAGE__->sequence('jobsetevals_id_seq');
}
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 10:29:41
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ORCZ73BJrscvmyf/4ds0UQ
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-03-05 13:07:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Z0HutYxnzYVuQc3W51mq5Q
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 10:29:41
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yH/9hz6FH09kgusRNWrqPg
# Created by DBIx::Class::Schema::Loader v0.05000 @ 2010-03-05 13:07:45
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SXJ+FzgNDad87OKSBH2qrg
# Schedule each successfully evaluated job.
my %currentBuilds;
foreach my $job (permute @{$jobs->{job}}) {
next if $job->{jobName} eq "";
print "considering job " . $job->{jobName} . "\n";
checkBuild($db, $project, $jobset, $inputInfo, $nixExprInput, $job, \%currentBuilds);
}
my $evalStop = time;
$jobset->jobsetinputhashes->create({hash => $argsHash, timestamp => time});
my $ev = $jobset->jobsetevals->create(
{ hash => $argsHash
, timestamp => time
, checkouttime => abs($checkoutStop - $checkoutStart)
, evaltime => abs($evalStop - $evalStart)
, hasnewbuilds => $hasNewBuilds
});
if ($hasNewBuilds) {
while (my ($id, $new) = each %currentBuilds) {
$ev->jobsetevalmembers->create({ build => $id, isnew => $new });
}
}
-- This table is used to prevent repeated Nix expression evaluation
-- for the same set of inputs for a jobset. In the scheduler, after
-- obtaining the current inputs for a jobset, we hash the inputs
-- together, and if the resulting hash already appears in this table,
-- we can skip the jobset. Otherwise it's added to the table, and the
-- Nix expression for the jobset is evaluated. The hash is computed
-- over the command-line arguments to hydra_eval_jobs.
create table JobsetInputHashes (
create table JobsetEvals (
#ifdef POSTGRESQL
id serial primary key not null,
#else
id integer primary key autoincrement not null,
#endif
timestamp integer not null, -- when this entry was added
checkoutTime integer not null, -- how long obtaining the inputs took (in seconds)
evalTime integer not null, -- how long evaluation took (in seconds)
-- If 0, then the evaluation of this jobset did not cause any new
-- builds to be added to the database. Otherwise, *all* the
-- builds resulting from the evaluation of the jobset (including
-- existing ones) can be found in the JobsetEvalMembers table.
hasNewBuilds integer not null,
-- Used to prevent repeated Nix expression evaluation for the same
-- set of inputs for a jobset. In the scheduler, after obtaining
-- the current inputs for a jobset, we hash the inputs together,
-- and if the resulting hash already appears in this table, we can
-- skip the jobset. Otherwise we proceed. The hash is computed
-- over the command-line arguments to hydra_eval_jobs.