* Caching of "path" inputs, and fake a revision number for those.
[?]
Nov 25, 2008, 2:59 PM
6BLUKEQ2M5RGWMPXPYIFIEVEUBV4PYAZ75S2WSBIATMRGYFMQZHQCDependencies
- [2]
H7CNGK4O* Log evaluation errors etc. in the DB. - [3]
B72GLND4 - [4]
YTZOC7C5* Editing of jobset inputs. - [5]
J5UVLXOK* Start of a basic Catalyst web interface. - [6]
VCOSLZRP - [7]
GWCV3TQV* BuildInputs table: link to dependencies, include store paths. - [8]
PHX2HIVG* Store info about the build inputs in the build record. - [9]
67P45PY4 - [10]
IK53RV4V - [11]
WYN733ST* Store build duration, handle cached builds. - [12]
TQKGQ5R3 - [13]
BVOPAMLS - [14]
DVNWJXWW* Generic declaration of build products. - [15]
L2E6EVE2* Merged the Build and Job tables. - [16]
SHBLLAVH* More global substitution. - [17]
CLJQCY2X* Store info about all the build actions and allow them to be - [18]
7YBYT2LQ - [19]
X27GNHDV* Basic job info in the database. - [20]
HJLYC753* Adding input value alternatives. - [21]
BD3GRK4B* Get rid of "positive failures" and separate log phases. - [22]
ZEHSSVFG - [23]
M552HLIA* Support variant builds. - [24]
KOTB7BKV - [25]
TLZ2SPBR - [26]
FDE3BJAP* Refactoring. - [*]
N22GPKYT* Put info about logs / build products in the DB.
Change contents
- replacement in src/Hydra/lib/Hydra/Schema/Buildinputs.pm at line 39
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:H8JAWhQt1ehZTEEPH2KGBw# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Nv28F7I+7azffAhYPWYTvA - replacement in src/Hydra/lib/Hydra/Schema/Buildproducts.pm at line 36
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EAo0rZSn+5Q5OY7Y1xjuyA# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Fj95oLQNEptO9LgSfclVGQ - replacement in src/Hydra/lib/Hydra/Schema/Buildresultinfo.pm at line 30
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5R03Kdy5ujkr7s9OfCNbTA# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CvVVHVHL2UEZ5XMkgf01OA - replacement in src/Hydra/lib/Hydra/Schema/Builds.pm at line 73
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:G1KBKGvEgnTcrgDkUnG1UQ# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ty4vMjEqpl6yM81PrOtjqA - replacement in src/Hydra/lib/Hydra/Schema/Buildschedulinginfo.pm at line 26
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MkMR6pE6mrN2BQL18ROYfA# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:81cloGb6HT/PTPgzB8v5Tg - replacement in src/Hydra/lib/Hydra/Schema/Buildsteps.pm at line 38
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JbawGso3rboFeQMX6XfgXQ# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cNgqL+ZLxQirdHUa/i6mww - replacement in src/Hydra/lib/Hydra/Schema/Jobsetinputalts.pm at line 34
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7+oJOQegjLhp5JeuCS0KPw# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zZEUHrrOIOIg1JH0Pgi5xg - replacement in src/Hydra/lib/Hydra/Schema/Jobsetinputs.pm at line 46
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BCzeQkhJYieHoL4ppjdJvw# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uzlil1U0VlHnTe1tvaRO4A - replacement in src/Hydra/lib/Hydra/Schema/Jobsets.pm at line 51
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kEcdBc9XKVhz6zO/XEkAxg# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ednIpbErLs3gjqQd9w4KsA - replacement in src/Hydra/lib/Hydra/Schema/Projects.pm at line 33
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rRYzLbd9BlZAQdOjT/GQcw# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OGLaq1Y/rLPlz+whXTZnzw - replacement in src/Hydra/lib/Hydra/Schema.pm at line 11
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 12:58:40# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iYwU4nHj9C2HkHwpYlVygQ# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 15:16:17# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:scYtOwO4xnXnKWlNGWyjcQ - edit in src/Hydra/programs/Scheduler.pl at line 7[2.1994][28.1392]
use POSIX qw(strftime); - replacement in src/Hydra/programs/Scheduler.pl at line 48[3.2738]→[2.2175:2246](∅→∅),[2.2246]→[3.6820:6956](∅→∅),[3.2738]→[3.6820:6956](∅→∅),[3.5346]→[3.6820:6956](∅→∅),[3.6820]→[3.6820:6956](∅→∅),[3.50]→[3.2187:2196](∅→∅)
print "copying input ", $input->name, " from $uri\n";my $storePath = `nix-store --add "$uri"`or die "cannot copy path $uri to the Nix store";chomp $storePath;my $timestamp = time;my $sha256;my $storePath;# Some simple caching: don't check a path more than once every N seconds.(my $cachedInput) = $db->resultset('Cachedpathinputs')->search({srcpath => $uri, lastseen => {">", $timestamp - 60}},{rows => 1, order_by => "lastseen DESC"});if (defined $cachedInput && isValidPath($cachedInput->storepath)) {print "CACHED $uri $cachedInput ", $cachedInput->timestamp, " ", $cachedInput->timestamp, "\n";$storePath = $cachedInput->storepath;$sha256 = $cachedInput->sha256hash;$timestamp = $cachedInput->timestamp;} else {print "copying input ", $input->name, " from $uri\n";$storePath = `nix-store --add "$uri"`or die "cannot copy path $uri to the Nix store";chomp $storePath;$sha256 = getStorePathHash $storePath;($cachedInput) = $db->resultset('Cachedpathinputs')->search({srcpath => $uri, sha256hash => $sha256});# Path inputs don't have a natural notion of a "revision",# so we simulate it by using the timestamp that we first# saw this path have this SHA-256 hash. So if the# contents of the path changes, we get a new "revision",# but if it doesn't change (or changes back), we don't get# a new "revision".if (!defined $cachedInput) {$db->txn_do(sub {$db->resultset('Cachedpathinputs')->create({ srcpath => $uri, timestamp => $timestamp, lastseen => $timestamp, sha256hash => $sha256, storepath => $storePath});});} else {$timestamp = $cachedInput->timestamp;$db->txn_do(sub {$cachedInput->lastseen(time);$cachedInput->update;});}} - replacement in src/Hydra/programs/Scheduler.pl at line 104
, sha256hash => getStorePathHash $storePath, sha256hash => $sha256, revision => strftime "%Y%m%d%H%M%S", gmtime($timestamp) - replacement in src/Hydra/programs/Scheduler.pl at line 183
#, revision => $input->{orig}->revision#, tag => $input->{orig}->tag, revision => $input->{revision} - replacement in src/Hydra/programs/Scheduler.pl at line 231
fetchInput($input, $alt, $inputInfo); # !!! cachingfetchInput($input, $alt, $inputInfo); - replacement in src/Hydra/programs/Scheduler.pl at line 234
push @newArgs, "--arg", $argName, "{path = " . $inputInfo->{$argName}->{storePath} . ";}";push @newArgs, "--arg", $argName,"{path = " . $inputInfo->{$argName}->{storePath} . ";" ." rev = \"" . $inputInfo->{$argName}->{revision} . "\";}"; - replacement in src/Hydra/root/build.tt at line 132
<tr><th>Name</th><th>Type</th><th>What</th><th>Store path</th></tr><tr><th>Name</th><th>Type</th><th>Value</th><th>Revision</th><th>Store path</th></tr> - edit in src/Hydra/root/build.tt at line 148
<td>[% IF input.revision %][% input.revision %][% END %]</td> - edit in src/hydra.sql at line 227
);-- Cache for inputs of type "path" (used for testing Hydra), storing-- the SHA-256 hash and store path for each source path. Also stores-- the timestamp when we first saw the path have these contents, which-- may be used to generate release names.create table CachedPathInputs (srcPath text not null,timestamp integer not null, -- when we first saw this hashlastSeen integer not null, -- when we last saw this hashsha256hash text not null,storePath text not null,primary key (srcPath, sha256hash)