GitLab Runner understanding
How does GitLab Runner works:
concurrent
= 4 is a global option, it won't cause you to have 4 parallel executions. And
limit is a runner option on how many executions the runner is doing.
In
other words, suppose that you have this config concurrent=4 and only one runner
defined with limit = 1. The maximum amount of executions you will do is 1,
because you have only one runner that can run only one subprocess at the same
time.
But
suppose that you have the same config (concurrent=4) but you have 10 different
runners running with limit=1. What this means is that only 4 of those runners
will run executions at the same time at any given time and, when they run, they
can spawn only one subprocess.
0
does not mean unlimited.
0
(default) simply means don’t limit
limit=4
è (how many executions the same runner
can have)
Example1
:
STEPS:
1.
Set
the parameter as follow: Current setting is=>> concurrent=1. The new setting is =>> concurrent=4
(globally allows 4)
2. Edit the limit parameter in each runner =>> limit=1
Example2:
2. Create 4 runners
3. Runner 1 è limit=3 (the same runner can run parallel 3 times)
4. Runner 2 è limit=2 (the same runner can run parallel 2 times)
5. Runner 3 è limit=1 (this runner can just run one time =>> no parallel)
What this means is that only 4 of those runners will run executions at the same time. Because we allow globally 4 concurrent è [concurrent=4 (globally allows 4)].
Example3:
2. Create 4 runners
3. Runner 1 è limit=3 (the same runner can run parallel 3 times)
4. Runner 2 è limit=2 (the same runner can run parallel 2 times)
5. Runner 3 è limit=1 (this runner can just run one time =>> no parallel)
What this means is that all 4 runners can have run 10 executions at the same time. Because we allow globally 10 concurrent è [concurrent=10 (globally allows 10)]. Each runner limit has different, but not much then 10.
If you want to make chane in your runner config. You need to do as follow:
vi /etc/gitlab-runner/config.toml
Change the concurrent and limit values.
Restart runner
gitlab-runner verify
gitlab-runner stop
gitlab-runner restart
gitlab-runner status
gitlab-runner start
-- Follwoing command stop your complete gitlab envoronment.
gitlab-ctl status
gitlab-ctl stop
Hope this helps.
You can Create runner as follow:
You need registration token.
Go to on you GitLab Web Link:
Groups =>> Explore groups =>>{Choos a group}: Test-HowKnow =>> {on the left side}: Setting=>> CI/CD =>> Runners =>> Expand [you find there the registration tocken
gitlab-runner register -n --url [GitLab Server URL
]/
--limit 1 --registration-token [
registrationtoken] --executor docker --description
"Test Deployment"
--docker-image
"docker:latest"
--docker-privileged --docker-volumes /var/run/docker
.sock:
/var/run/docker.sock
No comments:
Post a Comment