diff --git a/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh b/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh index 034c28138a756..bea728d0459b3 100755 --- a/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh +++ b/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-commands.sh @@ -13,9 +13,35 @@ expiration_date=$(date -d '8 hours' --iso=minutes --utc) function join_by { local IFS="$1"; shift; echo "$*"; } REGION="${LEASED_RESOURCE}" + +# m6a (AMD) are more cost effective than other x86 instance types +# for general purpose work. Use by default, when supported in the +# region. +IS_M6A_REGION="no" +if aws ec2 describe-instance-type-offerings --region "${REGION}" | grep m6a ; then + IS_M6A_REGION="yes" +fi + +# Do not change auto-types unless it is coordinated with the cloud +# financial operations team. Savings plans may be in place to +# decrease the cost of certain instance families. +if [[ "${COMPUTE_NODE_TYPE}" == "" ]]; then + if [[ "${IS_M6A_REGION}" == "yes" ]]; then + COMPUTE_NODE_TYPE="m6a.xlarge" + else + COMPUTE_NODE_TYPE="m6i.xlarge" + fi +fi + # BootstrapInstanceType gets its value from pkg/types/aws/defaults/platform.go architecture=${OCP_ARCH:-"amd64"} -arch_instance_type=m6i + +if [[ "${IS_M6A_REGION}" == "yes" ]]; then + arch_instance_type=m6a +else + arch_instance_type=m6i +fi + if [[ "${CLUSTER_TYPE}" == "aws-arm64" ]]; then architecture="arm64" fi @@ -29,7 +55,8 @@ workers=3 if [[ "${SIZE_VARIANT}" == "compact" ]]; then workers=0 fi -master_type=null + +master_type=${arch_instance_type}.xlarge if [[ "${SIZE_VARIANT}" == "xlarge" ]]; then master_type=${arch_instance_type}.8xlarge elif [[ "${SIZE_VARIANT}" == "large" ]]; then diff --git a/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml b/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml index f5bf638f52ee2..98e4192cc7bec 100644 --- a/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml +++ b/ci-operator/step-registry/ipi/conf/aws/ipi-conf-aws-ref.yaml @@ -25,10 +25,10 @@ ref: in some regions or accounts due to quota issues. - name: COMPUTE_NODE_TYPE - default: "m6i.xlarge" + default: "" documentation: |- - The instance type to use for compute nodes (e.g. AWS https://aws.amazon.com/ec2/instance-types/). We use a 4 core worker to match the median configuration of the fleet. - Do not change family type without consulting with FinOPs about active AWS savings plans. + The instance type to use for compute nodes (e.g. AWS https://aws.amazon.com/ec2/instance-types/). When "" (default), + the step uses the lowest cost 4 CPU / 16G supported worker instance type for the region. - name: OCP_ARCH default: "amd64" documentation: |-