From 76b9d8524e5abaeb28b8c66e3bd0300067c60652 Mon Sep 17 00:00:00 2001 From: "Matthias J. Kannwischer" Date: Wed, 13 Nov 2024 12:32:50 +0800 Subject: [PATCH] Fix EC2 failures when Github runner name is already taken I suspect that our CI failures may be due to the runner registration failing due to the name already being used. By default, it is using the hostname as the Github runner name which defaults to the private IP address on EC2 instances. When instances get terminated, it does not delete the runners in Github which means we now have a lot of offline runners listed. This may be explaining why our CI sometimes timesouts due to the runner not being registered. I patched ec2-github-runner to add the `--replace` flag when registering the runner. Signed-off-by: Matthias J. Kannwischer --- .github/workflows/bench_ec2_reusable.yml | 4 ++-- .github/workflows/ci_ec2_reusable.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bench_ec2_reusable.yml b/.github/workflows/bench_ec2_reusable.yml index 5ad7fbd99..dd8841553 100644 --- a/.github/workflows/bench_ec2_reusable.yml +++ b/.github/workflows/bench_ec2_reusable.yml @@ -96,7 +96,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Start EC2 runner id: start-ec2-runner - uses: machulav/ec2-github-runner@1827d6ca7544d7044ddbd2e9360564651b463da2 # v2.3.7 + uses: mkannwischer/ec2-github-runner@d15c8804522523d2bac7119a01ffff83b7795d87 with: mode: start github-token: ${{ secrets.AWS_GITHUB_TOKEN }} @@ -167,7 +167,7 @@ jobs: role-to-assume: ${{ env.AWS_ROLE }} aws-region: ${{ env.AWS_REGION }} - name: Stop EC2 runner - uses: machulav/ec2-github-runner@1827d6ca7544d7044ddbd2e9360564651b463da2 # v2.3.7 + uses: mkannwischer/ec2-github-runner@d15c8804522523d2bac7119a01ffff83b7795d87 with: mode: stop github-token: ${{ secrets.AWS_GITHUB_TOKEN }} diff --git a/.github/workflows/ci_ec2_reusable.yml b/.github/workflows/ci_ec2_reusable.yml index 44f6628eb..74178d669 100644 --- a/.github/workflows/ci_ec2_reusable.yml +++ b/.github/workflows/ci_ec2_reusable.yml @@ -101,7 +101,7 @@ jobs: aws-region: ${{ env.AWS_REGION }} - name: Start EC2 runner id: start-ec2-runner - uses: machulav/ec2-github-runner@1827d6ca7544d7044ddbd2e9360564651b463da2 # v2.3.7 + uses: mkannwischer/ec2-github-runner@d15c8804522523d2bac7119a01ffff83b7795d87 with: mode: start github-token: ${{ secrets.AWS_GITHUB_TOKEN }} @@ -165,7 +165,7 @@ jobs: role-to-assume: ${{ env.AWS_ROLE }} aws-region: ${{ env.AWS_REGION }} - name: Stop EC2 runner - uses: machulav/ec2-github-runner@1827d6ca7544d7044ddbd2e9360564651b463da2 # v2.3.7 + uses: mkannwischer/ec2-github-runner@d15c8804522523d2bac7119a01ffff83b7795d87 with: mode: stop github-token: ${{ secrets.AWS_GITHUB_TOKEN }}