From 94ccd9e7bec3d9554d7885e6a24ce3202b3134a7 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 9 Nov 2014 23:31:40 +0000 Subject: Add support for sharding the build --- NEWS | 1 + iurt | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/NEWS b/NEWS index b4fef05..d50d0e7 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,5 @@ - speed up installing packages +- support sharding the build with --num_shards and --shard_id 0.6.23 - remove old src.rpm before recreating it (mga#14243) diff --git a/iurt b/iurt index eb60726..b69b4f2 100755 --- a/iurt +++ b/iurt @@ -176,6 +176,12 @@ $run{todo} = []; [ "", "build-all", 0, "", "Build all packages of the media, even if they are up to date", sub { $run{build_all} = 1 }, "Setting the full build flag" ], + [ "", "num_shards", 1, "", + "Number of shards for building", + sub { ($run{num_shards}) = @_; 1 }, 'Setting number of shards' ], + [ "", "shard_id", 1, "", + "Shard id (starts at 0)", + sub { ($run{shard_id}) = @_; 1 }, 'Setting shard id' ], [ "n", "no", 0, "", "Perform all the check but do not compile anything", sub { ($run{no_compile}) = 1 }, "Setting the no compilation flag" ], @@ -972,6 +978,10 @@ do { my %children; for ($i; $i < @{$run{todo}}; $i++) { my ($dir, $srpm, $status) = @{$run{todo}[$i]}; + if ($run{num_shards} && ($i % $run{num_shards}) != $run{shard_id}) { + plog('DEBUG', "Skipping $srpm, not for my shard"); + next; + } $done{$srpm} and next; $done{$srpm} = 1; check_version(\%run, $srpm, \%srpm_version) or next; -- cgit v1.2.1