difference between user-mode and system-mode in GitLab Runner CI/CD

Viewed 3696

While configuring GitLab runner in system-mode, service is not getting started, but in user-mode the service is working good.

In GitLab runner document they have not briefed the purpose https://docs.gitlab.com/runner/commands/#super-user-permission

Only difference I understood is the path:

User-mode = /Users/ayufan/.gitlab-runner/config.toml

Sytem-mode = /etc/gitlab-runner/config.toml

Could any one explain, how the results are affected with system-mode.

Update: I didnt get the answer from gitlab forums but I reading some notes here https://medium.com/static-object/how-to-set-up-gitlab-ci-for-ios-in-a-few-relatively-simple-steps-56a0d88d0272 , I learned that this an issue that most of them facing.

1 Answers

User mode vs System mode

In user mode, the runners you register will only work for the current user. If you log in from different user the runners will not be available for your pipeline and if you try to run your pipeline, it will be stuck cause there are no available runners to work.

In system mode, the runners you register will be available to run and work as long as the machine is on regardless of the user you log in from.

Working in system mode

To register a runner in system mode, all you need to do is to prefix your register command with sudo as following:

sudo gitlab-runner register

To verify which runners are working in system mode:

sudo gitlab-runner verify
Related