Only schedule jobs when runner available
I have a job type that requires to be run on a machine with specialized hardware.
I want my pipeline to execute jobs on that runner with HW when it's available. The gitlab-runner service on the host is stopped frequently to allow user debug sessions. The problem I have is that CI pipelines get 'stuck' because the runner is not processing any jobs from the queue.
I consider this pipeline job to be best-effort, and therefor set "allowed to fail".
What I'm looking for is a way to either:
- "skip/fail job when in Pending state for over X minutes".
- "skip/fail job when there are no -active- runners that can process the job"
=> Gitlab is already able to detect that there are no runners available to process the job (with that label), but it just keeps waiting until the global project timeout is hit.
https://gitlab.com/gitlab-org/gitlab-ce/issues/18183 would allow someone to specify a timeout per job, which would make it slightly better to handle my use case.
I guess option 2) might be the most useful for everyone. The syntax could, for example, be "only/when: runner_available".