diff mbox series

.gitlab-ci.d/base: Mark jobs as interruptible by default

Message ID 20230223191343.1064274-1-thuth@redhat.com
State New
Headers show
Series .gitlab-ci.d/base: Mark jobs as interruptible by default | expand

Commit Message

Thomas Huth Feb. 23, 2023, 7:13 p.m. UTC
When handling pull requests in the staging branch, it often happens
that one of the job fails due to a problem, so that the pull request
can't be merged. Peter/Richard/Stefan then informs the sender of the
pull request and continues by pushing the next pending pull request
from another subsystem maintainer. Now the problem is that there might
still be lots of other running jobs in the pipeline of the first pull
request, eating up precious CI minutes though the pipeline is not
needed anymore. We can avoid this by marking the jobs as "interruptible".
With this setting, the jobs from previous pipelines are automatically
terminated when pushing a new one. If someone does not like this auto-
matic termination, it can still be disabled in the settings of the
repository. See this URL for details:

 https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/base.yml | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé Feb. 23, 2023, 8:23 p.m. UTC | #1
On 23/2/23 20:13, Thomas Huth wrote:
> When handling pull requests in the staging branch, it often happens
> that one of the job fails due to a problem, so that the pull request
> can't be merged. Peter/Richard/Stefan then informs the sender of the
> pull request and continues by pushing the next pending pull request
> from another subsystem maintainer. Now the problem is that there might
> still be lots of other running jobs in the pipeline of the first pull
> request, eating up precious CI minutes though the pipeline is not
> needed anymore. We can avoid this by marking the jobs as "interruptible".
> With this setting, the jobs from previous pipelines are automatically
> terminated when pushing a new one. If someone does not like this auto-
> matic termination, it can still be disabled in the settings of the
> repository. See this URL for details:
> 
>   https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   .gitlab-ci.d/base.yml | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
> index 50fb59e147..0274228de8 100644
> --- a/.gitlab-ci.d/base.yml
> +++ b/.gitlab-ci.d/base.yml
> @@ -11,6 +11,8 @@
>       # and show the duration of each line.
>       FF_SCRIPT_SECTIONS: 1
>   
> +  interruptible: true

It makes sense for mainstream, but seems counter-productive in forks.
At least in my maintainer use case.

Is it possible to add a 'default' in .gitlab-ci.d/qemu-project.yml,
so we can overwrite with a different namespace? 'interruptible' is
listed in https://docs.gitlab.com/ee/ci/yaml/index.html#default.
Thomas Huth Feb. 24, 2023, 6:22 a.m. UTC | #2
On 23/02/2023 21.23, Philippe Mathieu-Daudé wrote:
> On 23/2/23 20:13, Thomas Huth wrote:
>> When handling pull requests in the staging branch, it often happens
>> that one of the job fails due to a problem, so that the pull request
>> can't be merged. Peter/Richard/Stefan then informs the sender of the
>> pull request and continues by pushing the next pending pull request
>> from another subsystem maintainer. Now the problem is that there might
>> still be lots of other running jobs in the pipeline of the first pull
>> request, eating up precious CI minutes though the pipeline is not
>> needed anymore. We can avoid this by marking the jobs as "interruptible".
>> With this setting, the jobs from previous pipelines are automatically
>> terminated when pushing a new one. If someone does not like this auto-
>> matic termination, it can still be disabled in the settings of the
>> repository. See this URL for details:
>>
>>   https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   .gitlab-ci.d/base.yml | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
>> index 50fb59e147..0274228de8 100644
>> --- a/.gitlab-ci.d/base.yml
>> +++ b/.gitlab-ci.d/base.yml
>> @@ -11,6 +11,8 @@
>>       # and show the duration of each line.
>>       FF_SCRIPT_SECTIONS: 1
>> +  interruptible: true
> 
> It makes sense for mainstream, but seems counter-productive in forks.
> At least in my maintainer use case.
> 
> Is it possible to add a 'default' in .gitlab-ci.d/qemu-project.yml,
> so we can overwrite with a different namespace? 'interruptible' is
> listed in https://docs.gitlab.com/ee/ci/yaml/index.html#default.

As I wrote in the commit description: "If someone does not like this 
automatic termination, it can still be disabled in the settings of the 
repository."

See here for how to change the setting:

 
https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines

  Thomas
Philippe Mathieu-Daudé Feb. 24, 2023, 8:01 a.m. UTC | #3
On 24/2/23 07:22, Thomas Huth wrote:
> On 23/02/2023 21.23, Philippe Mathieu-Daudé wrote:
>> On 23/2/23 20:13, Thomas Huth wrote:
>>> When handling pull requests in the staging branch, it often happens
>>> that one of the job fails due to a problem, so that the pull request
>>> can't be merged. Peter/Richard/Stefan then informs the sender of the
>>> pull request and continues by pushing the next pending pull request
>>> from another subsystem maintainer. Now the problem is that there might
>>> still be lots of other running jobs in the pipeline of the first pull
>>> request, eating up precious CI minutes though the pipeline is not
>>> needed anymore. We can avoid this by marking the jobs as 
>>> "interruptible".
>>> With this setting, the jobs from previous pipelines are automatically
>>> terminated when pushing a new one. If someone does not like this auto-
>>> matic termination, it can still be disabled in the settings of the
>>> repository. See this URL for details:
>>>
>>>   https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>   .gitlab-ci.d/base.yml | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
>>> index 50fb59e147..0274228de8 100644
>>> --- a/.gitlab-ci.d/base.yml
>>> +++ b/.gitlab-ci.d/base.yml
>>> @@ -11,6 +11,8 @@
>>>       # and show the duration of each line.
>>>       FF_SCRIPT_SECTIONS: 1
>>> +  interruptible: true
>>
>> It makes sense for mainstream, but seems counter-productive in forks.
>> At least in my maintainer use case.
>>
>> Is it possible to add a 'default' in .gitlab-ci.d/qemu-project.yml,
>> so we can overwrite with a different namespace? 'interruptible' is
>> listed in https://docs.gitlab.com/ee/ci/yaml/index.html#default.
> 
> As I wrote in the commit description: "If someone does not like this 
> automatic termination, it can still be disabled in the settings of the 
> repository."
> 
> See here for how to change the setting:
> 
> 
> https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines

Oh I couldn't find this. Do you mind listing this URL in the commit
description?
Thomas Huth Feb. 24, 2023, 8:03 a.m. UTC | #4
On 24/02/2023 09.01, Philippe Mathieu-Daudé wrote:
> On 24/2/23 07:22, Thomas Huth wrote:
>> On 23/02/2023 21.23, Philippe Mathieu-Daudé wrote:
>>> On 23/2/23 20:13, Thomas Huth wrote:
>>>> When handling pull requests in the staging branch, it often happens
>>>> that one of the job fails due to a problem, so that the pull request
>>>> can't be merged. Peter/Richard/Stefan then informs the sender of the
>>>> pull request and continues by pushing the next pending pull request
>>>> from another subsystem maintainer. Now the problem is that there might
>>>> still be lots of other running jobs in the pipeline of the first pull
>>>> request, eating up precious CI minutes though the pipeline is not
>>>> needed anymore. We can avoid this by marking the jobs as "interruptible".
>>>> With this setting, the jobs from previous pipelines are automatically
>>>> terminated when pushing a new one. If someone does not like this auto-
>>>> matic termination, it can still be disabled in the settings of the
>>>> repository. See this URL for details:
>>>>
>>>>   https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible
>>>>
>>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>>> ---
>>>>   .gitlab-ci.d/base.yml | 2 ++
>>>>   1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
>>>> index 50fb59e147..0274228de8 100644
>>>> --- a/.gitlab-ci.d/base.yml
>>>> +++ b/.gitlab-ci.d/base.yml
>>>> @@ -11,6 +11,8 @@
>>>>       # and show the duration of each line.
>>>>       FF_SCRIPT_SECTIONS: 1
>>>> +  interruptible: true
>>>
>>> It makes sense for mainstream, but seems counter-productive in forks.
>>> At least in my maintainer use case.
>>>
>>> Is it possible to add a 'default' in .gitlab-ci.d/qemu-project.yml,
>>> so we can overwrite with a different namespace? 'interruptible' is
>>> listed in https://docs.gitlab.com/ee/ci/yaml/index.html#default.
>>
>> As I wrote in the commit description: "If someone does not like this 
>> automatic termination, it can still be disabled in the settings of the 
>> repository."
>>
>> See here for how to change the setting:
>>
>>
>> https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines 
>>
> 
> Oh I couldn't find this. Do you mind listing this URL in the commit
> description?

It's linked from https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible 
(which I mentioned already in the commit description) ... isn't that enough?

  Thomas
Philippe Mathieu-Daudé Feb. 24, 2023, 8:12 a.m. UTC | #5
On 24/2/23 09:03, Thomas Huth wrote:
> On 24/02/2023 09.01, Philippe Mathieu-Daudé wrote:
>> On 24/2/23 07:22, Thomas Huth wrote:
>>> On 23/02/2023 21.23, Philippe Mathieu-Daudé wrote:
>>>> On 23/2/23 20:13, Thomas Huth wrote:
>>>>> When handling pull requests in the staging branch, it often happens
>>>>> that one of the job fails due to a problem, so that the pull request
>>>>> can't be merged. Peter/Richard/Stefan then informs the sender of the
>>>>> pull request and continues by pushing the next pending pull request
>>>>> from another subsystem maintainer. Now the problem is that there might
>>>>> still be lots of other running jobs in the pipeline of the first pull
>>>>> request, eating up precious CI minutes though the pipeline is not
>>>>> needed anymore. We can avoid this by marking the jobs as 
>>>>> "interruptible".
>>>>> With this setting, the jobs from previous pipelines are automatically
>>>>> terminated when pushing a new one. If someone does not like this auto-
>>>>> matic termination, it can still be disabled in the settings of the
>>>>> repository. See this URL for details:
>>>>>
>>>>>   https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible
>>>>>
>>>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>>>> ---
>>>>>   .gitlab-ci.d/base.yml | 2 ++
>>>>>   1 file changed, 2 insertions(+)
>>>>>
>>>>> diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
>>>>> index 50fb59e147..0274228de8 100644
>>>>> --- a/.gitlab-ci.d/base.yml
>>>>> +++ b/.gitlab-ci.d/base.yml
>>>>> @@ -11,6 +11,8 @@
>>>>>       # and show the duration of each line.
>>>>>       FF_SCRIPT_SECTIONS: 1
>>>>> +  interruptible: true
>>>>
>>>> It makes sense for mainstream, but seems counter-productive in forks.
>>>> At least in my maintainer use case.
>>>>
>>>> Is it possible to add a 'default' in .gitlab-ci.d/qemu-project.yml,
>>>> so we can overwrite with a different namespace? 'interruptible' is
>>>> listed in https://docs.gitlab.com/ee/ci/yaml/index.html#default.
>>>
>>> As I wrote in the commit description: "If someone does not like this 
>>> automatic termination, it can still be disabled in the settings of 
>>> the repository."
>>>
>>> See here for how to change the setting:
>>>
>>>
>>> https://docs.gitlab.com/ee/ci/pipelines/settings.html#auto-cancel-redundant-pipelines
>>
>> Oh I couldn't find this. Do you mind listing this URL in the commit
>> description?
> 
> It's linked from 
> https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible (which I 
> mentioned already in the commit description) ... isn't that enough?

Ah right. I guess it was too late when I looked at that yesterday :\
Daniel P. Berrangé Feb. 27, 2023, 11:05 a.m. UTC | #6
On Thu, Feb 23, 2023 at 08:13:43PM +0100, Thomas Huth wrote:
> When handling pull requests in the staging branch, it often happens
> that one of the job fails due to a problem, so that the pull request
> can't be merged. Peter/Richard/Stefan then informs the sender of the
> pull request and continues by pushing the next pending pull request
> from another subsystem maintainer. Now the problem is that there might
> still be lots of other running jobs in the pipeline of the first pull
> request, eating up precious CI minutes though the pipeline is not
> needed anymore. We can avoid this by marking the jobs as "interruptible".
> With this setting, the jobs from previous pipelines are automatically
> terminated when pushing a new one. If someone does not like this auto-
> matic termination, it can still be disabled in the settings of the
> repository. See this URL for details:
> 
>  https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  .gitlab-ci.d/base.yml | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
Alex Bennée Feb. 27, 2023, 11:32 a.m. UTC | #7
Thomas Huth <thuth@redhat.com> writes:

> When handling pull requests in the staging branch, it often happens
> that one of the job fails due to a problem, so that the pull request
> can't be merged. Peter/Richard/Stefan then informs the sender of the
> pull request and continues by pushing the next pending pull request
> from another subsystem maintainer. Now the problem is that there might
> still be lots of other running jobs in the pipeline of the first pull
> request, eating up precious CI minutes though the pipeline is not
> needed anymore. We can avoid this by marking the jobs as "interruptible".
> With this setting, the jobs from previous pipelines are automatically
> terminated when pushing a new one. If someone does not like this auto-
> matic termination, it can still be disabled in the settings of the
> repository. See this URL for details:
>
>  https://docs.gitlab.com/ee/ci/yaml/index.html#interruptible
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>

Queued to testing/next, thanks.
diff mbox series

Patch

diff --git a/.gitlab-ci.d/base.yml b/.gitlab-ci.d/base.yml
index 50fb59e147..0274228de8 100644
--- a/.gitlab-ci.d/base.yml
+++ b/.gitlab-ci.d/base.yml
@@ -11,6 +11,8 @@ 
     # and show the duration of each line.
     FF_SCRIPT_SECTIONS: 1
 
+  interruptible: true
+
   rules:
     #############################################################
     # Stage 1: exclude scenarios where we definitely don't