How should a build stop all other builds in the same project?

Hi,

I have an FPGA fitting run that may execute several times (with slightly differing parameters) before finding a solution.

Given that each attempt may take from 1 to 9 hours to succeed, I would like to run several attempts in parallel (say, 10).  Supposing I have a five-wide agent pool associated with my FPGA project, I would like to kick off all the attempts at once (each in its own build configuration), and have the first successful attempt stop all the others (or remove them from the queue if they've not yet started).

Any suggestions as to how the successful attempt should signal the other still-running or queued attempts to give up?

Thanks!
-chris

4 comments
Comment actions Permalink

I think it is possible to write a plugin which will do something like this. You'll need to pass information from build script to the server somehow. For this you can use custom service message. Once build script finishes successfully it can issue this service message into the output and plugin on the server side will catch it and kill unnecessary builds. jetbrains.buildServer.messages.serviceMessages.ServiceMessageTranslator extension can be implemented on the server side and handle this custom service message.

0
Comment actions Permalink

Hi Pavel, thanks for the pointer.  I got a plugin pretty much working with ServiceMessageTranslator.  The only issue I'm seeing is that when I call stop() on an SRunningBuild object, the build gets automatically re-added to the queue.

How would I disable the auto-re-add?

Thanks!
-chris

0
Comment actions Permalink

OK, it looks like if I pass in a non-null user when stopping the build, it won't be re-queued.  This would be good information to add to the javadocs for the stop() method.

Thanks again for the help!

0
Comment actions Permalink

FWIW, here is the code for the TeamCity plugin that does this:  https://github.com/walquis/custom-svc-msgs

0

Please sign in to leave a comment.