L
L
lugange2021-12-20 17:10:15
Amazon Web Services
lugange, 2021-12-20 17:10:15

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'
            }

But wouldn't it be better to use ECS for slaves? If yes, then what?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2021-12-21
@saboteur_kiev

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.

V
Vitaly Karasik, 2021-12-20
@vitaly_il1

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 question

Ask a Question

731 491 924 answers to any question