Skip to content

Commit

Permalink
Fix EC2 failures when Github runner name is already taken
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mkannwischer committed Nov 13, 2024
1 parent c530758 commit 76b9d85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bench_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_ec2_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 76b9d85

Please sign in to comment.