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

@@ -13,7 +13,7 @@ class Mrsk::Cli::App < Mrsk::Cli::Base
execute *MRSK.app.tag_current_as_latest
end
on(MRSK.hosts) do |host|
on(MRSK.hosts, **MRSK.config.group_strategy) do |host|
roles = MRSK.roles_on(host)
roles.each do |role|
@@ -39,7 +39,7 @@ class Mrsk::Cli::App < Mrsk::Cli::Base
desc "start", "Start existing app container on servers"
def start
with_lock do
on(MRSK.hosts) do |host|
on(MRSK.hosts, **MRSK.config.group_strategy) do |host|
roles = MRSK.roles_on(host)
roles.each do |role|