From: Adrian Villin Date: Tue, 24 Jun 2025 08:23:22 +0000 (+0200) Subject: hs-test: support building master CalicoVPP (KinD) X-Git-Tag: v26.02-rc0~219 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=4ba427d7eb8108079c09fa548c5202a3af55d3b8;p=vpp.git hs-test: support building master CalicoVPP (KinD) - 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 --- diff --git a/.gitignore b/.gitignore index 5b20e10799a..17b48e307cc 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/extras/hs-test/Makefile b/extras/hs-test/Makefile index c2885b299eb..82b548d3006 100644 --- a/extras/hs-test/Makefile +++ b/extras/hs-test/Makefile @@ -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: diff --git a/extras/hs-test/kubernetes/setupCluster.sh b/extras/hs-test/kubernetes/setupCluster.sh index 4cbc9914e44..b972839b3dd 100755 --- a/extras/hs-test/kubernetes/setupCluster.sh +++ b/extras/hs-test/kubernetes/setupCluster.sh @@ -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