问题
A shared runner is used by dozens of our project. I set concurrent = 5
in config.toml, so my runner can do 5 job concurrently for all project.
For example, the following scenario:3 job for A project, 2 job for B project, 0 job for C project which causes C project should wait for at least 1 job of A or B project being finished until it starts first job.
I want to set like "all project concurrent = 5
" and "each project concurrent = 2
". Is there any way to deal with it?
回答1:
There is an open issue for your problem here.
One of the options proposed by users is to register your worker with multiple runners, use concurrent
in global runner configuration and limit
parameter per runner. Then you can set tag in each project yaml to execute on runner which is limited to 2 parallel jobs.
Runners config would look like():
concurrent = 5
[[runners]]
limit = 2
name = "project-a-runner"
...
[[runners]]
limit = 2
name = "project-b-runner"
...
来源:https://stackoverflow.com/questions/60647262/gitlab-shared-runner-set-concurrence-for-each-project