-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ability to run linux workflows on large runners #6273
Open
rashidnhm
wants to merge
5
commits into
master
Choose a base branch
from
sc-73711-onboard-to-large-runners
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9b38435
Added ability to run linux workflows on large runners
rashidnhm 8125f8b
Trigger CI
rashidnhm b030d4a
Move determine_runner job to interface-unit-test workflow (have it ru…
rashidnhm c2c1ede
Merge branch 'master' into sc-73711-onboard-to-large-runners
rashidnhm 18fd83e
Remove usage of large runners on scheduled job
rashidnhm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
name: Benchmarks | ||
on: | ||
pull_request: | ||
workflow_call: | ||
inputs: | ||
ref_branch: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Determine Workflow Runner group | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
default_runner: | ||
description: The runner type that is used by the calling workflow by default | ||
required: true | ||
type: string | ||
outputs: | ||
runner_group: | ||
description: The runner all subsequent jobs within the calling workflow should run on | ||
value: ${{ jobs.determine_workflow_runner.outputs.runner_group || inputs.default_runner }} | ||
|
||
env: | ||
LARGE_RUNNER_GROUP_NAME: pl-4-core-large-runner | ||
|
||
jobs: | ||
determine_workflow_runner: | ||
runs-on: >- | ||
${{ | ||
( | ||
github.event_name == 'pull_request' | ||
&& contains(github.event.pull_request.labels.*.name, 'urgent') | ||
) && 'pl-4-core-large-runner' || 'ubuntu-latest' | ||
}} | ||
|
||
outputs: | ||
runner_group: ${{ steps.runner_group.outputs.runner_group }} | ||
|
||
steps: | ||
- name: Output Runner Group name | ||
if: >- | ||
${{ | ||
github.event_name == 'pull_request' | ||
&& startsWith(inputs.default_runner, 'ubuntu') | ||
}} | ||
id: runner_group | ||
env: | ||
# We are not able to use \d to check numeric values as bash does not allow them (not POSIX compliant) | ||
RC_BRANCH_FORMAT_REGEX: v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]? | ||
REPO_FULL_NAME: PennyLaneAI/pennylane | ||
run: | | ||
if [[ '${{ contains(github.event.pull_request.labels.*.name, 'urgent') }}' == 'true' || ('${{ github.event.pull_request.head.repo.full_name }}' == "$REPO_FULL_NAME" && '${{ github.event.pull_request.head.ref }}' =~ $RC_BRANCH_FORMAT_REGEX) ]]; then | ||
echo "This job requires usage of the large runner group '$LARGE_RUNNER_GROUP_NAME'"; | ||
echo "runner_group=$LARGE_RUNNER_GROUP_NAME" >> $GITHUB_OUTPUT | ||
else | ||
echo "This job does not require usage of large runners ..."; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,17 +7,24 @@ on: | |
- synchronize | ||
- ready_for_review | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
determine_runner: | ||
if: github.event.pull_request.draft == false | ||
name: Determine runner type to use | ||
uses: ./.github/workflows/determine-workflow-runner.yml | ||
with: | ||
default_runner: ubuntu-latest | ||
|
||
black-pylint: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
needs: [determine_runner] | ||
runs-on: ${{ needs.determine_runner.outputs.runner_group }} | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it make sense to potentially use the large runners for running
black
andpylint
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you say we should exclude format/docs_check/upload to codecov from large runners?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excluding
upload-to-codecov
andformat
makes sense to me. I think includingdocs
has some merit, considering that it's actually very useful for new features or big refactors to verify that the sphinx build passes without issues.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more I think about it, the more sense it makes to me to use the large runners for the actions above. If a PR is marked as urgent, we should treat all workflows as such.