diff --git a/.github/actions/get-runner-spot/action.yml b/.github/actions/get-runner-spot/action.yml new file mode 100644 index 00000000000..6ddf77f9a8e --- /dev/null +++ b/.github/actions/get-runner-spot/action.yml @@ -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. + +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 diff --git a/.github/workflows/ccip-system-tests.yaml b/.github/workflows/ccip-system-tests.yaml index 8b3821c8d5c..312444ca8e6 100644 --- a/.github/workflows/ccip-system-tests.yaml +++ b/.github/workflows/ccip-system-tests.yaml @@ -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 @@ -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" + ] }) ') diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 5ee58465d28..e395d0c70c8 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -32,6 +32,7 @@ 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 @@ -39,6 +40,10 @@ jobs: 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: @@ -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: @@ -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: "" @@ -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" @@ -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: "" @@ -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: "" diff --git a/.github/workflows/ci-deployments.yml b/.github/workflows/ci-deployments.yml index 70a67d387ac..109ed1a0c44 100644 --- a/.github/workflows/ci-deployments.yml +++ b/.github/workflows/ci-deployments.yml @@ -33,6 +33,7 @@ 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 @@ -40,6 +41,10 @@ jobs: 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: @@ -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: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 40e28b6e84a..64961a44b7a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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 @@ -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." diff --git a/.github/workflows/cre-local-env-tests.yaml b/.github/workflows/cre-local-env-tests.yaml index 152b0acb73c..85c38f06c89 100644 --- a/.github/workflows/cre-local-env-tests.yaml +++ b/.github/workflows/cre-local-env-tests.yaml @@ -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 @@ -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: @@ -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 @@ -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 }} @@ -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 diff --git a/.github/workflows/cre-regression-system-tests.yaml b/.github/workflows/cre-regression-system-tests.yaml index 98e17868883..106fc529510 100644 --- a/.github/workflows/cre-regression-system-tests.yaml +++ b/.github/workflows/cre-regression-system-tests.yaml @@ -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 @@ -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") }) ') diff --git a/.github/workflows/cre-soak-memory-leak.yml b/.github/workflows/cre-soak-memory-leak.yml index c7758a63954..93924da48cb 100644 --- a/.github/workflows/cre-soak-memory-leak.yml +++ b/.github/workflows/cre-soak-memory-leak.yml @@ -23,13 +23,32 @@ on: type: string jobs: + runner-config: + runs-on: ubuntu-latest + outputs: + spot_param: ${{ steps.spot-config.outputs.spot_param }} + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Get Spot Runner Config + id: spot-config + uses: ./.github/actions/get-runner-spot + soak: name: CRE Resource Regression Test + needs: [runner-config] environment: name: integration deployment: false - runs-on: runs-on=${{ github.run_id - }}/cpu=32/ram=128/family=m6id+m6idn/spot=false/image=ubuntu24-full-x64/extras=s3-cache + runs-on: + - runs-on=${{ github.run_id }} + - cpu=32 + - ram=128 + - family=m6id+m8id + - ${{ needs.runner-config.outputs.spot_param }} + - image=ubuntu24-full-x64 + - extras=s3-cache timeout-minutes: 270 # 4h30m — test timeout is 4h20m permissions: contents: read @@ -40,14 +59,14 @@ jobs: uses: runs-on/action@4e5f72399b6b17f2e79c511c1b38a315a64d22dc # v2.2.0 - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: ref: ${{ github.sha }} persist-credentials: false - name: Set up Go id: setup-go - uses: actions/setup-go@v6 + uses: actions/setup-go@v7 with: go-version-file: system-tests/tests/go.mod cache: true diff --git a/.github/workflows/cre-system-tests.yaml b/.github/workflows/cre-system-tests.yaml index fb7def0bd69..57615452fcd 100644 --- a/.github/workflows/cre-system-tests.yaml +++ b/.github/workflows/cre-system-tests.yaml @@ -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 @@ -123,6 +127,7 @@ 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 tops "$TOPOLOGIES_JSON" \ --argjson per "$PER_TEST_TOPOLOGIES_JSON" ' (split("\n") | map(select(length>0))) as $names @@ -135,7 +140,15 @@ jobs: | to_entries | map(.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" + ] }) ') diff --git a/.github/workflows/cre-wf-caching-test.yml b/.github/workflows/cre-wf-caching-test.yml index 5c1aa52363a..464d9ec68fd 100644 --- a/.github/workflows/cre-wf-caching-test.yml +++ b/.github/workflows/cre-wf-caching-test.yml @@ -23,13 +23,32 @@ on: type: string jobs: + runner-config: + runs-on: ubuntu-latest + outputs: + spot_param: ${{ steps.spot-config.outputs.spot_param }} + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Get Spot Runner Config + id: spot-config + uses: ./.github/actions/get-runner-spot + caching: name: CRE Workflow Caching Test + needs: [runner-config] environment: name: integration deployment: false - runs-on: runs-on=${{ github.run_id - }}/cpu=32/ram=128/family=m6id+m6idn/spot=false/image=ubuntu24-full-x64/extras=s3-cache + runs-on: + - runs-on=${{ github.run_id }} + - cpu=32 + - ram=128 + - family=m6id+m8id + - ${{ needs.runner-config.outputs.spot_param }} + - image=ubuntu24-full-x64 + - extras=s3-cache timeout-minutes: 270 # 4h30m — test timeout is 4h20m permissions: contents: read @@ -42,14 +61,14 @@ jobs: metrics: cpu,network,memory,disk,io - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: ref: ${{ github.sha }} persist-credentials: false - name: Set up Go id: setup-go - uses: actions/setup-go@v6 + uses: actions/setup-go@v7 with: go-version-file: system-tests/tests/go.mod cache: true diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d94aefb7385..40547494c09 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -37,6 +37,11 @@ jobs: checked-out-sha: ${{ steps.checkout-sha.outputs.checked-out-sha }} version-tag: ${{ steps.version-info.outputs.version-tag }} steps: + - name: Checkout repository + uses: actions/checkout@v7 + with: + ref: ${{ inputs.git-ref || github.sha }} + - name: Get PR Labels id: pr-labels uses: smartcontractkit/.github/actions/get-pr-labels@get-pr-labels/v1 @@ -44,14 +49,18 @@ jobs: check-label: "build-publish" skip-merge-group: "true" + - name: Get Spot Runner Config + id: spot-config + uses: ./.github/actions/get-runner-spot + - name: Set runner labels id: runner-labels shell: bash env: SH_RUNNER_LABEL_ARM64: runs-on=${{ github.run_id - }}/cpu=16/ram=64/family=m7g/spot=false/image=ubuntu24-full-arm64/extras=s3-cache+tmpfs + }}/cpu=16/ram=64/family=m7g+m8g/${{ steps.spot-config.outputs.spot_param }}/image=ubuntu24-full-arm64/extras=s3-cache+tmpfs SH_RUNNER_LABEL_AMD64: runs-on=${{ github.run_id - }}/cpu=16/ram=64/family=m6i+m7i/spot=false/image=ubuntu24-full-x64/extras=s3-cache+tmpfs + }}/cpu=16/ram=64/family=m7i+m8i/${{ steps.spot-config.outputs.spot_param }}/image=ubuntu24-full-x64/extras=s3-cache+tmpfs GH_RUNNER_LABEL_ARM64: ubuntu-24.04-arm GH_RUNNER_LABEL_AMD64: ubuntu-24.04 run: | @@ -64,11 +73,6 @@ jobs: echo "runner-amd64=${GH_RUNNER_LABEL_AMD64}" | tee -a "$GITHUB_OUTPUT" fi - - name: Checkout repository - uses: actions/checkout@v6 - with: - ref: ${{ inputs.git-ref || github.sha }} - - name: Resolve checked out SHA id: checkout-sha shell: bash @@ -286,7 +290,7 @@ jobs: id-token: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Deploy uses: ./.github/actions/deploy-image with: @@ -309,7 +313,7 @@ jobs: id-token: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Deploy uses: ./.github/actions/deploy-image with: diff --git a/.github/workflows/go-mod-cache.yml b/.github/workflows/go-mod-cache.yml index ce8b183b21e..d843fda7365 100644 --- a/.github/workflows/go-mod-cache.yml +++ b/.github/workflows/go-mod-cache.yml @@ -34,10 +34,15 @@ jobs: pull-requests: read outputs: changed: ${{ steps.changes.outputs.src || 'true' }} + spot_param: ${{ steps.spot-config.outputs.spot_param }} steps: - uses: actions/checkout@v7 with: persist-credentials: false + + - name: Get Spot Runner Config + id: spot-config + uses: ./.github/actions/get-runner-spot - uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2 if: github.event_name == 'pull_request' id: changes @@ -64,10 +69,22 @@ jobs: suffix: "Deployment (Github-hosted)" go-mod-directory: "deployment/" - - runs-on: runs-on=${{ github.run_id }}/cpu=8/ram=16/family=c6id/spot=false/extras=s3-cache + - runs-on: + - runs-on=${{ github.run_id }} + - cpu=8 + - ram=16 + - family=c6id+c8id + - ${{ needs.filter.outputs.spot_param }} + - extras=s3-cache suffix: "Core (Self-hosted)" - - runs-on: runs-on=${{ github.run_id }}/cpu=8/ram=16/family=c6id/spot=false/extras=s3-cache + - runs-on: + - runs-on=${{ github.run_id }} + - cpu=8 + - ram=16 + - family=c6id+c8id + - ${{ needs.filter.outputs.spot_param }} + - extras=s3-cache suffix: "Deployment (Self-hosted)" go-mod-directory: "deployment/" diff --git a/.github/workflows/integration-in-memory-tests.yml b/.github/workflows/integration-in-memory-tests.yml index 7375842d4bb..9a3e9da4265 100644 --- a/.github/workflows/integration-in-memory-tests.yml +++ b/.github/workflows/integration-in-memory-tests.yml @@ -49,7 +49,7 @@ jobs: with: persist-credentials: false repository: smartcontractkit/chainlink - ref: ${{ inputs.chainlink_version || inputs.cl_ref || github.sha }} + ref: ${{ inputs.chainlink_version || inputs.cl_ref }} - name: Advanced Triggers uses: smartcontractkit/.github/actions/advanced-triggers@advanced-triggers/v1 @@ -102,6 +102,7 @@ jobs: if: always() && github.actor != 'dependabot[bot]' && github.event_name != 'push' && (needs.changes.result == 'skipped' || needs.changes.outputs.run-tests == 'true') outputs: matrix: ${{ steps.define-matrix.outputs.matrix }} + spot_param: ${{ steps.spot-config.outputs.spot_param }} permissions: contents: read steps: @@ -112,6 +113,10 @@ jobs: repository: smartcontractkit/chainlink ref: ${{ inputs.chainlink_version || inputs.cl_ref || github.sha }} + - name: Get Spot Runner Config + id: spot-config + uses: ./.github/actions/get-runner-spot + - name: Define test matrix id: define-matrix shell: bash @@ -119,7 +124,8 @@ jobs: # shellcheck disable=SC1083,SC2016 tests=$(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 + { # Stable, human-readable id for artifact names. `.name` is unique across @@ -129,7 +135,14 @@ jobs: job_timeout: (((.value.timeout | rtrimstr("m") | tonumber) + 5)), # The runner label only needs per-run uniqueness, so the index is fine # here and keeps the label short enough for runs-on. - runs_on: (if .value.runs_on == "" or .value.runs_on == null then "ubuntu-latest" else "runs-on=\($run_id)-\(.key)-\($run_attempt)/\(.value.runs_on)/family=m7i+m8i/spot=co/image=ubuntu24-full-x64/extras=s3-cache+tmpfs" end) + runs_on: (if .value.runs_on == "" or .value.runs_on == null then "ubuntu-latest" else [ + "runs-on=\($run_id)-\(.key)-\($run_attempt)", + .value.runs_on, + "family=m7i+m8i", + "spot=\($spot)", + "image=ubuntu24-full-x64", + "extras=s3-cache+tmpfs" + ] end) }) ' .github/in-memory-tests.json) @@ -154,7 +167,14 @@ jobs: compile-tests: name: Compile In-Memory Test Binaries needs: [define-test-matrix] - runs-on: runs-on=${{ github.run_id }}-inmem-compile/cpu=32/ram=64/family=c7i+c8i/spot=co/volume=100GB/extras=s3-cache + runs-on: + - runs-on=${{ github.run_id }}-inmem-compile + - cpu=32 + - ram=64 + - family=c7i+c8i + - ${{ needs.define-test-matrix.outputs.spot_param }} + - volume=100GB + - extras=s3-cache environment: name: integration deployment: false diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index fce930a63f3..c2252dad0b3 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -211,7 +211,11 @@ jobs: should-use-self-hosted-runners: ${{ steps.label-runs-on-opt-out.outputs.check-label-found == 'false' }} run-e2e-tests-label-found: ${{ steps.label-runs-e2e-tests.outputs.check-label-found || 'false' }} skip-e2e-regression-label-found: ${{ steps.label-skip-e2e-regression.outputs.check-label-found || 'false' }} + spot_param: ${{ steps.spot-config.outputs.spot_param }} steps: + - name: Checkout repository + uses: actions/checkout@v7 + - name: Get PR Labels (runs-on-opt-out) if: github.event_name == 'pull_request' id: label-runs-on-opt-out @@ -233,17 +237,22 @@ jobs: with: check-label: "skip-e2e-regression" + - name: Get Spot Runner Config + id: spot-config + uses: ./.github/actions/get-runner-spot + - name: Set runner labels id: runner-labels env: OPT_OUT: ${{ steps.label-runs-on-opt-out.outputs.check-label-found || 'false' }} GH_BUILDER_RUNNER: ubuntu22.04-8cores-32GB # include unique label (core/plugins) to ensure jobs are not competing for the same runner - SH_BUILDER_RUNNER_CORE: runs-on=${{ github.run_id }}-core/cpu=16/ram=64/family=m7i+m8i/spot=co/extras=s3-cache+tmpfs - SH_BUILDER_RUNNER_PLUGINS: runs-on=${{ github.run_id }}-plugins/cpu=16/ram=64/family=m7i+m8i/spot=co/extras=s3-cache+tmpfs + SH_BUILDER_RUNNER_CORE: runs-on=${{ github.run_id }}-core/cpu=16/ram=64/family=m7i+m8i/${{ steps.spot-config.outputs.spot_param }}/extras=s3-cache+tmpfs + SH_BUILDER_RUNNER_PLUGINS: runs-on=${{ github.run_id }}-plugins/cpu=16/ram=64/family=m7i+m8i/${{ steps.spot-config.outputs.spot_param }}/extras=s3-cache+tmpfs run: | if [[ "${OPT_OUT}" == "true" ]]; then - echo "builder-runner-label=${GH_BUILDER_RUNNER}" | tee -a "$GITHUB_OUTPUT" + echo "builder-runner-label-core=${GH_BUILDER_RUNNER}" | tee -a "$GITHUB_OUTPUT" + echo "builder-runner-label-plugins=${GH_BUILDER_RUNNER}" | tee -a "$GITHUB_OUTPUT" else echo "builder-runner-label-core=${SH_BUILDER_RUNNER_CORE}" | tee -a "$GITHUB_OUTPUT" echo "builder-runner-label-plugins=${SH_BUILDER_RUNNER_PLUGINS}" | tee -a "$GITHUB_OUTPUT" @@ -523,9 +532,17 @@ jobs: needs.run-ccip-v1-6-e2e-tests-setup.outputs.should-run == 'true') }} needs: + - labels - run-core-cre-e2e-tests-setup - run-ccip-v1-6-e2e-tests-setup - runs-on: runs-on=${{ github.run_id }}-compile/cpu=32/ram=64/family=c7i+c8i/spot=co/volume=100GB/extras=s3-cache + runs-on: + - runs-on=${{ github.run_id }}-compile + - cpu=32 + - ram=64 + - family=c7i+c8i + - ${{ needs.labels.outputs.spot_param }} + - volume=100GB + - extras=s3-cache environment: name: integration deployment: false