Re: [PATCH] ci: avoid unnecessary builds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 07 2022, Derrick Stolee wrote:

> On 11/7/22 2:53 PM, Taylor Blau wrote:
>> On Mon, Nov 07, 2022 at 02:45:24PM -0500, Derrick Stolee wrote:
>>> On 11/3/22 9:34 AM, Johannes Schindelin via GitGitGadget wrote:
>>>> From: Johannes Schindelin <johannes.schindelin@xxxxxx>
>>>>
>>>> Whenever a branch is pushed to a repository which has GitHub Actions
>>>> enabled, a bunch of new workflow runs are started.
>>>>
>>>> We sometimes see contributors push multiple branch updates in rapid
>>>> succession, which in conjunction with the impressive time swallowed by
>>>> even just a single CI build frequently leads to many queued-up runs.
>>>>
>>>> This is particularly problematic in the case of Pull Requests where a
>>>> single contributor can easily (inadvertently) prevent timely builds for
>>>> other contributors.
>>>
>>> As someone who is both the cause and the victim of this, I
>>> thank you for finding a way to reduce wasted CPU time. This
>>> patch looks good to me, though I'll need to trust the docs
>>> and your testing to be sure it will work. We will definitely
>>> see it in place as it merges into 'next' and 'main'.
>> 
>> I wonder how we should treat Ævar's concerns in this thread. I suspect
>> that the vast majority of workflows wouldn't be affected, but I don't
>> want to completely break Ævar's workflow, either ;-).
>> 
>> Some kind of configuration mechanism like I proposed might be nice.
>> Thoughts?
>
> Taking a look at that sub-thread, I have two thoughts:
>
> 1. I don't think supporting a "multiple pushes of WIP work"
>    scenario is a good use of "free" resources. If you want to
>    test multiple versions of something, then use multiple
>    branches (and I think Johannes's patch allows concurrent
>    builds for distinct branch names).

The setting Taylor proposed in
https://lore.kernel.org/git/Y2R3vJf1A2KOZwA7@nand.local/ is off by
default, i.e. it would behave the same way as what Johannes is
proposing, just give you (well, me) an opt-out from the default, without
patching main.yml on every branch.

So it seems like a win-win, why force others to change their workflow?
Sure, I could push multiple branches, but you could also manually cancel
your outstanding jobs before re-pushing...

I agree that cancelling the outstanding job is a better default, and if
we had to pick one or the other I'd say "sure", but if we can have
both...

> 2. The change you recommend requires running the job and
>    deciding at runtime whether to do the actual build
>    (unless I'm mistaken). It is better to let the workflow
>    coordinator decide on concurrency before the stage where
>    worker VMs are engaged.

Doesn't the "concurrency" setting say "I am a job thaht's prepared to
have its run cancelled if another job shows up with this <key>".

I.e. we'd already be running the VM by definition if we're going to
benefit from it (very tight races aside), and in any case getting to the
"configure" stage doesn't require much in the way of resources, a few
seconds of VM time...

Whereas the "this tree already ran" *would* benefit from not starting a
VM, but that's "I'm a new push, and maybe I shouldn't run at all",
whereas this feature is "I always want to run, but someone might cancel
me later".

> Either of these points may have an incorrect assumption, so
> I'm prepared to be wrong.

I *think* you're wrong about #2, but I'm not sure either.

I don't think you can be wrong about #1, "others should change their
workflow to fit a new worldview" is more of a value-judgment :)




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux