Skip to content

Conversation

@samestep
Copy link
Contributor

This PR adds a lightweight workflow which runs when any of our GitHub Actions lint or test workflows start (currently just the three listed in the YAML in this PR's diff), and cancels redundant ones (e.g. if a PR author pushes several commits in rapid succession). Currently this isn't particularly impactful, but it would become more so if/when we add heavier workflows that run on PRs.

Initially we tried using technote-space/auto-cancel-redundant-workflow instead of potiuk/cancel-workflow-runs, but for some reason it the former doesn't seem to work even if triggered by workflow_run with the TARGET_RUN_ID input set appropriately.

Test plan:

@janeyx99 and I tested this in a separate GitHub repo, and confirmed that it successfully cancels redundant push-triggered workflows on the source repo and pull_request-triggered workflows from forks.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Mar 25, 2021

💊 CI failures summary and remediations

As of commit 884af22 (more details on the Dr. CI page):


  • 1/1 failures introduced in this PR

🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_windows_vs2019_py36_cuda10.1_test1 (1/1)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

RuntimeError: CUDA error: unspecified launch failure
(base) C:\Users\circleci\project\test>echo Some smoke tests 
Some smoke tests

(base) C:\Users\circleci\project\test>"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\gflags.exe" /i python.exe +sls 
Current Registry Settings for python.exe executable are: 00000002
    sls - Show Loader Snaps

(base) C:\Users\circleci\project\test>python C:/Users/circleci/project/.jenkins/pytorch/win-test-helpers\run_python_nn_smoketests.py 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
RuntimeError: CUDA error: unspecified launch failure

Microsoft (R) Windows Debugger Version 10.0.18362.1 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

CommandLine: python -c "import torch; torch.rand(1).cuda(); exit(0 if torch.cuda.has_magma else 1)"
Symbol search path is: srv*
Executable search path is: 
ModLoad: 00000000`1c220000 00000000`1c23b000   python.exe
ModLoad: 00007ff8`c7ee0000 00007ff8`c80cc000   ntdll.dll
145c:2110 @ 00403890 - LdrpInitializeProcess - INFO: Beginning execution of python.exe (C:\Jenkins\Miniconda3\python.exe)

This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@facebook-github-bot
Copy link
Contributor

@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

workflow_run:
types:
- requested
workflows:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most lightweight way for us to cancel redundant workflows, but it comes at the potential cost of needing to list out all the names of our workflows here. It would not be too difficult to write a script that would generate the names, but I wonder if there's a better, more GH supported way to accomplish the same thing. (e.g., if there were some way to just specify all workflows with a *).

Copy link
Contributor

@janeyx99 janeyx99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woohoo 🧠

@samestep samestep requested a review from a team March 25, 2021 15:52
@facebook-github-bot
Copy link
Contributor

@samestep merged this pull request in f251bb4.

@samestep
Copy link
Contributor Author

samestep commented Mar 25, 2021

Unlanding this because I just realized that

redundant push-triggered workflows on the source repo

are things we do not actually want to cancel (e.g. on master).

Will follow up with a reland that filters this to only cancel redundant workflows from PRs.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by 0b0a5dd.

facebook-github-bot pushed a commit that referenced this pull request Mar 25, 2021
Summary:
Relands #54685 with the fix to filter out master

Tested with samestep in other repository.

Pull Request resolved: #54689

Reviewed By: walterddr

Differential Revision: D27330804

Pulled By: janeyx99

fbshipit-source-id: 06d8199af6173eedca2e7db4a1fd7b9a143d29d2
facebook-github-bot pushed a commit that referenced this pull request Mar 29, 2021
Summary:
We've been using [pytorch/add-annotations-github-action](https://github.com/pytorch/add-annotations-github-action) to add annotations to PRs when they fail Flake8 or clang-tidy. Up until now, though, that functionality has only worked on PRs in pytorch/pytorch itself, not on PRs from forks. This PR fixes that using a technique from [this GitHub blog post](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) (also linked in a comment in this diff).

Pull Request resolved: #54779

Test Plan: janeyx99 and I tested this in the same GitHub repo used to test #54685 and #54693, including with PRs from forks.

Reviewed By: walterddr

Differential Revision: D27364777

Pulled By: samestep

fbshipit-source-id: a830d372d7bb3b2529fc633b707b44f2b6cf9baa
facebook-github-bot pushed a commit that referenced this pull request Mar 31, 2021
Summary:
We've been using [pytorch/add-annotations-github-action](https://github.com/pytorch/add-annotations-github-action) to add annotations to PRs when they fail Flake8 or clang-tidy. Up until now, though, that functionality has only worked on PRs in pytorch/pytorch itself, not on PRs from forks. This PR fixes that using a technique from [this GitHub blog post](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) (also linked in a comment in this diff).

Pull Request resolved: #54779

Test Plan: janeyx99 and I tested this in the same GitHub repo used to test #54685 and #54693, including with PRs from forks.

Reviewed By: seemethere, xuzhao9

Differential Revision: D27470866

Pulled By: samestep

fbshipit-source-id: d165b8e875d412b910592aa897163fb938d23365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants