Skip to content

Commit

Permalink
chore: switch to smaller 'small' instances without nvme drives (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored Dec 20, 2023
1 parent 57bfe2c commit 2ef100b
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
48 changes: 36 additions & 12 deletions .aspect/workflows/terraform/workflows.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,38 @@ module "aspect_workflows" {
default = {}
}

# Resource types for use by runner groups
# Resource types for use by runner groups. Aspect recommends machines types that have SSD drives
# for large Bazel workflows. See
# https://cloud.google.com/compute/docs/machine-resource#machine_type_comparison for list of
# machine types availble on GCP.
resource_types = {
default = {
# Aspect Workflows requires machine types that have local SSD drives. See
# https://cloud.google.com/compute/docs/machine-resource#machine_type_comparison for full list
# of machine types availble on GCP.
machine_type = "n1-standard-4"
image_id = data.google_compute_image.runner_image.id
machine_type = "n1-standard-4"
image_id = data.google_compute_image.runner_image.id
# While preemtible instances are possible to provision and we use them here on this open source
# repository as a demonstration of how to reduce compute costs, they are not recommended for
# repositories where the occasional CI failures due to a machine being preemted mid-job are not
# acceptable.
use_preemptible = true
}
small = {
# Aspect Workflows requires machine types that have local SSD drives. See
# https://cloud.google.com/compute/docs/machine-resource#machine_type_comparison for full list
# of machine types availble on GCP.
machine_type = "n1-standard-1"
image_id = data.google_compute_image.runner_image.id
machine_type = "e2-small"
num_ssds = 0
image_id = data.google_compute_image.runner_image.id
# While preemtible instances are possible to provision and we use them here on this open source
# repository as a demonstration of how to reduce compute costs, they are not recommended for
# repositories where the occasional CI failures due to a machine being preemted mid-job are not
# acceptable.
use_preemptible = true
}
micro = {
machine_type = "e2-micro"
num_ssds = 0
image_id = data.google_compute_image.runner_image.id
# While preemtible instances are possible to provision and we use them here on this open source
# repository as a demonstration of how to reduce compute costs, they are not recommended for
# repositories where the occasional CI failures due to a machine being preemted mid-job are not
# acceptable.
use_preemptible = true
}
}
Expand All @@ -80,13 +96,21 @@ module "aspect_workflows" {
warming = true
}
small = {
agent_idle_timeout_min = 1
agent_idle_timeout_min = 10
max_runners = 10
min_runners = 0
resource_type = "small"
scaling_polling_frequency = 3 # check for queued jobs every 20s
warming = false # don't warm for faster bootstrap; these runners won't be running large builds
}
micro = {
agent_idle_timeout_min = 60 * 12
max_runners = 10
min_runners = 0
resource_type = "micro"
scaling_polling_frequency = 3 # check for queued jobs every 20s
warming = false # don't warm for faster bootstrap; these runners won't be running large builds
}
# The warming runner group is used for the periodic warming job that creates
# warming archives for use by other runner groups.
warming = {
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ workflows:
jobs:
- legacy
- aspect-workflows/setup:
resource_class: aspect-build/bazel-lib-small
resource_class: aspect-build/bazel-lib-nano
context:
- slack

0 comments on commit 2ef100b

Please sign in to comment.