Closed
Description
So we are using ubuntu-focal
for our runners as we have ebs created from this part of code:
device_name = "/dev/sda1"
volume_size = "${var.root_volume_size_gb}"
volume_type = "gp3"
delete_on_termination = "${var.ebs_delete_on_termination}"
}
But this part cause images to have other ebs with default value of 30GB.
for_each = [var.block_device_mappings]
content {
device_name = lookup(block_device_mappings.value, "device_name", "/dev/xvda")
ebs {
delete_on_termination = lookup(block_device_mappings.value, "delete_on_termination", true)
volume_type = lookup(block_device_mappings.value, "volume_type", "gp3")
volume_size = lookup(block_device_mappings.value, "volume_size", var.volume_size)
encrypted = lookup(block_device_mappings.value, "encrypted", true)
iops = lookup(block_device_mappings.value, "iops", null)
}
}
}
Defaults are taken from:
description = "The EC2 instance block device configuration. Takes the following keys: `device_name`, `delete_on_termination`, `volume_type`, `volume_size`, `encrypted`, `iops`"
type = map(string)
default = {}
}
variable "volume_size" {
description = "Size of runner volume"
type = number
default = 30
}
What should we do about that? Should module accept null and not configure or ignore a empty {}?
Reacted by Dev Shah
Metadata
Metadata
Assignees
Labels
No labels

Activity
mahela-aws commentedon Mar 3, 2022
@hunqer how did you managed to get it working with ubuntu-focal ? I have used the same packer template given here with few changes to suit our environment but runners are not getting registered with github. appreciate any help here
toast-gear commentedon Mar 7, 2022
We haven't done anything beyond provide some non-conequential variable inputs, we've made 0 changes to the template. Are you sure your changes aren't impacting? Have you got a route out to the internet in the subnet you've depoyed the runners in?
ScottGuymer commentedon Mar 9, 2022
I think this is one place that needs a bit of a re-write to make it simpler and more obvious.
What is happening here is that the AMI you have specified has a default device mapping of
/dev/sda1so it will always get that when booted. By default the runners module modifies a device called/dev/xvdawhich isnt present on your AMI so this device will get added as an additional device. You now have two devices on your running instance.To get back to one you need to configure the following as part of the runners config
This will have the effect of removing the config for
/dev/xvdaand modifying the default root device on your AMI which is/dev/sda1(but it could be something else too)mahela-aws commentedon Mar 9, 2022
yes they do have access to internet and also we have a working setup with
amzn-linux-2but we really wants to switch toubuntusince there are few public actions that doesn't supportamzn-linux-2.changes that I have made almost none, we copied over the scripts and changed the folder structure and inputs
regionsetc. we wanted to have our own setup for packer templates so that we can make changes as we wish. but unfortunately we are struggling a bit with ubuntu runners.toast-gear commentedon Mar 9, 2022
Our pipeline for building the runner is pretty basic so I can't imagine it's the packer template within this repository that is the problem for you, it's most likely a change made assuming your runner environment is valid. We build our AMI using this repository with 0 changes as we favour baking as little into the runner AMI as possible and instead opting for pipelines to use actions to setup the environment / run a tool e.g. actions/setup-python, hashicorp/packer-github-actions or projects / product teams to provide and own a container/s for their pipelines with dependencies included and use the
container:workflow feature in their pipelines.AMIs and launch templates are fairly horrible to work with in general so we try to stay away from customising the AMI if possible and instead solve the problem in other ways.
Hankier commentedon Mar 17, 2022
Was fixed with PR -> https://github.com/philips-labs/terraform-aws-github-runner/pull/1807