Add a jobset eval action to restart all aborted/cancelled builds
[?]
Oct 4, 2013, 3:01 PM
VHV6GI4L2GEV2PV3AEV4C22O3JB4XUS6WPEBFINYD5CJOBMAESAACDependencies
- [2]
ZH6B56XRTry harder to find build logs - [3]
AWMM5OGVUse delete instead of delete_all - [4]
UOINKJ2JAdd an action to cancel all builds in a jobset eval - [5]
3XTHEUMP* Implemented the clone feature. - [6]
CQTN62OHDie tabs die - [7]
BDSD2JLV* Speed up manifest generation. - [8]
GJFYEU3S* Nix now stores logs by default as bzip2, make sure the build page uncompresses before showing. - [9]
MOX7XJ2EMerge the BuildSchedulingInfo table into the Builds table - [10]
SKQXOQ7Thydra: fixed missing argument to restartbuild function - [11]
GEADFVZ5hydra-queue-runner: Improved scheduling - [12]
OSVLMLCQhydra: factored out build restart and - [13]
LZVO64YGMerge in the first bits of the API work - [14]
JIJDYWPYRemove the Build menu from the top bar - [15]
NLJJZVHO* Use ->update({...}) properly. - [16]
HPEG2RHVMerge the BuildResultInfo table into the Builds table - [17]
2UZJG6XTClear nrSucceeded when restarting a build - [18]
QEC5HR4RAlways record inputs passed through -I in the BuildInputs table - [19]
A52HEFHQ* Allow builds to be restarted (if they failed with a transient error, - [20]
PMNWRTGJAdd multiple output support - [21]
YDVFPMKPSecurity: Ensure that a build product refers to the Nix store - [22]
KLSDJV75Serve raw uncompressed logs directly - [23]
ZILILXXK* Allow scheduled builds to be cancelled. They're not removed from - [24]
R6B5CAFFLet Builds.timestamp refer to the time the build was added - [*]
LBNVQXUB* Build the /build stuff in a separate controller. - [*]
U4TD3AIQAdd support for viewing jobset evaluations - [*]
OOQ2D3KC* Refactoring: move fetchInput out of hydra_scheduler into a separate - [*]
2GK5DOU7* Downloading closures. - [*]
TJK27WSBOpen the DB using Hydra::Model::DB->new - [*]
AFTXA575* $HYDRA_DATA environment variable. - [*]
6HWHYPSWAdd an action menu to evaluations
Change contents
- edit in src/lib/Hydra/Controller/Build.pm at line 440
- edit in src/lib/Hydra/Controller/Build.pm at line 441
- replacement in src/lib/Hydra/Controller/Build.pm at line 442[5.230]→[5.621:622](∅→∅),[5.35]→[5.41:90](∅→∅),[5.41]→[5.41:90](∅→∅),[5.90]→[5.0:55](∅→∅),[5.55]→[5.521:522](∅→∅),[5.84]→[5.521:522](∅→∅),[5.139]→[5.521:522](∅→∅),[5.521]→[5.521:522](∅→∅),[5.522]→[5.0:51](∅→∅),[5.51]→[5.756:757](∅→∅),[5.166]→[5.756:757](∅→∅),[5.756]→[5.756:757](∅→∅)
error($c, "This build cannot be restarted.")unless $build->finished && -f $build->drvpath;restartBuild($c->model('DB')->schema, $build);my $n = restartBuilds($c->model('DB')->schema, $c->model('DB::Builds')->search({ id => $build->id }));error($c, "This build cannot be restarted.") if $n != 1; - edit in src/lib/Hydra/Controller/Build.pm at line 445
- edit in src/lib/Hydra/Controller/JobsetEval.pm at line 162
$c->res->redirect($c->uri_for($c->controller('JobsetEval')->action_for('view'), $c->req->captures));}sub restart_aborted : Chained('eval') PathPart('restart-aborted') Args(0) {my ($self, $c) = @_;requireProjectOwner($c, $c->stash->{eval}->project);my $builds = $c->stash->{eval}->builds->search({ finished => 1, buildstatus => { -in => [3, 4] } });my $n = restartBuilds($c->model('DB')->schema, $builds);$c->flash->{successMsg} = "$n builds have been restarted."; - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 554
sub restartBuild {my ($db, $build) = @_;txn_do($db, sub {my @paths;push @paths, $build->drvpath;push @paths, $_->drvpath foreach $build->buildsteps; - edit in src/lib/Hydra/Helper/AddBuilds.pm at line 555
my $r = `nix-store --clear-failed-paths @paths`; - replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 556[5.716]→[5.3113:3137](∅→∅),[5.3137]→[5.4716:4744](∅→∅),[5.3183]→[5.913:964](∅→∅),[5.4776]→[5.913:964](∅→∅),[5.913]→[5.913:964](∅→∅),[5.964]→[5.527:560](∅→∅),[5.560]→[5.4777:4793](∅→∅),[5.964]→[5.4777:4793](∅→∅),[5.4793]→[5.561:562](∅→∅),[5.562]→[3.561:600](∅→∅),[3.600]→[5.85:319](∅→∅),[5.605]→[5.85:319](∅→∅),[5.4793]→[5.85:319](∅→∅),[5.3193]→[5.85:319](∅→∅),[5.319]→[5.980:990](∅→∅),[5.3230]→[5.980:990](∅→∅),[5.980]→[5.980:990](∅→∅)
$build->update({ finished => 0, busy => 0, locker => "", iscachedbuild => 0});$build->buildproducts->delete;# Reset the stats for the evals to which this build belongs.# !!! Should do this in a trigger.foreach my $m ($build->jobsetevalmembers->all) {$m->eval->update({nrsucceeded => undef});}});}[5.589]1; - edit in src/lib/Hydra/Helper/Nix.pm at line 10
use Nix::Store; - replacement in src/lib/Hydra/Helper/Nix.pm at line 26
cancelBuilds);cancelBuilds restartBuilds); - replacement in src/lib/Hydra/Helper/Nix.pm at line 278
- edit in src/lib/Hydra/Helper/Nix.pm at line 561
});}sub restartBuilds($$) {my ($db, $builds) = @_;my $n = 0;txn_do($db, sub {my @paths;$builds = $builds->search({ finished => 1 });foreach my $build ($builds->all) {next if !isValidPath($build->drvpath);push @paths, $build->drvpath;push @paths, $_->drvpath foreach $build->buildsteps;$build->update({ finished => 0, busy => 0, locker => "", iscachedbuild => 0});$n++;# Reset the stats for the evals to which this build belongs.# !!! Should do this in a trigger.$build->jobsetevals->update({nrsucceeded => undef});}# Clear Nix's negative failure cache.# FIXME: Add this to the API.system("nix-store", "--clear-failed-paths", @paths); - edit in src/lib/Hydra/Helper/Nix.pm at line 595
return $n; - edit in src/root/jobset-eval.tt at line 46[4.1756][32.353]
<li><a href="[% c.uri_for(c.controller('JobsetEval').action_for('restart_aborted'), [eval.id]) %]">Restart all aborted builds</a></li>