Commit 6a8e1f0
feat(runners): add retry logic to default install and start script for dnf operations (#3787)
## Background
---
This is a continuation of work done in #3748
There seems to be a race condition some where with the user-data script
and the EC2 starting up and locking RPM. This issue is seen elsewhere,
not necessarily with this repo's user-data, see the following:
[Amazon Linux 2023 - issue with installing packages with
cloud-init](https://repost.aws/questions/QU_tj7NQl6ReKoG53zzEqYOw/amazon-linux-2023-issue-with-installing-packages-with-cloud-init)
[dnf/yum both fails while being executed on instance bootstrap on Amazon
Linux
2023](https://repost.aws/questions/QUgNz4VGCFSC2TYekM-6GiDQ/dnf-yum-both-fails-while-being-executed-on-instance-bootstrap-on-amazon-linux-2023)
Also,
https://github.com/philips-labs/terraform-aws-github-runner/issues/3741
## Changes Made
---
Added a loop to retry if the rpm lock file is found which sleeps for 5
seconds then retries again with a total of 5 iterations. This logic is
now added to the `user-data.sh` for the `upgrade-minimal` operation and
installation of docker, cloudwatch-agent, and curl.
## Testing Done
---
In progress. I'd like to open this up to review while testing.
Co-authored-by: Niek Palm <npalm@users.noreply.github.com>1 parent 8b843ad commit 6a8e1f0
1 file changed
+35
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
3 | 20 | | |
4 | 21 | | |
5 | 22 | | |
| |||
15 | 32 | | |
16 | 33 | | |
17 | 34 | | |
18 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
19 | 49 | | |
20 | 50 | | |
21 | | - | |
| 51 | + | |
| 52 | + | |
22 | 53 | | |
23 | 54 | | |
24 | 55 | | |
25 | | - | |
26 | | - | |
| 56 | + | |
| 57 | + | |
27 | 58 | | |
28 | 59 | | |
29 | 60 | | |
| |||
0 commit comments