From 7e6f4f6e379660441a7374c38b21582bd16909b0 Mon Sep 17 00:00:00 2001 From: Yutong Zhang <90831468+yutongzhang-microsoft@users.noreply.github.com> Date: Wed, 30 Nov 2022 22:36:29 +0800 Subject: [PATCH] Set worker numbers using variables in azure pipeline library (#6927) Approach What is the motivation for this PR? Previously, we hard code the min and max numbers of instance in a plan. In this pr, we support passing the instance numbers of a testplan. How did you do it? Use a variable to set the instance number. How did you verify/test it? Any platform specific information? Supported testbed topology if it's a new test case? --- .../run-test-scheduler-template.yml | 4 +-- azure-pipelines.yml | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.azure-pipelines/run-test-scheduler-template.yml b/.azure-pipelines/run-test-scheduler-template.yml index de7f724084b..f728ec0bdb1 100644 --- a/.azure-pipelines/run-test-scheduler-template.yml +++ b/.azure-pipelines/run-test-scheduler-template.yml @@ -11,11 +11,11 @@ parameters: default: 36000 - name: MIN_WORKER - type: number + type: string default: 1 - name: MAX_WORKER - type: number + type: string default: 2 - name: NUM_ASIC diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c6824d430a0..eb63f929d6f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -73,8 +73,8 @@ stages: - template: .azure-pipelines/run-test-scheduler-template.yml parameters: TOPOLOGY: t0 - MIN_WORKER: 2 - MAX_WORKER: 3 + MIN_WORKER: $(T0_INSTANCE_NUM) + MAX_WORKER: $(T0_INSTANCE_NUM) - job: t0_2vlans_testbedv2 displayName: "kvmtest-t0-2vlans by TestbedV2" @@ -86,7 +86,8 @@ stages: parameters: TOPOLOGY: t0 TEST_SET: t0-2vlans - MAX_WORKER: 1 + MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM) + MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" - job: @@ -146,8 +147,8 @@ stages: - template: .azure-pipelines/run-test-scheduler-template.yml parameters: TOPOLOGY: t1-lag - MIN_WORKER: 2 - MAX_WORKER: 3 + MIN_WORKER: $(T1_LAG_INSTANCE_NUM) + MAX_WORKER: $(T1_LAG_INSTANCE_NUM) - job: displayName: "kvmtest-t1-lag" @@ -193,8 +194,8 @@ stages: - template: .azure-pipelines/run-test-scheduler-template.yml parameters: TOPOLOGY: t0-64-32 - MIN_WORKER: 1 - MAX_WORKER: 2 + MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) + MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) TEST_SET: t0-sonic COMMON_EXTRA_PARAMS: "--neighbor_type=sonic --enable_macsec --macsec_profile=128_SCI,256_XPN_SCI" VM_TYPE: vsonic @@ -225,8 +226,8 @@ stages: - template: .azure-pipelines/run-test-scheduler-template.yml parameters: TOPOLOGY: dualtor - MIN_WORKER: 1 - MAX_WORKER: 1 + MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM) + MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM) COMMON_EXTRA_PARAMS: "--disable_loganalyzer " - job: @@ -255,8 +256,8 @@ stages: parameters: TOPOLOGY: t1-8-lag TEST_SET: multi-asic-t1-lag - MIN_WORKER: 1 - MAX_WORKER: 1 + MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM) + MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM) NUM_ASIC: 4 - job: wan_testbedv2 @@ -268,6 +269,6 @@ stages: - template: .azure-pipelines/run-test-scheduler-template.yml parameters: TOPOLOGY: wan-pub - MIN_WORKER: 1 - MAX_WORKER: 1 + MIN_WORKER: $(WAN_INSTANCE_NUM) + MAX_WORKER: $(WAN_INSTANCE_NUM) COMMON_EXTRA_PARAMS: "--skip_sanity "