hs-test: support building master CalicoVPP (KinD) 59/43259/3
authorAdrian Villin <[email protected]>
Tue, 24 Jun 2025 08:23:22 +0000 (10:23 +0200)
committerFlorin Coras <[email protected]>
Tue, 24 Jun 2025 17:36:51 +0000 (17:36 +0000)
- we can now build master CalicoVPP with master VPP using:
  'make setup-cluster BASE=master'
- TODO: docs, use the same VPP build in CalicoVPP as in HST images
  (so that VPP isn't built twice)

Type: test

Change-Id: If5ba154a2f6868db04c17742f4e531269e57a56e
Signed-off-by: Adrian Villin <[email protected]>
.gitignore
extras/hs-test/Makefile
extras/hs-test/kubernetes/setupCluster.sh

index 5b20e10..17b48e3 100644 (file)
@@ -146,6 +146,7 @@ compile_commands.json
 /extras/hs-test/.goimports.ok
 /extras/hs-test/summary/
 /extras/hs-test/.last_state_hash
+/extras/hs-test/.kind_deps.ok
 
 # ./configure
 /CMakeFiles
index c2885b2..82b548d 100644 (file)
@@ -114,6 +114,9 @@ help:
        @echo " NO_COLOR=[true|false]    - disables colorful Docker and Ginkgo output"
        @echo " TIMEOUT=[minutes]        - test timeout override (5 minutes by default)"
        @echo " GINKGO_TIMEOUT=[Ns/m/h]  - Ginkgo timeout override (3h by default)"
+       @echo
+       @echo "'make setup-cluster' arguments:"
+       @echo " BASE=[master|latest]     - build master CalicoVPP with master VPP or use latest release of CalicoVPP (default = latest)"
 
 .PHONY: list-tests
 list-tests:
@@ -191,7 +194,7 @@ test-perf: .deps.ok .build.ok
 
 .PHONY: setup-cluster
 setup-cluster: .kind_deps.ok
-       @bash ./kubernetes/setupCluster.sh
+       @bash ./kubernetes/setupCluster.sh $(BASE)
 
 .PHONY: build-go
 build-go:
index 4cbc991..b972839 100755 (executable)
@@ -1,19 +1,72 @@
 #!/usr/bin/env bash
 set -e
 
-echo "********"
-echo "Performance tests only work on Ubuntu 22.04 for now."
-echo "********"
+MASTER_OR_LATEST=${1-"latest"}
+CALICOVPP_DIR="$HOME/vpp-dataplane"
 
-kind create cluster --config kubernetes/kind-config.yaml
-kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.3/manifests/tigera-operator.yaml
+if [ $MASTER_OR_LATEST = "master" ]; then
+    if [ ! -d "$CALICOVPP_DIR" ]; then
+        git clone https://github.com/projectcalico/vpp-dataplane.git $CALICOVPP_DIR
+    fi
+        cd $CALICOVPP_DIR
+        git pull
 
-echo "Sleeping for 10s, waiting for tigera operator to start up."
-sleep 10
+        # ---------------- images ----------------
+        export CALICO_AGENT_IMAGE=localhost:5000/calicovpp/agent:latest
+        export CALICO_VPP_IMAGE=localhost:5000/calicovpp/vpp:latest
+        export MULTINET_MONITOR_IMAGE=localhost:5000/calicovpp/multinet-monitor:latest
+        export IMAGE_PULL_POLICY=Always
 
-kubectl create -f  https://raw.githubusercontent.com/projectcalico/vpp-dataplane/master/yaml/calico/installation-default.yaml
-kubectl create -f kubernetes/calico-config.yaml
+        # ---------------- interfaces ----------------
+        export CALICOVPP_INTERFACES='{
+          "uplinkInterfaces": [
+            {
+              "interfaceName": "eth0",
+              "vppDriver": "af_packet"
+            }
+          ]
+        }'
+        export CALICOVPP_DISABLE_HUGEPAGES=true
+        export CALICOVPP_CONFIG_TEMPLATE="
+            unix {
+              nodaemon
+              full-coredump
+              log /var/run/vpp/vpp.log
+              cli-listen /var/run/vpp/cli.sock
+              pidfile /run/vpp/vpp.pid
+            }
+            buffers {
+              buffers-per-numa 131072
+            }
+            socksvr { socket-name /var/run/vpp/vpp-api.sock }
+            plugins {
+              plugin default { enable }
+              plugin calico_plugin.so { enable }
+              plugin dpdk_plugin.so { disable }
+            }"
+        export CALICOVPP_ENABLE_VCL=true
 
-echo "Done. Please wait for the cluster to come fully online before running tests."
-echo "Use 'watch kubectl get pods -A' to monitor cluster status."
-echo "To delete the cluster, use 'kind delete cluster'"
\ No newline at end of file
+        make -C $CALICOVPP_DIR kind-new-cluster N_KIND_WORKERS=2
+        kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.3/manifests/tigera-operator.yaml
+        make -C $CALICOVPP_DIR/vpp-manager vpp BASE=origin/master
+        make -C $CALICOVPP_DIR dev-kind
+        make -C $CALICOVPP_DIR load-kind
+        $CALICOVPP_DIR/yaml/overlays/dev/kustomize.sh up
+    else
+        echo "********"
+        echo "Performance tests only work on Ubuntu 22.04 for now."
+        echo "********"
+
+        kind create cluster --config kubernetes/kind-config.yaml
+        kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.3/manifests/tigera-operator.yaml
+
+        echo "Sleeping for 10s, waiting for tigera operator to start up."
+        sleep 10
+
+        kubectl create -f  https://raw.githubusercontent.com/projectcalico/vpp-dataplane/master/yaml/calico/installation-default.yaml
+        kubectl create -f kubernetes/calico-config.yaml
+
+        echo "Done. Please wait for the cluster to come fully online before running tests."
+        echo "Use 'watch kubectl get pods -A' to monitor cluster status."
+        echo "To delete the cluster, use 'kind delete cluster'"
+    fi