From 210a1d4dfd41e641a18cfa10fea20a3937ad5ade Mon Sep 17 00:00:00 2001 From: Matt Boersma Date: Fri, 5 Apr 2024 12:17:58 -0600 Subject: [PATCH] Add support for Ubuntu 24.04 on Azure --- images/capi/Makefile | 10 +++++++++- images/capi/azure_targets.sh | 16 ++++++++-------- images/capi/packer/azure/scripts/init-sig.sh | 9 +++++++++ images/capi/packer/azure/ubuntu-2404-cvm.json | 9 +++++++++ images/capi/packer/azure/ubuntu-2404-gen2.json | 9 +++++++++ images/capi/packer/azure/ubuntu-2404.json | 9 +++++++++ 6 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 images/capi/packer/azure/ubuntu-2404-cvm.json create mode 100644 images/capi/packer/azure/ubuntu-2404-gen2.json create mode 100644 images/capi/packer/azure/ubuntu-2404.json diff --git a/images/capi/Makefile b/images/capi/Makefile index 8659f3d526..d85515223d 100644 --- a/images/capi/Makefile +++ b/images/capi/Makefile @@ -488,7 +488,7 @@ $(AZURE_BUILD_SIG_GEN2_TARGETS): deps-azure .PHONY: $(AZURE_BUILD_SIG_CVM_TARGETS) $(AZURE_BUILD_SIG_CVM_TARGETS): deps-azure - . $(abspath packer/azure/scripts/init-sig.sh) $(subst build-azure-sig-,,$@) && packer build $(if $(findstring windows,$@),$(PACKER_WINDOWS_NODE_FLAGS),$(PACKER_NODE_FLAGS)) -var-file="$(abspath packer/azure/azure-config.json)" -var-file="$(abspath packer/azure/azure-sig-cvm.json)" -var-file="$(abspath packer/azure/$(subst build-azure-sig-,,$@).json)" -only="$(subst build-azure-,,$@)" $(ABSOLUTE_PACKER_VAR_FILES) packer/azure/packer$(findstring -windows,$@).json + . $(abspath packer/azure/scripts/init-sig.sh) $(subst build-azure-sig-,,$@) && $(PACKER) build $(if $(findstring windows,$@),$(PACKER_WINDOWS_NODE_FLAGS),$(PACKER_NODE_FLAGS)) -var-file="$(abspath packer/azure/azure-config.json)" -var-file="$(abspath packer/azure/azure-sig-cvm.json)" -var-file="$(abspath packer/azure/$(subst build-azure-sig-,,$@).json)" -only="$(subst build-azure-,,$@)" $(ABSOLUTE_PACKER_VAR_FILES) packer/azure/packer$(findstring -windows,$@).json .PHONY: $(AZURE_VALIDATE_SIG_TARGETS) $(AZURE_VALIDATE_SIG_TARGETS): deps-azure @@ -627,6 +627,7 @@ build-ami-all: $(AMI_BUILD_TARGETS) ## Builds all AMIs build-azure-sig-ubuntu-2004: ## Builds Ubuntu 20.04 Azure managed image in Shared Image Gallery build-azure-sig-ubuntu-2204: ## Builds Ubuntu 22.04 Azure managed image in Shared Image Gallery +build-azure-sig-ubuntu-2404: ## Builds Ubuntu 24.04 Azure managed image in Shared Image Gallery build-azure-sig-centos-7: ## Builds CentOS 7 Azure managed image in Shared Image Gallery build-azure-sig-mariner-2: ## Builds Mariner 2 Azure managed image in Shared Image Gallery build-azure-sig-rhel-8: ## Builds RHEL 8 Azure managed image in Shared Image Gallery @@ -636,6 +637,7 @@ build-azure-sig-windows-2019-containerd-cvm: ## Builds Windows Server 2019 with build-azure-sig-windows-2022-containerd-cvm: ## Builds Windows Server 2022 with containerd CVM Azure managed image in Shared Image Gallery build-azure-vhd-ubuntu-2004: ## Builds Ubuntu 20.04 VHD image for Azure build-azure-vhd-ubuntu-2204: ## Builds Ubuntu 22.04 VHD image for Azure +build-azure-vhd-ubuntu-2404: ## Builds Ubuntu 24.04 VHD image for Azure build-azure-vhd-centos-7: ## Builds CentOS 7 VHD image for Azure build-azure-vhd-mariner-2: ## Builds Mariner 2 VHD image for Azure build-azure-vhd-rhel-8: ## Builds RHEL 8 VHD image for Azure @@ -648,8 +650,10 @@ build-azure-sig-flatcar: ## Builds Flatcar Azure managed image in Shared Image G build-azure-sig-flatcar-gen2: ## Builds Flatcar Azure Gen2 managed image in Shared Image Gallery build-azure-sig-ubuntu-2004-gen2: ## Builds Ubuntu 20.04 Gen2 managed image in Shared Image Gallery build-azure-sig-ubuntu-2204-gen2: ## Builds Ubuntu 22.04 Gen2 managed image in Shared Image Gallery +build-azure-sig-ubuntu-2404-gen2: ## Builds Ubuntu 24.04 Gen2 managed image in Shared Image Gallery build-azure-sig-ubuntu-2004-cvm: ## Builds Ubuntu 20.04 CVM managed image in Shared Image Gallery build-azure-sig-ubuntu-2204-cvm: ## Builds Ubuntu 22.04 CVM managed image in Shared Image Gallery +build-azure-sig-ubuntu-2404-cvm: ## Builds Ubuntu 24.04 CVM managed image in Shared Image Gallery build-azure-vhds: $(AZURE_BUILD_VHD_TARGETS) ## Builds all Azure VHDs build-azure-sigs: $(AZURE_BUILD_SIG_TARGETS) $(AZURE_BUILD_SIG_GEN2_TARGETS) $(AZURE_BUILD_SIG_CVM_TARGETS) ## Builds all Azure Shared Image Gallery images @@ -822,6 +826,7 @@ validate-azure-sig-mariner-2: ## Validates Mariner 2 Azure managed image in Shar validate-azure-sig-rhel-8: ## Validates RHEL 8 Azure managed image in Shared Image Gallery Packer config validate-azure-sig-ubuntu-2004: ## Validates Ubuntu 20.04 Azure managed image in Shared Image Gallery Packer config validate-azure-sig-ubuntu-2204: ## Validates Ubuntu 22.04 Azure managed image in Shared Image Gallery Packer config +validate-azure-sig-ubuntu-2404: ## Validates Ubuntu 24.04 Azure managed image in Shared Image Gallery Packer config validate-azure-sig-windows-2019-containerd: ## Validate Windows Server 2019 with containerd Azure managed image in Shared Image Gallery Packer config validate-azure-sig-windows-2022-containerd: ## Validate Windows Server 2022 with containerd Azure managed image in Shared Image Gallery Packer config validate-azure-sig-windows-annual-containerd: ## Validate Windows Server Annual Channel with containerd Azure managed image in Shared Image Gallery Packer config @@ -830,6 +835,7 @@ validate-azure-vhd-mariner-2: ## Validates Mariner 2 VHD image Azure Packer conf validate-azure-vhd-rhel-8: ## Validates RHEL 8 VHD image Azure Packer config validate-azure-vhd-ubuntu-2004: ## Validates Ubuntu 20.04 VHD image Azure Packer config validate-azure-vhd-ubuntu-2204: ## Validates Ubuntu 22.04 VHD image Azure Packer config +validate-azure-vhd-ubuntu-2404: ## Validates Ubuntu 24.04 VHD image Azure Packer config validate-azure-vhd-windows-2019-containerd: ## Validate Windows Server 2019 VHD with containerd image Azure Packer config validate-azure-vhd-windows-2022-containerd: ## Validate Windows Server 2022 VHD with containerd image Azure Packer config validate-azure-sig-centos-7-gen2: ## Validates CentOS 7 Azure managed image in Shared Image Gallery Packer config @@ -838,6 +844,8 @@ validate-azure-sig-ubuntu-2004-gen2: ## Validates Ubuntu 20.04 Azure managed ima validate-azure-sig-ubuntu-2004-cvm: ## Validates Ubuntu 20.04 CVM Azure managed image in Shared Image Gallery Packer config validate-azure-sig-ubuntu-2204-gen2: ## Validates Ubuntu 22.04 Azure managed image in Shared Image Gallery Packer config validate-azure-sig-ubuntu-2204-cvm: ## Validates Ubuntu 22.04 CVM Azure managed image in Shared Image Gallery Packer config +validate-azure-sig-ubuntu-2404-gen2: ## Validates Ubuntu 24.04 Azure managed image in Shared Image Gallery Packer config +validate-azure-sig-ubuntu-2404-cvm: ## Validates Ubuntu 24.04 CVM Azure managed image in Shared Image Gallery Packer config validate-azure-all: $(AZURE_VALIDATE_SIG_TARGETS) $(AZURE_VALIDATE_VHD_TARGETS) $(AZURE_VALIDATE_SIG_GEN2_TARGETS) $(AZURE_VALIDATE_SIG_CVM_TARGETS) ## Validates all images for Azure Packer config validate-do-ubuntu-2004: ## Validates Ubuntu 20.04 DigitalOcean Snapshot Packer config diff --git a/images/capi/azure_targets.sh b/images/capi/azure_targets.sh index a5dc5b655b..87cf363c2f 100644 --- a/images/capi/azure_targets.sh +++ b/images/capi/azure_targets.sh @@ -1,8 +1,8 @@ -VHD_TARGETS="ubuntu-2004 ubuntu-2204 centos-7 mariner-2 rhel-8 windows-2019-containerd windows-2022-containerd" -VHD_CI_TARGETS="ubuntu-2004 ubuntu-2204 mariner-2 windows-2019-containerd windows-2022-containerd" -SIG_TARGETS="ubuntu-2004 ubuntu-2204 centos-7 mariner-2 rhel-8 windows-2019-containerd windows-2022-containerd flatcar" -SIG_CI_TARGETS="ubuntu-2004 ubuntu-2204 mariner-2 windows-2019-containerd windows-2022-containerd flatcar" -SIG_GEN2_TARGETS="ubuntu-2004 ubuntu-2204 centos-7 mariner-2 flatcar" -SIG_GEN2_CI_TARGETS="ubuntu-2004 ubuntu-2204 mariner-2 flatcar" -SIG_CVM_TARGETS="ubuntu-2004 ubuntu-2204 windows-2019-containerd windows-2022-containerd" -SIG_CVM_CI_TARGETS="ubuntu-2204 windows-2022-containerd" +VHD_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 mariner-2 rhel-8 windows-2019-containerd windows-2022-containerd" +VHD_CI_TARGETS="ubuntu-2204 ubuntu-2404 mariner-2 windows-2019-containerd windows-2022-containerd" +SIG_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 mariner-2 rhel-8 windows-2019-containerd windows-2022-containerd flatcar" +SIG_CI_TARGETS="ubuntu-2204 ubuntu-2404 mariner-2 windows-2019-containerd windows-2022-containerd flatcar" +SIG_GEN2_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 mariner-2 flatcar" +SIG_GEN2_CI_TARGETS="ubuntu-2204 ubuntu-2404 mariner-2 flatcar" +SIG_CVM_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 windows-2019-containerd windows-2022-containerd" +SIG_CVM_CI_TARGETS="ubuntu-2204 ubuntu-2404 windows-2022-containerd" diff --git a/images/capi/packer/azure/scripts/init-sig.sh b/images/capi/packer/azure/scripts/init-sig.sh index 70f17cbe27..3d9f3f56a4 100755 --- a/images/capi/packer/azure/scripts/init-sig.sh +++ b/images/capi/packer/azure/scripts/init-sig.sh @@ -58,6 +58,9 @@ case ${SIG_TARGET} in ubuntu-2204) create_image_definition ${SIG_TARGET} "22_04-lts" "V1" "Linux" ;; + ubuntu-2404) + create_image_definition ${SIG_TARGET} "24_04-lts" "V1" "Linux" + ;; centos-7) create_image_definition "centos-7" "centos-7" "V1" "Linux" ;; @@ -100,6 +103,12 @@ case ${SIG_TARGET} in ubuntu-2204-cvm) create_image_definition ${SIG_TARGET} "22_04-lts-cvm" "V2" "Linux" ${SECURITY_TYPE_CVM_SUPPORTED_FEATURE} ;; + ubuntu-2404-gen2) + create_image_definition ${SIG_TARGET} "24_04-lts-gen2" "V2" "Linux" + ;; + ubuntu-2404-cvm) + create_image_definition ${SIG_TARGET} "24_04-lts-cvm" "V2" "Linux" ${SECURITY_TYPE_CVM_SUPPORTED_FEATURE} + ;; centos-7-gen2) create_image_definition "centos-7-gen2" "centos-7-gen2" "V2" "Linux" ;; diff --git a/images/capi/packer/azure/ubuntu-2404-cvm.json b/images/capi/packer/azure/ubuntu-2404-cvm.json new file mode 100644 index 0000000000..dc5b35bb1f --- /dev/null +++ b/images/capi/packer/azure/ubuntu-2404-cvm.json @@ -0,0 +1,9 @@ +{ + "build_name": "ubuntu-2404", + "distribution": "ubuntu", + "distribution_release": "noble", + "distribution_version": "2404", + "image_offer": "ubuntu-24_04-lts", + "image_publisher": "Canonical", + "image_sku": "cvm" +} diff --git a/images/capi/packer/azure/ubuntu-2404-gen2.json b/images/capi/packer/azure/ubuntu-2404-gen2.json new file mode 100644 index 0000000000..e318a4d7de --- /dev/null +++ b/images/capi/packer/azure/ubuntu-2404-gen2.json @@ -0,0 +1,9 @@ +{ + "build_name": "ubuntu-2404", + "distribution": "ubuntu", + "distribution_release": "noble", + "distribution_version": "2404", + "image_offer": "ubuntu-24_04-lts", + "image_publisher": "Canonical", + "image_sku": "server" +} diff --git a/images/capi/packer/azure/ubuntu-2404.json b/images/capi/packer/azure/ubuntu-2404.json new file mode 100644 index 0000000000..b4821d707a --- /dev/null +++ b/images/capi/packer/azure/ubuntu-2404.json @@ -0,0 +1,9 @@ +{ + "build_name": "ubuntu-2404", + "distribution": "ubuntu", + "distribution_release": "noble", + "distribution_version": "2404", + "image_offer": "ubuntu-24_04-lts", + "image_publisher": "Canonical", + "image_sku": "server-gen1" +}