* Prevent repeated evaluation of a jobset with the same inputs. This

should make the Hydra scheduler a lot less CPU-intensive, since it
  won't run hydra_eval_jobs all the time.
This commit is contained in:
Eelco Dolstra
2009-11-17 13:55:22 +00:00
parent 2bcedde1c8
commit 7eda090e74
6 changed files with 112 additions and 5 deletions

View File

@ -8,7 +8,7 @@ use IPC::Run;
use Hydra::Helper::Nix;
our @ISA = qw(Exporter);
our @EXPORT = qw(fetchInput evalJobs checkBuild);
our @EXPORT = qw(fetchInput evalJobs checkBuild inputsToArgs);
sub getStorePathHash {

View File

@ -0,0 +1,59 @@
package Hydra::Schema::JobsetInputHashes;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
use strict;
use warnings;
use base 'DBIx::Class';
__PACKAGE__->load_components("Core");
__PACKAGE__->table("JobsetInputHashes");
__PACKAGE__->add_columns(
"project",
{
data_type => "text",
default_value => undef,
is_foreign_key => 1,
is_nullable => 0,
size => undef,
},
"jobset",
{
data_type => "text",
default_value => undef,
is_foreign_key => 1,
is_nullable => 0,
size => undef,
},
"hash",
{
data_type => "text",
default_value => undef,
is_nullable => 0,
size => undef,
},
"timestamp",
{
data_type => "integer",
default_value => undef,
is_nullable => 0,
size => undef,
},
);
__PACKAGE__->set_primary_key("project", "jobset", "hash");
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" });
__PACKAGE__->belongs_to(
"jobset",
"Hydra::Schema::Jobsets",
{ name => "jobset", project => "project" },
);
# Created by DBIx::Class::Schema::Loader v0.04999_09 @ 2009-11-17 14:04:55
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f8/4vTSQJbmAh/0PZHeFDg
# You can replace this text with custom content, and it will be preserved on regeneration
1;

View File

@ -104,10 +104,18 @@ __PACKAGE__->has_many(
"foreign.project" => "self.project",
},
);
__PACKAGE__->has_many(
"jobsetinputhashes",
"Hydra::Schema::JobsetInputHashes",
{
"foreign.jobset" => "self.name",
"foreign.project" => "self.project",
},
);
# Created by DBIx::Class::Schema::Loader v0.04999_09 @ 2009-10-23 16:56:03
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M+eetraKtSfF8q3cqJhEPw
# Created by DBIx::Class::Schema::Loader v0.04999_09 @ 2009-11-17 14:04:55
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xWsqXneZw90uEw/vcEXc4w
# You can replace this text with custom content, and it will be preserved on regeneration

View File

@ -87,10 +87,15 @@ __PACKAGE__->has_many(
"Hydra::Schema::ReleaseMembers",
{ "foreign.project" => "self.name" },
);
__PACKAGE__->has_many(
"jobsetinputhashes",
"Hydra::Schema::JobsetInputHashes",
{ "foreign.project" => "self.name" },
);
# Created by DBIx::Class::Schema::Loader v0.04999_09 @ 2009-10-23 16:56:03
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zhL+ArisX2ZFU0NPIuDLdw
# Created by DBIx::Class::Schema::Loader v0.04999_09 @ 2009-11-17 14:04:55
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dWe2DEsuZuOjVj4IA8TwQg
# You can replace this text with custom content, and it will be preserved on regeneration