hydra-update-gc-roots: Get Builds and BuildOutputs in the same query

[?]
Jun 11, 2015, 12:09 PM
YAT6VX542JXMSSS642S52K72636L7IM3F6ZDHCOUUB3325S7NHOQC

Dependencies

  • [2] AGNPN3WH Keep the most recent successful build of current jobs
  • [3] PMNWRTGJ Add multiple output support
  • [4] HLYVEJX7 * Keep the 3 most recent builds for every platform for every job.
  • [5] WZ3AEJ67 * hydra_update_gc_roots.pl registers build outputs that should be kept
  • [6] KJQWSRCC Speed up hydra-update-gc-roots
  • [7] SLBM7H4Q hydra-update-gc-roots: Keep derivations of failed builds

Change contents

  • replacement in src/script/hydra-update-gc-roots at line 25
    [3.1073][3.0:113]()
    my @columns = ( "id", "project", "jobset", "job", "system", "finished", "drvpath", "timestamp", "buildstatus" );
    [3.1073]
    [2.0]
    my @columns =
    ( "id", "project", "jobset", "job", "system", "finished", "drvpath", "timestamp", "buildstatus"
    , { "outpaths" => \ "(select string_agg(path, ' ') from BuildOutputs where build = me.id)" }
    );
  • replacement in src/script/hydra-update-gc-roots at line 41
    [3.240][3.240:373]()
    foreach my $out ($build->buildoutputs->all) {
    if (isValidPath($out->path)) {
    addRoot $out->path;
    [3.240]
    [3.373]
    foreach my $path (split / /, $build->get_column('outpaths')) {
    if (isValidPath($path)) {
    addRoot $path;
  • replacement in src/script/hydra-update-gc-roots at line 45
    [3.394][3.394:501]()
    print STDERR " warning: output ", $out->path, " has disappeared\n" if $build->finished;
    [3.394]
    [3.501]
    print STDERR " warning: output ", $path, " has disappeared\n" if $build->finished;