Multiple projects in CruiseControl.NET in the same queue running at the same time

2k views Asked by At

I have multiple projects within CruiseControl.NET (version 1.4.4) that I have assigned to a single Queue...

   <project name="Build - A" queue="Q1">
   ...
   </project>
   <project name="Build - B" queue="Q1">
   ...
   </project>
   <project name="Build - C" queue="Q1">
   ...
   </project>
   <project name="Build - D" queue="Q1">
   ...
   </project>

All the projects are non-triggered projects - I (along with every other developer in the division) use CCTray to manually kick off each project. The problem is: If, while project A is running, another user uses Force Build to start another project, it runs concurrently with project A. Even though they are in the same queue. I would have thought that requests within the same queue would be... I don't know, queued and not executed at the same time. I am using the default queue implementation of "UseFirst".

Any idea how to make the projects within the queue behave a little more queue-like? I'd like to add the projects to a timed scheduler, but without any confidence that the projects will not all try to run concurrently and kill my woefully underpowered build machine, I dare not try it.

2

There are 2 answers

1
Hertzel Guinness On BEST ANSWER

Odd. I'm using the same configuration you mentioned and its queuing the force build requests. Try updating ccnet version.

Following is (some of) my ccnet config style (its using preprocessor):

<cruisecontrol
    xmlns:cb="urn:ccnet.config.builder" xmlns="http://thoughtworks.org/ccnet/1/5">

  <!-- Queue to make sure one build at a time - to avoid same folder SVN locking issues-->
  <queue name="Q_Synchronizer" duplicates="UseFirst" />

  <!-- ************ Common defs (CC.net pre-processor tags)*********-->
  <cb:define local_svn_root="C:\svn"/>
  <cb:define remote_svn_root="http://SVN_SERVER:8888/svn/"/>
  <cb:define svn_exe="C:\Program Files\Subversion\bin\svn.exe"/>
  <cb:define svn_user="SVNUSER" svn_pw="PPPPPWWWW"/>
  <cb:define server_url="http://CCNET_SERVER/ccnet"/>
  <cb:define build_timeout="900"/>

  <cb:define name="msbuild_task">
    <msbuild>
      <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
      <workingDirectory>$(local_svn_root)$(project_solution_path)</workingDirectory>
      <projectFile>$(project_solution_file)</projectFile>
      <buildArgs>/p:Configuration=$(project_solution_configuration) /p:VCBuildAdditionalOptions="/useenv" /v:diag /t:rebuild</buildArgs>
      <timeout>$(build_timeout)</timeout>
    </msbuild>
  </cb:define>

  <cb:define name="svn_dependency">
    <svn>
      <executable>$(svn_exe)</executable>
      <workingDirectory>$(local_svn_root)$(internal_svn_path)</workingDirectory>
      <trunkUrl>$(remote_svn_root)$(internal_svn_path)</trunkUrl>
      <username>$(svn_user)</username>
      <password>$(svn_pw)</password>
      <timeout units="minutes">30</timeout>
    </svn>

  </cb:define>

   <cb:define name="project_template" >
    <project name="$(project_name)" queue="Q_Synchronizer" queuePriority="$(queuePriority)">
      <workingDirectory>$(local_svn_root)$(project_solution_path)</workingDirectory>
      <webURL>$(server_url)/server/local/project/$(project_name)/ViewLatestBuildReport.aspx</webURL>
      <triggers>
        <intervalTrigger seconds="30" name="continuous" buildCondition="IfModificationExists"/>
      </triggers>
      <sourcecontrol type="multi">
        <sourceControls>
          <cb:svn_dependency internal_svn_path="$(project_internal_svn_path)"/>

          <cb:additional_svn_dependencies/>

        </sourceControls>
      </sourcecontrol>
      <tasks>
        <cb:msbuild_tasks/>
      </tasks>
      <publishers>
        <xmllogger logDir="$(local_svn_root)$(project_solution_path)\BuildLogs" />        
      </publishers>
    </project>
  </cb:define>

   <!-- ************* Projects definition ************-->
  <cb:project_template
     project_name="Proj A"
     project_internal_svn_path="/code/"
     project_solution_path="/code/Proj A"
     project_solution_file="Proj A.sln"
     queuePriority="1"
     >
    <cb:define name="msbuild_tasks">
      <cb:msbuild_task project_solution_configuration="Debug"/>
      <cb:msbuild_task project_solution_configuration="Release"/>
    </cb:define>
    <cb:define name="additional_svn_dependencies">
      <cb:svn_dependency internal_svn_path="/bin"/>
    </cb:define>

  </cb:project_template>

  <cb:project_template
     project_name="Proj B"
     project_internal_svn_path="/code/"
     project_solution_path="/code/Proj B"
     project_solution_file="Proj B.sln"
     queuePriority="1"
     >
    <cb:define name="msbuild_tasks">
      <cb:msbuild_task project_solution_configuration="Debug"/>
      <cb:msbuild_task project_solution_configuration="Release"/>
    </cb:define>
    <cb:define name="additional_svn_dependencies">
      <cb:svn_dependency internal_svn_path="/third-party"/>
    </cb:define>
  </cb:project_template>


</cruisecontrol>
0
alexandrul On

You can try to define each project in his own queue with all the other queues added to the lockqueues parameter (see last example from Queue Configuration)