Running multiple GitLab CI runners as normal users
- Install gitlab multi runner systemwide: https://docs.gitlab.com/runner/install/
- Register the runner as an unpriviledged user (paste the secret key in your repo's runners page). This should create your configuration config (toml) file.
gitlab-runner register
- Register the service as root user by passing the path to the toml file and the user flag and the service name (needs to be unique per user or runner).
gitlab-runner install --config /home/myuser/.gitlab-runner/config.toml --user myuser --working-directory /home/myuser --service myuser_gitlabrunner
- As root, run
service myuser_gitlabrunner start
. The process should also start on boot (it should be in/etc/init/
folder or similar, depending on your distro.)
- Install gitlab multi runner systemwide.
- Register the runner as unpriviledged user. This should create your configuration toml file.
gitlab-runner register
- Run the process as normal user. No need to pass toml file or service name. Example supervisord script:
[program:myuser_runner]
command=gitlab-runner run
directory=/home/foo
user=foo
numprocs=1
- As root or as a user who can manage supervisord, run
supervisorctl myuser_runner start
. The process should also start on boot.