I have a job with 100 taskgroups, with each group having 10 tasks and while updating the deployment, I would like roll out new changes in such a way that each taskgroup is updated serially, one at a time, while within a taskgroup I am ok with having a parallelism of 2. I have been looking into update stanza in job specification for this. From what I understand update can be applied either to taskgroup and/or job.
The Q I have is the following:
If I have update.max_parallel set at job level to 1 and update.max_parallel at group level set to 2, will this guarantee that each taskgroup will be updated one at a time, even though the individual groups could update 2 tasks parallelly?
When configuring an update stanza, any stanza at the group level tasks precedence over a stanza configured at the job level. Therefore configuring update.max_parallel=2 within the group block will allow for only two allocations of each group to be updated at the same time as you desire.
When each group is updated, all tasks within that group are updated at the same time because they form part of a single allocation. This logic is due to the internal way Nomad treats allocations (a set of tasks in a group) and there is no way to alter this behaviour.
Thank you so much for your reply. I think I understand the behavior of update tasks within a group and controlling it using update.max_parallel. However, If I have a job with 100 task groups and each group containing 1 task, Is there a way to update each group one at a time (not at the same time) in a serial order rather than kicking off all group updates parallely. Does the question make sense?
My confusion mostly arises from the documentation here which says meaning exactly one task group will be updated at a time and would like to know how job.update.max_parallel it interacts with job.group.update.max_parallel.
There is no way to coordinate the groups within a job. I would be curious to understand whether the groups can instead be their own job, or why they have a requirement to be within a single job?
Sorry, forgot to reply to this. If we assume that each taskgroup can be converted to a job, how do we handle coordination? Does this have to be done manually by us, or can Nomad has some functionality to deploy one job at a time.