Store the inputs of each evaluation in the database
[?]
Apr 15, 2012, 6:36 PM
G2T4WAHINIIKTEKR4JBIRXO5IEKO7MPYD7U5PQ4AIX3WL54EPP3ACDependencies
- [2]
DDMYFZ5XFix the jobset unchanged check - [3]
L2E6EVE2* Merged the Build and Job tables. - [4]
SB2V735VKeep track of the database schema version - [5]
SJLEZFC4check getHydraPath in stead of Envvar HYDRA_DBI directly - [6]
MOX7XJ2EMerge the BuildSchedulingInfo table into the Builds table - [7]
TJK27WSBOpen the DB using Hydra::Model::DB->new - [8]
5SHCWE7X* Prevent repeated evaluation of a jobset with the same inputs. This - [9]
ZTQEU5QSHydra: Add support for maxSilent meta attribute (also already added timeout, but not implemented the actual timeout for the build yet) - [10]
RFE6T5LG* Store jobset evaluations in the database explicitly. This includes - [11]
HPEG2RHVMerge the BuildResultInfo table into the Builds table - [12]
KPZNJ33U* In views, support selecting a job that doesn't depend on the - [*]
J5UVLXOK* Start of a basic Catalyst web interface. - [*]
JM3DPYOMgenerated schema with new dbix class schema loader, grrrrrr - [*]
D5QIOJGP* Move everything up one directory. - [*]
N22GPKYT* Put info about logs / build products in the DB. - [*]
34DPX2OR* Create some more indices on tables that have a foreign key reference - [*]
E2TOU3L6* More indices.
Change contents
- edit in src/lib/Hydra/Schema/Builds.pm at line 390
=head2 jobsetevalinputsType: has_manyRelated object: L<Hydra::Schema::JobsetEvalInputs> - edit in src/lib/Hydra/Schema/Builds.pm at line 397
=cut__PACKAGE__->has_many("jobsetevalinputs","Hydra::Schema::JobsetEvalInputs",{ "foreign.dependency" => "self.id" },{},); - replacement in src/lib/Hydra/Schema/Builds.pm at line 447
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-02-29 18:56:22# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w16c86FRReLPdA8H0yTIRg# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-04-15 16:38:10# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AltTdmkzfwBMYToTkj84vA - file addition: JobsetEvalInputs.pm[16.477]
use utf8;package Hydra::Schema::JobsetEvalInputs;# Created by DBIx::Class::Schema::Loader# DO NOT MODIFY THE FIRST PART OF THIS FILE=head1 NAMEHydra::Schema::JobsetEvalInputs=cutuse strict;use warnings;use base 'DBIx::Class::Core';=head1 TABLE: C<JobsetEvalInputs>=cut__PACKAGE__->table("JobsetEvalInputs");=head1 ACCESSORS=head2 evaldata_type: 'integer'is_foreign_key: 1is_nullable: 0=head2 namedata_type: 'text'is_nullable: 0=head2 altnrdata_type: 'integer'is_nullable: 0=head2 typedata_type: 'text'is_nullable: 0=head2 uridata_type: 'text'is_nullable: 1=head2 revisiondata_type: 'text'is_nullable: 1=head2 valuedata_type: 'text'is_nullable: 1=head2 dependencydata_type: 'integer'is_foreign_key: 1is_nullable: 1=head2 pathdata_type: 'text'is_nullable: 1=head2 sha256hashdata_type: 'text'is_nullable: 1=cut__PACKAGE__->add_columns("eval",{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },"name",{ data_type => "text", is_nullable => 0 },"altnr",{ data_type => "integer", is_nullable => 0 },"type",{ data_type => "text", is_nullable => 0 },"uri",{ data_type => "text", is_nullable => 1 },"revision",{ data_type => "text", is_nullable => 1 },"value",{ data_type => "text", is_nullable => 1 },"dependency",{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },"path",{ data_type => "text", is_nullable => 1 },"sha256hash",{ data_type => "text", is_nullable => 1 },);=head1 PRIMARY KEY=over 4=item * L</eval>=item * L</name>=item * L</altnr>=back=cut__PACKAGE__->set_primary_key("eval", "name", "altnr");=head1 RELATIONS=head2 dependencyType: belongs_toRelated object: L<Hydra::Schema::Builds>=cut__PACKAGE__->belongs_to("dependency","Hydra::Schema::Builds",{ id => "dependency" },{ join_type => "LEFT" },);=head2 evalType: belongs_toRelated object: L<Hydra::Schema::JobsetEvals>=cut__PACKAGE__->belongs_to("eval", "Hydra::Schema::JobsetEvals", { id => "eval" }, {});# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-04-15 16:38:10# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PNxVBdoUNeUzf5BztiIhLw# You can replace this text with custom code or comments, and it will be preserved on regeneration1; - edit in src/lib/Hydra/Schema/JobsetEvals.pm at line 118
=head2 jobsetevalinputsType: has_manyRelated object: L<Hydra::Schema::JobsetEvalInputs> - edit in src/lib/Hydra/Schema/JobsetEvals.pm at line 125
=cut__PACKAGE__->has_many("jobsetevalinputs","Hydra::Schema::JobsetEvalInputs",{ "foreign.eval" => "self.id" },{},); - replacement in src/lib/Hydra/Schema/JobsetEvals.pm at line 160
# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eQtF5bcR/qZ625LxWBc7ug# Created by DBIx::Class::Schema::Loader v0.07014 @ 2012-04-15 16:38:10# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Yt39QbkhH52hfpJZ4ZECeg - edit in src/script/hydra-evaluator at line 173
}foreach my $name (keys %{$inputInfo}) {for (my $n = 0; $n < scalar(@{$inputInfo->{$name}}); $n++) {my $input = $inputInfo->{$name}->[$n];$ev->jobsetevalinputs->create({ name => $name, altnr => $n, type => $input->{type}, uri => $input->{uri}, revision => $input->{revision}, value => $input->{value}, dependency => $input->{id}, path => $input->{storePath} || "" # !!! temporary hack, sha256hash => $input->{sha256hash}});} - edit in src/script/hydra-evaluator at line 191
- edit in src/sql/hydra.sql at line 443
);create table JobsetEvalInputs (eval integer not null references JobsetEvals(id) on delete cascade,name text not null,altNr integer not null,-- Copied from the jobsetinputs from which the build was created.type text not null,uri text,revision text,value text,dependency integer, -- build ID of the input, for type == 'build'path text,sha256hash text,primary key (eval, name, altNr),foreign key (dependency) references Builds(id) - edit in src/sql/hydra.sql at line 545[18.72][19.427]
create index IndexJobsetEvalMembersOnEval on JobsetEvalMembers(eval); - file addition: upgrade-6.sql[16.3004]
create index IndexJobsetEvalMembersOnEval on JobsetEvalMembers(eval);-- Inputs of jobset evals.create table JobsetEvalInputs (eval integer not null references JobsetEvals(id) on delete cascade,name text not null,altNr integer not null,-- Copied from the jobsetinputs from which the build was created.type text not null,uri text,revision text,value text,dependency integer, -- build ID of the input, for type == 'build'path text,sha256hash text,primary key (eval, name, altNr),foreign key (dependency) references Builds(id));-- Reconstruct the repository inputs for pre-existing evals. This is-- tricky (and not entirely possible) because builds are not uniquely-- part of a single eval, so they may have different inputs.-- For Subversion or Bazaar inputs, pick the highest revision for each-- input.insert into JobsetEvalInputs (eval, name, altNr, type, uri, revision)select e.id, b.name, 0, max(b.type), max(b.uri), max(b.revision)from (select id from JobsetEvals where hasNewBuilds = 1) ejoin JobsetEvalMembers m on e.id = m.evaljoin BuildInputs b on b.build = m.buildwhere (b.type = 'svn' or b.type = 'svn-checkout' or b.type = 'bzr' or b.type = 'bzr-checkout')group by e.id, b.namehaving count(distinct type) = 1 and count(distinct uri) = 1;-- For other inputs there is no "best" revision to pick, so only do-- the conversion if there is only one.insert into JobsetEvalInputs (eval, name, altNr, type, uri, revision)select e.id, b.name, 0, max(b.type), max(uri), max(revision)from (select id from JobsetEvals where hasNewBuilds = 1) ejoin JobsetEvalMembers m on e.id = m.evaljoin BuildInputs b on b.build = m.buildwhere (b.type != 'svn' and b.type != 'svn-checkout' and b.type != 'bzr' and b.type != 'bzr-checkout')and b.uri is not null and b.revision is not nulland not exists(select 1 from JobsetEvalInputs i where e.id = i.eval and b.name = i.name)group by e.id, b.namehaving count(distinct type) = 1 and count(distinct uri) = 1 and count(distinct revision) = 1;