Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions modules/python/clusterloader2/large_cluster/large_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def configure_clusterloader2(
provider,
cilium_enabled,
scrape_containerd,
override_file
override_file,
prometheus_cpu_scale_factor=30.0,
prometheus_memory_limit_factor=100.0,
prometheus_memory_scale_factor=100.0,
):

steps = node_count // node_per_step
Expand All @@ -64,9 +67,9 @@ def configure_clusterloader2(
file.write(f"CL2_STEPS: {steps}\n")
file.write(f"CL2_OPERATION_TIMEOUT: {operation_timeout}\n")
file.write("CL2_PROMETHEUS_TOLERATE_MASTER: true\n")
file.write("CL2_PROMETHEUS_MEMORY_LIMIT_FACTOR: 100.0\n")
file.write("CL2_PROMETHEUS_MEMORY_SCALE_FACTOR: 100.0\n")
file.write("CL2_PROMETHEUS_CPU_SCALE_FACTOR: 30.0\n")
file.write(f"CL2_PROMETHEUS_MEMORY_LIMIT_FACTOR: {prometheus_memory_limit_factor}\n")
file.write(f"CL2_PROMETHEUS_MEMORY_SCALE_FACTOR: {prometheus_memory_scale_factor}\n")
file.write(f"CL2_PROMETHEUS_CPU_SCALE_FACTOR: {prometheus_cpu_scale_factor}\n")
file.write("CL2_PROMETHEUS_NODE_SELECTOR: \"prometheus: \\\"true\\\"\"\n")
file.write("CL2_POD_STARTUP_LATENCY_THRESHOLD: 3m\n")

Expand Down Expand Up @@ -207,6 +210,12 @@ def main():
help="Whether cilium is enabled. Must be either True or False")
parser_configure.add_argument("--scrape_containerd", type=str2bool, choices=[True, False], default=False,
help="Whether to scrape containerd metrics. Must be either True or False")
parser_configure.add_argument("--prometheus_cpu_scale_factor", type=float, default=30.0,
help="Prometheus CPU request scale factor")
parser_configure.add_argument("--prometheus_memory_limit_factor", type=float, default=100.0,
help="Prometheus memory limit scale factor")
parser_configure.add_argument("--prometheus_memory_scale_factor", type=float, default=100.0,
help="Prometheus memory request scale factor")
parser_configure.add_argument("--cl2_override_file", type=str, help="Path to the overrides of CL2 config file")

# Sub-command for validate_clusterloader2
Expand Down Expand Up @@ -251,6 +260,9 @@ def main():
args.cilium_enabled,
args.scrape_containerd,
args.cl2_override_file,
args.prometheus_cpu_scale_factor,
args.prometheus_memory_limit_factor,
args.prometheus_memory_scale_factor,
)
elif args.command == "validate":
validate_clusterloader2(
Expand Down
25 changes: 24 additions & 1 deletion modules/python/tests/test_large_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,28 @@ def test_configure_clusterloader2_basic_azure_config(self):

self.assertIn("CL2_NODES: 20", content)
self.assertIn("CL2_LOAD_TEST_THROUGHPUT: 100", content)
self.assertIn("CL2_PROMETHEUS_CPU_SCALE_FACTOR: 30.0", content)
self.assertIn("CL2_PROMETHEUS_MEMORY_LIMIT_FACTOR: 100.0", content)
self.assertIn("CL2_PROMETHEUS_MEMORY_SCALE_FACTOR: 100.0", content)

def test_configure_clusterloader2_custom_prometheus_resources(self):
"""Test scenario-specific Prometheus resource factors."""
configure_clusterloader2(
cpu_per_node=2, node_count=1000, node_per_step=1000,
pods_per_node=20, repeats=10, operation_timeout="15m",
provider="azure", cilium_enabled=False,
scrape_containerd=False, override_file=self.temp_path,
prometheus_cpu_scale_factor=3.6,
prometheus_memory_limit_factor=4.0,
prometheus_memory_scale_factor=4.0,
)

with open(self.temp_path, "r", encoding='utf-8') as f:
content = f.read()

self.assertIn("CL2_PROMETHEUS_CPU_SCALE_FACTOR: 3.6", content)
self.assertIn("CL2_PROMETHEUS_MEMORY_LIMIT_FACTOR: 4.0", content)
self.assertIn("CL2_PROMETHEUS_MEMORY_SCALE_FACTOR: 4.0", content)

def test_configure_clusterloader2_cilium_enabled(self):
"""Test configuration with Cilium enabled"""
Expand Down Expand Up @@ -717,7 +739,8 @@ def test_main_configure_command(self, mock_configure):
main()

mock_configure.assert_called_once_with(
4, 20, 5, 10, 3, '30m', 'aws', False, False, '/tmp/override.yaml'
4, 20, 5, 10, 3, '30m', 'aws', False, False, '/tmp/override.yaml',
30.0, 100.0, 100.0
)

@patch('clusterloader2.large_cluster.large_cluster.validate_clusterloader2')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ schedules:

variables:
SCENARIO_TYPE: perf-eval
SCENARIO_NAME: pod-churn-50k-sched
SCENARIO_NAME: pod-churn-20k-sched

# We only run with the override scheduler configuration, since we have baseline
# data for AWS and Azure from the "SLO service discovery" pod churn test. This
Expand All @@ -28,17 +28,20 @@ stages:
- eastus
engine: clusterloader2
engine_input:
image: "ghcr.io/azure/clusterloader2:v20241022"
image: "ghcr.io/azure/clusterloader2:v20260220"
topology: service-churn
matrix:
azure_cni:
cpu_per_node: 4
cpu_per_node: 2
node_count: 1000
node_per_step: 1000
pods_per_node: 20
repeats: 10
scale_timeout: "15m"
cilium_enabled: False
prometheus_cpu_scale_factor: 3.6
prometheus_memory_scale_factor: 4.0
prometheus_memory_limit_factor: 4.0
cl2_config_file: service-churn.yaml
max_parallel: 1
timeout_in_minutes: 720
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scenario_type = "perf-eval"
scenario_name = "pod-churn-50k-sched"
scenario_name = "pod-churn-20k-sched"
deletion_delay = "8h"
owner = "aks"

Expand Down Expand Up @@ -36,9 +36,9 @@ aks_config_list = [
}
default_node_pool = {
name = "default"
node_count = 5
node_count = 3
auto_scaling_enabled = false
vm_size = "Standard_D8_v3"
vm_size = "Standard_D2_v3"
os_disk_type = "Managed"
only_critical_addons_enabled = false
temporary_name_for_rotation = "defaulttmp"
Expand All @@ -48,15 +48,15 @@ aks_config_list = [
name = "prompool"
node_count = 1
auto_scaling_enabled = false
vm_size = "Standard_D64_v3"
vm_size = "Standard_D4_v3"
max_pods = 110
node_labels = { "prometheus" = "true" }
},
{
name = "userpool0"
node_count = 300
auto_scaling_enabled = false
vm_size = "Standard_D4_v3"
vm_size = "Standard_D2_v3"
max_pods = 110
node_taints = ["slo=true:NoSchedule"]
node_labels = { "slo" = "true" }
Expand All @@ -65,7 +65,7 @@ aks_config_list = [
name = "userpool1"
node_count = 300
auto_scaling_enabled = false
vm_size = "Standard_D4_v3"
vm_size = "Standard_D2_v3"
max_pods = 110
node_taints = ["slo=true:NoSchedule"]
node_labels = { "slo" = "true" }
Expand All @@ -74,7 +74,7 @@ aks_config_list = [
name = "userpool2"
node_count = 400
auto_scaling_enabled = false
vm_size = "Standard_D4_v3"
vm_size = "Standard_D2_v3"
max_pods = 110
node_taints = ["slo=true:NoSchedule"]
node_labels = { "slo" = "true" }
Expand Down
3 changes: 3 additions & 0 deletions steps/engine/clusterloader2/large-cluster/execute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ steps:
--provider $CLOUD \
--cilium_enabled $CILIUM_ENABLED \
--scrape_containerd ${SCRAPE_CONTAINERD:-False} \
--prometheus_cpu_scale_factor ${PROMETHEUS_CPU_SCALE_FACTOR:-30.0} \
--prometheus_memory_limit_factor ${PROMETHEUS_MEMORY_LIMIT_FACTOR:-100.0} \
--prometheus_memory_scale_factor ${PROMETHEUS_MEMORY_SCALE_FACTOR:-100.0} \
--cl2_override_file ${CL2_CONFIG_DIR}/overrides.yaml
PYTHONPATH=$PYTHONPATH:$(pwd) python3 $PYTHON_SCRIPT_FILE execute \
--cl2_image ${CL2_IMAGE} \
Expand Down
2 changes: 1 addition & 1 deletion steps/topology/service-churn/validate-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ steps:
region: ${{ parameters.regions[0] }}
- template: /steps/engine/clusterloader2/large-cluster/validate.yml
parameters:
desired_nodes: 1006
desired_nodes: 1004
validation_timeout_in_minutes: 30
Loading