One thing with GitLab Runner I do not understand. Can I register one dedicated Runner (Hardware) to different Projects?
As sample I have following Gitlab Runners
gitlab-runner-1
gitlab-runner-2
gitlab-runner-shared-1
gitlab-runner-shared-2
gitlab-runner-1 is bound to project 1 with project token
gitlab-runner-2 is bound to project 2 with project token
Each runner is shown inside the project and on the left side the shared runners.
My Question is now, do I need for each project one hardware runner or can I register one runner with multiple projects. Like register project 1 on gitlab-runner 1 and als register project 2 on gitlabe-runner 1 too? Or will this double register overwrite the previous registration?
For a project runner, go to Settings > CI/CD and expand the Runners section
Basically, it comes down to taking this token from different places. In your case, I believe you can just delete the Runner from the UI and then repeat registration process with new registration token.
Hi, using an API call at project level with the project runner registration token you may create runner access tokens, see Runners API | GitLab. So create two access tokens using the two different registration tokens of the projects and use them in the corresponding section of the config.toml.
You may reuse the same hardware but keep in mind that then jobs may interfere unless you use docker runners. This may be useful if you want to share special GPUs, e.g.