* Store info about all the build actions and allow them to be

[?]
Nov 11, 2008, 5:49 PM
CLJQCY2XHIDNNMFBJ5PK3GQEN6RFALEFKXBJRWZPEIKR4PR5ZQ5AC

Dependencies

Change contents

  • replacement in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 40
    [3.406][3.406:549]()
    , where => "finished != 0 and timestamp = (select max(timestamp) from Builds where project == me.project and attrName == me.attrName)"
    [3.406]
    [3.549]
    , where => "finished != 0 and timestamp = (select max(timestamp) from Builds where project == me.project and attrName == me.attrName and finished != 0)"
  • edit in src/HydraFrontend/lib/HydraFrontend/Controller/Root.pm at line 106
    [3.2413]
    [3.2413]
    }
    sub nixlog :Local {
    my ( $self, $c, $id, $stepnr ) = @_;
    my $build = getBuild($c, $id);
    return error($c, "Build with ID $id doesn't exist.") if !defined $build;
    my $step = $build->buildsteps->find({stepnr => $stepnr});
    return error($c, "Build $id doesn't have a build step $stepnr.") if !defined $step;
    $c->stash->{template} = 'log.tt';
    $c->stash->{id} = $id;
    $c->stash->{step} = $step;
    # !!! should be done in the view (as a TT plugin).
    $c->stash->{logtext} = loadLog($step->logfile);
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildinputs.pm at line 41
    [3.782][3.1001:1143]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dKMSSomUN+gJX57Z5e295w
    [3.782]
    [3.924]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MtL3cwH9upjNmhaZkGszRA
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildlogs.pm at line 24
    [3.3992][3.1269:1411]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZOxJeT+ltgyc/zuDl9aEDQ
    [3.3992]
    [3.4134]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vvyGq3BeKyyK7K6uDxJHyQ
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildproducts.pm at line 24
    [3.4922][3.1450:1592]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rZPTilX/PAiIoxffxc0nJw
    [3.4922]
    [3.5064]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:et00AvSBi5LZUoIrIUOKFQ
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildresultinfo.pm at line 28
    [3.2382][3.2382:2524]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2Vfqs9RUhbDrje18yZb3AA
    [3.2382]
    [3.2524]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8zXrs7iT2h3xp6C/2q37uQ
  • edit in src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm at line 73
    [3.1466]
    [3.6192]
    __PACKAGE__->has_many(
    "buildsteps",
    "HydraFrontend::Schema::Buildsteps",
    { "foreign.id" => "self.id" },
    );
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Builds.pm at line 80
    [3.6194][3.3235:3377]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1GZeB3YVr064AZrGargmFg
    [3.6194]
    [3.3377]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c8feWTpKijITXXSdJICuFg
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Buildschedulinginfo.pm at line 26
    [3.4473][3.4473:4615]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rN7v2+MnC8TkrEHUzt2Gqg
    [3.4473]
    [3.4615]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Z65HteUghCT7sXfXpsHYXg
  • file addition: Buildsteps.pm (----------)
    [3.3332]
    package HydraFrontend::Schema::Buildsteps;
    use strict;
    use warnings;
    use base 'DBIx::Class';
    __PACKAGE__->load_components("Core");
    __PACKAGE__->table("BuildSteps");
    __PACKAGE__->add_columns(
    "id",
    { data_type => "integer", is_nullable => 0, size => undef },
    "stepnr",
    { data_type => "integer", is_nullable => 0, size => undef },
    "type",
    { data_type => "integer", is_nullable => 0, size => undef },
    "drvpath",
    { data_type => "text", is_nullable => 0, size => undef },
    "outpath",
    { data_type => "text", is_nullable => 0, size => undef },
    "logfile",
    { data_type => "text", is_nullable => 0, size => undef },
    "busy",
    { data_type => "integer", is_nullable => 0, size => undef },
    "status",
    { data_type => "integer", is_nullable => 0, size => undef },
    "errormsg",
    { data_type => "text", is_nullable => 0, size => undef },
    "starttime",
    { data_type => "integer", is_nullable => 0, size => undef },
    "stoptime",
    { data_type => "integer", is_nullable => 0, size => undef },
    );
    __PACKAGE__->set_primary_key("id", "stepnr");
    __PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GmvM5Rhj4MY7eNQpqTz7bw
    # You can replace this text with custom content, and it will be preserved on regeneration
    1;
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputalts.pm at line 36
    [3.1831][3.4798:4940]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bvEulSFMDlAMs39sIyHgZQ
    [3.1831]
    [3.1973]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mng7GAPMDxsznKupYdhwQw
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Jobsetinputs.pm at line 46
    [3.1681][3.4978:5120]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:54xK3D1D0Jm5oKgRelXN7Q
    [3.1681]
    [3.1823]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vEXBbzKUTBQmGmL8uh9mIA
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Jobsets.pm at line 51
    [3.2992][3.5153:5295]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JHirlq7Jc8dQOy+Op/VflA
    [3.2992]
    [3.3134]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hMYI8zT3UB/k9IbddK1X4g
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema/Projects.pm at line 27
    [3.3685][3.5329:5471]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7Ag5ZfYVgfw3MJZkNUmBYw
    [3.3685]
    [3.3827]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1DTnCjRw929OuAfeJ5gsXA
  • replacement in src/HydraFrontend/lib/HydraFrontend/Schema.pm at line 11
    [3.6498][3.5472:5614]()
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 13:41:38
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1AgCf4sf5h2RU24Slo0sTA
    [3.6498]
    [3.6640]
    # Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-11 18:02:00
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gS2Lp7T6IZ160iYQbEhd+g
  • replacement in src/HydraFrontend/root/build.tt at line 36
    [2.602][2.602:665]()
    <strong>Build returned a non-zero exit code</strong>
    [2.602]
    [2.665]
    <strong class="error-msg">Build returned a non-zero exit code</strong>
  • replacement in src/HydraFrontend/root/build.tt at line 39
    [2.735][2.735:775]()
    <strong>Build failed</strong>
    [2.735]
    [2.775]
    <strong class="error-msg">Build failed</strong>
  • edit in src/HydraFrontend/root/build.tt at line 135
    [3.2523]
    [3.6735]
  • edit in src/HydraFrontend/root/build.tt at line 137
    [3.6736]
    [3.2523]
    [% IF build.buildsteps %]
  • edit in src/HydraFrontend/root/build.tt at line 139
    [3.2524]
    [3.6737]
    <h2>Build steps</h2>
    <table class="tablesorter">
    <thead>
    <tr><th>Nr</th><th>What</th><th>Status</th></tr>
    </thead>
    <tbody>
    [% FOREACH step IN build.buildsteps -%]
    <tr>
    <td>[% step.stepnr %]</td>
    <td>
    Build of <tt>[% step.outpath %]</tt>
    </td>
    <td>
    [% IF step.busy == 1 %]
    <strong>Building</strong>
    [% ELSIF step.status == 0 %]
    Succeeded
    [% ELSE %]
    <strong class="error-msg">Failed: [% step.errormsg %]</strong>
    [% END %]
    (<a href="[% c.uri_for('/nixlog' build.id step.stepnr) %]">log</a>)
    </td>
    </tr>
    [% END %]
    </tbody>
    </table>
    [% END %]
  • replacement in src/HydraFrontend/root/hydra.css at line 146
    [3.10576][3.10576:10593]()
    span.error-msg {
    [3.10576]
    [3.10593]
    .error-msg {
  • replacement in src/HydraFrontend/root/log.tt at line 3
    [3.11832][3.11832:11895]()
    <h1>Build log <tt>[% log.logphase %] of build ID [% id %]</h1>
    [3.11832]
    [3.11895]
    <h1>Build log [% IF step %] of step [% step.stepnr %] [% ELSE %]<tt>[% log.logphase %]</tt>[% END %] of build ID [% id %]</h1>
  • replacement in src/build.pl at line 35
    [3.3598][3.3598:3656]()
    my $res = system("nix-store --realise $drvPath");
    [3.3598]
    [3.3656]
    # Run Nix to perform the build, and monitor the stderr output
    # to get notifications about specific build steps, the
    # associated log files, etc.
    my $cmd = "nix-store --keep-going --no-build-output " .
    "--log-type flat --print-build-trace --realise $drvPath 2>&1";
    my $buildStepNr = 1;
    open OUT, "$cmd |" or die;
    while (<OUT>) {
    unless (/^@\s+/) {
    print STDERR "$_";
    next;
    }
    print STDERR "GOT $_";
    if (/^@\s+build-started\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/) {
    $db->txn_do(sub {
    $db->resultset('Buildsteps')->create(
    { id => $build->id
    , stepnr => $buildStepNr++
    , type => 0 # = build
    , drvpath => $1
    , outpath => $2
    , logfile => $4
    , busy => 1
    });
    });
    }
    if (/^@\s+build-succeeded\s+(\S+)\s+(\S+)$/) {
    $db->txn_do(sub {
    my $drvPath = $1;
    (my $step) = $db->resultset('Buildsteps')->search(
    {id => $build->id, type => 0, drvpath => $drvPath}, {});
    die unless $step;
    $step->busy(0);
    $step->status(0);
    $step->update;
    });
    }
    if (/^@\s+build-failed\s+(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/) {
    $db->txn_do(sub {
    my $drvPath = $1;
    (my $step) = $db->resultset('Buildsteps')->search(
    {id => $build->id, type => 0, drvpath => $drvPath}, {});
    die unless $step;
    $step->busy(0);
    $step->status(1);
    $step->errormsg($4);
    $step->update;
    });
    }
    }
    close OUT;
    my $res = $?;
  • replacement in src/build.pl at line 126
    [3.4892][2.1418:1460]()
    print "found log $logPath\n";
    [3.4892]
    [3.4934]
    print STDERR "found log $logPath\n";
  • replacement in src/build.pl at line 139
    [3.5286][2.1461:1511]()
    print "found log $logPath\n";
    [3.5286]
    [3.5336]
    print STDERR "found log $logPath\n";
  • replacement in src/build.pl at line 181
    [3.7682][3.7682:7719]()
    print "performing build $buildId\n";
    [3.7682]
    [3.6711]
    print STDERR "performing build $buildId\n";
  • edit in src/hydra.sql at line 60
    [3.2529]
    [3.2529]
  • edit in src/hydra.sql at line 62
    [3.2530]
    [3.2530]
    create table BuildSteps (
    id integer not null,
    stepnr integer not null,
  • edit in src/hydra.sql at line 66
    [3.2531]
    [3.10076]
    type integer not null, -- 0 = build, 1 = substitution
    drvPath text,
    outPath text,
    logfile text,
    busy integer not null,
    status integer,
    errorMsg text,
    startTime integer, -- in Unix time, 0 = used cached build result
    stopTime integer,
    primary key (id, stepnr),
    foreign key (id) references Builds(id) on delete cascade -- ignored by sqlite
    );
  • edit in src/runner.pl at line 19
    [3.8125][3.11473:11499]()
    print $job, "\n";