简体   繁体   中英

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.

so, i want to know in ideal scenario How many build should be run on single Jenkins slave for microservices build?

you do not need to clean .m2 manually and there is no limitation (apart from server hardware ofc) stops you on jenkins master/slaves

for reason of clean .m2 I would suggest to use key on maven builds which requires clean dependencies -U which will force update dependecies

in case you really want to cleanup local repo use this 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. 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. 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. So under normal scenarios , we have 4 executors per slave.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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