I have a number of code compile jobs in TeamCity, and have recently started adding larger tasks (such as producing ISOs of our products for various platforms). The ISOs can be built with a large number of options, and I have written a separate application to handle these options, this application is able to submit a job to a TeamCity configuration, which in turns performs the job and emails the user results. To accommodate these larger tasks I have brought online a number of higher specification PC's (i7 @ 4 GHz, 6 GB RAM, SATA III SSD hard drives), as we need to be able to turn around ISOs reasonably quickly. The problem I am having right now is I want to be able to use these new fast build agents for *all* build jobs, but when a special ISO build is added, I want that to take priority. To attempt to do this I currently always place ISO jobs at the top of the build queue, which means they will get processed before any non ISO jobs, but the problem with this is the ISO jobs don't trigger in the right order, for example if I have three producers, who trigger one build each in sequence Producer A, Producer B, Producer C, the build queue will be reversed. This gets worse if people are constantly adding new builds to the queue, as it means the first build will never make it to the top of the queue.
Can anyone think of anyway to fix my problem? The only solutions I can think of are along the lines of:
Query the current build queue, and then place any ISO build jobs above non ISO build jobs, but below existing ISO build jobs. I could probably query the build queue information from the SQL database (or look at the html returned by querying the build queue URL), and could probably work out what I need to submit to change the order.
While doing something like this wouldn't be impossible, I was hoping someone might be able to come up with a nicer solution - eventually I'd love to see some priority system inside TeamCity itself, something as simple as being able to assign build configurations a priority between 0 and 100, with 50 being the default, and then when a build is triggered, it'd be added to the build queue in a way that makes sure the build queue is in priority order (if other items in the queue have the same priority it'd always go below them). I can see how a simple system like this could leave to some things in the queue starving, but at least the user would have some control over it. Certainly for me that'd fix the issues I have right now rather well.