I must be missing something and would appreciate if someone would help me:
Suppose I have a tenanted deployment, with steps ‘a’, ‘b’ and ‘c’. Suppose also that the tenants(T1, T2…Tn) are all hosted in the same server. Step ‘b’ needs to run exclusively of other tenants. ie: when ‘b’ is running for tenant T1, I do not want to start ‘b’ for any other tenants T2…n. I also do want steps ‘a’ & ‘c’ to run in parallel in all tenants on all servers.
How can we achieve this exclusive one-at-a-time in a target server? Like is there a semaphore implementation per target that can be leveraged?
I’d recommend taking a look at our documentation on running multiple processes on a deployment target simultaneously:
The tl;dr of the above is that by default, Octopus will only run one process on each target at a time, queuing the rest. If you want to run multiple processes on a single target, you need to create a variable called OctopusBypassDeploymentMutex which must be set at the project variable level.
Having said that, deployments of the same project to the same environment (and, if applicable, the same tenant) are not able to be run in parallel even when using this variable.
In addition, If you require multiple steps to run on a target, by multiple Projects in parallel, you need to add this variable to ALL of your projects.
So in your example, whilst you would be able to get steps a and c to run in parallel in a single deployment, you wouldn’t be able to prevent step b from doing so too, unless you create a semaphore or other mutex yourself.
This is what I needed. Thank you.
Yes we are using the OctopusBypassDeploymentMutex … and that is how we have a and c working in parallel. Multiple projects at a time is not our goal at the moment. so we are good.
Thank you so much for your detailed explanation. I was hoping I was missing something and it could be done on a step by step basis.