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

Perforce Building on Multiple Agents Doesn't Detect Changes Correctly

      Perforce manages which changes/files you have by storing the information on the server. Once you have downloaded the change A with one client it marks that change as being downloaded. If you then use that same client on another machine the Perforce Server will assume you already have change A and not download it.

      This means that using perforce on multiple build agents won't pick up the changes when it syncs. So it could be building incorrect code.

      Because of this you have a few options.

      1. Restrict your plan to use a single machine and (if using multiple agents on the one machine, also set the client root yourself).
      2. Make Bamboo force a clean build every time it builds (okay for smaller projects but a pain for larger ones)
      3. Use alternate roots This would allow you to restrict your plan to 3 machines with 3 different alternate roots (a slightly better alternative than #1). A word of warning though, Bamboo will go through the roots in order till one exists so if you want Bamboo to build in the third root the first two must not exist on that machine.

            [BAM-2843] Perforce Building on Multiple Agents Doesn't Detect Changes Correctly

            Support for Perforce is deprecated and scheduled to be removed in Bamboo 10.0

            Marcin Gardias added a comment - Support for Perforce is deprecated and scheduled to be removed in Bamboo 10.0

            Here's another potential (though very differnent from how Bamboo does things now) solution:

            • In the Agent configuration, in the Perforce Capability setup, add a field for a clientspec. (In other works, each Agent will use it's own single clientspec for all builds it executes).
            • Developers create the clientspec for each Agent, configured to "see" the entire depot, and root it to a unique location on disk that doesn't conflict with any other clientspec
              • e.g. //... //agentA/uniqueroot/...
            • In the Perforce setup for a Build Plan, change the "workspace" entry from requiring the right-hand (client) side of the specification, to taking the left-hand (server) side.
              • e.g. instead of specifying //agentA/uniqueroot/some/files/to/watchandsyncandbuild/..., specify //some/files/to/watchandsyncandbuild/...
            • Modify the Bamboo Agents to sync using their configured clientspec, but only sync the files scoped to what's configured in the build plan
              • e.g. p4 -c agentSpec sync //some/files/to/watchandsyncandbuild/... (not //..., which is the only line in the view in the clientspec on the agent)

            Not sure how "good" of a solution that is, but that's the only solution I can think of that would let any remote agent build any build plan using Perforce (boooo, Perforce).

            David Aldridge added a comment - Here's another potential (though very differnent from how Bamboo does things now) solution: In the Agent configuration, in the Perforce Capability setup, add a field for a clientspec. (In other works, each Agent will use it's own single clientspec for all builds it executes). Developers create the clientspec for each Agent, configured to "see" the entire depot, and root it to a unique location on disk that doesn't conflict with any other clientspec e.g. //... //agentA/uniqueroot/... In the Perforce setup for a Build Plan, change the "workspace" entry from requiring the right-hand (client) side of the specification, to taking the left-hand (server) side. e.g. instead of specifying //agentA/uniqueroot/some/files/to/watchandsyncandbuild/..., specify //some/files/to/watchandsyncandbuild/... Modify the Bamboo Agents to sync using their configured clientspec, but only sync the files scoped to what's configured in the build plan e.g. p4 -c agentSpec sync //some/files/to/watchandsyncandbuild/... (not //..., which is the only line in the view in the clientspec on the agent) Not sure how "good" of a solution that is, but that's the only solution I can think of that would let any remote agent build any build plan using Perforce (boooo, Perforce).

            bmccoy added a comment -

            http://jira.atlassian.com/browse/BAM-2774 suggests a couple of solutions

            bmccoy added a comment - http://jira.atlassian.com/browse/BAM-2774 suggests a couple of solutions

              Unassigned Unassigned
              bmccoy bmccoy
              Affected customers:
              13 This affects my team
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: