Skip to content

Commit

Permalink
feat: enhance setup-tests.yml to log cluster usage and run ID selection
Browse files Browse the repository at this point in the history
refactor: update conditional syntax for use_secondary_cluster parameter in setup-tests.yml

DEBUG RUN_IDS

refactor: improve logging and condition handling in setup-tests.yml

fix: correct case sensitivity for use_secondary_cluster parameter in setup-tests.yml

Variables for the config

refactor: simplify configuration by using defaults in cilium-network-churn.yml

refactor: enhance parameterization in cilium-network-churn.yml for improved configurability

feat: add no_of_namespaces parameter for enhanced cluster configuration

refactor: remove redundant echo statements in setup-tests.yml
  • Loading branch information
mushiboy authored and agrawaliti committed Dec 19, 2024
1 parent 9a4eed7 commit e7ad48d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 17 deletions.
5 changes: 4 additions & 1 deletion modules/python/clusterloader2/slo/slo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def configure_clusterloader2(
pods_per_node,
repeats,
operation_timeout,
no_of_namespaces,
provider,
cilium_enabled,
service_test,
Expand All @@ -63,6 +64,7 @@ def configure_clusterloader2(
file.write(f"CL2_REPEATS: {repeats}\n")
file.write(f"CL2_STEPS: {steps}\n")
file.write(f"CL2_OPERATION_TIMEOUT: {operation_timeout}\n")
file.write(f"CL2_NO_OF_NAMESPACES: {no_of_namespaces}\n")
file.write("CL2_PROMETHEUS_TOLERATE_MASTER: true\n")
file.write("CL2_PROMETHEUS_MEMORY_LIMIT_FACTOR: 30.0\n")
file.write("CL2_PROMETHEUS_MEMORY_SCALE_FACTOR: 30.0\n")
Expand Down Expand Up @@ -212,6 +214,7 @@ def main():
parser_configure.add_argument("pods_per_node", type=int, help="Number of pods per node")
parser_configure.add_argument("repeats", type=int, help="Number of times to repeat the deployment churn")
parser_configure.add_argument("operation_timeout", type=str, help="Timeout before failing the scale up test")
parser_configure.add_argument("no_of_namespaces", type=int, default=1, help="Number of namespaces to create")
parser_configure.add_argument("provider", type=str, help="Cloud provider name")
parser_configure.add_argument("cilium_enabled", type=eval, choices=[True, False], default=False,
help="Whether cilium is enabled. Must be either True or False")
Expand Down Expand Up @@ -258,7 +261,7 @@ def main():

if args.command == "configure":
configure_clusterloader2(args.cpu_per_node, args.node_count, args.node_per_step, args.max_pods,
args.pods_per_node, args.repeats, args.operation_timeout, args.provider,
args.pods_per_node, args.repeats, args.operation_timeout, args.no_of_namespaces, args.provider,
args.cilium_enabled, args.service_test, args.network_test, args.cl2_override_file)
elif args.command == "validate":
validate_clusterloader2(args.node_count, args.operation_timeout)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
trigger: none

parameters:
- name: node_count
type: number
default: 100
- name: node_per_step
type: number
default: 10
- name: max_pods

Check failure on line 10 in pipelines/perf-eval/CNI Benchmark/network-churn/cilium-network-churn.yml

View workflow job for this annotation

GitHub Actions / yaml-validation

10:19 [trailing-spaces] trailing spaces
type: number
default: 100
- name: pods_per_node
type: number
default: 10
- name: repeats
type: number
default: 1
- name: scale_timeout
type: string
default: "15m"
- name: no_of_namespaces
type: number
default: 10

variables:
SCENARIO_TYPE: perf-eval
SCENARIO_NAME: cilium-network-churn
Expand All @@ -21,12 +44,13 @@ stages:
matrix:
azure_cilium:
cpu_per_node: 4
node_count: 100
node_per_step: 10 # node_per_namespace
max_pods: 100
pods_per_node: 10 # value is added to DeploymentSize
repeats: 1
scale_timeout: "15m"
node_count: ${{ parameters.node_count }}
node_per_step: ${{ parameters.node_per_step }}
max_pods: ${{ parameters.max_pods }}
pods_per_node: ${{ parameters.pods_per_node }}
repeats: ${{ parameters.repeats }}
scale_timeout: ${{ parameters.scale_timeout }}
no_of_namespaces: ${{ parameters.no_of_namespaces }}
cilium_enabled: True
network_policy: cilium
network_dataplane: cilium
Expand All @@ -52,12 +76,13 @@ stages:
matrix:
azure_cni:
cpu_per_node: 4
node_count: 100
node_per_step: 10 # node_per_namespace
max_pods: 100
pods_per_node: 10 # value is added to DeploymentSize
repeats: 1
scale_timeout: "15m"
node_count: ${{ parameters.node_count }}
node_per_step: ${{ parameters.node_per_step }}
max_pods: ${{ parameters.max_pods }}
pods_per_node: ${{ parameters.pods_per_node }}
repeats: ${{ parameters.repeats }}
scale_timeout: ${{ parameters.scale_timeout }}
no_of_namespaces: ${{ parameters.no_of_namespaces }}
cilium_enabled: False
service_test: False
network_test: True
Expand Down
2 changes: 1 addition & 1 deletion steps/engine/clusterloader2/slo/execute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
PYTHONPATH=$PYTHONPATH:$(pwd) python3 $PYTHON_SCRIPT_FILE configure \
$CPU_PER_NODE $NODE_COUNT $NODE_PER_STEP $MAX_PODS $PODS_PER_NODE \
$REPEATS $SCALE_TIMEOUT $CLOUD $CILIUM_ENABLED \
$REPEATS $SCALE_TIMEOUT $NO_OF_NAMESPACES $CLOUD $CILIUM_ENABLED \
$SERVICE_TEST $NETWORK_TEST ${CL2_CONFIG_DIR}/overrides.yaml
PYTHONPATH=$PYTHONPATH:$(pwd) python3 $PYTHON_SCRIPT_FILE execute \
${CL2_IMAGE} ${CL2_CONFIG_DIR} $CL2_REPORT_DIR $CL2_CONFIG_FILE \
Expand Down
8 changes: 5 additions & 3 deletions steps/setup-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ parameters:

steps:
- script: |
if [ "${ parameters.use_secondary_cluster }" == true ] && [ -n "${RUN_ID_2:-}" ]; then
set -eu
if [ "${{ parameters.use_secondary_cluster }}" == "True" ] && [ -n "${RUN_ID_2:-}" ]; then
echo "Using secondary cluster"
run_id=$RUN_ID_2
elif [ -n "${RUN_ID:-}" ]; then
echo "Using primary cluster"
run_id=$RUN_ID
else
run_id=$(Build.BuildId)-$(System.JobId)
Expand All @@ -39,8 +43,6 @@ steps:
env:
RUN_ID: ${{ parameters.run_id }}
RUN_ID_2: ${{ parameters.run_id_2 }}
USE_SECONDARY_CLUSTER: ${{ parameters.use_secondary_cluster }}

- script: |
run_url="$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=logs&j=$(System.JobId)"
echo "Run URL: $run_url"
Expand Down

0 comments on commit e7ad48d

Please sign in to comment.