Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1ea8aea
feat: implement cluster reuse pattern with dual-ID system for SwiftV2…
j-isaac-joseph Jan 28, 2026
3f7081b
fix: change reuse_cluster and skip_cleanup parameters from boolean to…
j-isaac-joseph Jan 28, 2026
9d4bf55
fix: cleanup resources.yaml remove white spaces
j-isaac-joseph Jan 28, 2026
6dcba91
fix: {{ if eq(parameters.skip_cleanup, 'false') }}:
j-isaac-joseph Jan 28, 2026
4a28b2f
fix: correct reuse_cluster and skip_cleanup conditions to use runtime…
j-isaac-joseph Jan 28, 2026
e1488e8
fix: remove invalid condition on template step
j-isaac-joseph Jan 28, 2026
961bba9
fix(pipeline): handle unexpanded ADO variables and clean up unnecessa…
j-isaac-joseph Jan 28, 2026
60181eb
feat(swiftv2-slo): optimize prepull for cluster reuse and add retry m…
j-isaac-joseph Jan 28, 2026
2a51bc5
fix: prevent bash command substitution in shared_run_id parameter
j-isaac-joseph Jan 28, 2026
157d05b
fix(provision): use runtime variable for shared_run_id instead of tem…
j-isaac-joseph Jan 28, 2026
79c137f
fix(provision): access shared_run_id as pipeline variable instead of …
j-isaac-joseph Jan 28, 2026
5e4a21c
refactor(cluster-reuse): eliminate SHARED_RUN_ID and use BASE_RUN_ID …
j-isaac-joseph Jan 28, 2026
281c207
docs: update running-swiftv2-pipeline to reflect SHARED_RUN_ID removal
j-isaac-joseph Jan 28, 2026
f0b019d
feat(swiftv2): ensure nodepools idempotent provisioning
j-isaac-joseph Jan 28, 2026
affaf7f
fix(azure): normalize boolean casing for reuse_cluster & skip_cleanup
j-isaac-joseph Jan 28, 2026
a09c93c
refactor(pipelines): remove terraform infrastructure management
j-isaac-joseph Jan 28, 2026
521aba0
fix(swiftv2): use BASE_RUN_ID for resource group in reuse cluster pat…
j-isaac-joseph Jan 28, 2026
7024971
fix: simplify pod group labels and fix nodepool label handling
j-isaac-joseph Jan 28, 2026
4914519
fix(swiftv2): always use BASE_RUN_ID for cluster identification
j-isaac-joseph Jan 29, 2026
31936b6
refactor(pipeline): per-stage run ID generation with idempotent provi…
j-isaac-joseph Jan 29, 2026
b72a26d
nit: remove redundant condition in first stage
j-isaac-joseph Jan 29, 2026
bcd444e
fix(pipelines): add job dependencies for BASE_RUN_ID propagation
j-isaac-joseph Jan 29, 2026
6b5d36b
fix(pipeline): export BASE_RUN_ID as pipeline variable for subsequent…
j-isaac-joseph Jan 29, 2026
da8a94d
fix(pipelines): resolve BASE_RUN_ID runtime expression not evaluated
j-isaac-joseph Jan 29, 2026
c44cb82
fix(azure): use RESOURCE_GROUP_NAME for cluster discovery
j-isaac-joseph Jan 29, 2026
9bd0ca1
fix(scale-cluster): account for already-labeled nodes in swiftv2slo l…
j-isaac-joseph Jan 29, 2026
2690da6
fix(cleanup): use AzureCLI@2 tasks for Azure authentication in pipeline
j-isaac-joseph Jan 29, 2026
8301735
fix(cl2): add jobIndex to namespace prefix for cluster reuse
j-isaac-joseph Jan 29, 2026
115edce
fix(cleanup): use AZURE_SERVICE_CONNECTION instead of AZURE_SUBSCRIPTION
j-isaac-joseph Jan 29, 2026
a68f631
fix(datapath-observer): copy pod labels to metadata.labels for label …
j-isaac-joseph Jan 29, 2026
697ab40
fix(cl2): make CL2_JOB_INDEX required and pass to CL2 config
j-isaac-joseph Jan 29, 2026
cef246d
fix(cleanup): require AZURE_SUBSCRIPTION_ID for cleanup scripts
j-isaac-joseph Jan 29, 2026
b5fb8b2
feat(swiftv2): add incremental pod deployment for cluster reuse
j-isaac-joseph Jan 29, 2026
4253f95
fix: cleanup rg set subscription
j-isaac-joseph Jan 29, 2026
99a5c6f
fix(cl2): use podsPerStep instead of actualPodsPerStep for deployment…
j-isaac-joseph Jan 29, 2026
2f27f28
fix(cl2): calculate steps based on delta pods instead of total capacity
j-isaac-joseph Jan 29, 2026
2d59ab4
feat(cl2): auto-detect existing pods from cluster at runtime
j-isaac-joseph Jan 29, 2026
5bfee9a
doc: udpate usage
j-isaac-joseph Jan 29, 2026
3cbe129
feat(cl2): add podgroup-job label for per-job PodStartupLatency measu…
j-isaac-joseph Jan 29, 2026
3710015
refactor(cl2): rename actualPodsPerStep to actualPodsThisJob for clarity
j-isaac-joseph Jan 29, 2026
c88e308
fix(swiftv2-slo): calculate PNIs per step instead of total pods
j-isaac-joseph Jan 30, 2026
297a010
fix(swiftv2-slo): add podgroup label to Deployment metadata for exist…
j-isaac-joseph Jan 30, 2026
86d49e8
fix(cleanup): make cleanup scripts resilient to failures
j-isaac-joseph Jan 30, 2026
930aff8
fix: dynamicres add missing podgroup label in deployment metadata
j-isaac-joseph Jan 31, 2026
f17f59a
fix(prepull): add label verification before DaemonSet creation
j-isaac-joseph Jan 31, 2026
1262d21
feat(cleanup): add SLOW_DELETE flag to control swiftv2 workload cleanup
j-isaac-joseph Jan 31, 2026
4b46d40
fix(pipeline): increase max_pods to 13 to account for azuresecurityli…
j-isaac-joseph Feb 1, 2026
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
40 changes: 33 additions & 7 deletions docs/running-swiftv2-pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,44 @@ Here is the pipeline [link](https://dev.azure.com/akstelescope/telescope/_build?

1. For a given region, make sure the regional customer [RG + AKS + identities] exist. If not, run the regional customer setup script `swiftv2kubeobjects/runCustomerSetup.sh`. Further instructions on how to run the script are mentioned in the script file. This is a one time setup and the resources are preserved for 3 months.
2. For a given region, make sure the regional ACR exists with mirrored images. If not, run the regional ACR setup script `swiftv2kubeobjects/setup-regional-acr.sh`. This creates a dedicated ACR per region to avoid throttling on shared team ACR and mirrors required images.
3. For a given region + VM-SKU, Check if the subscription has quota for the scale target.
3. For a given region + VM-SKU, check if the subscription has quota for the scale target.

## Pipeline variables, branches and test matrix

- As of 11/11/2025, no pipeline variables need to be touched in ADO. All the variables are hardcoded in `pipelines/system/new-pipeline-test.yml`. For example, location, subscription, vm-sku, number of nics, CLEANUP_RESOURCES etc.
- This is the official branch - `feature/swiftv2GA/swiftv2scale`, and it has comprehensive test matrix. Not all of which needs to be run for a given objective.
- It is recomended to create a test branch and disable/comment out unnnecessary test cases.
- All pipeline variables are hardcoded in `pipelines/system/new-pipeline-test.yml` (location, subscription, vm-sku, etc.)
- Set `CLEANUP: "false"` to preserve resources after pipeline completes (useful for debugging)
- Official branch: `feature/swiftv2GA/swiftv2scale`
- Recommended: Create a test branch and comment out unnecessary test cases

## Disabling stages and removing test matrix entries
## Disabling stages and matrix entries

- If certain stages are not required for the perf run, in `pipelines/system/new-pipeline-test.yml` flip `condition` flag to `false`. At the moment both `burst` stages are set to false.
- Each stage has a matrix file here - `pipelines/system/matrices`, where different combinations of pods, nodes and pods-per-step are set. Comment out the matrix entries that are irrelevant for the enabled stages.
- To disable stages, set `condition: false` in `pipelines/system/new-pipeline-test.yml` (burst stages are disabled by default)
- Matrix files are in `pipelines/system/matrices/` - comment out entries that are not needed

## Pipeline Architecture

Each stage has:
1. **`generate_run_id` job**: Creates a unique `BASE_RUN_ID` with stage prefix (sg, dg, sb, db)
2. **Matrix jobs**: Run tests using the shared `BASE_RUN_ID` for resource group naming
3. **`cleanup` job**: Runs after all matrix jobs complete (controlled by `CLEANUP` variable)

### Run ID and Job Isolation

- **`BASE_RUN_ID`**: Shared across all jobs in a stage, used for resource group naming and cluster tagging
- **`RUN_ID`**: Unique per job (BASE_RUN_ID + job suffix), used for result storage
- **`CL2_JOB_INDEX`**: Derived from `System.JobId`, used to isolate CL2 resources (namespaces, deployments, PNIs) across parallel jobs

This ensures test results don't overwrite each other while sharing infrastructure.

### Cleanup Behavior

Cleanup runs at the end of each stage and:
1. Deletes swiftv2 workloads (deployments, pods)
2. Removes nodepools sequentially
3. Deletes Azure resources (NAT gateways, NSGs, public IPs)
4. Destroys the resource group

To preserve resources for debugging, set `CLEANUP: "false"` in the pipeline variables.

## Kusto

Expand Down
50 changes: 50 additions & 0 deletions jobs/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
parameters:
- name: cloud
type: string
- name: regions
type: object
- name: credential_type
type: string
default: service_connection
- name: dependsOn
type: object
default: []

jobs:
- job: cleanup
dependsOn: ${{ parameters.dependsOn }}
displayName: 'Cleanup Resources'
condition: and(always(), eq(variables['CLEANUP'], 'true'))
timeoutInMinutes: 60
variables:
# Runtime expression to get BASE_RUN_ID from generate_run_id job output
# Must be defined here (not passed through parameters) for ADO to evaluate at runtime
BASE_RUN_ID: $[ dependencies.generate_run_id.outputs['set_run_id.BASE_RUN_ID'] ]
steps:
- script: |
# Set RESOURCE_GROUP_NAME from BASE_RUN_ID
if [ -z "${BASE_RUN_ID:-}" ]; then
echo "ERROR: BASE_RUN_ID not set"
exit 1
fi
RESOURCE_GROUP_NAME="$BASE_RUN_ID"
echo "Resource group to cleanup: $RESOURCE_GROUP_NAME"
echo "##vso[task.setvariable variable=RESOURCE_GROUP_NAME]$RESOURCE_GROUP_NAME"
displayName: "Set Resource Group Name"

- ${{ if eq(parameters.credential_type, 'service_connection') }}:
- task: AzureCLI@2
displayName: "Azure Login (Service Connection)"
inputs:
azureSubscription: $(AZURE_SERVICE_CONNECTION)
scriptType: bash
scriptLocation: inlineScript
addSpnToEnvironment: true
inlineScript: |
echo "Logged in via service connection"

- template: /steps/cleanup-resources.yml
parameters:
cloud: ${{ parameters.cloud }}
regions: ${{ parameters.regions }}
credential_type: ${{ parameters.credential_type }}
35 changes: 8 additions & 27 deletions jobs/competitive-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,12 @@ parameters:
default: {}
- name: max_parallel
type: number
- name: terraform_modules_dir
type: string
default: ''
- name: terraform_input_file_mapping
type: object
default: []
- name: terraform_arguments
type: string
default: ''
- name: terraform_input_varibles
type: object
default: {}
- name: test_modules_dir
type: string
default: ''
- name: run_id
type: string
default: ''
- name: base_run_id
type: string
default: ''
- name: timeout_in_minutes
type: number
default: 60 # default when not specified is 60 minutes
Expand All @@ -51,9 +36,17 @@ parameters:
- name: ssh_key_enabled
type: boolean
default: true
- name: dependsOn
type: object
default: []

jobs:
- job: ${{ parameters.cloud }}
dependsOn: ${{ parameters.dependsOn }}
variables:
# Runtime expression to get BASE_RUN_ID from generate_run_id job output
# Must be defined here (not passed through parameters) for ADO to evaluate at runtime
BASE_RUN_ID: $[ dependencies.generate_run_id.outputs['set_run_id.BASE_RUN_ID'] ]
strategy:
maxParallel: ${{ parameters.max_parallel }}
matrix:
Expand All @@ -64,7 +57,6 @@ jobs:
parameters:
cloud: ${{ parameters.cloud }}
region: ${{ parameters.regions[0] }}
base_run_id: ${{ parameters.base_run_id }}
test_modules_dir: ${{ parameters.test_modules_dir }}
retry_attempt_count: ${{ parameters.retry_attempt_count }}
credential_type: ${{ parameters.credential_type }}
Expand All @@ -73,10 +65,6 @@ jobs:
parameters:
cloud: ${{ parameters.cloud }}
regions: ${{ parameters.regions }}
terraform_modules_dir: ${{ parameters.terraform_modules_dir }}
terraform_input_file_mapping: ${{ parameters.terraform_input_file_mapping }}
terraform_arguments: ${{ parameters.terraform_arguments }}
terraform_input_varibles: ${{ parameters.terraform_input_varibles }}
retry_attempt_count: ${{ parameters.retry_attempt_count }}
credential_type: ${{ parameters.credential_type }}
- template: /steps/validate-resources.yml
Expand All @@ -100,10 +88,3 @@ jobs:
regions: ${{ parameters.regions }}
engine_input: ${{ parameters.engine_input }}
credential_type: ${{ parameters.credential_type }}
- template: /steps/cleanup-resources.yml
parameters:
cloud: ${{ parameters.cloud }}
regions: ${{ parameters.regions }}
terraform_arguments: ${{ parameters.terraform_arguments }}
retry_attempt_count: ${{ parameters.retry_attempt_count }}
credential_type: ${{ parameters.credential_type }}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:

while [ $ELAPSED -lt $TIMEOUT ]; do
# Get all PNIs in namespace and count Ready ones matching our pattern
ALL_PNIS=$(kubectl get podnetworkinstance -n slo-1 -o custom-columns=NAME:.metadata.name,STATUS:.status.status --no-headers 2>/dev/null || echo "")
ALL_PNIS=$(kubectl get podnetworkinstance -n {{.Namespace}} -o custom-columns=NAME:.metadata.name,STATUS:.status.status --no-headers 2>/dev/null || echo "")

if [ -n "$ALL_PNIS" ]; then
READY_COUNT=$(echo "$ALL_PNIS" | grep "^${PNI_PREFIX}" | grep -c "Ready" || echo "0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ name: deployment-churn
{{$podsPerStep := DefaultParam .CL2_PODS_PER_STEP 7}}
{{$nodes := DefaultParam .CL2_NODES 1000}}
{{$total_pods := DefaultParam .CL2_TOTAL_PODS 7000}}
{{$existingPods := DefaultParam .CL2_EXISTING_PODS 0}}
{{$deltaPods := SubtractInt $total_pods $existingPods}}
{{$actualPodsThisJob := MaxInt $deltaPods 0}}
{{$steps := DefaultParam .CL2_STEPS 1}}
{{$latencyPodCpu := DefaultParam .CL2_LATENCY_POD_CPU 10}}
{{$latencyPodMemory := DefaultParam .CL2_LATENCY_POD_MEMORY 50}}
Expand All @@ -15,10 +18,11 @@ name: deployment-churn
{{$probeTimeout := .CL2_PROBE_TIMEOUT}}
{{$datapathReporterImage := .CL2_DATAPATH_REPORTER_IMAGE}}
{{$nginxImage := .CL2_NGINX_IMAGE}}
{{$jobIndex := .CL2_JOB_INDEX}}

namespace:
number: 1
prefix: slo
prefix: slo-job{{$jobIndex}}
deleteStaleNamespaces: false
deleteAutomanagedNamespaces: false
enableExistingNamespaces: false
Expand Down Expand Up @@ -46,7 +50,7 @@ steps:
objectTemplatePath: reporter_role_template.yaml
- basename: reporter-binding
objectTemplatePath: reporter_rolebinding_template.yaml
- name: Log - steps={{$steps}}, nodes={{$nodes}}, pods/step={{$podsPerStep}}, pods/node={{$podsPerNode}}, total pods={{$total_pods}}
- name: Log - job_index={{$jobIndex}}, steps={{$steps}}, nodes={{$nodes}}, pods/node={{$podsPerNode}}, pods/step={{$podsPerStep}}, total_pods={{$total_pods}}, existing_pods={{$existingPods}}, delta_pods={{$deltaPods}}, actual_pods_this_job={{$actualPodsThisJob}}
measurements:
- Identifier: Dummy
Method: Sleep
Expand All @@ -61,7 +65,7 @@ steps:
replicasPerNamespace: 1
tuningSet: DeploymentCreatePNIQps
objectBundle:
- basename: pod-network-instance
- basename: pod-network-instance-job{{$jobIndex}}
objectTemplatePath: pni_dynamic_template.yaml
- name: Deploy PNI Readiness Checker
phases:
Expand All @@ -74,7 +78,7 @@ steps:
- basename: pni-checker
objectTemplatePath: pni_readiness_checker_unified_template.yaml
templateFillMap:
PNIPrefix: pod-network-instance-0
PNIPrefix: pod-network-instance-job{{$jobIndex}}-0
NumPNIs: 1
- name: Wait for PNI Readiness Checker to Complete
measurements:
Expand All @@ -95,15 +99,15 @@ steps:
- basename: pni-checker
objectTemplatePath: pni_readiness_checker_unified_template.yaml
templateFillMap:
PNIPrefix: pod-network-instance-0
PNIPrefix: pod-network-instance-job{{$jobIndex}}-0
NumPNIs: 1
- name: Starting Pod Startup Latency Measurements
measurements:
- Identifier: PodStartupLatency
Method: PodStartupLatency
Params:
action: start
labelSelector: podgroup={{$groupName}}
labelSelector: podgroup-job={{$groupName}}-job{{$jobIndex}}
threshold: {{$podStartupLatencyThreshold}}
{{range $j := Loop $steps}}
- name: Starting Deployment Latency Measurements -{{$j}}
Expand All @@ -114,7 +118,7 @@ steps:
action: start
apiVersion: apps/v1
kind: Deployment
labelSelector: group={{$groupName}}-{{$j}}
labelSelector: group={{$groupName}}-job{{$jobIndex}}-{{$j}}
operationTimeout: {{$operationTimeout}}
- name: Create Deployments {{$j}}
phases:
Expand All @@ -124,16 +128,17 @@ steps:
replicasPerNamespace: 1
tuningSet: DeploymentCreateQps
objectBundle:
- basename: deployment-churn-{{$j}}
- basename: deployment-churn-job{{$jobIndex}}-{{$j}}
objectTemplatePath: swiftv2_deployment_template.yaml
templateFillMap:
Replicas: {{$podsPerStep}}
PodGroup: {{$groupName}}
Group: {{$groupName}}-{{$j}}
PodGroupJob: {{$groupName}}-job{{$jobIndex}}
Group: {{$groupName}}-job{{$jobIndex}}-{{$j}}
CpuRequest: {{$latencyPodCpu}}m
MemoryRequest: {{$latencyPodMemory}}M
deploymentLabel: start
pniName: pod-network-instance-0
pniName: pod-network-instance-job{{$jobIndex}}-0
Location: {{$.CL2_LOCATION}}
DevicePluginEnabled: {{$devicePluginEnabled}}
ProbeTarget: {{$probeTargetUrl}}
Expand All @@ -148,7 +153,7 @@ steps:
action: gather
apiVersion: apps/v1
kind: Deployment
labelSelector: group={{$groupName}}-{{$j}}
labelSelector: group={{$groupName}}-job{{$jobIndex}}-{{$j}}
operationTimeout: {{$operationTimeout}}
{{end}}
- name: Gather Pod Startup Latency Measurements
Expand All @@ -157,7 +162,7 @@ steps:
Method: PodStartupLatency
Params:
action: gather
labelSelector: podgroup={{$groupName}}
labelSelector: podgroup-job={{$groupName}}-job{{$jobIndex}}
- name: Wait for Datapath Readiness
measurements:
- Identifier: Dummy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ metadata:
name: {{.Name}}
labels:
group: {{.Group}}
podgroup: {{.PodGroup}}
kubernetes.azure.com/pod-network: pn100
kubernetes.azure.com/pod-network-instance: pod-network-instance-{{.StepIndex}}-{{DivideInt .Index .PodsPerPNI}}
kubernetes.azure.com/pod-network-instance: {{.PNIPrefix}}-{{DivideInt .Index .PodsPerPNI}}
spec:
replicas: 1
selector:
Expand All @@ -19,8 +20,9 @@ spec:
name: {{.Name}}
group: {{.Group}}
podgroup: {{.PodGroup}}
podgroup-job: {{.PodGroupJob}}
kubernetes.azure.com/pod-network: pn100
kubernetes.azure.com/pod-network-instance: pod-network-instance-{{.StepIndex}}-{{DivideInt .Index .PodsPerPNI}}
kubernetes.azure.com/pod-network-instance: {{.PNIPrefix}}-{{DivideInt .Index .PodsPerPNI}}
restart: {{.deploymentLabel}}
spec:
serviceAccountName: reporter-sa-0
Expand Down
Loading
Loading