[
https://issues.apache.org/jira/browse/BEAM-10835?focusedWorklogId=477482&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-477482
]
ASF GitHub Bot logged work on BEAM-10835:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Sep/20 21:58
Start Date: 01/Sep/20 21:58
Worklog Time Spent: 10m
Work Description: potiuk commented on pull request #12729:
URL: https://github.com/apache/beam/pull/12729#issuecomment-685155548
@aaltay: It does cancel all previous, duplicate runs - including those from
the forks. It works in a robust way and it removes the need of having a regular
(every five minutes or so) cron job doing that.
It was not possible previously to do it differently, because builds from
fork did not have (for a good reason) permissions to cancel the jobs from the
main repository. It has only be made possible by introducing the new
`workflow_run` type of event by Github Actions:
https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/
It works in the way, that every PR runs an accompanying "workflow_run" event
that runs with the "write" permission to the "beam" project, and it runs from
the "master" of the Beam repo (not the PR). This way you can run a cancel of
duplicate runs for a build from fork without running any of the code coming
from the fork.
I've implemented [Cancel Workflow
Runs](https://github.com/potiuk/cancel-workflow-runs/) action (based initially
on the [cancel-previous-runs by
n1hility](https://github.com/n1hility/cancel-previous-runs) that implements all
that is need to have it nicely handled and used it in the Apache Airflow
project where I am a committer and PMC member. This and general usage of
'workflow_run' helped us in Airflow to speed up our CI builds by ~25% and make
it 10x more reliable).
In your case it will optimise the use of jobs from GA for runs that are
submitted from the same fork/branch in quick succession without having to rely
on regular cron jobs run every few minutes. In the future you might also use
some of the more complex features of my pluing (fast-fail for non-matrix jobs
and killing heavy "workflow_run") - we utilise both in Apache Airflow and you
might find it useful at some point in time in Beam.
As I was helping @TobKed and @damgad as "consultant" in the project of
improving Beam infrastructure, I also discussed the cancel one and since my
action was ready to use, I helped @TobKed to get it configured and used. I
hope you find it useful :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 477482)
Time Spent: 1h 10m (was: 1h)
> Improve Github Actions cancelling duplicated runs
> -------------------------------------------------
>
> Key: BEAM-10835
> URL: https://issues.apache.org/jira/browse/BEAM-10835
> Project: Beam
> Issue Type: Improvement
> Components: build-system, testing
> Reporter: Tobiasz Kedzierski
> Assignee: Tobiasz Kedzierski
> Priority: P2
> Fix For: Not applicable
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)