Skip to content
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
46 changes: 46 additions & 0 deletions .github/actions/get-runner-spot/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Get Runner Spot Setting
description: Determines whether to use spot=co or spot=false based on merge queue and release flow rules.
Comment thread
kalverra marked this conversation as resolved.

outputs:
spot:
description: "The spot setting value ('co' or 'false')"
value: ${{ steps.eval-spot.outputs.spot }}
spot_param:
description: "The formatted spot parameter ('spot=co' or 'spot=false')"
value: ${{ steps.eval-spot.outputs.spot_param }}

runs:
using: composite
steps:
- name: Evaluate Spot Strategy
id: eval-spot
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
REF_NAME: ${{ github.ref_name }}
run: |
IS_MERGE_QUEUE="false"
if [[ "$EVENT_NAME" == "merge_group" ]]; then
IS_MERGE_QUEUE="true"
fi

IS_RELEASE_BRANCH="false"
if [[ "$REF" == refs/heads/release/* || "$REF_NAME" == release/* ]]; then
IS_RELEASE_BRANCH="true"
fi

IS_RELEASE_TAG_OR_EVENT="false"
if [[ "$REF" == refs/tags/v* || "$EVENT_NAME" == "release" ]]; then
IS_RELEASE_TAG_OR_EVENT="true"
fi

if [[ "$IS_MERGE_QUEUE" == "true" || "$IS_RELEASE_BRANCH" == "true" || "$IS_RELEASE_TAG_OR_EVENT" == "true" ]]; then
echo "Run is merge_group or release flow. Using spot=false."
echo "spot=false" >> "$GITHUB_OUTPUT"
echo "spot_param=spot=false" >> "$GITHUB_OUTPUT"
else
echo "Standard run. Using spot=co."
echo "spot=co" >> "$GITHUB_OUTPUT"
echo "spot_param=spot=co" >> "$GITHUB_OUTPUT"
fi
20 changes: 18 additions & 2 deletions .github/workflows/ccip-system-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ jobs:
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Get Spot Runner Config
id: spot-config
uses: ./.github/actions/get-runner-spot

- name: Define test matrix
id: define-matrix
shell: bash
Expand All @@ -78,10 +85,19 @@ jobs:

tests=$(echo "$TESTS_JSON" | jq -c \
--argjson run_id "${{ github.run_id }}" \
--arg run_attempt "${{ github.run_attempt }}" '
--arg run_attempt "${{ github.run_attempt }}" \
--arg spot "${{ steps.spot-config.outputs.spot }}" '
to_entries | map(.value + {
test_id: .key,
runs_on: ("runs-on=\($run_id)-\(.key)-\($run_attempt)/cpu=8/ram=64/family=r6i+r7i+r8i/spot=co/image=ubuntu24-full-x64/extras=s3-cache+tmpfs")
runs_on: [
"runs-on=\($run_id)-\(.key)-\($run_attempt)",
"cpu=8",
"ram=64",
"family=r7i+r8i",
"spot=\($spot)",
"image=ubuntu24-full-x64",
"extras=s3-cache+tmpfs"
]
})
')

Expand Down
56 changes: 46 additions & 10 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ jobs:
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
}}
spot_param: ${{ steps.spot-config.outputs.spot_param }}
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v7
with:
persist-credentials: false
repository: smartcontractkit/chainlink

- name: Get Spot Runner Config
id: spot-config
uses: ./.github/actions/get-runner-spot
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: match-some
with:
Expand Down Expand Up @@ -171,8 +176,14 @@ jobs:
contents: read
# For golangci-lint-action's `only-new-issues` option.
pull-requests: read
runs-on: runs-on=${{ github.run_id }}-${{ strategy.job-index
}}/cpu=16/ram=32/family=c6gd/spot=false/image=ubuntu24-full-arm64/extras=s3-cache
runs-on:
- runs-on=${{ github.run_id }}-${{ strategy.job-index }}
- cpu=16
- ram=32
- family=c7gd+c8g
- ${{ needs.filter.outputs.spot_param }}
- image=ubuntu24-full-arm64
- extras=s3-cache
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -260,8 +271,14 @@ jobs:
matrix:
type:
- cmd: go_core_tests
os: runs-on=${{ github.run_id
}}-unit/cpu=48/ram=96/family=c7id+c8id/spot=co/image=ubuntu24-full-x64/extras=s3-cache
os:
- runs-on=${{ github.run_id }}-unit
- cpu=48
- ram=96
- family=c6id+c8id
- ${{ needs.filter.outputs.spot_param }}
- image=ubuntu24-full-x64
- extras=s3-cache
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "true"
go-mod-directory: ""
Expand All @@ -272,8 +289,14 @@ jobs:
build-cache-write: always

- cmd: go_core_tests_integration
os: runs-on=${{ github.run_id
}}-integ/cpu=48/ram=96/family=c7i+c8i/spot=co/image=ubuntu24-full-x64/extras=s3-cache+tmpfs
os:
- runs-on=${{ github.run_id }}-integ
- cpu=48
- ram=96
- family=c7i+c8i
- ${{ needs.filter.outputs.spot_param }}
- image=ubuntu24-full-x64
- extras=s3-cache+tmpfs
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "true"
setup-solana: "true"
Expand All @@ -284,8 +307,14 @@ jobs:
build-cache-write: always

- cmd: go_core_fuzz
os: runs-on=${{
github.run_id}}-fuzz/cpu=8/ram=32/family=m7id+m7idn+m8id+m8idn/spot=co/image=ubuntu24-full-x64/extras=s3-cache
os:
- runs-on=${{ github.run_id }}-fuzz
- cpu=8
- ram=32
- family=m6id+m6idn+m8id+m8idn
- ${{ needs.filter.outputs.spot_param }}
- image=ubuntu24-full-x64
- extras=s3-cache
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "false"
go-mod-directory: ""
Expand All @@ -297,8 +326,15 @@ jobs:
build-cache-write: never

- cmd: go_core_race_tests
os: runs-on=${{
github.run_id}}-race/cpu=64/ram=128/family=c7i+c8i/volume=150gb/spot=co/image=ubuntu24-full-x64/extras=s3-cache
os:
- runs-on=${{ github.run_id }}-race
- cpu=64
- ram=128
- family=c7i+c8i
- volume=150gb
- ${{ needs.filter.outputs.spot_param }}
- image=ubuntu24-full-x64
- extras=s3-cache
should-run: ${{ needs.filter.outputs.should-run-core-tests }}
trunk-auto-quarantine: "false"
go-mod-directory: ""
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/ci-deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ jobs:
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
}}
spot_param: ${{ steps.spot-config.outputs.spot_param }}
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v7
with:
persist-credentials: false
repository: smartcontractkit/chainlink

- name: Get Spot Runner Config
id: spot-config
uses: ./.github/actions/get-runner-spot
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # 4.0.2
id: match-some
with:
Expand Down Expand Up @@ -134,7 +139,14 @@ jobs:
if: ${{ github.actor != 'dependabot[bot]' && needs.filter.outputs.should-run == 'true' }}
needs: [filter]
timeout-minutes: 35
runs-on: "runs-on=${{ github.run_id }}-deployment-${{ matrix.shard-id }}/cpu=8/ram=32/family=m6id+m8id/spot=co/image=ubuntu24-full-x64/extras=s3-cache"
runs-on:
- runs-on=${{ github.run_id }}-deployment-${{ matrix.shard-id }}
- cpu=8
- ram=32
- family=m6id+m8id
- ${{ needs.filter.outputs.spot_param }}
- image=ubuntu24-full-x64
- extras=s3-cache
outputs:
shard-count: ${{ strategy.job-total }}
permissions:
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,20 @@ jobs:
runner-config:
name: Runner Config
runs-on: ubuntu-latest
outputs:
go-runner: ${{ steps.go-codeql.outputs.go-runner }}
spot_param: ${{ steps.spot-config.outputs.spot_param }}
permissions:
pull-requests: read
contents: read
env:
SH_GO_RUNNER: runs-on=${{ github.run_id }}/cpu=32/ram=64/family=c7i+c8i/spot=co/extras=s3-cache+tmpfs
GH_GO_RUNNER: ubuntu24.04-8cores-32GB
outputs:
go-runner: ${{ steps.go-codeql.outputs.go-runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Get Spot Runner Config
id: spot-config
uses: ./.github/actions/get-runner-spot

- name: Get PR Labels
id: pr-labels
uses: smartcontractkit/.github/actions/get-pr-labels@get-pr-labels/v1
Expand All @@ -110,6 +115,8 @@ jobs:
shell: bash
env:
OPT_OUT: ${{ steps.pr-labels.outputs.check-label-found || 'false' }}
SH_GO_RUNNER: runs-on=${{ github.run_id }}/cpu=32/ram=64/family=c7i+c8i/${{ steps.spot-config.outputs.spot_param }}/extras=s3-cache+tmpfs
GH_GO_RUNNER: ubuntu24.04-8cores-32GB
run: |
if [[ "$OPT_OUT" == "true" ]]; then
echo "Opt-out is true for current run. Using gh-hosted runner for Go codeql."
Expand Down
22 changes: 17 additions & 5 deletions .github/workflows/cre-local-env-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:

jobs:
changes:
runs-on: runs-on=${{ github.run_id }}/cpu=16/ram=64/family=m7i+m8i/spot=false/image=ubuntu24-full-x64/extras=s3-cache+tmpfs
runs-on: ubuntu-latest
environment:
# http://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/control-deployments#using-environments-without-deployments
name: integration
Expand All @@ -44,13 +44,18 @@ jobs:
github.event_name == 'pull_request' && contains(join(github.event.pull_request.labels.*.name, ' '), 'run-local-cre-env-tests') ||
steps.changes.outputs.ci_changes == 'true'
}}
spot_param: ${{ steps.spot-config.outputs.spot_param }}
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.sha || inputs.chainlink_version }}

- name: Get Spot Runner Config
id: spot-config
uses: ./.github/actions/get-runner-spot

- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
Expand All @@ -59,7 +64,14 @@ jobs:
- '.github/workflows/cre-local-env-tests.yaml'

test-cli:
runs-on: runs-on=${{ github.run_id }}/cpu=16/ram=64/family=m7i+m8i/spot=false/image=ubuntu24-full-x64/extras=s3-cache+tmpfs
runs-on:
- runs-on=${{ github.run_id }}
- cpu=16
- ram=64
- family=m7i+m8i
- ${{ needs.changes.outputs.spot_param }}
- image=ubuntu24-full-x64
- extras=s3-cache+tmpfs
environment:
# http://docs.github.com/en/actions/how-tos/deploy/configure-and-manage-deployments/control-deployments#using-environments-without-deployments
name: integration
Expand All @@ -72,7 +84,7 @@ jobs:
if: needs.changes.outputs.should-run-tests == 'true'
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
ref: ${{ github.event_name == 'pull_request' && github.sha || inputs.chainlink_version }}

Expand All @@ -81,7 +93,7 @@ jobs:

- name: Set up Go
id: setup-go
uses: actions/setup-go@v6
uses: actions/setup-go@v7
with:
go-version-file: core/scripts/go.mod
cache: true
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/cre-regression-system-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ jobs:
ref: ${{ inputs.chainlink_version || github.sha }}
persist-credentials: false

- name: Get Spot Runner Config
id: spot-config
uses: ./.github/actions/get-runner-spot

- name: Define test matrix
id: define-matrix
shell: bash
Expand All @@ -85,13 +89,22 @@ jobs:
tests=$(echo "$test_names" | jq -c -R -s \
--argjson run_id "${{ github.run_id }}" \
--arg run_attempt "${{ github.run_attempt }}" \
--arg spot "${{ steps.spot-config.outputs.spot }}" \
--argjson per "$per_test_configs" '
split("\n") | map(select(length>0))
| to_entries
| map({
test_name: .value,
test_id: .key,
runs_on: "runs-on=\($run_id)-\(.key)-\($run_attempt)/cpu=16/ram=64/family=m7i+m8i/spot=co/image=ubuntu24-full-x64/extras=s3-cache+tmpfs",
runs_on: [
"runs-on=\($run_id)-\(.key)-\($run_attempt)",
"cpu=16",
"ram=64",
"family=m7i+m8i",
"spot=\($spot)",
"image=ubuntu24-full-x64",
"extras=s3-cache+tmpfs"
],
configs: ($per[.value] // "configs/workflow-gateway-capabilities-don.toml")
})
')
Expand Down
Loading
Loading