Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab CI building on multiple runners

My question is relatively simple,

I have gitlab set-up, gitlab CI too and two separate server which each have their own runner. Both runners are working and can execute a build successfully.

What I'd like to achieve now is to have one project be build by both runners, perferrably even with seperate commands. This last thing doesn't seem possible however if I add both runners to a project it just seems to build on one of them and not the other.

Is it possible to get it to build on both and maybe even vary the scripts?

like image 484
w3re Avatar asked Oct 10 '13 17:10

w3re


People also ask

How many GitLab runners do I need?

You can have one gitlab runner for all stages. The build job would then be picked up by any gitlab runner that you have defined that has the tag build .

Is it safe to use GitLab shared runners?

GitLab Runners do not offer secure isolation between projects that they do builds for. You are TRUSTING all GitLab users who can push code to project A, B or C to run shell scripts on the machine hosting runner X.

How do I run multiple GitLab runners?

It's possible to run multiple GitLab runners on the same host by encapsulating the runner and its executor dependencies inside a container. For example, since I use GitLab with the Docker executor, I created a container that encapsulates the GitLab runner + a docker engine.

Do GitLab jobs run in parallel?

GitLab provides a method to make clones of a job and run them in parallel for faster execution using the parallel: keyword. While parallel jobs may not help in reducing the consumption of CI minutes, they definitely help increase work productivity.


1 Answers

Someone brought this up on the GitLab CI issue tracker (https://gitlab.com/gitlab-org/gitlab-ci/issues/237). The workaround proposed there is as follows:

Create multiple jobs with different tags and assign different tags to these runners: job1: script: echo 1 tags: - runner1 job2: script: echo 2 tags: - runner2

Not a great solution, especially if you want to run the exact same job on a bunch of runners (as I do), but it can be made to work.

like image 169
Jason R Avatar answered Oct 14 '22 22:10

Jason R