-
Notifications
You must be signed in to change notification settings - Fork 368
feat!: add packages input that installs packages on the AWS instance as part of cloud-init #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There are cases where this change does not work. I'm closing for now, might reopen with updated code. |
Hi @Preen, this is ready for review. I ran this with workflows that auto-install the runner on: and with a pre-runner script + packages: |
fyi I re-tested after merging the main branch:
|
Installing packages in the
pre-runner-script
has been unreliable as it seems during boot there are other processes locking the package index. It appears the recommended way is to use thepackages
property of cloud-init.This requires passing a cloud init YAML (starts with
#cloud-config
) as user data. Luckily this format is supported by AWS.This PR:
pre-runner-script.sh
and the main user-data script (runner-setup.sh
) using cloud-init'swrite_files
packages
directive to install packagesruncmd
This allows supporting multi-line pre-runner-script.sh. As a bonus, this greatly simplified strange escaping issues stemming from
echo "${config.input.preRunnerScript}" > pre-runner-script.sh
-- we tried to write a file inside the pre-runner-script which required multiple levels of nested escaping before this change, now this burden is greatly reduced.Additionally, this PR causes the package, when installing the github runner, to install the latest version. Otherwise I've seen the runner updates itself on load, increasing the startup time. I thought this might be causing some issues while debugging the feature and added this according to github instructions. Since this works, I think we might as well merge this too and enjoy the reduced startup time.