Skip to content
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

Support Amazon Linux 2022 AMI #2848

Closed
markandrus opened this issue Jan 3, 2023 · 9 comments
Closed

Support Amazon Linux 2022 AMI #2848

markandrus opened this issue Jan 3, 2023 · 9 comments

Comments

@markandrus
Copy link

First, thanks for this great project!

Second, I was able to get version 2.0.0 of this project working with Amazon Linux 2022 on arm64 by applying the following changes:

user-data.sh
--- a/modules/runners/templates/user-data.sh	2023-01-03 11:04:23
+++ b/modules/runners/templates/user-data.sh	2023-01-03 14:20:55
@@ -18,11 +18,11 @@
 yum update -y
 
 # Install docker
-amazon-linux-extras install docker
+yum install -y docker
 service docker start
 usermod -a -G docker ec2-user
 
-yum install -y amazon-cloudwatch-agent curl jq git
+yum install -y amazon-cloudwatch-agent jq git
 
 user_name=ec2-user
install-runner.sh
--- a/modules/runners/templates/install-runner.sh
+++ b/modules/runners/templates/install-runner.sh
@@ -43,7 +43,7 @@ echo "Delete tar file"
 rm -rf $file_name
 
 if [[ "$architecture" == "arm64" ]]; then
-  yum install -y libicu60
+  yum install -y libicu
 fi
 
 os_id=$(awk -F= '/^ID/{print $2}' /etc/os-release)

I applied these changes in a hacky way by overriding userdata_template and abusing userdata_pre_install. I'll spare the details on what I did in userdata_pre_install, but here is how I set them:

  runner_architecture  = "arm64"
  ami_filter           = { name = ["al2022-ami-2022.*-kernel-5.*-arm64"] }
  userdata_template    = "user-data.sh"
  userdata_pre_install = file("pre-install.sh")

Could this project could support Amazon Linux 2022 AMI natively by tweaking user-data.sh and install-runner.sh?

@npalm
Copy link
Member

npalm commented Jan 5, 2023

I last checked Amazon 2022 a few weeks ago (back in 2022). At that time it was still not GA. We have some troubles with supporting node18 on Amazon Linux 2 as well. Would be great to support or move to 2022 in case it is stable. But for maintenace purpose we don't want to support only a few version by default.

Looking on your changes, the work to support Amazon 2022 should be minimal. So I would prefer a way we can support both for a short time. Or support it in such way that they work with the same config. The last one I prefer.

Would you have time to add a few conditonals to the scripts to make them workin on Amazon 2022 and open a PR?

@lassesteffen
Copy link

It would be also great for us, as we are also struggling to support node 18, so 👍

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Feb 24, 2023
@lassesteffen
Copy link

Hey, this issue is still very relevant for us

@npalm
Copy link
Member

npalm commented Mar 7, 2023

@lassesteffen We understand the need of this, but any help is welcome. We use the module with a custom AMI, which means we do not rely on the provided start scripts of the runner. But have similar ones in our AMI.

Would be great if the community can support to migrate the current runner to Amazon Linux 2

@eabrouwer3
Copy link
Contributor

I've opened a PR (#3293) with an attempt to somewhat do what @markandrus mentioned in the original issue comment. I'm not sure if it's the best way to do it, or how the maintainers would like to do it, but as far as I can tell it should work.

Another option would be to pass through the name filter and do some conditionals based on it starting with al2022-ami-2022. That's a little messier though because the ami_filter could have other options in there instead of just name. I'm curious if any of you can think of another option for the conditionals. It would be way nicer if we didn't have to add another variable and could just use the ami_filter or some byproduct of that somehow. Like the $os_id check:

os_id=$(awk -F= '/^ID/{print $2}' /etc/os-release)

if [[ ! "$os_id" =~ ^ubuntu.* ]]; then
  # ...
end

@rahul799
Copy link

It would be also great for us, as we are also struggling to support node 18, so 👍

Any luck ?

@eabrouwer3
Copy link
Contributor

New PR #3437 needs a review.

@npalm
Copy link
Member

npalm commented Oct 30, 2023

Since 5.x runners are default using amz linux 2023

@npalm npalm closed this as completed Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants