From 74f5a549d4281ccc34f1d3ffec3b9a0b20d91b69 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Tue, 18 Jan 2022 18:54:27 +0000 Subject: [PATCH 01/16] feat: create Ubuntu image --- .github/workflows/packer-build.yml | 2 +- images/install-runner.sh | 2 +- images/linux-amzn2/github_agent.linux.pkr.hcl | 3 +- .../ubuntu-focal/github_agent.ubuntu.pkr.hcl | 156 ++++++++++++++++++ 4 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 images/ubuntu-focal/github_agent.ubuntu.pkr.hcl diff --git a/.github/workflows/packer-build.yml b/.github/workflows/packer-build.yml index 3ccac79f6a..3ae03611e8 100644 --- a/.github/workflows/packer-build.yml +++ b/.github/workflows/packer-build.yml @@ -20,7 +20,7 @@ jobs: image: hashicorp/packer:1.7.8 strategy: matrix: - image: ["linux-amzn2", "windows-core-2019"] + image: ["linux-amzn2", "windows-core-2019", "ubuntu-focal"] defaults: run: working-directory: images/${{ matrix.image }} diff --git a/images/install-runner.sh b/images/install-runner.sh index e042333f00..dfe8f31694 100644 --- a/images/install-runner.sh +++ b/images/install-runner.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -user_name=ec2-user +user_name=$(cat /tmp/install-user.txt) ## This wrapper file re-uses scripts in the /modules/runners/templates directory ## of this repo. These are the same that are used by the user_data functionality diff --git a/images/linux-amzn2/github_agent.linux.pkr.hcl b/images/linux-amzn2/github_agent.linux.pkr.hcl index a930814fa3..0b865dfef7 100644 --- a/images/linux-amzn2/github_agent.linux.pkr.hcl +++ b/images/linux-amzn2/github_agent.linux.pkr.hcl @@ -10,7 +10,7 @@ packer { variable "runner_version" { description = "The version (no v prefix) of the runner software to install https://github.com/actions/runner/releases" type = string - default = "2.286.0" + default = "2.286.1" } variable "region" { @@ -113,6 +113,7 @@ build { ] inline = [ "sudo chmod +x /tmp/install-runner.sh", + "echo ec2-user > /tmp/install-user.txt", "sudo RUNNER_TARBALL_URL=$RUNNER_TARBALL_URL /tmp/install-runner.sh" ] } diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl new file mode 100644 index 0000000000..c865c16b02 --- /dev/null +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -0,0 +1,156 @@ +# TODO: Sort out cloudwatch agent + +packer { + required_plugins { + amazon = { + version = ">= 0.0.2" + source = "github.com/hashicorp/amazon" + } + } +} + +variable "runner_version" { + description = "The version (no v prefix) of the runner software to install https://github.com/actions/runner/releases" + type = string + default = "2.286.1" +} + +variable "region" { + description = "The region to build the image in" + type = string + default = "eu-west-2" +} + +variable "security_group_id" { + description = "The ID of the security group Packer will associate with the builder to enable access" + type = string + default = null +} + +variable "subnet_id" { + description = "If using VPC, the ID of the subnet, such as subnet-12345def, where Packer will launch the EC2 instance. This field is required if you are using an non-default VPC" + type = string + default = null +} + +variable "instance_type" { + description = "The instance type Packer will use for the builder" + type = string + default = "t3.medium" +} + +variable "root_volume_size_gb" { + type = number + default = 8 +} + +variable "global_tags" { + description = "Tags to apply to everything" + type = map(string) + default = {} +} + +variable "ami_tags" { + description = "Tags to apply to the AMI" + type = map(string) + default = {} +} + +variable "snapshot_tags" { + description = "Tags to apply to snapshot" + type = map(string) + default = {} +} + +source "amazon-ebs" "githubrunner" { + ami_name = "github-runner-ubuntu-focal-amd64-${formatdate("YYYYMMDDhhmm", timestamp())}" + instance_type = var.instance_type + region = var.region + security_group_id = var.security_group_id + subnet_id = var.subnet_id + source_ami_filter { + filters = { + name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*" + root-device-type = "ebs" + virtualization-type = "hvm" + } + most_recent = true + owners = ["099720109477"] + } + ssh_username = "ubuntu" + tags = merge( + var.global_tags, + var.ami_tags, + { + OS_Version = "ubuntu" + Release = "focal" + Base_AMI_Name = "{{ .SourceAMIName }}" + }) + snapshot_tags = merge( + var.global_tags, + var.snapshot_tags, + ) + + launch_block_device_mappings { + device_name = "/dev/xvda" + volume_size = "${var.root_volume_size_gb}" + volume_type = "gp3" + } +} + +build { + name = "githubactions-runner" + sources = [ + "source.amazon-ebs.githubrunner" + ] + provisioner "shell" { + environment_vars = [] + inline = [ + "sudo apt -y update", + "sudo apt -y install ca-certificates curl gnupg lsb-release", + "sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg", + "echo deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null", + "sudo apt -y update", + "sudo apt -y install docker-ce docker-ce-cli containerd.io jq git", + "sudo systemctl enable containerd.service", + "sudo service docker start", + "sudo usermod -a -G docker ubuntu", + ] + } + + provisioner "file" { + content = templatefile("../install-runner.sh", { + install_runner = templatefile("../../modules/runners/templates/install-runner.sh", { + ARM_PATCH = "" + S3_LOCATION_RUNNER_DISTRIBUTION = "" + }) + }) + destination = "/tmp/install-runner.sh" + } + + provisioner "shell" { + environment_vars = [ + "RUNNER_TARBALL_URL=https://github.com/actions/runner/releases/download/v${var.runner_version}/actions-runner-linux-x64-${var.runner_version}.tar.gz" + ] + inline = [ + "sudo chmod +x /tmp/install-runner.sh", + "echo ubuntu > /tmp/install-user.txt", + "sudo RUNNER_TARBALL_URL=$RUNNER_TARBALL_URL /tmp/install-runner.sh" + ] + } + + provisioner "file" { + content = templatefile("../start-runner.sh", { + start_runner = templatefile("../../modules/runners/templates/start-runner.sh", {}) + }) + destination = "/tmp/start-runner.sh" + } + + provisioner "shell" { + inline = [ + "sudo mv /tmp/start-runner.sh /var/lib/cloud/scripts/per-boot/start-runner.sh", + "sudo chmod +x /var/lib/cloud/scripts/per-boot/start-runner.sh", + ] + } + +} \ No newline at end of file From f6afdb14b84f79c5a589d8013ff35a1491198a09 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Tue, 18 Jan 2022 18:56:54 +0000 Subject: [PATCH 02/16] feat: add aws v2 cli --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index c865c16b02..b2e9cbec84 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -115,6 +115,9 @@ build { "sudo systemctl enable containerd.service", "sudo service docker start", "sudo usermod -a -G docker ubuntu", + "curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip", + "unzip awscliv2.zip", + "sudo ./aws/install", ] } From fb7835cb0b952d69fe15c46a7b68c2ba865fcebe Mon Sep 17 00:00:00 2001 From: toast-gear Date: Tue, 18 Jan 2022 18:57:53 +0000 Subject: [PATCH 03/16] feat: add unzip --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index b2e9cbec84..6f58fae446 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -111,7 +111,7 @@ build { "sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg", "echo deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null", "sudo apt -y update", - "sudo apt -y install docker-ce docker-ce-cli containerd.io jq git", + "sudo apt -y install docker-ce docker-ce-cli containerd.io jq git unzip", "sudo systemctl enable containerd.service", "sudo service docker start", "sudo usermod -a -G docker ubuntu", From 4c9a08f6c785070a4870bb29ce5a2c8f28a10bda Mon Sep 17 00:00:00 2001 From: toast-gear Date: Tue, 18 Jan 2022 19:02:51 +0000 Subject: [PATCH 04/16] feat: port tag changes to amazon linux image --- images/linux-amzn2/github_agent.linux.pkr.hcl | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/images/linux-amzn2/github_agent.linux.pkr.hcl b/images/linux-amzn2/github_agent.linux.pkr.hcl index 0b865dfef7..308db71a87 100644 --- a/images/linux-amzn2/github_agent.linux.pkr.hcl +++ b/images/linux-amzn2/github_agent.linux.pkr.hcl @@ -42,8 +42,20 @@ variable "root_volume_size_gb" { default = 8 } -variable "tags" { - description = "Additional tags to add globally" +variable "global_tags" { + description = "Tags to apply to everything" + type = map(string) + default = {} +} + +variable "ami_tags" { + description = "Tags to apply to the AMI" + type = map(string) + default = {} +} + +variable "snapshot_tags" { + description = "Tags to apply to the snapshot" type = map(string) default = {} } @@ -65,12 +77,18 @@ source "amazon-ebs" "githubrunner" { } ssh_username = "ec2-user" tags = merge( - var.tags, + var.global_tags, + var.ami_tags, { OS_Version = "amzn2" Release = "Latest" Base_AMI_Name = "{{ .SourceAMIName }}" }) + snapshot_tags = merge( + var.global_tags, + var.snapshot_tags, + ) + launch_block_device_mappings { device_name = "/dev/xvda" From 3f69b205658192a92ac632af69ef3d68ef4e173f Mon Sep 17 00:00:00 2001 From: toast-gear Date: Tue, 18 Jan 2022 19:07:45 +0000 Subject: [PATCH 05/16] chore(images): use same default for aws region --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index 6f58fae446..3399f434cd 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -18,7 +18,7 @@ variable "runner_version" { variable "region" { description = "The region to build the image in" type = string - default = "eu-west-2" + default = "eu-west-1" } variable "security_group_id" { @@ -57,7 +57,7 @@ variable "ami_tags" { } variable "snapshot_tags" { - description = "Tags to apply to snapshot" + description = "Tags to apply to the snapshot" type = map(string) default = {} } From c0a67879ca51aa67808132c45bd7c6d51cdbe2b6 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Tue, 18 Jan 2022 19:24:52 +0000 Subject: [PATCH 06/16] fix: use apt-get you melon --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index 3399f434cd..a1550b39ed 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -1,5 +1,3 @@ -# TODO: Sort out cloudwatch agent - packer { required_plugins { amazon = { @@ -106,12 +104,12 @@ build { provisioner "shell" { environment_vars = [] inline = [ - "sudo apt -y update", - "sudo apt -y install ca-certificates curl gnupg lsb-release", + "sudo apt-get -y update", + "sudo apt-get -y install ca-certificates curl gnupg lsb-release", "sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg", "echo deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null", - "sudo apt -y update", - "sudo apt -y install docker-ce docker-ce-cli containerd.io jq git unzip", + "sudo apt-get -y update", + "sudo apt-get -y install docker-ce docker-ce-cli containerd.io jq git unzip", "sudo systemctl enable containerd.service", "sudo service docker start", "sudo usermod -a -G docker ubuntu", From 1f9f6e0d086d4ed251ec2aa21f2c14314a0f470e Mon Sep 17 00:00:00 2001 From: toast-gear Date: Tue, 18 Jan 2022 20:42:50 +0000 Subject: [PATCH 07/16] feat: add cloudwatch agent --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index a1550b39ed..9f22c0848e 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -68,7 +68,7 @@ source "amazon-ebs" "githubrunner" { subnet_id = var.subnet_id source_ami_filter { filters = { - name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*" + name = "*/ubuntu-focal-20.04-amd64-server-*" root-device-type = "ebs" virtualization-type = "hvm" } @@ -113,7 +113,10 @@ build { "sudo systemctl enable containerd.service", "sudo service docker start", "sudo usermod -a -G docker ubuntu", - "curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip", + "sudo curl -f https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb -o amazon-cloudwatch-agent.deb", + "sudo dpkg -i amazon-cloudwatch-agent.deb", + "sudo systemctl restart amazon-cloudwatch-agent", + "sudo curl -f https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip", "unzip awscliv2.zip", "sudo ./aws/install", ] From 5bc05ad899cb702ccbeb4e53e155f79f6462dbfb Mon Sep 17 00:00:00 2001 From: toast-gear Date: Tue, 18 Jan 2022 20:43:16 +0000 Subject: [PATCH 08/16] fix: use new install location in example --- examples/ubuntu/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ubuntu/main.tf b/examples/ubuntu/main.tf index 65c71cd25a..c5755c2fc6 100644 --- a/examples/ubuntu/main.tf +++ b/examples/ubuntu/main.tf @@ -35,7 +35,7 @@ module "runners" { # enable access to the runners via SSM enable_ssm_on_runners = true - runner_run_as = "runners" + runner_run_as = "ubuntu" userdata_template = "./templates/user-data.sh" ami_owners = ["099720109477"] # Canonical's Amazon account ID @@ -64,7 +64,7 @@ module "runners" { { "log_group_name" : "runner", "prefix_log_group" : true, - "file_path" : "/home/runners/actions-runner/_diag/Runner_**.log", + "file_path" : "/opt/actions-runner/_diag/Runner_**.log", "log_stream_name" : "{instance_id}/runner" } ] From c94a441172d785e45d6685bb2e653a5f60e5ad20 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 19 Jan 2022 12:05:52 +0000 Subject: [PATCH 09/16] feat: set env vars in service and align --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index 9f22c0848e..0a701368ec 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -138,8 +138,9 @@ build { ] inline = [ "sudo chmod +x /tmp/install-runner.sh", - "echo ubuntu > /tmp/install-user.txt", - "sudo RUNNER_TARBALL_URL=$RUNNER_TARBALL_URL /tmp/install-runner.sh" + "echo ubuntu | tee -a /tmp/install-user.txt", + "sudo RUNNER_TARBALL_URL=$RUNNER_TARBALL_URL /tmp/install-runner.sh", + "echo ImageOS=ubuntu20 | tee -a /opt/actions-runner/.env" ] } From bfa334224f1f602b1a6b8d7d99a5958db7341ad0 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 19 Jan 2022 12:48:05 +0000 Subject: [PATCH 10/16] fix: setup action tool cache --- modules/runners/templates/install-runner.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/runners/templates/install-runner.sh b/modules/runners/templates/install-runner.sh index 3739973c74..2cf4631c11 100644 --- a/modules/runners/templates/install-runner.sh +++ b/modules/runners/templates/install-runner.sh @@ -11,10 +11,13 @@ fi file_name="actions-runner.tar.gz" -echo "Creating actions-runner directory for the GH Action installtion" +echo "Setting up GH Action tool cache" +mkdir -p /opt/hostedtoolcache +echo "Creating actions-runner directory for the GH Action installation" cd /opt/ mkdir -p actions-runner && cd actions-runner + if [[ -n "$RUNNER_TARBALL_URL" ]]; then echo "Downloading the GH Action runner from $RUNNER_TARBALL_URL to $file_name" curl -o $file_name -L "$RUNNER_TARBALL_URL" @@ -43,4 +46,5 @@ if [[ "$os_id" =~ ^ubuntu.* ]]; then fi echo "Set file ownership of action runner" -chown -R "$user_name":"$user_name" . \ No newline at end of file +chown -R "$user_name":"$user_name" . +chown -R "$user_name":"$user_name" /opt/hostedtoolcache \ No newline at end of file From 8229022d818d8a46bf638ccb48deed390e8fe3f4 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 19 Jan 2022 12:58:02 +0000 Subject: [PATCH 11/16] fix: add missing arch var --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index 0a701368ec..73587ac31f 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -127,6 +127,7 @@ build { install_runner = templatefile("../../modules/runners/templates/install-runner.sh", { ARM_PATCH = "" S3_LOCATION_RUNNER_DISTRIBUTION = "" + RUNNER_ARCHITECTURE = "x64" }) }) destination = "/tmp/install-runner.sh" @@ -139,7 +140,7 @@ build { inline = [ "sudo chmod +x /tmp/install-runner.sh", "echo ubuntu | tee -a /tmp/install-user.txt", - "sudo RUNNER_TARBALL_URL=$RUNNER_TARBALL_URL /tmp/install-runner.sh", + "sudo RUNNER_ARCHITECTURE=x64 RUNNER_TARBALL_URL=$RUNNER_TARBALL_URL /tmp/install-runner.sh", "echo ImageOS=ubuntu20 | tee -a /opt/actions-runner/.env" ] } From 0e9413a9a5307c66d028c832e49fa0fc76506287 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 19 Jan 2022 13:53:21 +0000 Subject: [PATCH 12/16] fix: use Ubuntu's root device name --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index 73587ac31f..d9afffb1e1 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -90,7 +90,7 @@ source "amazon-ebs" "githubrunner" { ) launch_block_device_mappings { - device_name = "/dev/xvda" + device_name = "/dev/sda1" volume_size = "${var.root_volume_size_gb}" volume_type = "gp3" } From b9304b794d275b16a9abbc9fa94738e3d53c1b95 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 19 Jan 2022 13:55:03 +0000 Subject: [PATCH 13/16] chore: set apt to be noninteractive --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index d9afffb1e1..9a98a3f813 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -102,7 +102,9 @@ build { "source.amazon-ebs.githubrunner" ] provisioner "shell" { - environment_vars = [] + environment_vars = [ + "DEBIAN_FRONTEND=noninteractive" + ] inline = [ "sudo apt-get -y update", "sudo apt-get -y install ca-certificates curl gnupg lsb-release", From 9a6450349f17d459d3d5ee7d1343f92b27b61447 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 19 Jan 2022 13:57:11 +0000 Subject: [PATCH 14/16] chore: align tag values with amzn2 image --- images/ubuntu-focal/github_agent.ubuntu.pkr.hcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index 9a98a3f813..02c3d7a21e 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -80,8 +80,8 @@ source "amazon-ebs" "githubrunner" { var.global_tags, var.ami_tags, { - OS_Version = "ubuntu" - Release = "focal" + OS_Version = "ubuntu-focal" + Release = "Latest" Base_AMI_Name = "{{ .SourceAMIName }}" }) snapshot_tags = merge( From 4823c84fd9f004009e2dc8fbe41fe2dc4567d105 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 26 Jan 2022 12:59:35 +0000 Subject: [PATCH 15/16] chore: better docs for tool cache location --- modules/runners/templates/install-runner.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/runners/templates/install-runner.sh b/modules/runners/templates/install-runner.sh index 1090a05388..58fb7feba5 100644 --- a/modules/runners/templates/install-runner.sh +++ b/modules/runners/templates/install-runner.sh @@ -12,8 +12,11 @@ fi file_name="actions-runner.tar.gz" -echo "Setting up GH Action tool cache" +echo "Setting up GH Actions runner tool cache" +# Required for various */setup-* actions to work, location is also know by various environment +# variable names in the actions/runner software : RUNNER_TOOL_CACHE / RUNNER_TOOLSDIRECTORY / AGENT_TOOLSDIRECTORY mkdir -p /opt/hostedtoolcache + echo "Creating actions-runner directory for the GH Action installation" cd /opt/ mkdir -p actions-runner && cd actions-runner From 2017bce882f4d5d1b6c1d512b0c33f07c64919d5 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 26 Jan 2022 13:02:56 +0000 Subject: [PATCH 16/16] chore: include a warning --- modules/runners/templates/install-runner.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/runners/templates/install-runner.sh b/modules/runners/templates/install-runner.sh index 58fb7feba5..c313439976 100644 --- a/modules/runners/templates/install-runner.sh +++ b/modules/runners/templates/install-runner.sh @@ -15,6 +15,7 @@ file_name="actions-runner.tar.gz" echo "Setting up GH Actions runner tool cache" # Required for various */setup-* actions to work, location is also know by various environment # variable names in the actions/runner software : RUNNER_TOOL_CACHE / RUNNER_TOOLSDIRECTORY / AGENT_TOOLSDIRECTORY +# Warning, not all setup actions support the env vars and so this specific path must be created regardless mkdir -p /opt/hostedtoolcache echo "Creating actions-runner directory for the GH Action installation"