From 3b757304f72d15b1c4f959a30d3b51049a686027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Val=C3=AD=C4=8Dek=20=28YCNet=29?= Date: Tue, 13 Feb 2018 14:53:59 +0100 Subject: [PATCH] Parametrized count of runs via JOBS environment varriable --- Makefile | 4 ++-- launcher-image/src/cron-command | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8cfbc8b..65ea437 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,10 @@ launcher: docker build -t $(TAGBASE)-launcher ./launcher-image run-launcher: launcher - docker run -v /var/run/docker.sock:/var/run/docker.sock -it --rm $(TAGBASE)-launcher + docker run -e JOBS=4 -v /var/run/docker.sock:/var/run/docker.sock -it --rm $(TAGBASE)-launcher run-launcher-detached: launcher - docker run -v /var/run/docker.sock:/var/run/docker.sock -itd --rm $(TAGBASE)-launcher + docker run -e JOBS=8 -v /var/run/docker.sock:/var/run/docker.sock -itd --rm $(TAGBASE)-launcher # wizzard wizzard: mirror run-creator diff --git a/launcher-image/src/cron-command b/launcher-image/src/cron-command index 76f59c8..4f0941a 100755 --- a/launcher-image/src/cron-command +++ b/launcher-image/src/cron-command @@ -8,6 +8,7 @@ lock=/var/run/cloner.pid volume_prefix=cloner clone_prefix=cloner-runner +max_jobs=${JOBS:-3} function die(){ echo $@ 1>&2 @@ -35,5 +36,5 @@ function listVolumes(){ } # run for every volume in parallel -listVolumes | parallel --lb -j 3 -n 1 run-mirror-update +listVolumes | parallel --lb -j $max_jobs -n 1 run-mirror-update