Skip to content

Commit

Permalink
cherry-pick some CI changes
Browse files Browse the repository at this point in the history
Signed-off-by: tao.yang <[email protected]>
  • Loading branch information
ty-dc committed Sep 9, 2024
1 parent 64fa3de commit 195d8ae
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/auto-upgrade-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,6 @@ jobs:
with:
go-version: 1.21.4

- name: Install Kind Bin
uses: helm/[email protected]
with:
install_only: true

- name: Install Tools
run: |
bash ./test/scripts/install-tools.sh
Expand Down Expand Up @@ -326,16 +321,17 @@ jobs:
id: upgrade
continue-on-error: true
run: |
RESULT=0
make upgrade_e2e_spiderpool -e E2E_CLUSTER_NAME=${{ env.E2E_CLUSTER_NAME }} \
-e E2E_SPIDERPOOL_TAG=${{ needs.call_build_new_ci_image.outputs.imageTag }} \
-e SPIDERPOOL_AGENT_IMAGE_NAME=spiderpool-agent-race \
-e SPIDERPOOL_CONTROLLER_IMAGE_NAME=spiderpool-controller-race \
-e INSTALL_KUBEVIRT=true \
-e INSTALL_KRUISE=true \
-e INSTALL_KDOCTOR=true \
-e INSTALL_OVS=${INSTALL_OVS_VALUE} \
-e INSTALL_RDMA=true \
-e INSTALL_SRIOV=true
-e SPIDERPOOL_CONTROLLER_IMAGE_NAME=spiderpool-controller-race || RESULT=1
if ((RESULT==0)) ; then
echo "succeeded to upgrade spiderpool from ${{ needs.get_ref.outputs.old_version }} to ${{ needs.get_ref.outputs.new_version }}"
else
echo "failed to upgrade spiderpool from ${{ needs.get_ref.outputs.old_version }} to ${{ needs.get_ref.outputs.new_version }}"
exit 1
fi
- name: Run e2e Test on tag ${{ needs.get_ref.outputs.new_version }}
id: run_e2e
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/e2e-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,10 @@ jobs:
path: e2ereport.json
retention-days: 1

- name: helm uninstalls spiderpool and cleans spiderpool CRD
id: clean
if: ${{ inputs.run_e2e == 'true' }}
run: |
RESULT=0
make clean_e2e_spiderpool || RESULT=1
if ((RESULT==0)) ; then
echo "CLEAN_E2E_PASS=true" >> $GITHUB_ENV
else
echo "CLEAN_E2E_PASS=false" >> $GITHUB_ENV
fi
- name: Show e2e Result
if: ${{ inputs.run_e2e == 'true' }}
run: |
if ${{ env.RUN_E2E_PASS == 'true' && env.CLEAN_E2E_PASS == 'true' }} ;then
if ${{ env.RUN_E2E_PASS == 'true' }} ;then
exit 0
else
exit 1
Expand Down Expand Up @@ -251,3 +239,15 @@ jobs:
label: performance
message: ${{ env.PERFORMANCE_RESULT }}
color: lightgrey

- name: helm uninstalls spiderpool and cleans spiderpool CRD
id: clean
if: ${{ inputs.run_e2e == 'true' }}
run: |
RESULT=0
make clean_e2e_spiderpool || RESULT=1
if ((RESULT==0)) ; then
echo "succeeded to uninstall spiderpool"
else
echo "failed to uninstall spiderpool"
fi
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,11 @@ clean: clean_e2e

.PHONY: clean_e2e_spiderpool
clean_e2e_spiderpool:
-$(QUIET) make -C test uninstall_spiderpool
$(QUIET) make -C test uninstall_spiderpool

.PHONY: upgrade_e2e_spiderpool
upgrade_e2e_spiderpool:
-$(QUIET) make -C test upgrade_spiderpool
$(QUIET) make -C test upgrade_spiderpool

.PHONY: codegen
codegen:
Expand Down
11 changes: 6 additions & 5 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ clean_spiderpool_crd:
@-$(QUIET) export KUBECONFIG=$(E2E_KUBECONFIG); $(ROOT_DIR)/tools/scripts/cleanCRD.sh
@ALL_CRD=`kubectl get crd -n $(RELEASE_NAMESPACE) --kubeconfig $(E2E_KUBECONFIG) | awk '{print $$1 } ' ` ; FAIL="false" ; \
for CRD in $$ALL_CRD ; do \
echo $${CRD} | grep -q 'spiderpool.spidernet.io' && FAIL="true" && echo "error, failed to clean spiderpool crd: $${CRD}" ; \
echo $${CRD} | grep -q -E 'spiderpool.spidernet.io|sriovnetwork.openshift.io' && FAIL="true" && echo "error, failed to clean spiderpool crd: $${CRD}" ; \
if [ "$$FAIL" == "true" ] ; then \
echo -e "\033[35m [===== describe crd: $${CRD} =====] \033[0m" ; \
kubectl describe crd $${CRD} --kubeconfig $(E2E_KUBECONFIG) ; \
Expand All @@ -371,20 +371,21 @@ clean_spiderpool_crd:
[ "$$FAIL" == "true" ] && echo "spiderpool crd cleanup failed" && exit 1 ; \
echo -e "\033[35m [done] all spiderpool crd cleaned up !!! \033[0m"

.PHONY: helm_uninstall_spiderpool
helm_uninstall_spiderpool:
.PHONY: uninstall_spiderpool
uninstall_spiderpool:
@echo -e "\033[35m [helm uninstall spiderpool] \033[0m"
helm uninstall $(RELEASE_NAME) --wait --debug -n $(RELEASE_NAMESPACE) \
--kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" ; exit 1 ; } ; \
echo "Multus config has been cleanup successfully." ; \
for ((i=0; i<100; i++)); do \
if ! kubectl --kubeconfig=$(E2E_KUBECONFIG) get all --all-namespaces | grep -q "spiderpool" ; then \
echo "All resources successfully cleared." ; \
echo "All Spiderpool Pod successfully cleared." ; \
exit 0; \
fi ;\
echo "found spiderpool resources, waiting..." ; \
echo "found spiderpool pod, waiting..." ; \
sleep 1 ; \
done; \
make clean_spiderpool_crd ; \
echo "error: found spiderpool resources" ; exit 1 ;
@echo "check cni conf removed from nodes: $(POST_UNINSTALL_CHECK_CNI_CONF) " ; \
NODE_LIST=` docker ps | egrep "kindest/node.* $(E2E_CLUSTER_NAME)-(control|worker)" | awk '{print $$1 }' ` ; \
Expand Down
6 changes: 5 additions & 1 deletion test/scripts/debugEnv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ elif [ "$TYPE"x == "detail"x ] ; then
echo "${ERROR_POD}"
for LINE in ${ERROR_POD}; do
NS_NAME=${LINE//,/ }
echo "---------------error pod: ${NS_NAME}------------"
echo "---------------describe error pod: ${NS_NAME}------------"
kubectl describe pod -n ${NS_NAME} --kubeconfig ${E2E_KUBECONFIG}
echo "---------------logs error pod: ${NS_NAME}------------"
kubectl logs -n ${NS_NAME} --kubeconfig ${E2E_KUBECONFIG}
echo "---------------logs error pod: ${NS_NAME} --previous------------"
kubectl logs -n ${NS_NAME} --kubeconfig ${E2E_KUBECONFIG} --previous
done
fi

Expand Down

0 comments on commit 195d8ae

Please sign in to comment.