简体   繁体   English

代理未在TFS 2017中选择新的构建请求

[英]Agents not picking new build requests in TFS 2017

I have 10 build agents configured in two servers under one agent pool. 我在一个代理程序池下的两台服务器中配置了10个构建代理程序。 Whenever the first four agents are used, the build requested is in the queue on the first four agents, but there are another six agents which are available and the builds are not queued to those agents. 无论何时使用前四个代理,请求的构建都会在前四个代理的队列中,但是还有其他六个代理可用,并且构建不会排队到那些代理。

It's been almost six months and agent 10 has not even once handled a build. 已经快六个月了,Agent 10甚至没有一次处理过构建。 Other agents from 5 to 10 are hardly used. 几乎没有使用5至10的其他试剂。 Why is there this phenomenon? 为什么会出现这种现象? How can we handle this by using all the agents fairly? 我们如何通过公平使用所有代理来处理此问题?

TFS will auto select the available build agent in the pool when running the build. TFS将在运行构建时自动选择池中的可用构建代理。 It's more like a conditional random choice. 这更像是条件随机选择。 It's not able to prioritize the build agent for now. 目前尚不能确定构建代理的优先级。 There has also been a related uservoice as below: 也有一个相关的用户语音,如下所示:

TFS 2015 build vNext agent prioritization TFS 2015构建vNext代理优先级

As a workaround you could specify a build agent in vNext build. 解决方法是,在vNext构建中指定构建代理。

You can add a User Capability to that specific build agent. 您可以将用户功能添加到该特定的构建代理。 Then in the build definition you just need put in that capability as a demand ( General tab). 然后,在构建定义中,您只需要按需输入该功能(“ 常规”选项卡)。

It seems like the builds are queued on the 'oldest' agents first. 似乎这些构建首先在“最早的”代理上排队。 So if agent 10 is the last agent you created, it will only be used if the first 9 are in use, assuming they all have the same capabilities. 因此,如果代理10是您创建的最后一个代理,则假定前九个代理都具有相同的功能,则只有在使用前九个代理时才使用它。

It does not appear to be a random selection of agents, but based on the order of creation of agents. 它似乎不是随机选择的代理,而是基于代理创建的顺序。 Ironically that means that if you add a new powerful build server, those agents will be at the bottom of the queue. 具有讽刺意味的是,这意味着如果您添加新的功能强大的构建服务器,这些代理将位于队列的底部。

The user voice suggestion in PatrickLu-MSFT's answer is to allow the agent to be prioritized. PatrickLu-MSFT的答案中的用户语音建议是允许对代理进行优先级排序。

The workaround at this moment seems to be to remove all (or some) agents and re-create them in the order you want them to be used. 目前的解决方法似乎是删除所有(或某些)代理,然后按照您希望使用它们的顺序重新创建它们。 Which still means the last agent will be used less, but at least you can influence the distribution of the agents a bit. 这仍然意味着最后一个代理将被减少使用,但是至少您可以稍微影响代理的分布。

We are running into this issue as well. 我们也遇到了这个问题。 We have six build servers with three agents each and builds are not distributed fairly. 我们有六个构建服务器,每个构建服务器具有三个代理,并且构建分布不均。 I also do not want to assign an agent per definition, but I guess we are going to have to puzzle with it. 我也不想为每个定义分配一个代理,但是我想我们将不得不对此困惑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM