* Keep the most recent builds for each job.
[?]
Feb 6, 2009, 2:17 PM
4X6NS66QDWR4S4ZZFKN2QOJQII5ZYIMTDYRHK25N6NJSROVLHJ6QCDependencies
- [2]
WZ3AEJ67* hydra_update_gc_roots.pl registers build outputs that should be kept - [*]
N22GPKYT* Put info about logs / build products in the DB. - [*]
FHF6IZJQ* Basic release management: releases are now dynamically computed as
Change contents
- edit in src/Hydra/script/hydra_update_gc_roots.pl at line 8
use POSIX qw(strftime); - replacement in src/Hydra/script/hydra_update_gc_roots.pl at line 20
print "$path\n";#print "$path\n"; - replacement in src/Hydra/script/hydra_update_gc_roots.pl at line 26
if (!-e $link) {if (!-l $link) { - replacement in src/Hydra/script/hydra_update_gc_roots.pl at line 28
or die "cannot creating symlink in $gcRootsDir to $path";or die "cannot create symlink in $gcRootsDir to $path"; - replacement in src/Hydra/script/hydra_update_gc_roots.pl at line 35
# Determine which builds to keep automatically.my %pathsToKeep;sub keepBuild {my ($build) = @_;print "keeping build ", $build->id, " (",strftime("%Y-%m-%d %H:%M:%S", localtime($build->timestamp)), ")\n";if (isValidPath($build->outpath)) {registerRoot $build->outpath;} else {print STDERR "warning: output ", $build->outpath, " has disappeared\n";}} - edit in src/Hydra/script/hydra_update_gc_roots.pl at line 46
# TODO - edit in src/Hydra/script/hydra_update_gc_roots.pl at line 47
# Go over all jobs in all projects. - replacement in src/Hydra/script/hydra_update_gc_roots.pl at line 49
# For finished builds, we only keep the output path, not the derivation.foreach my $build ($db->resultset('Builds')->search({finished => 1, buildStatus => 0}, {join => 'resultInfo'})) {if ($build->resultInfo->keep || defined $pathsToKeep{$build->outpath}) {if (isValidPath($build->outpath)) {registerRoot $build->outpath;} else {print STDERR "warning: output ", $build->outpath, " has disappeared\n";}foreach my $project ($db->resultset('Projects')->all) {foreach my $job ($project->builds->search({},{select => [{distinct => 'attrname'}], as => ['attrname']})){print "*** looking for builds to keep in ", $project->name, ":", $job->attrname, "\n";# Keep the N most recent successful builds for each job and# platform.my @recentBuilds = $project->builds->search({ attrname => $job->attrname, finished => 1, buildStatus => 0 # == success},{ join => 'resultInfo', order_by => 'timestamp DESC', rows => 3 # !!! should make this configurable});keepBuild $_ foreach @recentBuilds; - edit in src/Hydra/script/hydra_update_gc_roots.pl at line 73
# Keep all builds that have been marked as "keep".print "*** looking for kept builds\n";my @buildsToKeep = $db->resultset('Builds')->search({finished => 1, keep => 1}, {join => 'resultInfo'});keepBuild $_ foreach @buildsToKeep; - edit in src/Hydra/script/hydra_update_gc_roots.pl at line 80
print "*** looking for scheduled builds\n"; - edit in src/Hydra/sql/hydra.sql at line 343[5.12735][5.12735]
-- !!! urgh: "release" is a reserved keyword in sqlite >= 3.6.8!