Answer the question
In order to leave comments, you need to log in
What is better for Jenkins: use ECS as slaves or use docker image on the master?
Now we only have a Jenkins wizard for building applications, there is a suggestion to use the following option:
pipeline {
agent {
dockerfile {
filename 'Dockerfile.build'
dir 'build'
additionalBuildArgs "-t build-image:latest"
args '-v /efs/jenkins/.nuget/:/home/jenkins/.nuget/'
label 'unix'
}
Answer the question
In order to leave comments, you need to log in
In fact, there is no better here - you must always adapt to your tasks and your project.
Raising additional slaves in ECS makes sense if you have a lot of builds, a lot of tests, and they cost money.
In a complex project, the configuration may look like this:
The master spins in his more or less stable container and drives only tasks, does not start workers.
There are several types of prepared containers for slaves - for assembly and for tests, with different configurations. In some cases, you can even make different containers here for building nodejs, building python, tests, and for example a container for performance tests.
During the pipeline, the necessary steps are performed on the necessary slave, and the slaves are dynamically raised if the queue grows and are also automatically destroyed when they are not needed. For example, if the container rises in 1-2 minutes, then with a downtime of 20-30 minutes it can be extinguished. So you will reduce the time of builds when there are a lot of them, and save money on resources when they are idle.
And in a simple project, where everything can be assembled and tested on the same container, and the builds last not hours but ten minutes maximum, you can not complicate and not engage in overengineering, everything is riveted on several master workers.
The general recommendation is to use the master only for orchestration, and run jobs on slaves.
What to use as slaves? I'm used to virtual machines, there are plugins for dynamically launching slaves in AWS and other clouds. As a matter of fact, I don’t understand at all why images are suggested to be built inside the container.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question