From 9a5608d8019811c32113acb2549a0485a4672b8d Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Mon, 1 Dec 2025 13:26:43 +1300 Subject: [PATCH 1/2] Make vCPU/Disk/Memory configurable in agent scenarios Previously whenever an agent scenario was specified, it overrode the vCPU count, disk size, and memory size from the config file. Change this so that the agent scenario values are used as a default, but the configuration can override with the usual environment variables like MASTER_MEMORY. --- common.sh | 109 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 48 deletions(-) diff --git a/common.sh b/common.sh index 634247b9e..37f8b5290 100644 --- a/common.sh +++ b/common.sh @@ -286,22 +286,6 @@ export ARBITER_HOSTNAME_FORMAT=${ARBITER_HOSTNAME_FORMAT:-"arbiter-%d"} export WORKER_HOSTNAME_FORMAT=${WORKER_HOSTNAME_FORMAT:-"worker-%d"} export EXTRA_WORKER_HOSTNAME_FORMAT=${EXTRA_WORKER_HOSTNAME_FORMAT:-"extraworker-%d"} -export MASTER_MEMORY=${MASTER_MEMORY:-16384} -export MASTER_DISK=${MASTER_DISK:-60} -export MASTER_VCPU=${MASTER_VCPU:-8} - -export ARBITER_MEMORY=${ARBITER_MEMORY:-8192} -export ARBITER_DISK=${ARBITER_DISK:-50} -export ARBITER_VCPU=${ARBITER_VCPU:-4} - -export WORKER_MEMORY=${WORKER_MEMORY:-8192} -export WORKER_DISK=${WORKER_DISK:-60} -export WORKER_VCPU=${WORKER_VCPU:-4} - -export EXTRA_WORKER_MEMORY=${EXTRA_WORKER_MEMORY:-${WORKER_MEMORY}} -export EXTRA_WORKER_DISK=${EXTRA_WORKER_DISK:-${WORKER_DISK}} -export EXTRA_WORKER_VCPU=${EXTRA_WORKER_VCPU:-${WORKER_VCPU}} - # Ironic vars (Image can be use _LOCAL_IMAGE to override) export IRONIC_IMAGE=${IRONIC_IMAGE:-"quay.io/metal3-io/ironic:main"} export IRONIC_DATA_DIR="${WORKING_DIR}/ironic" @@ -465,59 +449,59 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then case "$SCENARIO" in "5CONTROL" ) export NUM_MASTERS=5 - export MASTER_VCPU=4 - export MASTER_DISK=100 - export MASTER_MEMORY=24576 + export MASTER_VCPU=${MASTER_VCPU:-4} + export MASTER_DISK=${MASTER_DISK:-100} + export MASTER_MEMORY=${MASTER_MEMORY:-24576} export NUM_WORKERS=0 ;; "4CONTROL" ) export NUM_MASTERS=4 - export MASTER_VCPU=4 - export MASTER_DISK=100 - export MASTER_MEMORY=24576 + export MASTER_VCPU=${MASTER_VCPU:-4} + export MASTER_DISK=${MASTER_DISK:-100} + export MASTER_MEMORY=${MASTER_MEMORY:-24576} export NUM_WORKERS=0 ;; "COMPACT" ) export NUM_MASTERS=3 - export MASTER_VCPU=4 - export MASTER_DISK=100 - export MASTER_MEMORY=32768 + export MASTER_VCPU=${MASTER_VCPU:-4} + export MASTER_DISK=${MASTER_DISK:-100} + export MASTER_MEMORY=${MASTER_MEMORY:-32768} export NUM_WORKERS=0 ;; "TNA" ) export NUM_MASTERS=2 - export MASTER_VCPU=8 - export MASTER_DISK=100 - export MASTER_MEMORY=32768 + export MASTER_VCPU=${MASTER_VCPU:-8} + export MASTER_DISK=${MASTER_DISK:-100} + export MASTER_MEMORY=${MASTER_MEMORY:-32768} export NUM_ARBITERS=1 - export ARBITER_VCPU=2 - export ARBITER_MEMORY=8192 - export ARBITER_DISK=50 + export ARBITER_VCPU=${ARBITER_VCPU:-2} + export ARBITER_MEMORY=${ARBITER_MEMORY:-8192} + export ARBITER_DISK=${ARBITER_DISK:-50} export NUM_WORKERS=0 ;; "TNF" ) export NUM_MASTERS=2 - export MASTER_VCPU=8 - export MASTER_DISK=100 - export MASTER_MEMORY=32768 + export MASTER_VCPU=${MASTER_VCPU:-8} + export MASTER_DISK=${MASTER_DISK:-100} + export MASTER_MEMORY=${MASTER_MEMORY:-32768} export NUM_WORKERS=0 export ENABLE_TWO_NODE_FENCING="true" ;; "HA" ) export NUM_MASTERS=3 - export MASTER_VCPU=4 - export MASTER_DISK=100 - export MASTER_MEMORY=32768 + export MASTER_VCPU=${MASTER_VCPU:-4} + export MASTER_DISK=${MASTER_DISK:-100} + export MASTER_MEMORY=${MASTER_MEMORY:-32768} export NUM_WORKERS=2 export WORKER_VCPU=4 - export WORKER_DISK=100 - export WORKER_MEMORY=9000 + export WORKER_DISK=${WORKER_DISK:-100} + export WORKER_MEMORY=${WORKER_MEMORY:-9000} ;; "SNO" ) export NUM_MASTERS=1 - export MASTER_VCPU=8 - export MASTER_DISK=100 - export MASTER_MEMORY=32768 + export MASTER_VCPU=${MASTER_VCPU:-8} + export MASTER_DISK=${MASTER_DISK:-100} + export MASTER_MEMORY=${MASTER_MEMORY:-32768} export NUM_WORKERS=0 export NETWORK_TYPE="OVNKubernetes" export AGENT_PLATFORM_TYPE="${AGENT_PLATFORM_TYPE:-"none"}" @@ -533,17 +517,25 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then # Increase master vCPU for agent OVE ISO installs or when certain operators like 'mtv' are used, # as some operators require more CPUs. if [ "${AGENT_E2E_TEST_BOOT_MODE}" == "ISO_NO_REGISTRY" ]; then - export MASTER_VCPU=9 + if ((MASTER_VCPU < 9)); then + export MASTER_VCPU=9 + fi if [ "${SCENARIO}" == "SNO" ]; then - export MASTER_VCPU=16 + if ((MASTER_VCPU < 16)); then + export MASTER_VCPU=16 + fi fi if [ "${SCENARIO}" == "HA" ]; then - export WORKER_VCPU=5 + if ((WORKER_VCPU < 5)); then + export WORKER_VCPU=5 + fi fi fi if [ "$AGENT_OPERATORS" =~ "mtv" ]; then - export MASTER_VCPU=9 + if ((MASTER_VCPU < 9)); then + export MASTER_VCPU=9 + fi fi if [ ! -z "${AGENT_DEPLOY_MCE}" ]; then @@ -552,8 +544,12 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then export VM_EXTRADISKS_LIST="vda vdb" export VM_EXTRADISKS_SIZE="10G" - export MASTER_VCPU=8 - export MASTER_MEMORY=32768 + if ((MASTER_VCPU < 8)); then + export MASTER_VCPU=8 + fi + if ((MASTER_MEMORY < 32768)); then + export MASTER_MEMORY=32768 + fi fi if [[ $IP_STACK != 'v4' ]] && [[ $IP_STACK != 'v6' ]] && [[ $IP_STACK != 'v4v6' ]]; then @@ -619,6 +615,23 @@ fi export AGENT_TEST_CASES=${AGENT_TEST_CASES:-} +export MASTER_MEMORY=${MASTER_MEMORY:-16384} +export MASTER_DISK=${MASTER_DISK:-60} +export MASTER_VCPU=${MASTER_VCPU:-8} + +export ARBITER_MEMORY=${ARBITER_MEMORY:-8192} +export ARBITER_DISK=${ARBITER_DISK:-50} +export ARBITER_VCPU=${ARBITER_VCPU:-4} + +export WORKER_MEMORY=${WORKER_MEMORY:-8192} +export WORKER_DISK=${WORKER_DISK:-60} +export WORKER_VCPU=${WORKER_VCPU:-4} + +export EXTRA_WORKER_MEMORY=${EXTRA_WORKER_MEMORY:-${WORKER_MEMORY}} +export EXTRA_WORKER_DISK=${EXTRA_WORKER_DISK:-${WORKER_DISK}} +export EXTRA_WORKER_VCPU=${EXTRA_WORKER_VCPU:-${WORKER_VCPU}} + + export PERSISTENT_IMAGEREG=${PERSISTENT_IMAGEREG:-false} if [ "${OPENSHIFT_CI}" == true ] ; then # Disruptive CI tests require a image-registry backed by persistent storage From 77d212470fed3cfbaef7853782e829a730d0e392 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Mon, 1 Dec 2025 16:15:05 +1300 Subject: [PATCH 2/2] Restore agent MASTER_MEMORY default to 16GiB The default MASTER_MEMORY was changed in some agent scenarios in order to work around a problem in OKD where FCOS would use only 20% of RAM for the ephemeral storage instead of 50%. Other scenarios were later changed to match when tests started failing in 4.19 due to OCPBUGS-62790. Return the defaults to the minimum values validated by assisted-service in ABI, so that any future regressions like OCPBUGS-62790 are caught immediately. --- common.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common.sh b/common.sh index 37f8b5290..8a6981e21 100644 --- a/common.sh +++ b/common.sh @@ -451,28 +451,28 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then export NUM_MASTERS=5 export MASTER_VCPU=${MASTER_VCPU:-4} export MASTER_DISK=${MASTER_DISK:-100} - export MASTER_MEMORY=${MASTER_MEMORY:-24576} + export MASTER_MEMORY=${MASTER_MEMORY:-16384} export NUM_WORKERS=0 ;; "4CONTROL" ) export NUM_MASTERS=4 export MASTER_VCPU=${MASTER_VCPU:-4} export MASTER_DISK=${MASTER_DISK:-100} - export MASTER_MEMORY=${MASTER_MEMORY:-24576} + export MASTER_MEMORY=${MASTER_MEMORY:-16384} export NUM_WORKERS=0 ;; "COMPACT" ) export NUM_MASTERS=3 export MASTER_VCPU=${MASTER_VCPU:-4} export MASTER_DISK=${MASTER_DISK:-100} - export MASTER_MEMORY=${MASTER_MEMORY:-32768} + export MASTER_MEMORY=${MASTER_MEMORY:-16384} export NUM_WORKERS=0 ;; "TNA" ) export NUM_MASTERS=2 export MASTER_VCPU=${MASTER_VCPU:-8} export MASTER_DISK=${MASTER_DISK:-100} - export MASTER_MEMORY=${MASTER_MEMORY:-32768} + export MASTER_MEMORY=${MASTER_MEMORY:-16384} export NUM_ARBITERS=1 export ARBITER_VCPU=${ARBITER_VCPU:-2} export ARBITER_MEMORY=${ARBITER_MEMORY:-8192} @@ -483,7 +483,7 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then export NUM_MASTERS=2 export MASTER_VCPU=${MASTER_VCPU:-8} export MASTER_DISK=${MASTER_DISK:-100} - export MASTER_MEMORY=${MASTER_MEMORY:-32768} + export MASTER_MEMORY=${MASTER_MEMORY:-16384} export NUM_WORKERS=0 export ENABLE_TWO_NODE_FENCING="true" ;; @@ -491,7 +491,7 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then export NUM_MASTERS=3 export MASTER_VCPU=${MASTER_VCPU:-4} export MASTER_DISK=${MASTER_DISK:-100} - export MASTER_MEMORY=${MASTER_MEMORY:-32768} + export MASTER_MEMORY=${MASTER_MEMORY:-16384} export NUM_WORKERS=2 export WORKER_VCPU=4 export WORKER_DISK=${WORKER_DISK:-100} @@ -501,7 +501,7 @@ if [[ ! -z ${AGENT_E2E_TEST_SCENARIO} ]]; then export NUM_MASTERS=1 export MASTER_VCPU=${MASTER_VCPU:-8} export MASTER_DISK=${MASTER_DISK:-100} - export MASTER_MEMORY=${MASTER_MEMORY:-32768} + export MASTER_MEMORY=${MASTER_MEMORY:-16384} export NUM_WORKERS=0 export NETWORK_TYPE="OVNKubernetes" export AGENT_PLATFORM_TYPE="${AGENT_PLATFORM_TYPE:-"none"}"