Skip to content

Commit

Permalink
release.auto.pkvars.hcl refactor: creating 1 file per AMI variant
Browse files Browse the repository at this point in the history
  • Loading branch information
singholt committed Nov 16, 2023
1 parent ec89cce commit 35af16d
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 32 deletions.
34 changes: 21 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ packer:
unzip ./packer.zip
rm ./packer.zip

release.auto.pkrvars.hcl:
echo "Missing configuration file: release.auto.pkrvars.hcl."
release-al1.auto.pkrvars.hcl:
echo "Missing configuration file: release-al1.auto.pkrvars.hcl."
exit 1

release-al2.auto.pkrvars.hcl:
echo "Missing configuration file: release-al2.auto.pkrvars.hcl."
exit 1

release-al2023.auto.pkrvars.hcl:
echo "Missing configuration file: release-al2023.auto.pkrvars.hcl."
exit 1

.PHONY: check-region
Expand All @@ -42,47 +50,47 @@ validate: check-region init
./packer validate -var "region=${REGION}" .

.PHONY: al1
al1: check-region init validate release.auto.pkrvars.hcl
al1: check-region init validate release-al1.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al1" -var "region=${REGION}" .

.PHONY: al2
al2: check-region init validate release.auto.pkrvars.hcl
al2: check-region init validate release-al2.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2" -var "region=${REGION}" .

.PHONY: al2arm
al2arm: check-region init validate release.auto.pkrvars.hcl
al2arm: check-region init validate release-al2.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2arm" -var "region=${REGION}" .

.PHONY: al2gpu
al2gpu: check-region init validate release.auto.pkrvars.hcl
al2gpu: check-region init validate release-al2.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2gpu" -var "region=${REGION}" .

.PHONY: al2keplergpu
al2keplergpu: check-region init validate release.auto.pkrvars.hcl
al2keplergpu: check-region init validate release-al2.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2keplergpu" -var "region=${REGION}" .

.PHONY: al2inf
al2inf: check-region init validate release.auto.pkrvars.hcl
al2inf: check-region init validate release-al2.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2inf" -var "region=${REGION}" .

.PHONY: al2kernel5dot10
al2kernel5dot10: check-region init validate release.auto.pkrvars.hcl
al2kernel5dot10: check-region init validate release-al2.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2kernel5dot10" -var "region=${REGION}" .

.PHONY: al2kernel5dot10arm
al2kernel5dot10arm: check-region init validate release.auto.pkrvars.hcl
al2kernel5dot10arm: check-region init validate release-al2.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2kernel5dot10arm" -var "region=${REGION}" .

.PHONY: al2023
al2023: check-region init validate release.auto.pkrvars.hcl
al2023: check-region init validate release-al2023.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2023" -var "region=${REGION}" .

.PHONY: al2023arm
al2023arm: check-region init validate release.auto.pkrvars.hcl
al2023arm: check-region init validate release-al2023.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2023arm" -var "region=${REGION}" .

.PHONY: al2023neu
al2023neu: check-region init validate release.auto.pkrvars.hcl
al2023neu: check-region init validate release-al2023.auto.pkrvars.hcl
./packer build -only="amazon-ebs.al2023neu" -var "region=${REGION}" .

shellcheck:
Expand Down
2 changes: 2 additions & 0 deletions release-al1.auto.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ami_version = "20231024"
source_ami_al1 = "amzn-ami-minimal-hvm-2018.03.0.20231002.0-x86_64-ebs"
5 changes: 5 additions & 0 deletions release-al2.auto.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ami_version = "20231024"
source_ami_al2 = "amzn2-ami-minimal-hvm-2.0.20230926.0-x86_64-ebs"
source_ami_al2arm = "amzn2-ami-minimal-hvm-2.0.20230926.0-arm64-ebs"
source_ami_al2kernel5dot10 = "amzn2-ami-minimal-hvm-2.0.20230926.0-x86_64-ebs"
source_ami_al2kernel5dot10arm = "amzn2-ami-minimal-hvm-2.0.20230926.0-arm64-ebs"
6 changes: 6 additions & 0 deletions release-al2023.auto.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ami_version = "20231024"
source_ami_al2023 = "al2023-ami-minimal-2023.2.20230920.1-kernel-6.1-x86_64"
source_ami_al2023arm = "al2023-ami-minimal-2023.2.20230920.1-kernel-6.1-arm64"
kernel_version_al2023 = "-kernel-6.1"
kernel_version_al2023arm = "-kernel-6.1"
distribution_release_al2023 = "2023.2.20230920"
17 changes: 0 additions & 17 deletions release.auto.pkrvars.hcl

This file was deleted.

10 changes: 8 additions & 2 deletions variables.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,50 @@ variable "region" {

variable "block_device_size_gb" {
type = number
default = 30
description = "Size of the root block device."
default = 30
}

variable "ecs_agent_version" {
type = string
description = "ECS agent version to build AMI with."
default = "1.79.0"
}

variable "ecs_init_rev" {
type = string
description = "ecs-init package version rev"
default = "1"
}

variable "docker_version" {
type = string
description = "Docker version to build AMI with."
default = "20.10.25"
}

variable "containerd_version" {
type = string
description = "Containerd version to build AMI with."
default = "1.6.19"
}

variable "docker_version_al2023" {
type = string
description = "Docker version to build AL2023 AMI with."
default = "20.10.25"
}

variable "containerd_version_al2023" {
type = string
description = "Containerd version to build AL2023 AMI with."
default = "1.6.19"
}

variable "exec_ssm_version" {
type = string
default = "3.2.1630.0"
description = "SSM binary version to build ECS exec support with."
default = "3.2.1630.0"
}

variable "source_ami_al2" {
Expand Down

0 comments on commit 35af16d

Please sign in to comment.