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
2 changes: 1 addition & 1 deletion .pipelines/swiftv2-long-running/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ parameters:
- name: vmSkuDefault
displayName: "VM SKU for Default Node Pool"
type: string
default: "Standard_D2s_v3"
default: "Standard_D4s_v3"

- name: vmSkuHighNIC
displayName: "VM SKU for High NIC Node Pool"
Expand Down
20 changes: 14 additions & 6 deletions .pipelines/swiftv2-long-running/scripts/create_aks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ VM_SKU_DEFAULT=$4
VM_SKU_HIGHNIC=$5

CLUSTER_COUNT=2
CLUSTER_PREFIX="aks"
DEFAULT_NODE_COUNT=1
COMMON_TAGS="fastpathenabled=true RGOwner=LongRunningTestPipelines stampcreatorserviceinfo=true"
CLUSTER_PREFIX="aks"

wait_for_provisioning() { # Helper for safe retry/wait for provisioning states (basic)
local rg="$1" clusterName="$2"
Expand Down Expand Up @@ -45,8 +43,7 @@ for i in $(seq 1 "$CLUSTER_COUNT"); do
SUB=$SUBSCRIPTION_ID \
GROUP=$RG \
CLUSTER=$CLUSTER_NAME \
NODE_COUNT=$DEFAULT_NODE_COUNT \
VM_SIZE=$VM_SKU_DEFAULT \
VM_SIZE=$VM_SKU_DEFAULT

echo " - waiting for AKS provisioning state..."
wait_for_provisioning "$RG" "$CLUSTER_NAME"
Expand All @@ -57,7 +54,18 @@ for i in $(seq 1 "$CLUSTER_COUNT"); do
GROUP=$RG \
VM_SIZE=$VM_SKU_HIGHNIC \
CLUSTER=$CLUSTER_NAME \
SUB=$SUBSCRIPTION_ID \
SUB=$SUBSCRIPTION_ID

KUBECONFIG_PATH="/tmp/${CLUSTER_NAME}.kubeconfig"
echo "Exporting admin kubeconfig for '$CLUSTER_NAME' to ${KUBECONFIG_PATH}..."

az aks get-credentials \
--resource-group "$RG" \
--name "$CLUSTER_NAME" \
--overwrite-existing \
--admin \
--file "$KUBECONFIG_PATH"
echo "Kubeconfig saved: ${KUBECONFIG_PATH}"

done
echo "All done. Created $CLUSTER_COUNT cluster set(s)."
89 changes: 42 additions & 47 deletions .pipelines/swiftv2-long-running/scripts/create_vnets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,22 @@
set -e
trap 'echo "[ERROR] Failed while creating VNets or subnets. Check Azure CLI logs above." >&2' ERR

SUBSCRIPTION_ID=$1
SUB_ID=$1
LOCATION=$2
RG=$3
BUILD_ID=$4

az account set --subscription "$SUBSCRIPTION_ID"

# VNets and subnets
VNET_A1="cx_vnet_a1"
VNET_A2="cx_vnet_a2"
VNET_A3="cx_vnet_a3"
VNET_B1="cx_vnet_b1"

A1_S1="10.10.1.0/24"
A1_S2="10.10.2.0/24"
A1_PE="10.10.100.0/24"

A2_MAIN="10.11.1.0/24"

A3_MAIN="10.12.1.0/24"

B1_MAIN="10.20.1.0/24"
# --- VNet definitions ---
# Create customer vnets for two customers A and B.
VNAMES=( "cx_vnet_a1" "cx_vnet_a2" "cx_vnet_a3" "cx_vnet_b1" )
VCIDRS=( "10.10.0.0/16" "10.11.0.0/16" "10.12.0.0/16" "10.13.0.0/16" )
NODE_SUBNETS=( "10.10.0.0/24" "10.11.0.0/24" "10.12.0.0/24" "10.13.0.0/24" )
EXTRA_SUBNETS_LIST=( "s1 s2 pe" "s1" "s1" "s1" )
EXTRA_CIDRS_LIST=( "10.10.1.0/24,10.10.2.0/24,10.10.3.0/24" \
"10.11.1.0/24" \
"10.12.1.0/24" \
"10.13.1.0/24" )
az account set --subscription "$SUB_ID"

# -------------------------------
# Verification functions
Expand All @@ -49,36 +44,36 @@ verify_subnet() {
fi
}

# -------------------------------
# Create VNets and Subnets
# -------------------------------
# A1
az network vnet create -g "$RG" -n "$VNET_A1" --address-prefix 10.10.0.0/16 --subnet-name s1 --subnet-prefix "$A1_S1" -l "$LOCATION" --output none \
&& echo "Created $VNET_A1 with subnet s1"
az network vnet subnet create -g "$RG" --vnet-name "$VNET_A1" -n s2 --address-prefix "$A1_S2" --output none \
&& echo "Created $VNET_A1 with subnet s2"
az network vnet subnet create -g "$RG" --vnet-name "$VNET_A1" -n pe --address-prefix "$A1_PE" --output none \
&& echo "Created $VNET_A1 with subnet pe"
# Verify A1
verify_vnet "$RG" "$VNET_A1"
for sn in s1 s2 pe; do verify_subnet "$RG" "$VNET_A1" "$sn"; done
# --- Loop over VNets ---
for i in "${!VNAMES[@]}"; do
VNET=${VNAMES[$i]}
VNET_CIDR=${VCIDRS[$i]}
NODE_SUBNET_CIDR=${NODE_SUBNETS[$i]}
EXTRA_SUBNETS=${EXTRA_SUBNETS_LIST[$i]}
EXTRA_SUBNET_CIDRS=${EXTRA_CIDRS_LIST[$i]}

# A2
az network vnet create -g "$RG" -n "$VNET_A2" --address-prefix 10.11.0.0/16 --subnet-name s1 --subnet-prefix "$A2_MAIN" -l "$LOCATION" --output none \
&& echo "Created $VNET_A2 with subnet s1"
verify_vnet "$RG" "$VNET_A2"
verify_subnet "$RG" "$VNET_A2" "s1"
# Create VNet + subnets
make -C ./hack/aks swift-delegated-subnet-up \
AZCLI=az REGION=$LOCATION GROUP=$RG VNET=$VNET \
VNET_CIDR=$VNET_CIDR NODE_SUBNET_CIDR=$NODE_SUBNET_CIDR \
EXTRA_SUBNETS="$EXTRA_SUBNETS" EXTRA_SUBNET_CIDRS="$EXTRA_SUBNET_CIDRS" \
&& echo "Created $VNET with subnets $EXTRA_SUBNETS"

# A3
az network vnet create -g "$RG" -n "$VNET_A3" --address-prefix 10.12.0.0/16 --subnet-name s1 --subnet-prefix "$A3_MAIN" -l "$LOCATION" --output none \
&& echo "Created $VNET_A3 with subnet s1"
verify_vnet "$RG" "$VNET_A3"
verify_subnet "$RG" "$VNET_A3" "s1"
verify_vnet "$RG" "$VNET" # Verify VNet

# B1
az network vnet create -g "$RG" -n "$VNET_B1" --address-prefix 10.20.0.0/16 --subnet-name s1 --subnet-prefix "$B1_MAIN" -l "$LOCATION" --output none \
&& echo "Created $VNET_B1 with subnet s1"
verify_vnet "$RG" "$VNET_B1"
verify_subnet "$RG" "$VNET_B1" "s1"
# Loop over extra subnets to verify and create dummy clusters to delegate the pod subnets.
for PODSUBNET in $EXTRA_SUBNETS; do
verify_subnet "$RG" "$VNET" "$PODSUBNET"
if [[ "$PODSUBNET" == "pe" ]]; then
# Skip creating dummy cluster for private endpoint subnet.
continue
fi
cluster_name="${BUILD_ID}-${VNET}-${PODSUBNET}"
make -C ./hack/aks swiftv2-dummy-cluster-subnet-delegator-up \
AZCLI=az CLUSTER=$cluster_name GROUP=$RG REGION=$LOCATION \
SUB=$SUB_ID VNET=$VNET POD_SUBNET=$PODSUBNET \
&& echo "Created dummy cluster for $VNET subnet $PODSUBNET"
done
done

echo " All VNets and subnets created and verified successfully."
echo "All VNets and subnets created and verified successfully."
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ stages:
# Job 3: Networking & Storage
# ------------------------------------------------------------
- job: NetworkingAndStorage
timeoutInMinutes: 0
displayName: "Networking and Storage Setup"
dependsOn: CreateResourceGroup
pool:
Expand All @@ -86,6 +87,7 @@ stages:
${{ parameters.subscriptionId }}
${{ parameters.location }}
${{ parameters.resourceGroupName }}
$(Build.BuildId)

# Task 2: Create Peerings
- task: AzureCLI@2
Expand Down Expand Up @@ -138,3 +140,55 @@ stages:
${{ parameters.location }}
${{ parameters.resourceGroupName }}
$(CreateStorageAccounts.StorageAccount1)
# =================================================================
# Stage 2: Datapath Tests
# =================================================================
- stage: DataPathTests
displayName: "Stage: Swiftv2 Data Path Tests"
dependsOn: AKSClusterAndNetworking
condition: succeeded()
jobs:
- job: RunDataPathTests
displayName: "Run PodNetwork and Data Path Tests"
timeoutInMinutes: 0 # Run indefinitely
pool:
vmImage: ubuntu-latest
steps:
- checkout: self

- task: GoTool@0
displayName: "Use Go 1.22.5"
inputs:
version: "1.22.5"
- task: AzureCLI@2
displayName: "Run Ginkgo Datapath Suite"
inputs:
azureSubscription: ${{ parameters.serviceConnection }}
scriptType: bash
scriptLocation: inlineScript
inlineScript: |
echo "==> Installing Ginkgo CLI"
go install github.com/onsi/ginkgo/v2/ginkgo@latest

echo "==> Adding Go bin to PATH"
export PATH=$PATH:$(go env GOPATH)/bin

echo "==> Downloading Go dependencies"
go mod download

echo "==> Setting up kubeconfig for cluster aks-2"
az aks get-credentials \
--resource-group ${{ parameters.resourceGroupName }} \
--name aks-2 \
--file /tmp/aks-2.kubeconfig \
--overwrite-existing \
--admin

echo "==> Verifying cluster connectivity"
kubectl --kubeconfig /tmp/aks-2.kubeconfig get nodes

echo "==> Running datapath tests"
export RG=${{ parameters.resourceGroupName }}
export BUILD_ID=$(Build.BuildId)
ginkgo -v -trace --timeout=0 ./test/integration/swiftv2/longRunningCluster

18 changes: 8 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/Azure/azure-container-networking

go 1.24.1
go 1.24.0

toolchain go1.24.10

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.19.1
Expand Down Expand Up @@ -68,7 +70,6 @@ require (
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/hpcloud/tail v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down Expand Up @@ -104,12 +105,9 @@ require (
golang.org/x/term v0.36.0 // indirect
golang.org/x/text v0.30.0 // indirect
golang.org/x/time v0.14.0
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
gopkg.in/fsnotify.v1 v1.4.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
Expand All @@ -125,6 +123,7 @@ require (
github.com/cilium/cilium v1.15.16
github.com/cilium/ebpf v0.19.0
github.com/jsternberg/zap-logfmt v1.3.0
github.com/onsi/ginkgo/v2 v2.23.4
golang.org/x/sync v0.17.0
gotest.tools/v3 v3.5.2
k8s.io/kubectl v0.34.1
Expand All @@ -147,9 +146,11 @@ require (
github.com/go-openapi/spec v0.20.11 // indirect
github.com/go-openapi/strfmt v0.21.9 // indirect
github.com/go-openapi/validate v0.22.3 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/kr/pretty v0.3.1 // indirect
Expand All @@ -174,10 +175,12 @@ require (
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
go.uber.org/dig v1.17.1 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/tools v0.37.0 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
Expand All @@ -193,11 +196,6 @@ require (
k8s.io/kubelet v0.34.1
)

replace (
github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.12.0
github.com/onsi/gomega => github.com/onsi/gomega v1.10.0
)

retract (
v1.16.17 // contains only retractions, new version to retract 1.15.22.
v1.16.16 // contains only retractions, has to be newer than 1.16.15.
Expand Down
Loading
Loading