From cd100ca200568bf034f90c1a7184a79a9e1371f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Fr=C3=A9con?= Date: Mon, 12 Feb 2024 23:57:24 +0100 Subject: [PATCH] Add sleep between runner startups --- orchestrator.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/orchestrator.sh b/orchestrator.sh index 5a3ed89..5ae079b 100755 --- a/orchestrator.sh +++ b/orchestrator.sh @@ -69,6 +69,9 @@ ORCHESTRATOR_DIR=${ORCHESTRATOR_DIR:-""} # used. ORCHESTRATOR_ISOLATION=${ORCHESTRATOR_ISOLATION:-"1"} +# Number of seconds to sleep between microVM creation at start +ORCHESTRATOR_SLEEP=${ORCHESTRATOR_SLEEP:-"30"} + # GitHub host, e.g. github.com or github.example.com RUNNER_GITHUB=${RUNNER_GITHUB:-"github.com"} @@ -241,6 +244,12 @@ for i in $(seq 1 "$runners"); do -E "${ORCHESTRATOR_ENVIRONMENT:-}" \ -- "$i" & set -- "$@" "$!" + if [ "$i" -lt "$runners" ]; then + if [ -n "$ORCHESTRATOR_SLEEP" ] && [ "$ORCHESTRATOR_SLEEP" -gt 0 ]; then + debug "Sleeping for $ORCHESTRATOR_SLEEP seconds" + sleep "$ORCHESTRATOR_SLEEP" + fi + fi fi done