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

feat: Update runner bin #2

Closed
wants to merge 12 commits into from
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ other optional variables (e.g., `name`, `tags`, etc.) provided by the
| `github_organization` | Name of the GitHub organization. | `string` | n/a | yes |
| `github_app_webhook_password` | Password for the GitHub app webhook. An empty string implies a randomly generated password. | `string` | `""` | no |
| `github_organization_runner_enabled` | Toggle to activate runners for all projects in the organization. | `bool` | `true` | no |
| `key_pair_name` | Name of the key pair to associate with the runner | `string` | n/a | no |
| `runner_ephemeral_mode_enabled` | Toggle to activate ephemeral runners. | `bool` | `false` | no |
| `runner_version` | Version of the GitHub Action runner. | `string` | n/a | yes |
| `runner_os` | Operating system for the GitHub Action runner. | `string` | `"linux"` | no |
Expand Down
6 changes: 5 additions & 1 deletion assets/instance/userdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# shellcheck disable=SC2154,SC2034,SC2128,SC2155,SC2206,SC2207,SC2046,SC2068,SC2125,SC1083
exec > >(tee /var/log/user-data.log | logger -t user-data -s 2>/dev/console) 2>&1

sleep 2m
# --- configurations --------------------------

GHR_CORE_CONFIG_RUN_AS=ec2-user
Expand Down Expand Up @@ -59,9 +60,12 @@ function provision_instance_stores {
export -f provision_instance_stores

# --- install: core -----------------------------

yum upgrade -y

sudo dnf upgrade --refresh rpm glibc
sudo rm /var/lib/rpm/.rpm.lock
dnf -y update

dnf install -y docker

yum install --allowerasing -y \
Expand Down
2 changes: 1 addition & 1 deletion assets/runner-binaries/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /tmp/runner-binaries
RUN apk add --no-cache curl

ENV RUNNER_RELEASE_ARTIFACT_BASE_URL=https://github.com/philips-labs/terraform-aws-github-runner/releases/download
ARG RUNNER_VERSION=3.6.1
ARG RUNNER_VERSION=4.2.3

RUN curl -L "${RUNNER_RELEASE_ARTIFACT_BASE_URL}/v${RUNNER_VERSION}/runner-binaries-syncer.zip" -o runner-binaries-syncer.zip && \
curl -L "${RUNNER_RELEASE_ARTIFACT_BASE_URL}/v${RUNNER_VERSION}/runners.zip" -o runners.zip && \
Expand Down
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "random_string" "github_runner_random_suffix" {

module "github_runner" {
source = "philips-labs/github-runner/aws"
version = "v3.6.1"
version = "v4.2.3"

prefix = module.github_runner_label.id
enable_ephemeral_runners = var.runner_ephemeral_mode_enabled
Expand All @@ -60,6 +60,7 @@ module "github_runner" {
instance_target_capacity_type = lower(var.instance_lifecycle_type)
instance_types = var.instance_types
instance_allocation_strategy = "capacity-optimized"
key_name = var.key_pair_name
logging_retention_in_days = var.log_retention
subnet_ids = var.vpc_subnet_ids
vpc_id = var.vpc_id
Expand Down
11 changes: 11 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ variable "github_organization_runner_enabled" {
default = true
}

variable "key_pair_name" {
description = "Name of the key pair to associate with the runner"
type = string
default = null
}

variable "runner_ephemeral_mode_enabled" {
type = bool
description = "Toggle to activate ephemeral runners."
Expand All @@ -42,6 +48,11 @@ variable "runner_os" {
default = "linux"
}

variable "runner_iam_role_managed_policy_arns" {
type = list(string)
description = "IAM policy arns to attach to the runner"
}

variable "runner_pool_config" {
type = list(object({
cron = string
Expand Down