Repository navigation
Automatically pause pipelines - #7876
Conversation
|
Oh this will be great to have, we do this manually. |
52f07a9 to
ef39c70
Compare
|
testflight is flaky af 😡 EDIT: tests were not flakey, human is stupid and introduced bug 🙃 |
|
the runc bump in our main CI caused the failure. Now it is pinned to previous version. Once |
pauses pipelines that have had no builds run in greater than some number of days. Pipelines this component pauses will be marked as paused by "automatic-pipeline-pauser" which will be visible from the web UI Signed-off-by: Taylor Silva <[email protected]>
Calls the db pauser. Short circuts if the days is set to zero. Essentially turns the feature off. Signed-off-by: Taylor Silva <[email protected]>
ef39c70 to
393b902
Compare
The pauser only needs to run once a day so its interal is 24h Signed-off-by: Taylor Silva <[email protected]>
393b902 to
11fd9ad
Compare
From concourse/concourse#7876 Signed-off-by: Taylor Silva <[email protected]>
Related concourse/concourse#7876 Signed-off-by: Taylor Silva <[email protected]>
clarafu
left a comment
There was a problem hiding this comment.
@taylorsilva Sorry for my super late review, had to finish up some bug fix for the 7.4.x series! I know it is merged already but I had one thing I wanted to run by you!
|
@taylorsilva would you be able to also add |
|
@xtremerui already did. The PRs should be referenced somewhere above. |
|
Hmm @xtremerui @taylorsilva I'm curious to know if you have tried running this manually and saw it pause pipelines that have not run in the configured amount of days? I'm thinking that using I think this could also benefit from some integration tests in the |
|
No, did not manually test this. I get what you're saying, that Okay diving into the code more cause I don't know the scheduler stuff very well, and this bit interests me: concourse/atc/scheduler/scheduler.go Lines 34 to 59 in 53949cd These are various cases where the scheduler/algorithm can error and return a bool that indicates whether a retry is needed (true) or not (false). I guess these are the cases you are talking about? And then diving over to concourse/atc/db/job_factory.go Lines 78 to 87 in 53949cd where yes, this column does not look like the data I want! I'll make changes in #7914 |
|
Oh the cases where the scheduler was run and a build is not created is pretty common! For example, it could be when a resource version is disabled and it will trigger a request to schedule the job. Lines 781 to 784 in 53949cd This disabled resource version can be a super old one and when the scheduler runs, it determines the same set of inputs as it did in the latest build and therefore does not create a new build. Here lists all the cases where a request to schedule will be done https://concourse-ci.org/scheduler.html#scheduling-on-demand. One way I can think of to get this to work is we might want to have this pipeline pausing component determine when it needs to be paused based off the creation time of the latest build of its jobs? |
Related concourse/concourse#7876 Signed-off-by: Taylor Silva <[email protected]>
Related concourse/concourse#7876 Signed-off-by: Taylor Silva <[email protected]>
Changes proposed by this PR
Adds a component that runs once every 24hrs and checks for any pipelines that
haven't run in more than X days. Setting the days to zero disables the component.
Thought of adding this feature after reading this discord message:

https://discord.com/channels/219899946617274369/413771057686773770/912836796348497932
Where the user created some scripts to do this for their Concourse instance.
Their reported paused/unpaused ratio was at 50%. This made me think there's a
lot of Concourse pipelines out there doing resource checks when they could be
doing nothing and saving compute power. Thus this feature, to bring it to all
Concourse users.
The database already has all the info needed to find pipelines to pause, so
users can get a benefit from this feature immediately as it will retroactively
pause pipelines on its first run.
Release Note
CONCOURSE_PAUSE_PIPELINES_AFTER. A value of zero (the default) disables this component. On first run it will retroactively pause pipelines that already fall out of the given day range.