Skip to content

Commit

Permalink
e2e: fix openkruise installtion and debug ovs installtion
Browse files Browse the repository at this point in the history
Signed-off-by: Cyclinder Kuo <[email protected]>
  • Loading branch information
cyclinder committed Dec 17, 2024
1 parent 046f30e commit e3a5db1
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 15 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/auto-nightly-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ jobs:
if: ${{ needs.get_ref.outputs.e2e_enabled == 'true' && needs.get_ref.outputs.ipfamily_dual_e2e == 'true' }}
uses: ./.github/workflows/e2e-init.yaml
with:
# github ci: openvswitch faild to run ubuntu-latest(24.04)
# https://github.com/spidernet-io/spiderpool/issues/4397
os: ubuntu-22.04
ip_family: dual
image_tag: ${{ needs.call_build_ci_image.outputs.imageTag }}
ref: ${{ needs.get_ref.outputs.ref }}
Expand All @@ -158,6 +161,9 @@ jobs:
if: ${{ needs.get_ref.outputs.e2e_enabled == 'true' && needs.get_ref.outputs.ipfamily_ipv4only_e2e == 'true' }}
uses: ./.github/workflows/e2e-init.yaml
with:
# github ci: openvswitch faild to run ubuntu-latest(24.04)
# https://github.com/spidernet-io/spiderpool/issues/4397
os: ubuntu-22.04
ip_family: ipv4
image_tag: ${{ needs.call_build_ci_image.outputs.imageTag }}
ref: ${{ needs.get_ref.outputs.ref }}
Expand All @@ -169,6 +175,9 @@ jobs:
if: ${{ needs.get_ref.outputs.e2e_enabled == 'true' && needs.get_ref.outputs.ipfamily_ipv6only_e2e == 'true' }}
uses: ./.github/workflows/e2e-init.yaml
with:
# github ci: openvswitch faild to run ubuntu-latest(24.04)
# https://github.com/spidernet-io/spiderpool/issues/4397
os: ubuntu-22.04
ip_family: ipv6
image_tag: ${{ needs.call_build_ci_image.outputs.imageTag }}
ref: ${{ needs.get_ref.outputs.ref }}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/auto-pr-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ jobs:
if: ${{ needs.get_ref.outputs.e2e_enabled == 'true' && needs.get_ref.outputs.ipfamily_dual_e2e == 'true' }}
uses: ./.github/workflows/e2e-init.yaml
with:
# github ci: openvswitch faild to run ubuntu-latest(24.04)
# https://github.com/spidernet-io/spiderpool/issues/4397
os: ubuntu-22.04
ip_family: dual
image_tag: ${{ needs.call_build_ci_image.outputs.imageTag }}
ref: ${{ needs.get_ref.outputs.ref }}
Expand All @@ -224,6 +227,9 @@ jobs:
if: ${{ needs.get_ref.outputs.e2e_enabled == 'true' && needs.get_ref.outputs.ipfamily_ipv4only_e2e == 'true' }}
uses: ./.github/workflows/e2e-init.yaml
with:
# github ci: openvswitch faild to run ubuntu-latest(24.04)
# https://github.com/spidernet-io/spiderpool/issues/4397
os: ubuntu-22.04
ip_family: ipv4
image_tag: ${{ needs.call_build_ci_image.outputs.imageTag }}
ref: ${{ needs.get_ref.outputs.ref }}
Expand All @@ -235,6 +241,9 @@ jobs:
if: ${{ needs.get_ref.outputs.e2e_enabled == 'true' && needs.get_ref.outputs.ipfamily_ipv6only_e2e == 'true' }}
uses: ./.github/workflows/e2e-init.yaml
with:
# github ci: openvswitch faild to run ubuntu-latest(24.04)
# https://github.com/spidernet-io/spiderpool/issues/4397
os: ubuntu-22.04
ip_family: ipv6
image_tag: ${{ needs.call_build_ci_image.outputs.imageTag }}
ref: ${{ needs.get_ref.outputs.ref }}
Expand All @@ -258,6 +267,9 @@ jobs:
if: ${{ needs.get_ref.outputs.e2e_enabled == 'true' && needs.get_ref.outputs.ipfamily_dual_e2e == 'true' }}
uses: ./.github/workflows/e2e-init.yaml
with:
# github ci: openvswitch faild to run ubuntu-latest(24.04)
# https://github.com/spidernet-io/spiderpool/issues/4397
os: ubuntu-22.04
ip_family: dual
image_tag: ${{ needs.call_build_ci_image.outputs.imageTag }}
ref: ${{ needs.get_ref.outputs.ref }}
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,18 @@ e2e_init_spiderpool:

.PHONY: e2e_init_cilium_ebpfservice
e2e_init_cilium_ebpfservice:
$(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
$(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 -e INSTALL_OVS=false

.PHONY: e2e_init_calico
e2e_init_calico:
$(QUIET) make e2e_init -e INSTALL_OVERLAY_CNI=true -e INSTALL_CALICO=true -e INSTALL_CILIUM=false -e E2E_SPIDERPOOL_ENABLE_SUBNET=false \
E2E_SPIDERPOOL_ENABLE_DRA=true
-e E2E_SPIDERPOOL_ENABLE_DRA=true -e INSTALL_OVS=false

.PHONY: e2e_init_cilium_legacyservice
e2e_init_cilium_legacyservice:
$(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
$(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 -e INSTALL_OVS=false


.PHONY: e2e_test
Expand Down
4 changes: 3 additions & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ setup_kruise:
docker pull $${IMAGE} ; \
kind load docker-image $${IMAGE} --name $(E2E_CLUSTER_NAME); \
done; \
helm upgrade --install kruise openkruise/kruise --wait --timeout 20m --debug --set manager.image.repository=$(E2E_OPENKRUISE_IMAGE) \
HELM_OPTION=" --wait --timeout 20m --debug --set manager.image.repository=$(E2E_OPENKRUISE_IMAGE) " ; \
HELM_OPTION+=" --version $(E2E_OPENKRUISE_VERSION) " ; \
helm upgrade --install kruise openkruise/kruise $${HELM_OPTION} \
--kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" "$(E2E_LOG_FILE)" ; exit 1 ; } ; \

.PHONY: setup_spiderpool
Expand Down
4 changes: 3 additions & 1 deletion test/Makefile.defs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ E2E_LOG_FILE ?= $(ROOT_DIR)/test/e2edebugLog.txt
E2E_UNINSTALL_LOG_FILE ?= $(ROOT_DIR)/test/e2e-uninstall-debugLog.txt

#========= openkruise =========

# openkruise failed to run 1.7.3, see
# https://github.com/spidernet-io/spiderpool/issues/4396
E2E_OPENKRUISE_VERSION := 1.7.2
ifeq ($(E2E_CHINA_IMAGE_REGISTRY),true)
E2E_OPENKRUISE_IMAGE ?= docker.m.daocloud.io/openkruise/kruise-manager
else
Expand Down
26 changes: 16 additions & 10 deletions test/scripts/install-ovs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -o errexit -o nounset -o pipefail

CURRENT_FILENAME=$( basename $0 )
CURRENT_FILENAME=$(basename $0)

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

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

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"
Expand All @@ -66,29 +69,33 @@ for NODE in $KIND_NODES; do
install_openvswitch() {
for attempt in {1..5}; do
echo "Attempt $attempt to install openvswitch on ${NODE}..."
if ! docker exec ${NODE} apt-get update > /dev/null; then
if ! docker exec ${NODE} apt-get update >/dev/null; then
echo "Failed to update package list on ${NODE}, retrying in 10s..."
sleep 10
continue
fi
if ! docker exec ${NODE} apt-get install -y openvswitch-switch > /dev/null; then

if ! docker exec ${NODE} apt-get install -y openvswitch-switch >/dev/null; then
echo "Failed to install openvswitch on ${NODE}, retrying in 10s..."
sleep 10
continue
fi

echo "Succeed to install openvswitch on ${NODE}"
return 0
done

echo "Error: Failed to install openvswitch on ${NODE} after 5 attempts." >&2
return 1
}

echo "=========install openvswitch"
install_openvswitch
docker exec ${NODE} systemctl start openvswitch-switch
docker exec ${NODE} systemctl start openvswitch-switch || {
echo "error, failed to start openvswitch on ${NODE}"
journalctl -xe
exit 1
}
docker exec ${NODE} ovs-vsctl add-br ${BRIDGE_INTERFACE}
docker exec ${NODE} ovs-vsctl add-port ${BRIDGE_INTERFACE} ${HOST_ADDITIONAL_INTERFACE}

Expand Down Expand Up @@ -123,4 +130,3 @@ for NODE in $KIND_NODES; do
done

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

0 comments on commit e3a5db1

Please sign in to comment.