Skip to content

Commit 4433035

Browse files
feat: allow set disk size & type on vm runners (#235)
1 parent 50fa84f commit 4433035

File tree

6 files changed

+32
-4
lines changed

6 files changed

+32
-4
lines changed

modules/gh-runner-mig-container-vm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ This example shows how to deploy a Self Hosted Runner on MIG Container VMs.
3030
| cooldown\_period | The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. | `number` | `60` | no |
3131
| create\_network | When set to true, VPC,router and NAT will be auto created | `bool` | `true` | no |
3232
| dind | Flag to determine whether to expose dockersock | `bool` | `false` | no |
33+
| disk\_size\_gb | Instance disk size in GB | `number` | `100` | no |
34+
| disk\_type | Instance disk type, can be either pd-ssd, local-ssd, or pd-standard | `string` | `"pd-ssd"` | no |
3335
| gh\_token | Github token that is used for generating Self Hosted Runner Token | `string` | n/a | yes |
3436
| image | The github runner image | `string` | n/a | yes |
3537
| instance\_name | The gce instance name | `string` | `"gh-runner"` | no |

modules/gh-runner-mig-container-vm/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ module "mig_template" {
163163
"https://www.googleapis.com/auth/cloud-platform",
164164
]
165165
}
166-
disk_size_gb = 100
167-
disk_type = "pd-ssd"
166+
disk_size_gb = var.disk_size_gb
167+
disk_type = var.disk_type
168168
auto_delete = true
169169
name_prefix = "gh-runner"
170170
source_image_family = "cos-stable"

modules/gh-runner-mig-container-vm/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,15 @@ variable "spot_instance_termination_action" {
131131
type = string
132132
default = "STOP"
133133
}
134+
135+
variable "disk_size_gb" {
136+
type = number
137+
description = "Instance disk size in GB"
138+
default = 100
139+
}
140+
141+
variable "disk_type" {
142+
type = string
143+
description = "Instance disk type, can be either pd-ssd, local-ssd, or pd-standard"
144+
default = "pd-ssd"
145+
}

modules/gh-runner-mig-vm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ This example shows how to deploy a MIG Self Hosted Runner with an image pre-bake
3232
| create\_network | When set to true, VPC,router and NAT will be auto created | `bool` | `true` | no |
3333
| create\_subnetwork | Whether to create subnetwork or use the one provided via subnet\_name | `bool` | `true` | no |
3434
| custom\_metadata | User provided custom metadata | `map(any)` | `{}` | no |
35+
| disk\_size\_gb | Instance disk size in GB | `number` | `100` | no |
36+
| disk\_type | Instance disk type, can be either pd-ssd, local-ssd, or pd-standard | `string` | `"pd-ssd"` | no |
3537
| gh\_runner\_labels | GitHub runner labels to attach to the runners. Docs: https://docs.github.com/en/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners | `set(string)` | `[]` | no |
3638
| gh\_token | Github token that is used for generating Self Hosted Runner Token | `string` | n/a | yes |
3739
| instance\_tags | Additional tags to add to the instances | `list(string)` | `[]` | no |

modules/gh-runner-mig-vm/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ module "mig_template" {
132132
"https://www.googleapis.com/auth/cloud-platform",
133133
]
134134
}
135-
disk_size_gb = 100
136-
disk_type = "pd-ssd"
135+
disk_size_gb = var.disk_size_gb
136+
disk_type = var.disk_type
137137
auto_delete = true
138138
name_prefix = "gh-runner"
139139
source_image_family = var.source_image_family

modules/gh-runner-mig-vm/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,15 @@ variable "spot_instance_termination_action" {
165165
type = string
166166
default = "STOP"
167167
}
168+
169+
variable "disk_size_gb" {
170+
type = number
171+
description = "Instance disk size in GB"
172+
default = 100
173+
}
174+
175+
variable "disk_type" {
176+
type = string
177+
description = "Instance disk type, can be either pd-ssd, local-ssd, or pd-standard"
178+
default = "pd-ssd"
179+
}

0 commit comments

Comments
 (0)