Skip to content

Commit 8daeabe

Browse files
authored
Merge pull request spidernet-io#4401 from cyclinder/ci/fix_install
e2e: fix openkruise installtion and debug ovs installtion
2 parents ca35928 + b81b3a3 commit 8daeabe

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,18 @@ e2e_init_spiderpool:
324324

325325
.PHONY: e2e_init_cilium_ebpfservice
326326
e2e_init_cilium_ebpfservice:
327-
$(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=false -e INSTALL_CILIUM=true -e DISABLE_KUBE_PROXY=true -e E2E_SPIDERPOOL_ENABLE_SUBNET=false
327+
$(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=false -e INSTALL_CILIUM=true -e DISABLE_KUBE_PROXY=true \
328+
-e E2E_SPIDERPOOL_ENABLE_SUBNET=false -e INSTALL_OVS=false
328329

329330
.PHONY: e2e_init_calico
330331
e2e_init_calico:
331332
$(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=true -e INSTALL_CILIUM=false -e E2E_SPIDERPOOL_ENABLE_SUBNET=false \
332-
E2E_SPIDERPOOL_ENABLE_DRA=true
333+
-e E2E_SPIDERPOOL_ENABLE_DRA=true -e INSTALL_OVS=false
333334

334335
.PHONY: e2e_init_cilium_legacyservice
335336
e2e_init_cilium_legacyservice:
336-
$(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=false -e INSTALL_CILIUM=true -e DISABLE_KUBE_PROXY=false -e E2E_SPIDERPOOL_ENABLE_SUBNET=false
337-
337+
$(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=false -e INSTALL_CILIUM=true -e DISABLE_KUBE_PROXY=false \
338+
-e E2E_SPIDERPOOL_ENABLE_SUBNET=false -e INSTALL_OVS=false
338339

339340
.PHONY: e2e_test
340341
e2e_test:

test/Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ setup_kruise:
225225
docker pull $${IMAGE} ; \
226226
kind load docker-image $${IMAGE} --name $(E2E_CLUSTER_NAME); \
227227
done; \
228-
helm upgrade --install kruise openkruise/kruise --wait --timeout 20m --debug --set manager.image.repository=$(E2E_OPENKRUISE_IMAGE) \
228+
HELM_OPTION=" --wait --timeout 20m --debug --set manager.image.repository=$(E2E_OPENKRUISE_IMAGE) " ; \
229+
# openkruise failed to run with 1.7.3, see
230+
# https://github.com/spidernet-io/spiderpool/issues/4396
231+
HELM_OPTION+=" --version $(E2E_OPENKRUISE_VERSION) " ; \
232+
helm upgrade --install kruise openkruise/kruise $${HELM_OPTION} \
229233
--kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" "$(E2E_LOG_FILE)" ; exit 1 ; } ; \
230234

231235
.PHONY: setup_spiderpool

test/Makefile.defs

+3-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ E2E_LOG_FILE ?= $(ROOT_DIR)/test/e2edebugLog.txt
190190
E2E_UNINSTALL_LOG_FILE ?= $(ROOT_DIR)/test/e2e-uninstall-debugLog.txt
191191

192192
#========= openkruise =========
193-
193+
# openkruise failed to run with 1.7.3, see
194+
# https://github.com/spidernet-io/spiderpool/issues/4396
195+
E2E_OPENKRUISE_VERSION := 1.7.2
194196
ifeq ($(E2E_CHINA_IMAGE_REGISTRY),true)
195197
E2E_OPENKRUISE_IMAGE ?= docker.m.daocloud.io/openkruise/kruise-manager
196198
else

test/scripts/install-ovs.sh

+19-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -o errexit -o nounset -o pipefail
77

8-
CURRENT_FILENAME=$( basename $0 )
8+
CURRENT_FILENAME=$(basename $0)
99

1010
[ -z "${HTTP_PROXY}" ] || export https_proxy=${HTTP_PROXY}
1111

@@ -25,7 +25,10 @@ echo "$CURRENT_FILENAME : HOST_ADDITIONAL_INTERFACE $HOST_ADDITIONAL_INTERFACE "
2525
echo "try to add secondary network nic for ovs bridge preparation"
2626
if ! docker network ls | grep -q "${DOCKER_ADDITIONAL_NETWORK}"; then
2727
echo "Docker network ${DOCKER_ADDITIONAL_NETWORK} does not exist, creating it..."
28-
docker network create ${DOCKER_ADDITIONAL_NETWORK} --driver bridge || { echo "Failed to create Docker network"; exit 1; }
28+
docker network create ${DOCKER_ADDITIONAL_NETWORK} --driver bridge || {
29+
echo "Failed to create Docker network"
30+
exit 1
31+
}
2932
else
3033
echo "Docker network ${DOCKER_ADDITIONAL_NETWORK} already exists."
3134
fi
@@ -53,17 +56,16 @@ elif [ ${E2E_IP_FAMILY} == "dual" ]; then
5356
docker exec ${VLAN_GATEWAY_CONTAINER} ip addr add fd00:172:30::1/64 dev ${HOST_ADDITIONAL_INTERFACE}.${VLAN30}
5457
docker exec ${VLAN_GATEWAY_CONTAINER} ip addr add fd00:172:40::1/64 dev ${HOST_ADDITIONAL_INTERFACE}.${VLAN40}
5558
else
56-
echo "error ip family, the value of IP_FAMILY must be of ipv4,ipv6 or dual." && exit 1
59+
echo "error ip family, the value of IP_FAMILY must be of ipv4,ipv6 or dual." && exit 1
5760
fi
5861

5962
echo -e "\033[35m Succeed to create vlan interface: ${HOST_ADDITIONAL_INTERFACE}.${VLAN30}${HOST_ADDITIONAL_INTERFACE}.${VLAN40} in kind-node ${VLAN_GATEWAY_CONTAINER} \033[0m"
6063

61-
6264
# https://github.com/antrea-io/antrea/issues/51
6365
# fix: it possibley fails to insmod openvswitch.ko in the container in some OS version
6466
# so it could load the ko in the host os in advance to make sure the ovs service could be started in the container
6567
echo "=========install openvswitch in host os"
66-
sudo apt-get update
68+
sudo apt-get update
6769
sudo apt-get install -y openvswitch-switch
6870
sudo modinfo openvswitch
6971
sudo systemctl start openvswitch-switch || true
@@ -78,32 +80,37 @@ for NODE in $KIND_NODES; do
7880
install_openvswitch() {
7981
for attempt in {1..5}; do
8082
echo "Attempt $attempt to install openvswitch on ${NODE}..."
81-
if ! docker exec ${NODE} apt-get update ; then
83+
if ! docker exec ${NODE} apt-get update; then
8284
echo "Failed to update package list on ${NODE}, retrying in 10s..."
8385
sleep 10
8486
continue
8587
fi
86-
87-
if ! docker exec ${NODE} apt-get install -y openvswitch-switch ; then
88+
89+
if ! docker exec ${NODE} apt-get install -y openvswitch-switch; then
8890
echo "Failed to install openvswitch on ${NODE}, retrying in 10s..."
8991
sleep 10
9092
continue
9193
fi
92-
94+
9395
echo "Succeed to install openvswitch on ${NODE}"
9496
return 0
9597
done
9698

9799
echo "Error: Failed to install openvswitch on ${NODE} after 5 attempts." >&2
98100
return 1
99101
}
100-
102+
101103
echo "=========install openvswitch"
102104
install_openvswitch
103105

104106
echo "start ovs service and add bridge"
105-
{ docker exec ${NODE} systemctl start openvswitch-switch ; } \
106-
|| { docker exec ${NODE} journalctl -xe ; docker exec ${NODE} systemctl status openvswitch-switch ; docker exec ${NODE} journalctl -u openvswitch-switch ; exit 1 ; }
107+
{ docker exec ${NODE} systemctl start openvswitch-switch; } ||
108+
{
109+
docker exec ${NODE} journalctl -xe
110+
docker exec ${NODE} systemctl status openvswitch-switch
111+
docker exec ${NODE} journalctl -u openvswitch-switch
112+
exit 1
113+
}
107114

108115
docker exec ${NODE} ovs-vsctl add-br ${BRIDGE_INTERFACE}
109116
docker exec ${NODE} ovs-vsctl add-port ${BRIDGE_INTERFACE} ${HOST_ADDITIONAL_INTERFACE}
@@ -139,4 +146,3 @@ for NODE in $KIND_NODES; do
139146
done
140147

141148
echo -e "\033[35m Succeed to install openvswitch \033[0m"
142-

0 commit comments

Comments
 (0)