Gitlab shared runner set concurrence for each project

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-08 05:30:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!