Looking for gitlab-runner startup documentation

We’ve got a gitlab instance with runners (all running on Ubuntu 20.04) and the tasks themselfs take about 30 seconds. But the runner setup code takes between 1 and 2 minutes. I don’t know where to start to debug that or what I can do to reduce the startup time of the jobs

The jobs use docker images

Unfortunately, it’s normal. As you can see in the job transcript, it takes time to build the Docker container and pull the repository

build the container? is it more than just a docker run -it container-name (which normally is ready in less than a second

the repo is cached on the runner (I think). so pulling updates to the repo should also take less than a few seconds on repeated runs)

AFAIU, when you use the Docker executor, there is no caching. On each run a new container is built from the scratch, and it knows nothing about the previous runs

@alexk, I think OP is talking about the image used to create the container. The gitlab-runner does take advantage of images already present in the docker host. This behaviour can be changed with the pull_policy setting.

@NeroBurner, I don’t know the answer but the runner source code is here: https://gitlab.com/gitlab-org/gitlab-runner/ (including the docker executor: https://gitlab.com/gitlab-org/gitlab-runner/-/tree/master/executors/docker). Maybe this could help you get an idea of what’s happening behind the scenes.

1 Like