Distributed build
[ vmassol ] 09:28, Friday, 11 March 2005

Continuing with my current build-mania, I'd like to propose the idea of a distributed build architecture. I'd love to see my favorite continuous integration tools (CruiseControl, DamageControl and Continuum in the future) support this notion in the future (I know they're thinking about it already!).

So what is the need for a distributed build?

I can see several use cases:

  • building on several JDKs
  • building on different OS platforms
  • building with different environment setups (for example building with different application servers, different browsers, different databases, etc) to validate that a product integrates well with various environment setups
  • delegating the build load on several machines when the build starts to take too long (of course, the first solution should be to try to lighten your build as much as possible)

A proposed architecture

Disclaimer: this only ONE potential solution. There are lots of other solution probably even more valid than this one. Please feel free to add your ideas as comments to this post.

It could work as follows:

  1. The central build machine (aka the build orchestrator) decides to start a build. The orchestrator can be one existing continuous integration tool like CruiseControl, DamageControl, etc. They can trigger a build on anything they want: time-based, change-based, manual, continuously, etc. The orchestrator sends a build request to the space. The request contains all the information about the requested build (e.g. JDK to run on, OS to run on, App.Sever/DB/etc to run on)
  2. The space holds all requests. It chould be a good idea to provide a browser to see pending requests (preferably using a simple HTTP browser so that people who wish to contribute can see what type of builds are required). In any case it's important that the space be transactional (Note: I'm not sure about the word "transactional". What I mean is that a request cannot be read by several build agents at the same time)
  3. Build agents listen on space build requests objects that match their capabilities. Using Jini/Javaspace would be nice here because (among other things) agents would be able to easily listen to requests with Jini attributes (OS, JDK, etc). Once they read a request they start a local build and publish the result to the space as a Result object
  4. The build orchestrator listens to Results object, and generate result reports, aggregating all results. Build results could contain anything required: result of the build, logs, generated artifacts, etc. The orchestrator gets the data from the Result object and perform usual build operations (publishing, build result notification).

Of course there would be several details to sort out, like should we send 2 Requests object for each build need so that we can compare the results and only accept the result if they match, etc.

Conclusion

I think this type of distributed build could be especially interesting for open source projects in order to build an active community around a project. This would be yet another way in which people can contribute to an open source project: by lending some of their machine CPU to perform continuous integration builds of this project. This usually makes sense as open source projects may be low on hardware resources and lending some would help. Of course it also bring its challenge of security issues that would also need to be implemented...

Would you like such a distributed build system? I personally prefer this architecture over one where the orchestrator directly sends build requests to build agents as I find it more scalable and more flexible.


Comments

Vincent, as you know, we have started talking about distributed builds in the CruiseControl developer list. We have already laid out some ideas and a primarily design/implementation.

Maybe could you join the discussion there?

See you!

Jerome

--jerome, March 11, 2005 10:42 AM

Take a look at http://distcc.samba.org/
It's for C/C++/Objective C, but it's a working, well established distributed build solution, so I'm sure it's worth a look.

Vidar

--Vidar Hokstad, March 20, 2005 10:53 AM

We started to implement a distributed build system in python. It is able to build projects written in C or C++ for the moment. it available at http://savannah.nongnu.org/projects/dms/ . I will read carefully the above text when I find some time. Until then, feel free to drop us a line if you have suggestions, want to ask questions or whatever.

Good luck !

--Julien Gilli, March 22, 2005 01:03 PM

Vincent,

Did you have a chance to look at Parabuild server? It is a production-grade continuous integration and build management server. It runs remote multiplatform builds while letting to access the results from one place. It also works with the most popular distributed build tools such as distcc, rAnt or IncrediBuild.

--Slava Imeshev, July 10, 2005 06:16 AM

Hello,

I'm very interested by distributed build controled by MAVEN. I've red very interesting Vincent Solution.

Is there a way to extend the multi-project feature without a lot of modifications ?

1/ The master checksout locally a mavenized source tree of sub-projects which have internal / external dependencies.

2/ sub-projects have informations in their POM about logical remote engine names on which they have to be built (true engine adresses are in a more global build.properties like maven repository URL, can be also machine pools ...)

3/ after dependency tree sort, the multi-project feature knows that it has to build each sub-project on a special machine. It can also launch some builds in parallel (depends on internal dependencies tree)

4/ remote build could be done by a simple call of a sub maven process through a communicator like SSH (or other for Windows) on the remote machine. LOG messages are transferred by the communicator standard input/output.

5/ remote build processes can access to extracted source by 2 ways:
a) no network shared disk: the sub-project is "packed / sent / unpacked remotely / built remotely / repacked remotely / received / unpacked".
b) source is on a shared disk and mounted on remote engines + master: just remote maven command (with shared mount path)

The 2 ways are possible and tunable by a muli-project property

6) the remote call is not transitive, multi-project feature runs only on the master, engines are only slaves.

If a sub-project MUST be built on 2 different agents (different OS -> "packaging" sub-projects for ex) its POM can have a list of pool/engines names => the build must be done on each.

parallelism is also activated by a multi-project property

just ideas.

Olivier.

--Olivier, August 31, 2006 09:57 PM
Post a comment









Remember personal info?