ee52e0807335ddc96c4455fbcb693140e2f82ce0 hiram Wed Jul 3 09:34:49 2019 -0700 remove kolossus from the list of machines to check for workhorse no redmine diff --git src/hg/utils/automation/HgAutomate.pm src/hg/utils/automation/HgAutomate.pm index 1efe33b..74b7df9 100755 --- src/hg/utils/automation/HgAutomate.pm +++ src/hg/utils/automation/HgAutomate.pm @@ -226,54 +226,54 @@ # If it doesn't produce a recognizable uptime result, return a # very high load. my ($mach) = @_; confess "Must have exactly 1 argument" if (scalar(@_) != 1); my $cmd = "$HgAutomate::runSSH $mach uptime 2>&1 | grep load"; verbose(4, "about to run '$cmd'\n"); my $load = `$cmd`; if ($load =~ s/.*load average: (\d+\.\d+).*/$1/) { return $load; } return 1000; } sub getWorkhorseLoads { #*** Would be nice to parameterize instead of hardcoding hostnames... - # Return a hash of workhorses (kolossus and all idle small cluster machines), + # Return a hash of workhorses (all idle small cluster machines), # associated with their load factors. # a valid workhorse needs to have access to hive. confess "Too many arguments" if (scalar(@_) != 0); my %horses = (); - foreach my $machLine ('ku', 'kolossus', 'hgwdev') { + foreach my $machLine ('ku', 'hgwdev') { my $mach = $machLine; $mach =~ s/[\. ].*//; chomp $mach; $horses{$mach} = &getLoadFactor($mach) if (! exists $horses{$mach}); } return %horses; } sub chooseWorkhorse { # Choose a suitable "workhorse" machine. If -workhorse was given, use that. # Otherwise, randomly pick a fast machine with low load factor, or wait if # none are available. This can wait indefinitely, so if it's broken or if # all workhorses are down, it's up to the engineer to halt the script. confess "Too many arguments" if (shift); if ($main::opt_workhorse) { return $main::opt_workhorse; } - &verbose(2, "chooseWorkhorse: polling load factors of kolossus and " . + &verbose(2, "chooseWorkhorse: polling load factors of " . "idle small cluster machines. This may take a minute...\n"); while (1) { my %horses = &getWorkhorseLoads(); foreach my $maxLoad (0.1, 0.5, 1.0, 2.0) { my @fastHorses = (); foreach my $horse (keys %horses) { push @fastHorses, $horse if ($horses{$horse} <= $maxLoad); } if (scalar(@fastHorses) > 0) { my $randomFastEnough = $fastHorses[int(rand(scalar(@fastHorses)))]; &verbose(2, "chooseWorkhorse: $randomFastEnough meets load " . "threshold of $maxLoad.\n"); return $randomFastEnough; } }