简体   繁体   English

在微服务构建的理想情况下,应在单个Jenkins从站上运行多少个构建?

[英]How many build should be run on single Jenkins slave in ideal scenarios for microservices build?

I have googled this issue, but not getting satisfactory answer. 我已经用谷歌搜索了这个问题,但没有得到满意的答案。 when we consider master slave Jenkins architecture, we are facing issue with maven clean, developer asking to clean .m2 repository every time before build, but i think this will cause build failure for other builds running on same slave. 当我们考虑主从Jenkins体系结构时,我们面临着maven clean的问题,开发人员每次在构建之前要求清除.m2存储库,但是我认为这将导致在同一从属上运行的其他构建失败。

so, i want to know in ideal scenario How many build should be run on single Jenkins slave for microservices build? 因此,我想知道在理想情况下,应在单个Jenkins从站上为微服务构建运行多少个构建?

you do not need to clean .m2 manually and there is no limitation (apart from server hardware ofc) stops you on jenkins master/slaves 您不需要手动清理.m2,并且没有任何限制(除了服务器硬件ofc之外)可以阻止您使用jenkins主服务器/从服务器

for reason of clean .m2 I would suggest to use key on maven builds which requires clean dependencies -U which will force update dependecies 出于清洁.m2的原因,我建议在需要清洁依赖项的Maven构建上使用key -U ,这将强制更新依赖项

in case you really want to cleanup local repo use this dependency:purge-local-repository 如果您真的想清理本地dependency:purge-local-repository使用以下dependency:purge-local-repository

other builds will be affected a bit, cause they will try to resolve dependencies once again but that's all 其他版本会受到一些影响,因为它们将再次尝试解决依赖关系,仅此而已

There is no need of clearing the .m2 folder everytime, if any of the dependencies that were cached but not downloaded you can use the mvn -U flag to update the .m2 repository. 无需每次都清除.m2文件夹,如果已缓存但未下载任何依赖项,则可以使用mvn -U标志更新.m2存储库。 However if you are building modules for a project that are interdependent and are going to update the same artifact on the mvn install, then yes if they both are building simultaneously it is going to cause problem on building the modules on the same slaves. 但是,如果您正在为相互依赖的项目构建模块,并打算在mvn安装中更新相同的工件,那么可以,如果它们同时在构建,则会在同一从属上构建模块时引起问题。 For such scenarios it is better to run these modules on different slaves. 对于这种情况,最好在不同的从站上运行这些模块。

As for the limitation on the build executors for a slave, it solely depends on the hardware configure ideally its one executor per core of the CPU. 至于从站的构建执行器的限制,它完全取决于硬件配置,理想情况下,每个CPU内核的配置是一个执行器。 So under normal scenarios , we have 4 executors per slave. 因此,在正常情况下,每个奴隶有4个执行者。

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

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