Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to synchronize two remote agents?

pinebit June 3, 2019

We have two remote agents (running on different VMs). These two agents run some plans that check-in to a common git repository as the last step. Sometimes they conflict because of this.

Question: how to enable these plans to run "mutually exclusive"? or how to make one plan waiting for another to complete?

1 answer

1 accepted

0 votes
Answer accepted
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 6, 2019

Hi @pinebit,

The easiest way I see you could implement this is by serializing the work in the same remote agent (as you said you run the build plans on different machines and you probably have a reason for that). Bamboo does not have a feature like a mutex to mutually exclude plans, stages or jobs that share the same resource.

It is important o remember that we can run parts of the same build in multiple agents. I'm wondering if you could set the concurrent part of your build in a special job and make only this job to run on a dedicated agent. Using this approach both plans would use the same job to run the commits and therefore never clash.

More details on how to dedicate an agent can be found here: 

There is also a pretty old feature request on this matter that didn't get much traction along the years. If you want this to be implemented, please vote on it and share your thoughts there.

I hope that helps you to move forward on this.

pinebit June 6, 2019

Thank you Daniel for the prompt answer!

To make it little more clear: the two agents I mentioned are OSX and Windows based and their build some desktop application targeting these platforms. The build result, let's say executable files, are pushed then to a shared git repository which is connected to our SW update server. And this last stage of the plan - pulling from and commiting to the git repository is the conflicting thing, if two plans are happen to run on these agents concurrently.

If we move that last stage (pull+commit) to another agent, then we will need to collect build artifacts from OSX and Windows agents and feed them to that new job, somehow..

Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 6, 2019

Hey @pinebit

Thank you for explaining the scenario better.
Yes, that is the idea, you will need a special stage and job for this. The stage will allow you to have all the artifacts from prior jobs ready to be downloaded into the new job. I didn't mention the stage part (my bad) because the job will be the building block assigned to an agent, but thanks to your last comment I have the opportunity to clarify this.

Please let me know if this is still foggy and you need more details.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events