hydra-update-gc-roots: Keep more evals

[?]
Sep 18, 2013, 11:10 AM
ACFFJUAN5R2AFJVVJ5OBX6BQHT3M4SHO7QXILF5LURVIFPDORLIQC

Dependencies

  • [2] MUBBWJPA Keep builds that failed with output
  • [3] AEFNBIIW * Merge the GC branch.
  • [4] I3X25POI hydra-update-gc-roots: Keep the most recent evaluations
  • [5] 2T42QGZD * Register builds as GC roots so they don't get deleted.
  • [6] A63IHCMX * Register GC roots properly.
  • [7] WZ3AEJ67 * hydra_update_gc_roots.pl registers build outputs that should be kept
  • [8] ONAQU4BR hydra: handle case where build to keep set to 0
  • [9] MOX7XJ2E Merge the BuildSchedulingInfo table into the Builds table
  • [10] KJQWSRCC Speed up hydra-update-gc-roots
  • [11] NEWDDAOF * Allow users to change the value of a build's "keep" flag, which
  • [12] SZPBGW2N Fix a race condition in hydra-update-gc-roots
  • [13] 6KJXJB7N qualify ordery_by clauses when necessary, remove unnecessary order_by's, reported by Ludo, resulted in errors in sqlite
  • [14] TJK27WSB Open the DB using Hydra::Model::DB->new
  • [15] E2X5OTFS Keep builds of disabled jobsets that are not hidden. Fixes #18.
  • [16] 4X6NS66Q * Keep the most recent builds for each job.
  • [17] PMNWRTGJ Add multiple output support
  • [18] HPEG2RHV Merge the BuildResultInfo table into the Builds table

Change contents

  • edit in src/script/hydra-update-gc-roots at line 59
    [3.302]
    [3.720]
    # For scheduled builds, we register the derivation as a GC root.
    print STDERR "*** looking for scheduled builds\n";
    keepBuild $_ foreach $db->resultset('Builds')->search({ finished => 0 }, { columns => [ @columns ] });
  • edit in src/script/hydra-update-gc-roots at line 89
    [3.306][3.306:334](),[3.334][3.920:921](),[3.921][3.343:475](),[3.343][3.343:475]()
    next;
    }
    if ($keepnr <= 0 ) {
    print STDERR "*** jobset ", $project->name, ":", $jobset->name, " set to keep 0 builds\n";
  • replacement in src/script/hydra-update-gc-roots at line 92
    [3.923][3.123:224]()
    print STDERR "*** looking for all builds in the $keepnr most recent evaluations of jobset ",
    [3.923]
    [3.18998]
    print STDERR "*** looking for all builds in the unfinished and $keepnr most recent finished evaluations of jobset ",
  • edit in src/script/hydra-update-gc-roots at line 94
    [3.19052]
    [3.797]
    my @evals;
    # Get the unfinished evals.
    push @evals, $_->get_column("eval") foreach $jobset->builds->search(
    { finished => 0 },
    { join => "jobsetevalmembers", select => "jobsetevalmembers.eval", as => "eval", distinct => 1 });
    # Get the N most recent finished evals.
    if ($keepnr) {
    push @evals, $_->get_column("id") foreach $jobset->jobsetevals->search(
    { hasNewBuilds => 1 },
    { where => \ "not exists (select 1 from builds b join jobsetevalmembers m on b.id = m.build where m.eval = me.id and b.finished = 0)"
    , order_by => "id desc", rows => $keepnr });
    }
  • replacement in src/script/hydra-update-gc-roots at line 112
    [2.116][2.116:145](),[2.145][3.349:617](),[3.349][3.349:617]()
    , id => { -in =>
    \ [ "select build from JobsetEvalMembers where eval in (select id from JobsetEvals where project = ? and jobset = ? and hasNewBuilds = 1 order by id desc limit ?)",
    [ '', $project->name ], [ '', $jobset->name ], [ '', $keepnr ] ] }
    [2.116]
    [2.146]
    , id => { -in => $db->resultset('JobsetEvalMembers')->search({ eval => { -in => [@evals] } }, { select => "build" })->as_query }
  • edit in src/script/hydra-update-gc-roots at line 135
    [3.1500][3.1304:1369](),[3.1369][3.2315:2366](),[3.769][3.2315:2366](),[3.2366][3.2620:2723](),[3.2723][3.1968:1970](),[3.1968][3.1968:1970]()
    # For scheduled builds, we register the derivation as a GC root.
    print STDERR "*** looking for scheduled builds\n";
    keepBuild $_ foreach $db->resultset('Builds')->search({ finished => 0 }, { columns => [ @columns ] });