Skip to content

Commit

Permalink
Optimize setup kind cluster debug log
Browse files Browse the repository at this point in the history
Signed-off-by: ty-dc <tao.yang@daocloud.io>
  • Loading branch information
ty-dc committed Sep 18, 2024
1 parent 9e2c46b commit d37b3a7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/e2e-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ jobs:
echo "The current kubernetes version is ${{ inputs.k8s_version }} , ignore to install openvswitch due to Kind base image outdated"
INSTALL_OVS_VALUE=false;
fi
RESULT=0
make ${{ matrix.e2e_init_mode }} -e E2E_CLUSTER_NAME=${{ env.E2E_CLUSTER_NAME }} \
-e E2E_SPIDERPOOL_TAG=${{ inputs.image_tag }} \
-e SPIDERPOOL_AGENT_IMAGE_NAME=spiderpool-agent-race \
Expand All @@ -157,7 +158,33 @@ jobs:
-e INSTALL_KDOCTOR=true \
-e INSTALL_OVS=${INSTALL_OVS_VALUE} \
-e INSTALL_RDMA=true \
-e INSTALL_SRIOV=true
-e INSTALL_SRIOV=true || RESULT=1
if ((RESULT==0)) ; then
echo "RUN_SETUP_KIND_CLUSTER_PASS=true" >> $GITHUB_ENV
else
echo "RUN_SETUP_KIND_CLUSTER_PASS=false" >> $GITHUB_ENV
fi
if [ -f "test/e2edebugLog" ] ; then
echo "UPLOAD_SETUP_KIND_CLUSTER_LOG=true" >> $GITHUB_ENV
else
echo "UPLOAD_SETUP_KIND_CLUSTER_LOG=false" >> $GITHUB_ENV
fi
- name: Upload Setup Kind Cluster log
if: ${{ env.RUN_SETUP_KIND_CLUSTER_PASS == 'false' && env.UPLOAD_SETUP_KIND_CLUSTER_LOG == 'true' }}
uses: actions/upload-artifact@v3.1.3
with:
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-setupkind.txt
path: test/e2edebugLog.txt
retention-days: 7

- name: Show Setup Kind Cluster Result
run: |
if ${{ env.RUN_SETUP_KIND_CLUSTER_PASS == 'true' }} ;then
exit 0
else
exit 1
fi
- name: Run e2e Test
id: run_e2e
Expand Down
4 changes: 2 additions & 2 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ setup_kruise:
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) \
--kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" ; exit 1 ; } ; \
--kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" "$(E2E_LOG_FILE)" ; exit 1 ; } ; \

.PHONY: setup_spiderpool
setup_spiderpool:
Expand Down Expand Up @@ -382,7 +382,7 @@ setup_spiderpool:
-n $(RELEASE_NAMESPACE) \
$${HELM_OPTION} \
$(E2E_HELM_ADDITIONAL_OPTIONS) \
--kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" ; exit 1 ; } ; \
--kubeconfig $(E2E_KUBECONFIG) || { KIND_CLUSTER_NAME=$(E2E_CLUSTER_NAME) ./scripts/debugEnv.sh $(E2E_KUBECONFIG) "detail" "$(E2E_LOG_FILE)" ; exit 1 ; } ; \
if [ "$(INSTALL_SRIOV)" == "true" ] ; then \
echo "label node for sriov operator " ; \
kubectl --kubeconfig $(E2E_KUBECONFIG) get node | sed '1d' | awk '{print $$1}' | xargs -n 1 -i kubectl --kubeconfig $(E2E_KUBECONFIG) label node {} node-role.kubernetes.io/worker="" ; \
Expand Down

0 comments on commit d37b3a7

Please sign in to comment.