hydra-evaluator: Always pick the jobset that hasn't been evaluated longest

[?]
Feb 25, 2013, 5:47 PM
OVR2RWBIUXNW2XSG63KFL2S3Q7UVTLHOEYO3573LZBY7AMLUKKTQC

Dependencies

  • [2] WQXF2T3D hydra-evaluator: Don't require $HYDRA_CONFIG
  • [3] ZVTSOVHN * Support Subversion checkouts.
  • [4] M552HLIA * Support variant builds.
  • [5] NI5BVF2V * In job inputs of type "build", allow the project and jobset names of
  • [6] FYO6NECE hydra
  • [7] POPU2ATH * hydra_scheduler: use eval-jobs.
  • [8] 7ZYBTNJJ revert unmeant previous change which caused errors to stay, even after successful evaluation of jobs
  • [9] RXVJFQ5A Evaluator cleanups
  • [10] QMW24O5S Add support for Guile & Guix.
  • [11] D6YQQQCN * Don't ignore SIGCHLD after all, Perl doesn't like it. Just do
  • [12] IWHFLFVV * Randomly permute the order in which builds are added. This is
  • [13] 3XTHEUMP * Implemented the clone feature.
  • [14] 4D4U5IPY * Allow jobsets to be disabled.
  • [15] X27GNHDV * Basic job info in the database.
  • [16] GCHNNFZP
  • [17] 5GRJZZOR
  • [18] FDE3BJAP * Refactoring.
  • [19] SQQSV4NB * Top-level: don't exit on errors.
  • [20] SHZLOM5M * eval-jobs -> hydra_eval_jobs.
  • [21] TIOBBINA * Some renaming.
  • [22] 3ZCEPLNO
  • [23] TULPZ62Y * Perform builds in parallel.
  • [24] H7CNGK4O * Log evaluation errors etc. in the DB.
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] RFE6T5LG * Store jobset evaluations in the database explicitly. This includes

Change contents

  • edit in src/script/hydra-evaluator at line 22
    [2.992]
    [27.5400]
    # Don't check a jobset more than once every five minutes.
    my $minCheckInterval = 1;
  • replacement in src/script/hydra-evaluator at line 104
    [3.233][3.1962:1980](),[3.3982][3.1962:1980](),[3.1980][3.3635:3668](),[3.3635][3.3635:3668]()
    sub checkJobset {
    my ($project, $jobset) = @_;
    [3.233]
    [3.3668]
    sub checkJobsetWrapped {
    my ($jobset) = @_;
    my $project = $jobset->project;
  • replacement in src/script/hydra-evaluator at line 227
    [3.9884][3.2043:2101]()
    sub checkJobsetWrapped {
    my ($project, $jobset) = @_;
    [3.9884]
    [2.1449]
    sub checkJobset {
    my ($jobset) = @_;
  • replacement in src/script/hydra-evaluator at line 230
    [2.1450][3.2841:2923](),[3.2106][3.2841:2923]()
    print STDERR "considering jobset ", $project->name, ":", $jobset->name, "\n";
    [2.1450]
    [2.1451]
    print STDERR "considering jobset ", $jobset->project->name, ":", $jobset->name,
    " (last checked ", time() - $jobset->lastcheckedtime, "s ago)\n";
  • replacement in src/script/hydra-evaluator at line 234
    [3.2200][3.2200:2240]()
    checkJobset($project, $jobset);
    [3.2200]
    [3.2240]
    checkJobsetWrapped($jobset);
  • replacement in src/script/hydra-evaluator at line 248
    [3.9901][3.1417:1437](),[3.1437][3.1752:1831](),[3.2518][3.1752:1831](),[3.9901][3.1752:1831](),[3.1831][3.2999:3066](),[3.3066][3.3184:3288](),[3.4467][3.3184:3288](),[3.1951][3.10169:10175](),[3.2592][3.10169:10175](),[3.3288][3.10169:10175](),[3.4735][3.10169:10175](),[3.10169][3.10169:10175]()
    sub checkProjects {
    foreach my $project ($db->resultset('Projects')->search({enabled => 1})) {
    print STDERR "considering project ", $project->name, "\n";
    checkJobsetWrapped($project, $_)
    foreach $project->jobsets->search({enabled => 1});
    }
    [3.9901]
    [3.0]
    # Check the jobset that hasn't been checked for the longest time.
    sub checkSomeJobset {
    my ($jobset) = $db->resultset('Jobsets')->search(
    { 'project.enabled' => 1, 'me.enabled' => 1, 'lastcheckedtime' => { '<', time() - $minCheckInterval } },
    { join => 'project', order_by => [ 'lastcheckedtime' ], rows => 1 });
    return 0 unless defined $jobset;
    checkJobset($jobset);
    return 1;
  • replacement in src/script/hydra-evaluator at line 267
    [3.228][3.2593:2644]()
    checkJobsetWrapped($jobset->project, $jobset);
    [3.228]
    [3.272]
    checkJobset($jobset);
  • replacement in src/script/hydra-evaluator at line 274
    [3.11][3.1438:1461]()
    checkProjects;
    [3.11]
    [3.30]
    if (checkSomeJobset) {
    # Just so we don't go completely crazy if lastcheckedtime
    # isn't updated properly.
    sleep 1;
    } else {
    print STDERR "sleeping...\n";
    sleep 30;
    }
  • edit in src/script/hydra-evaluator at line 284
    [3.3102][3.3102:3136](),[3.3136][3.855:869](),[3.1022][3.855:869]()
    print STDERR "sleeping...\n";
    sleep 30;