Multiple Executor/Runner Config

We have a pipeline that uses our private gitlab runner to run tests and build docker images. We are using AWS with docker+machine executor with auto-scaling. It has worked fine until recently when we tried running code coverage. Our tests aren’t the most efficient, so running the coverage needs more RAM than what our current executors are provisioned with. I could just bump up the instance size in the config.toml, but then we are paying for a larger instance for coverage that we only run occasionally.

I don’t want to provision a separate runner only for these “big” jobs, as it will sit idle most of the time. It is essential that it is available when we need it though. I would like to have a second runner configured with an idle count of 0, on the same host machine that houses our smaller runner that we use frequently(because I don’t want to provision a second host for a runner that only executes jobs 1-3x/day). I would like to have different tags on the “big” runner so that it needs to be called specifically for the jobs that require it. That way in gitlab-ci.yml I could use our default tags [“aws”,“ourcompany”,“docker”] with most jobs, and use something like [“big”,“aws”,“ourcompany”,“docker”] to use the runner with a bigger instance size when running jobs that require more resources.

There may be a way to have a dual config like this with a single runner, but I have combed the documentation and couldn’t find a way, though the documentation does hint that it is possible. Otherwise, just having a second runner on the underutilized host seems like it would be the a solution, if it is possible.

Thanks in advance for any help.

Hi @Btripp1986
your approach by creating a 2nd runner on the same server if the proper way to do it.
Just create another [[runner]] definition in the config.toml file to create a new runner. Or just use the gitlab runner CLI.

2 Likes