Block execution of gitlab runner during office hours

Block execution of gitlab runner during office hours

Hi, I’m trying to have some runners on machines that could be used for other things during office hours. Is there a way to use the Periods syntax to achieve that? The documentation on that is a bit sparse.

Or is this better done via some system cron jobs?

Thanks for any help! :blush:

I noticed I forgot to describe my question properly:

How can I use the Periods syntax to block runner execution during office hours?

Hi,

the Periods setting only is available in the context of auto-scaling (the upper heading for this section with an example). The thing you want to achieve is not possible, you’d want to pause certain runners.

Maybe the deploy freezes coming later this year can help.

If it is just about the runners themselves - I would create a cronjob and script which stops the service in given ranges, and later starts it again. Then the runner is not available for this period of time for the GitLab server, and the server queue will be dealt with other runners. Probably you can automate the task with Ansible/Puppet too.

Re-using the Period for an “inactivity/freeze time window” for the runner also sounds like a nice idea and worth a feature request in a new issue :slight_smile:

Cheers,
Michael

Thanks for your answer. The deploy freezes feature looks very similar, except it would skip all jobs released in the blocked period.

I made a feature request as you suggested :smile: