grundic / teamcity-agent-priority

Plugin for ordering Teamcity build agents.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pool priority

HackAttack opened this issue · comments

I have four different agent pools in my TeamCity installation: physical machines, VMs, Raspberry Pis, and GPU machines. Many of my configs could theoretically run on most or all of these pools, but for optimal resource utilization I would like to be able to specify a preference order by pool.

Examples:

  • A heavyweight compilation should preferentially run on a physical machine, but I would rather it start running on a VM than wait if all physical machines are busy.
  • A lightweight job should preferentially run on a VM but fall back to a physical machine.
  • Anything that can run on a physical machine or VM can also run on a GPU machine, but because those are more specialized I want them to be the last choice.

This is also a feature I'd like.
We split up our pools by project and have one shared pool (for smaller projects that don't get their own dedicated machines, and overflow for projects requiring more agents than assigned to their pool).
I'd love to be able to prioritize a project to it's own pool first, then if there are none free check the default pool.
Currently we have an issue where, even if machines dedicated to the project are free, teamcity will choose one of the shared ones, resulting in less throughput on smaller projects.
This feature would be a life saver!

Happy birthday to this issue! @grundic are you around?

@HackAttack I've forked the project and added my own implementation here:
https://github.com/AlexanderJReid/teamcity-agent-priority/pull/1
Would love some feedback as I'm not sure about the dependencies.
I was going to make the pools a dropdown selection but I don't have time at the moment, so it's just a case sensitive text field.
Deployed to my TeamCity instance and seems to be working and the tests pass 👍
Tested with: 2018.2.4 (build 61678)

Hey @AlexanderJReid, thank for taking this issue. Unfortunately I don't work with Teamcity anymore and it's very difficult to find spare time.

Yeah, the implementation looks fine. I'm not sure about dependencies, but as far as it works deployed on Teamcity instance it's good.

Would you like to create a pull request?

Sure thing!
EDIT:
PR has been raised here: #8

Would it be possible to publish a version containing this change?

Hey @michaelbailey. I don't know if the compiled code is hosted anywhere, but since this change has now been merged in, you should be able to pull the latest from master and compile it with gradle to get the output for TC.
Hope this helps!