Jenkins-等待两个执行程序可用 [英] Jenkins - Wait for two executors to be available

查看:88
本文介绍了Jenkins-等待两个执行程序可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在实现持续集成的步骤中,我们将构建工作分为两部分:

In our steps towards Continuous Integration we split the build job into two parts:

  1. 快速运行必需品
  2. 较慢的繁重任务

目标是始终在不到10分钟的时间内完成第一个操作,并且仅包含构建,单元测试和部署到工件存储库.第二个可能还需要几个小时.

The goal is to always have the first one run through in less than 10 minutes and only contains build, unit-test and deploy to artifact-repository. The second one may also take hours.

目前,我们有一个主设备负责处理所有事务,而没有从设备.大师有两个执行者.这不能更改.

Currently we have one master that is handling everything, no slaves. The master has two executors. This can not be changed.

我想做的是让繁重的一个等待两个插槽被打开,以确保始终有一个执行程序可用于快速运行的任务.

What I want to do is make the heavy one wait for two slots to be open in order to assure there is always one executor available for fast running tasks.

大量运行:

FastJob: -------xxxxxxxx---------xxxxx-------xxxxx------xxxxxxx-

LongJob: ---xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-----------------

沉重的等待:

FastJob: --xxxxxx--xxxxxxxx---------xxxxx-------xxxxx-----------

LongJob: ---wwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-----------

--- = nothing
xxx = executing build
www = waiting

我已经查看了繁重的工作插件,但是,这不能解决此问题,因为此后它会阻塞两个执行程序.繁重的工作要等到有两个执行者有空之后才可以阻止一个.

I already looked at the Heavy Job Plugin, however that does not solve this issue as it blocks both executors afterwards. The heavy job shall wait until two executors are free and then only block one.

另请参阅继续有关保留x%的执行人的问题.

推荐答案

好吧,当使用

如果当前正在运行的作业的至少一个名称与给定的正则表达式之一匹配,则此插件会将实际作业保留在队列中.

This plugin keeps the actual job in the queue if at least one name of currently running jobs is matching with one of the given regular expressions.

LongJob在两个执行程序都可用之前不会运行.

LongJob will not run until both executors become available.

这篇关于Jenkins-等待两个执行程序可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆