Skip to content

Commit

Permalink
fix DBM::Deep/fork hatefulness; reinstate cron jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
DrHyde committed May 22, 2014
1 parent 5822f3d commit 1a42b13
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cronjobs
Expand Up @@ -11,9 +11,9 @@ MAILTO=david@cantrell.org.uk
0 0,6,12,18 * * * cd /web/cpxxxan;rsync -qrptgx --exclude=CHECKSUMS backpan.cpantesters.org::BACKPAN/authors/id/ backpan/authors/id/
# 0 3,9,15,21 * * * cd /web/cpxxxan;rsync -qrptgx ftp.nic.funet.fi::backpan/authors/id/ backpan/authors/id/

# Every day, 22:00, import backpan, download test results, import test results. Takes about 14 hours
0 22 * * * cd /web/cpxxxan;echo Import backpan and test results;echo -n start:;date; ./importbackpan.pl;./refill-cpanstatsdb.pl --finishlimit=1;./importtestresults.pl;echo -n finish:;date
# Every day, 22:00, import backpan, download test results, import test results. Takes about two hours, so ETA 00:00
0 22 * * * cd /web/cpxxxan;echo Import backpan and test results;echo -n start:;date; ./importbackpan.pl;./refill-cpanstatsdb.pl --quiet --finishlimit=1;./importtestresults.pl;echo -n finish:;date

# # Every day 15:00, rebuild everything. Takes twenty hours-ish
# 0 15 * * * cd /web/cpxxxan; ./parallel-builder.pl ./build02packages.pl '--os netbsd' '--os irix' '--os MSWin32' '--os cygwin' '--os solaris' '--perl 5.8.8 --os irix' '--perl 5.5.3' '--perl 5.6.1' '--perl 5.6.2' '--perl 5.8.1' '--perl 5.8.3' '--perl 5.8.5' '--perl 5.8.8' '--perl 5.8.9' '--perl 5.9.0' '--perl 5.9.1' '--perl 5.9.2' '--perl 5.9.3' '--perl 5.9.4' '--perl 5.9.5' '--perl 5.10.0' '--perl 5.10.1' '--perl 5.12.0' '--perl 5.12.1' '--perl 5.12.2' '--perl 5.12.3' '--perl 5.12.4' '--perl 5.12.5' '--perl 5.14.0' '--perl 5.14.1' '--perl 5.14.2' '--perl 5.14.3' '--perl 5.16.0' '--perl 5.16.1' '--perl 5.16.2' '--perl 5.16.3' '--perl 5.14.4' '--perl 5.18.0' '--perl 5.18.1' '--perl 5.18.2'
# Every day 02:00, rebuild everything. Takes eight hours-ish, so ETA 10:00
0 15 * * * cd /web/cpxxxan; time ./parallel-builder.pl ./build02packages.pl '--os netbsd' '--os irix' '--os MSWin32' '--os cygwin' '--os solaris' '--perl 5.8.8 --os irix' '--perl 5.5.3' '--perl 5.6.1' '--perl 5.6.2' '--perl 5.8.1' '--perl 5.8.3' '--perl 5.8.5' '--perl 5.8.8' '--perl 5.8.9' '--perl 5.9.0' '--perl 5.9.1' '--perl 5.9.2' '--perl 5.9.3' '--perl 5.9.4' '--perl 5.9.5' '--perl 5.10.0' '--perl 5.10.1' '--perl 5.12.0' '--perl 5.12.1' '--perl 5.12.2' '--perl 5.12.3' '--perl 5.12.4' '--perl 5.12.5' '--perl 5.14.0' '--perl 5.14.1' '--perl 5.14.2' '--perl 5.14.3' '--perl 5.16.0' '--perl 5.16.1' '--perl 5.16.2' '--perl 5.16.3' '--perl 5.14.4' '--perl 5.18.0' '--perl 5.18.1' '--perl 5.18.2'

12 changes: 11 additions & 1 deletion parallel-builder.pl
Expand Up @@ -8,10 +8,15 @@
my $build_script = shift(@ARGV);

my $par = Parallel::ForkManager->new(2);
my $db = DBM::Deep->new(
my $db_dbm = DBM::Deep->new(
file => "/tmp/parallel-builder-history.db",
);

# clone into memory to avoid fork()y hatefulness
my $db = { map { $_ => $db_dbm->{$_} } keys %{$db_dbm} };

undef $db_dbm;

# order jobs by how long they took last time (assuming 0
# seconds if not seen before), longest first
my @jobs = sort {
Expand All @@ -35,3 +40,8 @@

print "finish: ".localtime()."\n";
print "elapsed: ".sprintf("%.2f mins == %d secs\n", (time() - $start)/60, time() - $start);

$db_dbm = DBM::Deep->new(
file => "/tmp/parallel-builder-history.db",
);
$db_dbm->{$_} = $db->{$_} foreach (keys%{$db});

0 comments on commit 1a42b13

Please sign in to comment.