Sigul-signing directories containing a lot of large artifacts may not be
optimal, because whether serial or parallel, the same amount of
network IO is required and the job takes about the same amount of time
in the end. This allows passing "serial" as a third argument to sign_dir
to specifically request serial operation.
Change-Id: I6a6267090cee6cbed1f134b27eb6cec485fa1793
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
--- /dev/null
+---
+features:
+ - |
+ Allow passing ``serial`` as third argument to **sign_dir**
+
+ Parallel-signing using sigul is resulting in NSPR reset errors,
+ so allow passing "serial" to the sign_dir function as a third argument
+ to request serial signing of directory contents.
exit 1
fi
+ local mode="serial"
if hash parallel 2>/dev/null; then
+ # Unless you specifically asked for serial mode
+ if [ "$3" != "serial" ]; then
+ local mode="parallel"
+ fi
+ fi
+
+ if [ "$mode" == "parallel" ]; then
echo "Signing in parallel..."
case "$signer" in
gpg )
echo "Signed the following files:"
printf '%s\n' "${files_to_sign[@]}"
else
- echo "GNU parallel not found. Signing in serial mode..."
+ echo "Signing in serial mode..."
case "$signer" in
gpg )
for f in "${files_to_sign[@]}"; do