Skip to content

Commit

Permalink
build: Test higher bandwidth machines
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax committed Apr 15, 2023
1 parent b910a17 commit 40c8ec3
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ami-build/agent-setup-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -eu

set -o pipefail


AGENT_VERSION=3.218.0

# shellcheck source=ami-build/scripts/install-fun.sh
. /home/ubuntu/scripts/install-fun.sh


agent_setup_build
50 changes: 50 additions & 0 deletions ami-build/azp-build-arm64.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Defines a Packer template that builds an AMI image of a large arm64 VM that runs
# the AZP Agent.

source "amazon-ebs" "envoy-azp-build-arm64" {
ami_name = "envoy-azp-build-arm64-{{timestamp}}"
instance_type = "r6g.large"
region = "us-east-2"
security_group_ids = ["sg-030a7a75a086f208c"]
source_ami_filter {
filters = {
# Found with:
# aws ec2 describe-images --owners 'aws-marketplace' --output json --region us-east-2 --filters "Name=product-code,Values=4s6b2r2vfe46kyul508kf459f"
name = "ubuntu-minimal/images/hvm-ssd/ubuntu-jammy-22.04-arm64-minimal-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
encrypt_boot = true
ssh_username = "ubuntu"

run_tags = {
"Project" : "Packer"
}
run_volume_tags = {
"Project" : "Packer"
}
tags = {
"Project" : "Envoy",
"AmiType" : "envoy-azp-build-arm64"
}
}

build {
name = "envoy-azp-build-arm64"
sources = [
"source.amazon-ebs.envoy-azp-build-arm64"
]

provisioner "file" {
source = "scripts"
destination = "/home/ubuntu/scripts"
}

provisioner "shell" {
script = "agent-setup-build.sh"
execute_command = "{{.Vars}} sudo -S -E bash -eu '{{.Path}}'"
}
}
50 changes: 50 additions & 0 deletions ami-build/azp-build-x64.pkr.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Defines a Packer template that builds an AMI image of a large x64 VM that runs
# the AZP Agent.

source "amazon-ebs" "envoy-azp-build-x64" {
ami_name = "envoy-azp-build-x64-{{timestamp}}"
instance_type = "r5.large"
region = "us-east-2"
security_group_ids = ["sg-030a7a75a086f208c"]
source_ami_filter {
filters = {
# Found with:
# aws ec2 describe-images --owners 'aws-marketplace' --output json --region us-east-2 --filters "Name=product-code,Values=4s6b2r2vfe46kyul508kf459f"
name = "ubuntu-minimal/images/hvm-ssd/ubuntu-jammy-22.04-amd64-minimal-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
encrypt_boot = true
ssh_username = "ubuntu"

run_tags = {
"Project" : "Packer"
}
run_volume_tags = {
"Project" : "Packer"
}
tags = {
"Project" : "Envoy",
"AmiType" : "envoy-azp-build-x64"
}
}

build {
name = "envoy-azp-build-x64"
sources = [
"source.amazon-ebs.envoy-azp-build-x64"
]

provisioner "file" {
source = "scripts"
destination = "/home/ubuntu/scripts"
}

provisioner "shell" {
script = "agent-setup-build.sh"
execute_command = "{{.Vars}} sudo -S -E bash -eu '{{.Path}}'"
}
}
18 changes: 18 additions & 0 deletions instances/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,21 @@ module "arm-build-pool" {
aws = aws
}
}

module "arm-2-build-pool" {
source = "./azp-build-asg"

ami_prefix = "envoy-azp-arm64-2"
aws_account_id = "457956385456"
azp_pool_name = "arm-large-2"
azp_token = var.azp_token
disk_size_gb = 10
idle_instances_count = 1
instance_types = ["c6gn.8xlarge"]
bazel_cache_bucket = aws_s3_bucket.build-cache.bucket
cache_prefix = "public-arm64"

providers = {
aws = aws
}
}

0 comments on commit 40c8ec3

Please sign in to comment.