Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-12842

Add option in Bamboo for locking agent for the complete plan build.

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • Agents
    • None
    • 1
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Hi I have build plan setup in Bamboo as follows:

      Stage 1:
      Job: Clean History
      Job: Clean Repository
      Job: Clean Cache
      Stage 2:
      Job: Build and Test
      Stage 3:
      Job: Report Results

      Now the same plan is run for multiple branches in the GIT repository. Since we have only single clean environment we have only single Agent running all jobs sequentially. But what I see is when multiple checkin happen the Stages across multiple branches get mixed up, thus resulting in the following run sequence where stages of one branch get mixed with stages of other branch.

      Branch 1, executes Stage 1
      Branch 2, executes Stage 1
      Branch 1, executes Stage 2
      Branch 2, executes Stage 2
      Branch 1, executes Stage 3
      Branch 2, executes Stage 3

      With this work flow, the last job will definitely fail as it will never get a clean environment. Not sure if this is a bug, but I believe a build plan run should be atomic and isolated and is currently not the case.

            [BAM-12842] Add option in Bamboo for locking agent for the complete plan build.

            Angus Wu added a comment -

            Yeah, it would be beneficial to have the ability to specify an agent to run entire plan for a branch.
            We have a job in later stage that have dependency configured in earlier stage, so if another agent tries to run it, it will fail.
            For now, I have to move the tasks in dependent job into the earlier job, so they run together.

            Angus Wu added a comment - Yeah, it would be beneficial to have the ability to specify an agent to run entire plan for a branch. We have a job in later stage that have dependency configured in earlier stage, so if another agent tries to run it, it will fail. For now, I have to move the tasks in dependent job into the earlier job, so they run together.

            Adam Cohen added a comment -

            The single biggest reason for separating the stages is so that a single stage failure doesn't require rebuilding the entire plan.  This feature would be extremely helpful for my organization as we have dozens of plans which could run concurrently and as some of them use the same repositories, can lead to building the wrong commit (ie: 'Revision' doesn't match the latest 'Commit' in the code commits); very irritating.

            Seems like a no-brainer here; checkbox "Agent treats entire plans as a single stage" or something similar.

            Adam Cohen added a comment - The single biggest reason for separating the stages is so that a single stage failure doesn't require rebuilding the entire plan.  This feature would be extremely helpful for my organization as we have dozens of plans which could run concurrently and as some of them use the same repositories, can lead to building the wrong commit (ie: 'Revision' doesn't match the latest 'Commit' in the code commits); very irritating. Seems like a no-brainer here; checkbox "Agent treats entire plans as a single stage" or something similar.

            Thanks Rahul.

            James Dumay added a comment - Thanks Rahul.

            May be it solves, but it would be great that, along with the agent capabilities with respect to plan, the option that agent is locked for the complete plan is required. Since my problem is when two agents map to a single plan they may take turns to run Stages in build plan which is not what I need. What I need is an Agent once started to run build plan should be the one to complete it and not other agent can interfere with the running plan even if its capability matches.

            Thanks,
            Rahul

            Rahul Rohilla added a comment - May be it solves, but it would be great that, along with the agent capabilities with respect to plan, the option that agent is locked for the complete plan is required. Since my problem is when two agents map to a single plan they may take turns to run Stages in build plan which is not what I need. What I need is an Agent once started to run build plan should be the one to complete it and not other agent can interfere with the running plan even if its capability matches. Thanks, Rahul

            Hi Rahul,

            If we implemented BAM-3491 would that solve this issue for you?

            Thanks
            James

            James Dumay added a comment - Hi Rahul, If we implemented BAM-3491 would that solve this issue for you? Thanks James

            Perfect, an option for locking agent for the build plan should resolve are problem. Please have that created.

            Thanks

            Rahul Rohilla added a comment - Perfect, an option for locking agent for the build plan should resolve are problem. Please have that created. Thanks

            PiotrA added a comment -

            Make sense...

            Say, would it be OK if I'd update the summary of this ticket to be "add option in Bamboo to lock the agent for the complete build"? I think it would better reflect what can be done in Bamboo and other people could vote on such issue. What do you think? Good/bad idea?

            PiotrA added a comment - Make sense... Say, would it be OK if I'd update the summary of this ticket to be "add option in Bamboo to lock the agent for the complete build"? I think it would better reflect what can be done in Bamboo and other people could vote on such issue. What do you think? Good/bad idea?

            Thanks and that is what I have done as a solution to put everything in a single stage. I had to put the cleanup tasks in different stage so that multiple agents could clean up and start various environments in parallel but the build has to run only after all clean up is done hence the next stage. We have several environments to clean up, as in Apache Felix, Jackrabbit, maven repository etc..and wanted to clean all in parallel. In future we may have cleanup to be done in cloud environment on multiple nodes hence the requirement for parallel cleanup.

            I would suggest to have an option to lock the agent for the complete build. As we are using repository isolation and hence switching agents during build stages does not seem to be good option.

            Rahul Rohilla added a comment - Thanks and that is what I have done as a solution to put everything in a single stage. I had to put the cleanup tasks in different stage so that multiple agents could clean up and start various environments in parallel but the build has to run only after all clean up is done hence the next stage. We have several environments to clean up, as in Apache Felix, Jackrabbit, maven repository etc..and wanted to clean all in parallel. In future we may have cleanup to be done in cloud environment on multiple nodes hence the requirement for parallel cleanup. I would suggest to have an option to lock the agent for the complete build. As we are using repository isolation and hence switching agents during build stages does not seem to be good option.

            PiotrA added a comment -

            Ah, and as a side note - why don't you merge all your stages into one single stage/job?
            Seems to me that a single Job containing all your tasks:

            • Clean History tasks
            • Clean Repository tasks
            • Clean Cache tasks
            • Build and Test tasks
            • Report Results tasks

            ...would work better - after all, why do you need to split these steps? To have parallel cleaning up (Clean History + Clean Repository + Clean Cache), or just to have better visually organized the build tasks in your Plan?

            PiotrA added a comment - Ah, and as a side note - why don't you merge all your stages into one single stage/job? Seems to me that a single Job containing all your tasks: Clean History tasks Clean Repository tasks Clean Cache tasks Build and Test tasks Report Results tasks ...would work better - after all, why do you need to split these steps? To have parallel cleaning up (Clean History + Clean Repository + Clean Cache), or just to have better visually organized the build tasks in your Plan?

            PiotrA added a comment -

            Hello Rahul,

            While definitely it's not a bug (what you experience is the designed behavior of the Bamboo - we might argue whether the design is correct, but what you describe is the expected execution from the current Bamboo design point of view), I do agree that for your use-case Bamboo is working improperly and it would be nice if Bamboo would have some Plan locking or priority mechanisms built-in.

            However, can I ask you to check if the BAM-3705 issue is actually what you need in Bamboo? Because if it is, then I'd like to close this issue here and ask you to watch&vote the BAM-3705 instead. What would you say?

            regards,
            Piotr Stefaniak
            Bamboo developer

            PiotrA added a comment - Hello Rahul, While definitely it's not a bug (what you experience is the designed behavior of the Bamboo - we might argue whether the design is correct, but what you describe is the expected execution from the current Bamboo design point of view), I do agree that for your use-case Bamboo is working improperly and it would be nice if Bamboo would have some Plan locking or priority mechanisms built-in. However, can I ask you to check if the BAM-3705 issue is actually what you need in Bamboo? Because if it is, then I'd like to close this issue here and ask you to watch&vote the BAM-3705 instead. What would you say? regards, Piotr Stefaniak Bamboo developer

              Unassigned Unassigned
              ef71436e3812 Rahul Rohilla
              Votes:
              11 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated: