Skip to content

Commit

Permalink
Add WS2025 SIG image
Browse files Browse the repository at this point in the history
    - Adds commands for Windows Server 2025 SIG images
    - Adds Purchase Plan info for Azure Market Place Images
  • Loading branch information
TinaMor committed Aug 27, 2024
1 parent c576a4b commit 08e70d9
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 4 deletions.
2 changes: 2 additions & 0 deletions images/capi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ build-azure-sig-azurelinux-3: ## Builds Azure Linux 3 Azure managed image in Sha
build-azure-sig-rhel-8: ## Builds RHEL 8 Azure managed image in Shared Image Gallery
build-azure-sig-windows-2019-containerd: ## Builds Windows Server 2019 with containerd Azure managed image in Shared Image Gallery
build-azure-sig-windows-2022-containerd: ## Builds Windows Server 2022 with containerd Azure managed image in Shared Image Gallery
build-azure-sig-windows-2025-containerd: ## Builds Windows Server 2025 with containerd Azure managed image in Shared Image Gallery
build-azure-sig-windows-2019-containerd-cvm: ## Builds Windows Server 2019 with containerd CVM Azure managed image in Shared Image Gallery
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
Expand Down Expand Up @@ -871,6 +872,7 @@ validate-azure-sig-ubuntu-2204: ## Validates Ubuntu 22.04 Azure managed image in
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-2025-containerd: ## Validate Windows Server 2025 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
validate-azure-vhd-centos-7: ## Validates CentOS 7 VHD image Azure Packer config
validate-azure-vhd-mariner-2: ## Validates Azure Linux 2 VHD image Azure Packer config
Expand Down
4 changes: 2 additions & 2 deletions images/capi/azure_targets.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VHD_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 mariner-2 azurelinux-3 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 azurelinux-3 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_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 mariner-2 azurelinux-3 rhel-8 windows-2019-containerd windows-2022-containerd windows-2025-containerd flatcar"
SIG_CI_TARGETS="ubuntu-2204 ubuntu-2404 mariner-2 windows-2019-containerd windows-2022-containerd windows-2025-containerd flatcar"
SIG_GEN2_TARGETS="ubuntu-2004 ubuntu-2204 ubuntu-2404 centos-7 mariner-2 azurelinux-3 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"
Expand Down
5 changes: 5 additions & 0 deletions images/capi/packer/azure/packer-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
"name": "sig-{{user `build_name`}}",
"os_disk_size_gb": "{{user `os_disk_size_gb`}}",
"os_type": "Windows",
"plan_info": {
"plan_name": "{{user `plan_image_sku`}}",
"plan_product": "{{user `plan_image_offer`}}",
"plan_publisher": "{{user `plan_image_publisher`}}"
},
"private_virtual_network_with_public_ip": "{{user `private_virtual_network_with_public_ip`}}",
"shared_gallery_image_version_exclude_from_latest": "{{ user `exclude_from_latest` }}",
"shared_image_gallery": {
Expand Down
25 changes: 23 additions & 2 deletions images/capi/packer/azure/scripts/init-sig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,22 @@ az account set -s ${AZURE_SUBSCRIPTION_ID} >/dev/null 2>&1
eval "$tracestate"

export RESOURCE_GROUP_NAME="${RESOURCE_GROUP_NAME:-cluster-api-images}"
export AZURE_LOCATION="${AZURE_LOCATION:-northcentralus}"
export AZURE_LOCATION="${AZURE_LOCATION:-southcentralus}"

# TODO: [AUGUST 2024] Remove purchase plan info when the image is GA
# Creating Azure VMs from a Marketplace Image requires a Purchase Plan
# https://learn.microsoft.com/en-us/azure/virtual-machines/marketplace-images
export PLAN_PUBLISHER="${PLAN_PUBLISHER:-''}"
export PLAN_OFFER="${PLAN_OFFER:-''}"
export PLAN_NAME="${PLAN_NAME:-''}"
export OS_VERSION="${OS_VERSION:-'latest'}"

# TODO: [AUGUST 2024] Remove after testing Windows Server 2025 preview
# Build fails wth: "You have not accepted the legal terms on this subscription"
# publisher:offer:sku:version
echo "Accept Azure marketplace terms"
az vm image terms accept --urn ${PLAN_PUBLISHER}:${PLAN_OFFER}:${PLAN_NAME}:${OS_VERSION}

if ! az group show -n ${RESOURCE_GROUP_NAME} -o none 2>/dev/null; then
az group create -n ${RESOURCE_GROUP_NAME} -l ${AZURE_LOCATION} --tags ${TAGS:-}
fi
Expand Down Expand Up @@ -50,7 +65,10 @@ create_image_definition() {
--sku ${SIG_SKU:-$2} \
--hyper-v-generation ${3} \
--os-type ${4} \
--features ${5:-''}
--features ${5:-''} \
--plan-name ${PLAN_NAME} \
--plan-product ${PLAN_OFFER} \
--plan-publisher ${PLAN_PUBLISHER}
}

SIG_TARGET=$1
Expand Down Expand Up @@ -83,6 +101,9 @@ case ${SIG_TARGET} in
windows-2022-containerd)
create_image_definition ${SIG_TARGET} "win-2022-containerd" "V1" "Windows"
;;
windows-2025-containerd)
create_image_definition ${SIG_TARGET} "win-2025-containerd" "V2" "Windows"
;;
windows-annual-containerd)
create_image_definition ${SIG_TARGET} "win-annual-containerd" "V1" "Windows"
;;
Expand Down
11 changes: 11 additions & 0 deletions images/capi/packer/azure/scripts/init-vhd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ fi
az account set -s ${AZURE_SUBSCRIPTION_ID} >/dev/null 2>&1
eval "$tracestate"

# TODO: [02-August-2024] Remove after testing Windows Server 2025 preview
# Build fails wth: "You have not accepted the legal terms on this subscription"
# publisher:offer:sku:version
echo "Accept Azure marketplace terms"
az vm image terms accept --urn ${PLAN_PUBLISHER}:${PLAN_OFFER}:${PLAN_NAME}:latest

echo "Create storage account"
export RESOURCE_GROUP_NAME="${RESOURCE_GROUP_NAME:-cluster-api-images}"
export AZURE_LOCATION="${AZURE_LOCATION:-northcentralus}"
Expand All @@ -35,4 +41,9 @@ export STORAGE_ACCOUNT_NAME="${STORAGE_ACCOUNT_NAME:-capi${CREATE_TIME}${RANDOM_
az storage account check-name --name ${STORAGE_ACCOUNT_NAME}
az storage account create -n ${STORAGE_ACCOUNT_NAME} -g ${RESOURCE_GROUP_NAME} -l ${AZURE_LOCATION} --allow-blob-public-access false

# TODO: [02-August-2024] Remove after testing Windows Server 2025 preview
# For this image, we need to create a managed disk from the VHD.
# https://developer.hashicorp.com/packer/integrations/hashicorp/azure/latest/components/builder/arm#required:
# export MANAGED_IMAGE_NAME="${MANAGED_IMAGE_NAME}:-CAPIManagedImage"

echo "done"
18 changes: 18 additions & 0 deletions images/capi/packer/azure/windows-2025-containerd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"additional_registry_images": "false",
"additional_registry_images_list": "",
"build_name": "windows-2025-containerd",
"distribution": "windows",
"distribution_version": "2025",
"image_offer": "microsoftserveroperatingsystems-previews",
"image_publisher": "MicrosoftWindowsServer",
"image_sku": "windows-server-2025-azure-edition-hotpatch",
"image_version": "latest",
"load_additional_components": "false",
"runtime": "containerd",
"vm_size": "Standard_D4s_v3",
"windows_updates_kbs": "",
"plan_image_sku": "windows-server-2025-azure-edition-hotpatch",
"plan_image_offer": "microsoftserveroperatingsystems-previews",
"plan_image_publisher": "microsoftwindowsserver"
}

0 comments on commit 08e70d9

Please sign in to comment.