From fcd511c4de79c09183177b854a605f3c8a2eaa5e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 5 Mar 2013 17:42:16 +0100 Subject: [PATCH] Revert "Remove now-unused SystemTypes table" This reverts commit 71d020735bb6f8e2f46a7813fe73d2a8dbe37add. Unfortunately there are still some cases where we need to set Hydra's concurrency separately. (Ideally, Hydra would start *all* queued builds in parallel and let Nix take care of everything...) --- doc/dev-notes.txt | 4 ++ src/lib/Hydra/Schema/SystemTypes.pm | 62 +++++++++++++++++++++++++++++ src/sql/hydra.sql | 6 +++ src/sql/upgrade-12.sql | 1 - tests/query-all-tables.pl | 2 +- 5 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 src/lib/Hydra/Schema/SystemTypes.pm delete mode 100644 src/sql/upgrade-12.sql diff --git a/doc/dev-notes.txt b/doc/dev-notes.txt index 6768d98b..8fa3b041 100644 --- a/doc/dev-notes.txt +++ b/doc/dev-notes.txt @@ -6,6 +6,10 @@ $ DBIC_TRACE=1 ./script/hydra_server.pl +* Setting the maximum number of concurrent builds per system type: + + $ sqlite3 hydra.sqlite "insert into SystemTypes(system, maxConcurrent) values('i686-linux', 3);" + * Creating a user: $ sqlite3 hydra.sqlite "insert into Users(userName, emailAddress, password) values('root', 'e.dolstra@tudelft.nl', '$(echo -n foobar | sha1sum | cut -c1-40)');" diff --git a/src/lib/Hydra/Schema/SystemTypes.pm b/src/lib/Hydra/Schema/SystemTypes.pm new file mode 100644 index 00000000..998b97c6 --- /dev/null +++ b/src/lib/Hydra/Schema/SystemTypes.pm @@ -0,0 +1,62 @@ +use utf8; +package Hydra::Schema::SystemTypes; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Hydra::Schema::SystemTypes + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("SystemTypes"); + +=head1 ACCESSORS + +=head2 system + + data_type: 'text' + is_nullable: 0 + +=head2 maxconcurrent + + data_type: 'integer' + default_value: 2 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "system", + { data_type => "text", is_nullable => 0 }, + "maxconcurrent", + { data_type => "integer", default_value => 2, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("system"); + + +# Created by DBIx::Class::Schema::Loader v0.07014 @ 2011-12-05 14:15:43 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zg8db3Cbi0QOv+gLJqH8cQ + +1; diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index c1781fb1..c1c68104 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -341,6 +341,12 @@ create table CachedCVSInputs ( ); +create table SystemTypes ( + system text primary key not null, + maxConcurrent integer not null default 2 +); + + -- Views are a mechanism to automatically group related builds -- together. A view definition consists of a build of some "primary" -- job, plus all builds of the other jobs named in ViewJobs that have diff --git a/src/sql/upgrade-12.sql b/src/sql/upgrade-12.sql deleted file mode 100644 index ab84423f..00000000 --- a/src/sql/upgrade-12.sql +++ /dev/null @@ -1 +0,0 @@ -drop table SystemTypes; diff --git a/tests/query-all-tables.pl b/tests/query-all-tables.pl index 2b2e946f..55cc779f 100755 --- a/tests/query-all-tables.pl +++ b/tests/query-all-tables.pl @@ -7,7 +7,7 @@ my $db = Hydra::Model::DB->new; my @sources = $db->schema->sources; my $nrtables = scalar(@sources); -use Test::Simple tests => 42; +use Test::Simple tests => 43; foreach my $source (@sources) { my $title = "Basic select query for $source";