Allow performing boot & start operations in groups

Adds top-level configuration options for `group_limit` and `group_wait`.
When a `group_limit` is present, we'll perform app boot & start
operations on no more than `group_limit` hosts at a time, optionally
sleeping for `group_wait` seconds after each batch.

We currently only do this batching on boot & start operations (including
when they are part of a deployment). Other commands, like `app stop` or
`app details` still work on all hosts in parallel.
This commit is contained in:
Kevin McConnell
2023-04-13 12:43:19 +01:00
parent bc8875e020
commit f530009a6e
5 changed files with 64 additions and 4 deletions

View File

@@ -153,6 +153,15 @@ class Mrsk::Configuration
end
def group_strategy
if group_limit.present?
{ in: :groups, limit: group_limit, wait: group_wait }
else
{}
end
end
def audit_broadcast_cmd
raw_config.audit_broadcast_cmd
end
@@ -237,4 +246,12 @@ class Mrsk::Configuration
raise "Can't use commit hash as version, no git repository found in #{Dir.pwd}"
end
end
def group_limit
raw_config.group_limit&.to_i
end
def group_wait
raw_config.group_wait&.to_i
end
end