Continuum
  1. Continuum
  2. CONTINUUM-2043

Release should happen on a build agent rather than on the master

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1 (Alpha)
    • Fix Version/s: 1.3.2 (Beta)
    • Component/s: Distributed Builds
    • Labels:
      None

      Description

      When the distributed builds feature is enabled, releases should happen on a build agent instead of the master.

      Will need to reverse the change made for CONTINUUM-2035 which checks out code on the master.

      Related to CONTINUUM-2042, Ability to control which build agent a project builds on.

        Issue Links

          Activity

          Hide
          Maria Catherine Tan added a comment -

          Fixed release prepare and release perform on build agent in revision 751433

          TODO:

          • UI
          • Release rollback
          Show
          Maria Catherine Tan added a comment - Fixed release prepare and release perform on build agent in revision 751433 TODO: UI Release rollback
          Hide
          Maria Catherine Tan added a comment -

          added UI and release rollback in revision 751678

          Show
          Maria Catherine Tan added a comment - added UI and release rollback in revision 751678
          Hide
          Wendy Smoak added a comment -

          Can you summarize the changes related to this issue? 751433 was split over four email messages, it's a lot to comprehend.

          I commented on the other commit, re: the new 'Releases' button, but left out a question about security. Who can see what on this page? (Only someone with the project group user role should be able to see its releases.)

          Show
          Wendy Smoak added a comment - Can you summarize the changes related to this issue? 751433 was split over four email messages, it's a lot to comprehend. I commented on the other commit, re: the new 'Releases' button, but left out a question about security. Who can see what on this page? (Only someone with the project group user role should be able to see its releases.)
          Hide
          Maria Catherine Tan added a comment - - edited

          1. Source code is no longer checked out from the master
          2. Release will happen in the build agent where the last build of the project was performed.
          3. Can release concurrently (distributed build only atm)
          4. Clicking the releases button will show all releases that are happening. (distributed build only atm)

          • all users will be able to view the list of releases
          • you need to have a build permission for that group to be able to view a particular release

          I don't think it's possible to add a security restriction for a certain resource in the Releases button because it's in the Menu side, but I can add a new role 'continuum-view-releases' for the project developers only. Still, project developers who don't belong in the group can still see the list of releases.

          Show
          Maria Catherine Tan added a comment - - edited 1. Source code is no longer checked out from the master 2. Release will happen in the build agent where the last build of the project was performed. 3. Can release concurrently (distributed build only atm) 4. Clicking the releases button will show all releases that are happening. (distributed build only atm) all users will be able to view the list of releases you need to have a build permission for that group to be able to view a particular release I don't think it's possible to add a security restriction for a certain resource in the Releases button because it's in the Menu side, but I can add a new role 'continuum-view-releases' for the project developers only. Still, project developers who don't belong in the group can still see the list of releases.
          Hide
          Wendy Smoak added a comment -

          I think that's going to raise an issue similar to the one on the Queues page – if a person doesn't have permission to see a project group, then NO information about that group can be exposed.

          I currently have a couple of "private" continuum instances for this reason. If consolidating them to a single master in order to use distributed build means that other users will be able to see that the private projects exist, I won't be able to do it.

          I think on the Queues page the decision was to mask the name of the project and just show "Other".

          If it can't be secured, then it probably needs to be visible only to the System Administrator role (or some new role that only admin has by default.)

          Show
          Wendy Smoak added a comment - I think that's going to raise an issue similar to the one on the Queues page – if a person doesn't have permission to see a project group, then NO information about that group can be exposed. I currently have a couple of "private" continuum instances for this reason. If consolidating them to a single master in order to use distributed build means that other users will be able to see that the private projects exist, I won't be able to do it. I think on the Queues page the decision was to mask the name of the project and just show "Other". If it can't be secured, then it probably needs to be visible only to the System Administrator role (or some new role that only admin has by default.)
          Show
          Wendy Smoak added a comment - More discussion in a reply to the commit on the dev list: http://www.nabble.com/Re%3A-svn-commit%3A-r751678---in--continuum-trunk%3A-continuum-api-src-main-java-org-apache-continuum-release-distributed-manager---continuum-buildagent-continuum-buildagent-api-src-main-java-org-apache-continuum-buildagent---continuum-buildagent-continuum-b-td22469769.html
          Hide
          Wendy Smoak added a comment -

          Thanks, Marica. I had a couple of questions about this one:

          > 2. Release will happen in the build agent where the last build of the project was performed.

          What happens if that build agent is busy building some other project when you click 'Release'?

          What happens if that build agent has been disabled or has been deleted from the system?

          Show
          Wendy Smoak added a comment - Thanks, Marica. I had a couple of questions about this one: > 2. Release will happen in the build agent where the last build of the project was performed. What happens if that build agent is busy building some other project when you click 'Release'? What happens if that build agent has been disabled or has been deleted from the system?
          Hide
          Maria Catherine Tan added a comment -

          > What happens if that build agent is busy building some other project when you click 'Release'?
          It will still continue with the release.

          > What happens if that build agent has been disabled or has been deleted from the System?
          You won't be able to release unless you try to build again in another agent then release. The reason for this is, if I only have a working copy in agent 1 and it has been deleted from the System, even if i try to release from another agent i still won't be able to release from that agent because there is no working copy.

          At least that's how I understand the way continuum does its release.

          Show
          Maria Catherine Tan added a comment - > What happens if that build agent is busy building some other project when you click 'Release'? It will still continue with the release. > What happens if that build agent has been disabled or has been deleted from the System? You won't be able to release unless you try to build again in another agent then release. The reason for this is, if I only have a working copy in agent 1 and it has been deleted from the System, even if i try to release from another agent i still won't be able to release from that agent because there is no working copy. At least that's how I understand the way continuum does its release.
          Hide
          Wendy Smoak added a comment -

          Thanks for the explanation. Yes it makes sense that you have to have a successful build prior to a release (though the UI could do a better job at telling you what's going on. Right now it just refuses to do the release and doesn't give you any message.)

          When I tested releasing on a build agent, It failed at the scm-commit-release phase with the following output:
          [ERROR] org.apache.maven.shared.release.scm.ReleaseScmCommandException: Unable to commit files
          Provider message:
          The svn command failed.
          Command output:
          svn: '/Users/wsmoak/svn/continuum/continuum/continuum-buildagent/continuum-buildagent-webapp/working-directory/6/working-directory/6' is not a working copy
          svn: Can't open file '/Users/wsmoak/svn/continuum/continuum/continuum-buildagent/continuum-buildagent-webapp/working-directory/6/working-directory/6/.svn/entries': No such file or directory

          at org.apache.maven.shared.release.phase.ScmCommitPhase.checkin(ScmCommitPhase.java:133)
          at org.apache.maven.shared.release.phase.ScmCommitPhase.execute(ScmCommitPhase.java:109)
          at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:194)
          at org.apache.maven.shared.release.DefaultReleaseManager.prepareWithResult(DefaultReleaseManager.java:107)
          at org.apache.maven.continuum.release.executors.PrepareReleaseTaskExecutor.execute(PrepareReleaseTaskExecutor.java:44)
          at org.apache.maven.continuum.release.executors.AbstractReleaseTaskExecutor.executeTask(AbstractReleaseTaskExecutor.java:68)
          at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116)
          at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
          at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
          at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
          at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
          at java.lang.Thread.run(Thread.java:637)

          Note that 'working-directory/6' is duplicated in the path it's trying to use.

          My configuration on the build agent is simply
          <buildOutputDirectory>build-output-directory</buildOutputDirectory>
          (not a full path).

          Show
          Wendy Smoak added a comment - Thanks for the explanation. Yes it makes sense that you have to have a successful build prior to a release (though the UI could do a better job at telling you what's going on. Right now it just refuses to do the release and doesn't give you any message.) When I tested releasing on a build agent, It failed at the scm-commit-release phase with the following output: [ERROR] org.apache.maven.shared.release.scm.ReleaseScmCommandException: Unable to commit files Provider message: The svn command failed. Command output: svn: '/Users/wsmoak/svn/continuum/continuum/continuum-buildagent/continuum-buildagent-webapp/working-directory/6/working-directory/6' is not a working copy svn: Can't open file '/Users/wsmoak/svn/continuum/continuum/continuum-buildagent/continuum-buildagent-webapp/working-directory/6/working-directory/6/.svn/entries': No such file or directory at org.apache.maven.shared.release.phase.ScmCommitPhase.checkin(ScmCommitPhase.java:133) at org.apache.maven.shared.release.phase.ScmCommitPhase.execute(ScmCommitPhase.java:109) at org.apache.maven.shared.release.DefaultReleaseManager.prepare(DefaultReleaseManager.java:194) at org.apache.maven.shared.release.DefaultReleaseManager.prepareWithResult(DefaultReleaseManager.java:107) at org.apache.maven.continuum.release.executors.PrepareReleaseTaskExecutor.execute(PrepareReleaseTaskExecutor.java:44) at org.apache.maven.continuum.release.executors.AbstractReleaseTaskExecutor.executeTask(AbstractReleaseTaskExecutor.java:68) at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116) at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528) at java.lang.Thread.run(Thread.java:637) Note that 'working-directory/6' is duplicated in the path it's trying to use. My configuration on the build agent is simply <buildOutputDirectory>build-output-directory</buildOutputDirectory> (not a full path).
          Hide
          Maria Catherine Tan added a comment -

          Fixed in revision 755049 by returning the canonical form of the working directory.

          Thanks Wendy!

          Show
          Maria Catherine Tan added a comment - Fixed in revision 755049 by returning the canonical form of the working directory. Thanks Wendy!
          Hide
          Wendy Smoak added a comment -

          There is a problem with the UI for this. It lets you select a Build Environment (and so, a Build Agent Group,) when you prepare the release, but then it builds on whatever agent was used last, ignoring at least that part of the Build Environment. I am not sure whether it uses the rest of the Build Env configuration or if it just uses the values it used during the last release. I opened CONTINUUM-2386 to track this.

          Show
          Wendy Smoak added a comment - There is a problem with the UI for this. It lets you select a Build Environment (and so, a Build Agent Group,) when you prepare the release, but then it builds on whatever agent was used last, ignoring at least that part of the Build Environment. I am not sure whether it uses the rest of the Build Env configuration or if it just uses the values it used during the last release. I opened CONTINUUM-2386 to track this.

            People

            • Assignee:
              Maria Catherine Tan
              Reporter:
              Wendy Smoak
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development