Prevent plans from running simultaneously

Charles April 18, 2012

I have two plans that use a shared resource, and which can't run simultaneously, even though there may be agents available to run them. Is there a way I can do this in Bamboo?

3 answers

1 accepted

1 vote
Answer accepted
Charles December 29, 2012

I implemented a simple plugin to solve this problem a while back and have just gotten approval to open source it. Source and documentation can be found here: https://github.com/ampedandwired/bamboo-mutex-plugin.

This would still be better implemented within Bamboo core I think, but this plugin should do the job until BAM-2423 is implemented.

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2012

I can think of a workaround. Configure both the plans to run on the same remote agent. Then only one plan can run at a time.

In order to restrict the plan to run on the same agent, add a custom capability to the agent with a unique key and then configure the plans to run only when the custom capability is present!

James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2012

Would the following Feature Request work? https://jira.atlassian.com/browse/BAM-11447

Charles April 18, 2012

Thanks Jobin,

Using capabilities to run both plans on a single agent is not going to get the result I want, unfortunately. Each of the plans in question has numerous jobs that I *want* to be run in parallel across many agents (they are long running acceptance test jobs). It's just that I don't want jobs from the different plans intermingling.

I may look into writing a custom plugin for this if no other options.

Charles April 18, 2012

Hi James, yep that pretty much sums it up - thanks!

In the meantime I'll look at doing it as a plugin.

James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2012

Thats great. If you have any questions about plugin development, post them on Answers :)

0 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2012

AFAIK sequencing is achieved based on agent availability. If you have multiple agents which can do the same work, I guess it will get started in parallel. Is it not possible that you have a single agent for this work so that it gets done in parallel? Use a custom capablity if needed so that the job looks for this specific agent for its work.

Charles April 18, 2012

Thanks Renjith. See my response to Jobin as to why I can't do this.

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 18, 2012

Okie I understand. Will it be possible to pull out this particular job alone and make a new plan with this single agent? And trigger this new plan when the original one ends. http://confluence.atlassian.com/display/BAMBOO40/Setting+up+plan+build+dependencies

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events