Force non-concurrent execution of job
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem to solve
Some jobs require exclusive execution on a runner instance. Currently, you can disable concurrency for the entire runner or you can use resource groups to prevent concurrent executions of the same job in separate pipelines, but you cannot ensure that only a specific job is run in a non-concurrent way.
Further details
As an example, for a 3D real-time application, you have a specific hardware configuration where you run automated performance tests. The test results are compared to a baseline and fail if there is a significant deviation. If a concurrent job is running at the same time, this will affect the performance test results.
One workaround is to completely disable concurrency on the runner. However, if the majority of jobs could be run in parallel, this will considerably increase the wall time of pipelines. For instance, you could have a dozen build jobs, unit test jobs and a single performance test job.
Proposal
A similar feature was added recently with resource groups. This prevents multiple instances of the same job to run in parallel. However, other jobs may still be executed on the same runner, affecting the results of a performance test.
One possibility could be to add an "exclusive" option to the resource_group setting of jobs, which defaults to true, but can be explicitly disabled. This way you could mark jobs that use the same resources, but allow most of them to run in parallel. A job marked as needing exclusive access to the resource would behave as it does currently.
Alternatively, a completely independent option could be implemented to request exclusive execution on a runner.