Make "Running builds" and "Machine status" pages faster

[?]
Mar 16, 2016, 2:19 PM
O5ZANJMR27RRDAY7EVZLXZRKCKA24TFRBIZYWW7I72KG3DZQSCJAC

Dependencies

  • [2] HWKCMAK5 Remove some redundant SQL queries
  • [3] AXU7D4PD Machine status page: Add link to build step
  • [4] IT5AXPY2 Disable channels on binary cached based Hydra instances
  • [5] QAUDQPWG Add a more concise queue page
  • [6] E46TNJK6 Use faster query to determine number of running builds
  • [7] MOX7XJ2E Merge the BuildSchedulingInfo table into the Builds table
  • [8] CQTN62OH Die tabs die
  • [9] 36ZTCZ4F Add basic Persona support
  • [10] 6FRLEP4P first try for timeline of last 24 hours in hydra
  • [11] J4R2VCPP Fix showing build steps in the machine status page
  • [12] K42RSSSI
  • [13] HRAFVVOE make logo configurable via HYDRA_LOGO env var
  • [14] MGOGOKQP add tracker html code via HYDRA_TRACKER
  • [15] R2PON6R7 Allow non-admin users to see the machine status page
  • [16] FPK5LF53 * Put the project-related actions in a separate controller. Put the
  • [17] HTL6HIBM machine-status: Read /etc/nix.machines instead of using the BuildMachines table
  • [18] 2DHE2ZAK Allow Hydra to run as a private instance by requiring a login.
  • [19] LZVO64YG Merge in the first bits of the API work
  • [20] RFGPN7U7 Machine status: Don't show removed machines anymore
  • [21] TPNHTE5V Remove obsolete Builds columns and provide accurate "Running builds"
  • [22] SMCOU72F hydra: add some admin for adding/enabling/etc build machines
  • [23] V6S6OYIA Formatting tweaks
  • [24] EFWN7JBV * Added a status page that shows all the currently executing build steps.
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] CS7T2XFI
  • [*] AFNDUSGD Set Expires headers for Hydra's binary cache
  • [*] ZWCTAZGL added newsitems, added some admin options to clear various caches.

Change contents

  • replacement in src/lib/Hydra/Controller/Root.pm at line 48
    [7.54][6.0:95]()
    $c->stash->{nrRunningBuilds} = $c->model('DB')->schema->storage->dbh->selectrow_array(
    [7.54]
    [6.95]
    $c->stash->{nrRunningBuilds} = dbh($c)->selectrow_array(
  • replacement in src/lib/Hydra/Controller/Root.pm at line 108
    [7.378][5.135:220]()
    $c->stash->{queued} = $c->model('DB')->schema->storage->dbh->selectall_arrayref(
    [7.378]
    [5.220]
    $c->stash->{queued} = dbh($c)->selectall_arrayref(
  • replacement in src/lib/Hydra/Controller/Root.pm at line 122
    [7.1314][7.1314:1369]()
    { finished => 0, "buildsteps.busy" => 1 },
    [7.1314]
    [7.1369]
    { "buildsteps.busy" => 1 },
  • replacement in src/lib/Hydra/Controller/Root.pm at line 167
    [7.391][7.416:480](),[7.416][7.416:480](),[7.480][7.1524:1568](),[7.1568][7.543:634](),[7.543][7.543:634]()
    $c->stash->{steps} = [ $c->model('DB::BuildSteps')->search(
    { finished => 0, 'me.busy' => 1, },
    { join => [ 'build' ]
    , order_by => [ 'machine', 'stepnr' ]
    } ) ];
    [7.391]
    [7.634]
    $c->stash->{steps} = dbh($c)->selectall_arrayref(
    "select build, stepnr, s.system as system, s.drvpath as drvpath, machine, s.starttime as starttime, project, jobset, job " .
    "from BuildSteps s join Builds b on s.build = b.id " .
    "where busy = 1 order by machine, stepnr",
    { Slice => {} });
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 29
    [4.191]
    [28.180]
    dbh
  • edit in src/lib/Hydra/Helper/CatalystUtils.pm at line 355
    [29.315]
    [27.3787]
    sub dbh {
    my ($c) = @_;
    return $c->model('DB')->schema->storage->dbh;
    }
  • replacement in src/root/machine-status.tt at line 42
    [7.852][2.0:86]()
    <td><tt>[% INCLUDE renderFullJobNameOfBuild build=step.build %]</tt></td>
    [7.852]
    [7.1006]
    <td><tt>[% INCLUDE renderFullJobName project=step.project jobset=step.jobset job=step.job %]</tt></td>
  • replacement in src/root/machine-status.tt at line 44
    [7.1054][7.1054:1149](),[7.1149][3.190:335]()
    <td><a href="[% c.uri_for('/build' step.build.id) %]">[% step.build.id %]</a></td>
    <td><a class="row-link" href="[% c.uri_for('/build' step.build.id 'nixlog' step.stepnr 'tail-reload') %]">[% step.stepnr %]</a></td>
    [7.1054]
    [7.1149]
    <td><a href="[% c.uri_for('/build' step.build) %]">[% step.build %]</a></td>
    <td><a class="row-link" href="[% c.uri_for('/build' step.build 'nixlog' step.stepnr 'tail-reload') %]">[% step.stepnr %]</a></td>