詹金斯(Jenkins)-让繁重的工作等待一定数量的执行者可用 [英] Jenkins - Make heavy job wait for a certain number of executors to be available

查看:61
本文介绍了詹金斯(Jenkins)-让繁重的工作等待一定数量的执行者可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上一个问题中问了如何仅在两个执行程序中有两个执行程序可用时才让繁重的工作运行.这样可以确保快速构建始终使执行器不会被繁重的执行器所阻塞.

In a previous question I asked how to only let a heavy job run if two of two executors are available. This assures, that fast builds always have an executor not being blocked by a heavy one.

快速工作不到10分钟,沉重的工作可能需要几个小时.

Fast jobs are below 10 minutes, heavies can take hours.

在下一阶段,我将介绍Jenkins构建集群.想象一下,在一个巨大的构建环境中,一个主机和n个构建奴隶,每m个执行者.简短:随机有大量执行者.

It the next level I look at Jenkins build clusters. Imagine one master and n build slaves with each m executors in a giant build environment. Short: A random big number of executors.

如何确保执行者中至少有 x% 可以用于快速工作?如果x%少于1位执行者(例如4位执行者中的10%),则应有1位执行者.

How can I assure that at least x% of the executors are available for fast jobs? If x% is less than 1 executor (e.g. 10% of 4 executors), 1 executor shall be available.

推荐答案

让我们说您有4个从属节点,每个节点有2个执行器,总共8个执行器.有多种方法可以限制jenkins作业在从属节点上运行.

Let us say you have 4 slave nodes with 2 executors each in total 8 executors. There are multiple ways of restricting a jenkins job from running on a slave node.

  1. 您可以在每个Jenkins作业配置部分使用默认的限制可以在哪里运行该项目"选项.这样,您始终可以拥有一个从节点,其中有2个始终专用于快速作业的执行程序.
  2. 请参阅此插件 https://wiki.jenkins-ci. org/display/JENKINS/Job + Restrictions + Plugin .该插件为您提供了不同的选择.
  1. You can use the default "Restrict where this project can be run" option on each Jenkins job configure section. In this way you can always have one slave node with 2 executors always dedicated for the fast jobs.
  2. Refer to this plugin https://wiki.jenkins-ci.org/display/JENKINS/Job+Restrictions+Plugin. This plugin gives you different option.

我个人更喜欢将一个从属节点专用于快速作业,这样可以根据可用的硬件灵活地增加或减少执行程序.您还可以灵活地将从节点更改为其他硬件,而Jenkins的更改最少.假设您在詹金斯(Jenkins)中有1000多个工作,每个工作都分为快速工作和繁重工作,并且已分配到特定节点,如果快速工作的数量增加,您总是可以轻松地增加从属的执行者,因此任何单个工作都不会发生变化配置.希望这可以帮助.

I personally prefer to dedicate a slave node for fast jobs, which gives the flexibility to increase or decrease the executors based on the hardware available. You will also have the flexibility to change the slave node to a different hardware with a minimal change in Jenkins. Say you have 1000+ jobs in Jenkins each classified as fast and heavy Jobs and have been allocated to a specific node if the number of fast jobs increases you can always easily increase the executors of the slave and hence no change in any of the individual job configuration. Hope this helps.

这篇关于詹金斯(Jenkins)-让繁重的工作等待一定数量的执行者可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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