Skip to content
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

Allow large runners to be configured by an input #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/pr-comment-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Run Uptest
on:
workflow_call:
inputs:
large-runner:
Copy link
Contributor

Choose a reason for hiding this comment

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

How about naming this parameter as:

Suggested change
large-runner:
workflow-runner:

The motivation is the supplied runner selector could be smaller or larger compared to a reference (standard) runner. So, it's better if we don't imply a size in the parameter name in my opinion (although the current use case is to have larger runners).

required: false
type: string
default: "[e2-standard-8, linux]"
trigger-keyword:
description: 'Keyword to trigger the workflow, defaults to /test-examples'
default: '/test-examples'
Expand All @@ -27,7 +31,7 @@ on:

jobs:
debug:
runs-on: [e2-standard-8, linux]
runs-on: ${{ fromJSON(inputs.large-runner) }}
steps:
- name: Debug
run: |
Expand All @@ -40,7 +44,7 @@ jobs:
if: ${{ (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' ) &&
github.event.issue.pull_request &&
contains(github.event.comment.body, inputs.trigger-keyword ) }}
runs-on: [e2-standard-8, linux]
runs-on: ${{ fromJSON(inputs.large-runner) }}
outputs:
example_list: ${{ steps.get-example-list-name.outputs.example-list }}
example_hash: ${{ steps.get-example-list-name.outputs.example-hash }}
Expand Down Expand Up @@ -97,7 +101,7 @@ jobs:
if: ${{ (github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' ) &&
github.event.issue.pull_request &&
contains(github.event.comment.body, inputs.trigger-keyword ) }}
runs-on: [e2-standard-8, linux]
runs-on: ${{ fromJSON(inputs.large-runner) }}
needs: get-example-list

steps:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/provider-ci.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we will currently need a new parameter for the lint job. It's using a different runner label than the others in the current main HEAD. My suggestion would be something like lint-workflow-runner. We can also consider differentiating the other job parameters but I would prefer we do so when we need it.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Provider CI
on:
workflow_call:
inputs:
large-runner:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please see the comment above regarding the parameter naming.

required: false
type: string
default: "[e2-standard-8, linux]"
upjet-based-provider:
required: false
type: boolean
Expand Down Expand Up @@ -65,7 +69,7 @@ jobs:
run: |
make schema-version-diff
lint:
runs-on: [e2-standard-8, linux]
runs-on: ${{ fromJSON(inputs.large-runner) }}
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'

Expand Down Expand Up @@ -273,7 +277,7 @@ jobs:
run: make local-deploy

publish-artifacts:
runs-on: [e2-standard-8, linux]
runs-on: ${{ fromJSON(inputs.large-runner) }}
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'

Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/provider-publish-service-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Provider Publish Service Artifacts
on:
workflow_call:
inputs:
large-runner:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please see the comment above regarding the parameter naming.

required: false
type: string
default: "[e2-standard-8, linux]"
subpackages:
description: 'Subpackages to be built individually (e.g. monolith config ec2)'
default: 'monolith'
Expand Down Expand Up @@ -38,7 +42,7 @@ env:

jobs:
index:
runs-on: [e2-standard-8, linux]
runs-on: ${{ fromJSON(inputs.large-runner) }}
outputs:
indices: ${{ steps.calc.outputs.indices }}
steps:
Expand All @@ -52,7 +56,7 @@ jobs:
index: ${{ fromJSON(needs.index.outputs.indices) }}

needs: index
runs-on: [e2-standard-8, linux]
runs-on: ${{ fromJSON(inputs.large-runner) }}
steps:
- name: Setup QEMU
uses: docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480 # v1
Expand Down