Add an action to cancel all builds in a jobset eval

[?]
Oct 4, 2013, 1:40 PM
UOINKJ2JBCRTZPFTAXDPRJOEUWWPJ43IGVWLRIRLIGHLBMWDOGDQC

Dependencies

  • [2] DETQRBBR clear_queue_non_current: Don't use isCurrent
  • [3] GEADFVZ5 hydra-queue-runner: Improved scheduling
  • [4] 6HWHYPSW Add an action menu to evaluations
  • [5] Z6MDQIGO * A quick (non-Web 2.0) interface to manually add builds to a release.
  • [6] OD5FSS5A * Quick hack to allow viewing of dependency graphs (via nix-store -q
  • [7] MOX7XJ2E Merge the BuildSchedulingInfo table into the Builds table
  • [8] PMNWRTGJ Add multiple output support
  • [9] YLMZLL2U Fix a reference to BuildResultInfo
  • [10] HPEG2RHV Merge the BuildResultInfo table into the Builds table
  • [11] ZILILXXK * Allow scheduled builds to be cancelled. They're not removed from
  • [12] 3XTHEUMP * Implemented the clone feature.
  • [13] GJFYEU3S * Nix now stores logs by default as bzip2, make sure the build page uncompresses before showing.
  • [14] R6B5CAFF Let Builds.timestamp refer to the time the build was added
  • [15] A52HEFHQ * Allow builds to be restarted (if they failed with a transient error,
  • [16] RXSEJG7W Do not delete builds when clearing the queue. Fixes #8.
  • [17] BDSD2JLV * Speed up manifest generation.
  • [18] B7IDAXTZ Admin controller: Use PathPart, not Path
  • [19] LZVO64YG Merge in the first bits of the API work
  • [20] AFTXA575 * $HYDRA_DATA environment variable.
  • [21] LBNVQXUB * Build the /build stuff in a separate controller.
  • [22] NEWDDAOF * Allow users to change the value of a build's "keep" flag, which
  • [23] BEKA3TMM Hydra/25: At job pages, show the hash of the output
  • [24] 2T42QGZD * Register builds as GC roots so they don't get deleted.
  • [25] LZO3C2KI * Hack around those SQLite timeouts: just retry the transaction.
  • [26] PZL3SZM3 Give every page a consistent title
  • [27] 5NSQUYBS Clear failed builds etc.: Redirect back to the referrer
  • [28] OSVLMLCQ hydra: factored out build restart and
  • [29] SKQXOQ7T hydra: fixed missing argument to restartbuild function
  • [30] OEPUOUNB Using twitter bootstrap for more consistent looks for Hydra
  • [31] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [32] S5GCSCNS Update bootstrap to 2.3.1
  • [33] 67NFGL7D add links in admin page to clear queue (all non-running builds, and all non-running old (non-current) builds)
  • [34] WRIU3S5E * UI for cloning builds (not functional yet).
  • [35] 3PNG7NIB Remove trailing whitespace
  • [36] JAH3UPWA Support revision control systems via plugins
  • [37] JARRBLZD Bootstrapify the Hydra forms (except the project and jobset edit pages)
  • [*] ZWCTAZGL added newsitems, added some admin options to clear various caches.
  • [*] U4TD3AIQ Add support for viewing jobset evaluations
  • [*] T273UOB7 Support obtaining the contents of an evaluation as a channel
  • [*] 2GK5DOU7 * Downloading closures.
  • [*] QL55ECJ6 - adapted ui for hydra, more in line with nixos.org website

Change contents

  • replacement in src/lib/Hydra/Controller/Admin.pm at line 37
    [5.117][5.436:459](),[5.459][2.0:37]()
    my $time = time();
    $c->model('DB::Builds')->search(
    [5.117]
    [2.37]
    my $builds = $c->model('DB::Builds')->search(
  • replacement in src/lib/Hydra/Controller/Admin.pm at line 40
    [2.239][2.239:348]()
    }, {})
    ->update({ finished => 1, buildstatus => 4, starttime => $time, stoptime => $time });
    [2.239]
    [5.0]
    });
    my $n = cancelBuilds($c->model('DB')->schema, $builds);
    $c->flash->{successMsg} = "$n builds have been cancelled.";
  • edit in src/lib/Hydra/Controller/Build.pm at line 63
    [5.61][5.0:51]()
    $c->stash->{flashMsg} = $c->flash->{buildMsg};
  • replacement in src/lib/Hydra/Controller/Build.pm at line 450
    [5.757][5.306:363]()
    $c->flash->{buildMsg} = "Build has been restarted.";
    [5.757]
    [5.623]
    $c->flash->{successMsg} = "Build has been restarted.";
  • edit in src/lib/Hydra/Controller/Build.pm at line 458
    [5.534][5.534:535]()
  • edit in src/lib/Hydra/Controller/Build.pm at line 459
    [5.571][5.571:572]()
  • replacement in src/lib/Hydra/Controller/Build.pm at line 460
    [5.618][5.618:619](),[5.619][5.43:85](),[5.85][5.661:714](),[5.661][5.661:714](),[5.714][5.1523:1572](),[5.1572][5.779:954](),[5.779][5.779:954](),[5.954][5.698:725](),[5.725][5.0:24](),[5.954][5.0:24](),[5.24][5.726:765](),[5.765][5.82:147](),[5.82][5.82:147](),[5.147][5.766:831](),[5.147][5.1202:1218](),[5.831][5.1202:1218](),[5.1202][5.1202:1218](),[5.1259][5.1259:1325](),[5.1325][5.625:626]()
    txn_do($c->model('DB')->schema, sub {
    error($c, "This build cannot be cancelled.")
    if $build->finished || $build->busy;
    # !!! Actually, it would be nice to be able to cancel busy
    # builds as well, but we would have to send a signal or
    # something to the build process.
    my $time = time();
    $build->update(
    { finished => 1, busy => 0
    , iscachedbuild => 0, buildstatus => 4 # = cancelled
    , starttime => $time
    , stoptime => $time
    });
    });
    $c->flash->{buildMsg} = "Build has been cancelled.";
    [5.618]
    [5.5421]
    my $n = cancelBuilds($c->model('DB')->schema, $c->model('DB::Builds')->search({ id => $build->id }));
    error($c, "This build cannot be cancelled.") if $n != 1;
    $c->flash->{successMsg} = "Build has been cancelled.";
  • replacement in src/lib/Hydra/Controller/Build.pm at line 483
    [5.492][5.492:520]()
    $c->flash->{buildMsg} =
    [5.492]
    [5.3815]
    $c->flash->{successMsg} =
  • replacement in src/lib/Hydra/Controller/Build.pm at line 513
    [5.638][5.746:823](),[5.823][5.746:823]()
    $c->flash->{buildMsg} = "Build added to project <tt>$releaseName</tt>.";
    [5.638]
    [5.639]
    $c->flash->{successMsg} = "Build added to project <tt>$releaseName</tt>.";
  • replacement in src/lib/Hydra/Controller/Build.pm at line 590
    [5.646][5.1170:1249](),[5.1170][5.1170:1249]()
    $c->flash->{buildMsg} = "Build " . $newBuild->id . " added to the queue.";
    [5.646]
    [5.647]
    $c->flash->{successMsg} = "Build " . $newBuild->id . " added to the queue.";
  • edit in src/lib/Hydra/Controller/JobsetEval.pm at line 155
    [41.53]
    [41.53]
    sub cancel : Chained('eval') PathPart('cancel') Args(0) {
    my ($self, $c) = @_;
    requireProjectOwner($c, $c->stash->{eval}->project);
    my $n = cancelBuilds($c->model('DB')->schema, $c->stash->{eval}->builds);
    $c->flash->{successMsg} = "$n builds have been cancelled.";
    $c->res->redirect($c->uri_for($c->controller('JobsetEval')->action_for('view'), $c->req->captures));
    }
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 24
    [3.1050][3.1050:1071]()
    getTotalShares);
    [3.1050]
    [5.77]
    getTotalShares
    cancelBuilds);
  • edit in src/lib/Hydra/Helper/Nix.pm at line 47
    [5.781]
    [5.781]
    my $res;
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 50
    [5.812][5.812:847]()
    $db->txn_do($coderef);
    [5.812]
    [5.847]
    $res = $db->txn_do($coderef);
  • replacement in src/lib/Hydra/Helper/Nix.pm at line 52
    [5.858][5.858:879]()
    last if !$@;
    [5.858]
    [5.879]
    return $res if !$@;
  • edit in src/lib/Hydra/Helper/Nix.pm at line 547
    [3.1330]
    [5.850]
    sub cancelBuilds($$) {
    my ($db, $builds) = @_;
    return txn_do($db, sub {
    $builds = $builds->search({ finished => 0, busy => 0 });
    my $n = $builds->count;
    my $time = time();
    $builds->update(
    { finished => 1,
    , iscachedbuild => 0, buildstatus => 4 # = cancelled
    , starttime => $time
    , stoptime => $time
    });
    return $n;
    });
    }
  • edit in src/root/jobset-eval.tt at line 45
    [4.353]
    [4.353]
    <li><a href="[% c.uri_for(c.controller('JobsetEval').action_for('cancel'), [eval.id]) %]">Cancel all scheduled builds</a></li>
  • replacement in src/root/topbar.tt at line 94
    [5.15491][5.548:610]()
    title = "Clear all non-running old builds from queue"
    [5.15491]
    [5.17123]
    title = "Clear scheduled non-current builds from queue"