Machine status page: Show disabled machines and some machine stats

[?]
Sep 9, 2015, 2:51 PM
NX5BM2OINIVVOHN23N2DWH5LHVQN7AVRWYPUZ5J54WXFWE5B5XIQC

Dependencies

  • [2] 2MSFKTD5 Ensure proper encoding of error messages
  • [3] AXU7D4PD Machine status page: Add link to build step
  • [4] TASNW7CT Remove double entry for localhost on machines status page
  • [5] 36ZTCZ4F Add basic Persona support
  • [6] HTL6HIBM machine-status: Read /etc/nix.machines instead of using the BuildMachines table
  • [7] V6S6OYIA Formatting tweaks
  • [8] J4R2VCPP Fix showing build steps in the machine status page
  • [9] RFGPN7U7 Machine status: Don't show removed machines anymore
  • [10] UFFPFIXS Don't show how long a machine has been idle
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] SMM4HQTP * Put actions related to builds under /build (e.g. /log/<buildid>
  • [*] ZWCTAZGL added newsitems, added some admin options to clear various caches.

Change contents

  • edit in src/lib/Hydra/Controller/Root.pm at line 12
    [2.12]
    [13.0]
    use JSON;
  • replacement in src/lib/Hydra/Controller/Root.pm at line 113
    [5.32][5.32:61](),[5.61][4.0:38]()
    ${$machines}{''} //= {};
    delete ${$machines}{'localhost'};
    [5.32]
    [5.0]
    $machines->{''} //= {};
    delete $machines->{'localhost'};
    my $status = $c->model('DB::SystemStatus')->find("queue-runner");
    if ($status) {
    my $ms = decode_json($status->status)->{"machines"};
    foreach my $name (keys %{$ms}) {
    $name = "" if $name eq "localhost";
    $machines->{$name} //= {disabled => 1};
    $machines->{$name}->{nrStepsDone} = $ms->{$name}->{nrStepsDone};
    $machines->{$name}->{avgStepBuildTime} = $ms->{$name}->{avgStepBuildTime} // 0;
    }
    }
  • edit in src/root/machine-status.tt at line 3
    [14.8411]
    [14.9392]
    [% USE format %]
  • replacement in src/root/machine-status.tt at line 21
    [3.189][5.403:433](),[5.259][5.403:433]()
    <tt>[% name %]</tt>
    [3.189]
    [5.192]
    <tt [% IF m.value.disabled %]style="text-decoration: line-through;"[% END %]>[% name %]</tt>
  • replacement in src/root/machine-status.tt at line 23
    [5.231][5.231:371]()
    ([% comma=0; FOREACH system IN m.value.systemTypes %][% IF comma; %], [% ELSE; comma = 1; END %]<tt>[% system %]</tt>[% END %])
    [5.231]
    [5.371]
    <span class="muted" style="font-weight: normal;">
    ([% comma=0; FOREACH system IN m.value.systemTypes %][% IF comma; %], [% ELSE; comma = 1; END %]<tt>[% system %]</tt>[% END %])
    </span>
    [% END %]
    [% IF m.value.nrStepsDone %]
    <span class="muted" style="font-weight: normal;">
    ([% m.value.nrStepsDone %] steps done, [% f = format("%.1f"); f(m.value.avgStepBuildTime) %] s/step)
    </span>