Skip to content

Commit

Permalink
chore: use ARM instances for small runner group
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Dec 13, 2023
1 parent 41d3c05 commit d65ecc8
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 94 deletions.
4 changes: 2 additions & 2 deletions .aspect/workflows/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
tasks:
- format:
queue: aspect-small
queue: aspect-small-amd64
- buildifier:
queue: aspect-small
queue: aspect-small-arm64
- test:
165 changes: 82 additions & 83 deletions .aspect/workflows/terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .aspect/workflows/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws",
version = "~> 4.58.0"
version = "~> 5.30.0"
}
}
}
Expand Down
42 changes: 35 additions & 7 deletions .aspect/workflows/terraform/workflows.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ provider "aws" {
}
}

data "aws_ami" "runner_ami" {
data "aws_ami" "runner_amd64_ami" {
# Aspect's AWS account 213396452403 provides public Aspect Workflows images for getting started
# during the trial period. We recommend that all Workflows users build their own AMIs and keep
# up-to date with patches. See https://docs.aspect.build/v/workflows/install/packer for more info
Expand All @@ -24,6 +24,20 @@ data "aws_ami" "runner_ami" {
}
}

data "aws_ami" "runner_arm64_ami" {
# Aspect's AWS account 213396452403 provides public Aspect Workflows images for getting started
# during the trial period. We recommend that all Workflows users build their own AMIs and keep
# up-to date with patches. See https://docs.aspect.build/v/workflows/install/packer for more info
# and/or https://github.com/aspect-build/workflows-images for example packer scripts and BUILD
# targets for building AMIs for Workflows.
owners = ["213396452403"]
most_recent = true
filter {
name = "name"
values = ["aspect-workflows-al2-minimal-arm64-*"]
}
}

module "aspect_workflows" {
providers = {
aws = aws.workflows
Expand Down Expand Up @@ -73,14 +87,19 @@ module "aspect_workflows" {
# Aspect Workflows requires instance types that have nvme drives. See
# https://aws.amazon.com/ec2/instance-types/ for full list of instance types available on AWS.
instance_types = ["c5ad.xlarge"]
image_id = data.aws_ami.runner_ami.id
image_id = data.aws_ami.runner_amd64_ami.id
}
"small" = {
"small-amd64" = {
# Aspect Workflows requires instance types that have nvme drives. See
# https://aws.amazon.com/ec2/instance-types/ for full list of instance types available on AWS.
# TODO: switch to Graviton processor when 5.9.0-beta.3 or rc.0 is out
instance_types = ["c5ad.large"]
image_id = data.aws_ami.runner_ami.id
image_id = data.aws_ami.runner_amd64_ami.id
}
"small-arm64" = {
# Aspect Workflows requires instance types that have nvme drives. See
# https://aws.amazon.com/ec2/instance-types/ for full list of instance types available on AWS.
instance_types = ["m6gd.medium"]
image_id = data.aws_ami.runner_arm64_ami.id
}
}

Expand All @@ -96,12 +115,21 @@ module "aspect_workflows" {
scaling_polling_frequency = 3 # check for queued jobs every 20s
warming = true
}
small = {
small-amd64 = {
agent_idle_timeout_min = 1
job_max_run_time_min = 5 * 60
max_runners = 10
min_runners = 0
resource_type = "small-amd64"
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
}
small-arm64 = {
agent_idle_timeout_min = 1
job_max_run_time_min = 5 * 60
max_runners = 10
min_runners = 0
resource_type = "small"
resource_type = "small-arm64"
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
}
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/aspect-small
resource_class: aspect-build/aspect-small-arm64
context:
- slack

0 comments on commit d65ecc8

Please sign in to comment.