Skip to content

Commit

Permalink
Merge pull request #2910 from spidernet-io/main
Browse files Browse the repository at this point in the history
merge main
  • Loading branch information
weizhoublue authored Dec 15, 2023
2 parents 92f502e + 921f004 commit 2ad8cbb
Show file tree
Hide file tree
Showing 282 changed files with 13,643 additions and 5,860 deletions.
2 changes: 1 addition & 1 deletion .github/.spelling
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ golangci-lint
gofmt
codeql
gokart
unitest
unittest
codecov
openapi.yaml
vXX.XX.XX
Expand Down
6 changes: 0 additions & 6 deletions .github/ISSUE_TEMPLATE/ci-failure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ body:
label: Which tests are failing?
validations:
required: true
- type: textarea
id: since
attributes:
label: Since when has it been failing?
validations:
required: true
- type: input
id: testgrid
attributes:
Expand Down
6 changes: 5 additions & 1 deletion .github/markdownlintignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
vendor/
vendor/
// Content tabs are used in the following documentation, which require special formatting
// see https://squidfunk.github.io/mkdocs-material/reference/content-tabs/#. Therefore, Markdown detection will be skipped.
docs/usage/install/get-started-kind-zh_CN.md
docs/usage/install/get-started-kind.md
8 changes: 4 additions & 4 deletions .github/workflows/auto-cherrypick.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: cherry pick
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.WELAN_PAT }}
JSON: ${{ toJSON(github) }}
run: |
set -x
Expand Down Expand Up @@ -174,9 +174,9 @@ jobs:
if [ "$FAIL" == "true" ] ; then
echo "failed to cherry pick to branch $BRANCH "
FINAL_FAILURE=true
echo -e "commits $PR_COMMITS conflict when merging to branch $BRANCH, please manually cherry pick it by yourself. \n PR <${PR_URL}> , action <${ACTION_URL}> \n\n \`\`\`\n${ERROR_MESSAGE}\n\`\`\` " | \
echo -e "commits $PR_COMMITS of ${PR_AUTHOR} conflict when merging to branch $BRANCH, please manually cherry pick it by yourself. \n PR <${PR_URL}> , action <${ACTION_URL}> \n\n \`\`\`\n${ERROR_MESSAGE}\n\`\`\` " | \
gh issue create \
--title "failed to auto cherry pick PR ${PR_NUMBER} to branch ${BRANCH}" \
--title "failed to cherry pick PR ${PR_NUMBER} from ${PR_AUTHOR}, to branch ${BRANCH}" \
--label "${{ env.CHERRYPICK_LABEL }}" \
--assignee "${PR_AUTHOR},${{ env.DEFAULT_REVIEWER }}" \
--body-file -
Expand All @@ -188,7 +188,7 @@ jobs:
gh pr create --title "${PR_TITLE}" \
--assignee "${PR_AUTHOR},${{ env.DEFAULT_REVIEWER }}" \
--label ${{ env.CHERRYPICK_LABEL }} \
--body "robot cherry pick pr <${PR_URL}> to branch ${BRANCH}, action <${ACTION_URL}> , commits $PR_COMMITS " \
--body "robot cherry pick PR <${PR_URL}> from ${PR_AUTHOR},to branch ${BRANCH}, action <${ACTION_URL}> , commits $PR_COMMITS " \
--base ${BRANCH}
else
echo "no changes happened for commits $PR_COMMITS, ignore create pr"
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/auto-nightly-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
outputs:
ref: ${{ env.RUN_REF }}
e2e_labels: ${{ env.RUN_E2E_LABELS }}
unitest_enabled: ${{ env.RUN_UNITEST_ENABLED }}
unittest_enabled: ${{ env.RUN_UNITTEST_ENABLED }}
run_push: ${{ env.RUN_PUSH}}
e2e_enabled: ${{ env.RUN_E2E_ENABLED }}
ipfamily_ipv4only_e2e: ${{ env.RUN_E2E_IPV4_ONLY }}
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
echo "RUN_E2E_LABELS=smoke" >> $GITHUB_ENV
echo "RUN_E2E_ENABLED=true" >> $GITHUB_ENV
# do it in another workflow
echo "RUN_UNITEST_ENABLED=false" >> $GITHUB_ENV
echo "RUN_UNITTEST_ENABLED=false" >> $GITHUB_ENV
echo "RUN_E2E_IPV4_ONLY=false" >> $GITHUB_ENV
echo "RUN_E2E_IPV6_ONLY=false" >> $GITHUB_ENV
echo "RUN_E2E_DUAL_STACK=true" >> $GITHUB_ENV
Expand All @@ -76,7 +76,7 @@ jobs:
fi
echo "RUN_E2E_ENABLED=${{ steps.filter_pr.outputs.run_e2e }}" >> $GITHUB_ENV
# do it in another workflow
echo "RUN_UNITEST_ENABLED=false" >> $GITHUB_ENV
echo "RUN_UNITTEST_ENABLED=false" >> $GITHUB_ENV
else
# schedule event
# use main sha for ci image tag
Expand All @@ -86,7 +86,7 @@ jobs:
# nightly ci, run all e2e
echo "RUN_E2E_LABEL=" >> $GITHUB_ENV
echo "RUN_E2E_ENABLED=true" >> $GITHUB_ENV
echo "RUN_UNITEST_ENABLED=true" >> $GITHUB_ENV
echo "RUN_UNITTEST_ENABLED=true" >> $GITHUB_ENV
echo "RUN_E2E_IPV4_ONLY=true" >> $GITHUB_ENV
echo "RUN_E2E_IPV6_ONLY=true" >> $GITHUB_ENV
echo "RUN_E2E_DUAL_STACK=true" >> $GITHUB_ENV
Expand All @@ -105,9 +105,9 @@ jobs:
ref=$( git show -s --format='format:%H')
echo "RUN_REF=${ref}" >> $GITHUB_ENV
call_unitest:
call_unittest:
needs: get_ref
if: ${{ needs.get_ref.outputs.unitest_enabled == 'true' }}
if: ${{ needs.get_ref.outputs.unittest_enabled == 'true' }}
# forbid to specify version for local workflow, GITHUB_REF Same as the caller workflow
uses: ./.github/workflows/lint-golang.yaml
with:
Expand Down Expand Up @@ -189,8 +189,8 @@ jobs:

creat_issue:
runs-on: ubuntu-latest
needs: [call_e2e_dual, call_e2e_ipv4, call_e2e_ipv6, call_unitest, lint_chart_against_release_image, call_low_kernel]
if: ${{ always() && needs.call_e2e_dual.result == 'failure' || needs.call_e2e_ipv4.result == 'failure' || needs.call_e2e_ipv6.result == 'failure' || needs.call_unitest.result == 'failure' || needs.lint_chart_against_release_image.result == 'failure' || needs.call_low_kernel.result == 'failure' }}
needs: [call_e2e_dual, call_e2e_ipv4, call_e2e_ipv6, call_unittest, lint_chart_against_release_image, call_low_kernel]
if: ${{ always() && needs.call_e2e_dual.result == 'failure' || needs.call_e2e_ipv4.result == 'failure' || needs.call_e2e_ipv6.result == 'failure' || needs.call_unittest.result == 'failure' || needs.lint_chart_against_release_image.result == 'failure' || needs.call_low_kernel.result == 'failure' }}
steps:
- name: echo
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/auto-pr-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
outputs:
ref: ${{ env.RUN_REF }}
e2e_labels: ${{ env.RUN_E2E_LABELS }}
unitest_enabled: ${{ env.RUN_UNITEST_ENABLED }}
unittest_enabled: ${{ env.RUN_UNITTEST_ENABLED }}
e2e_enabled: ${{ env.RUN_E2E_ENABLED }}
ipfamily_ipv4only_e2e: ${{ env.RUN_E2E_IPV4_ONLY }}
ipfamily_ipv6only_e2e: ${{ env.RUN_E2E_IPV6_ONLY }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
run: |
if ${{ github.event_name == 'workflow_dispatch' }} ; then
echo "call by self workflow_dispatch"
echo "RUN_UNITEST_ENABLED=true" >> $GITHUB_ENV
echo "RUN_UNITTEST_ENABLED=true" >> $GITHUB_ENV
echo "RUN_E2E_ENABLED=true" >> $GITHUB_ENV
echo "RUN_E2E_LABELS=${{ github.event.inputs.e2e_labels }}" >> $GITHUB_ENV
echo "RUN_TAG=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
echo "RUN_E2E_LABELS=smoke" >> $GITHUB_ENV
echo "RUN_E2E_ENABLED=true" >> $GITHUB_ENV
# do it in another workflow
echo "RUN_UNITEST_ENABLED=false" >> $GITHUB_ENV
echo "RUN_UNITTEST_ENABLED=false" >> $GITHUB_ENV
echo "RUN_E2E_IPV4_ONLY=false" >> $GITHUB_ENV
echo "RUN_E2E_IPV6_ONLY=false" >> $GITHUB_ENV
echo "RUN_E2E_DUAL_STACK=true" >> $GITHUB_ENV
Expand All @@ -118,15 +118,15 @@ jobs:
fi
echo "RUN_E2E_ENABLED=${{ steps.filter_pr.outputs.run_e2e }}" >> $GITHUB_ENV
# do it in another workflow
echo "RUN_UNITEST_ENABLED=false" >> $GITHUB_ENV
echo "RUN_UNITTEST_ENABLED=false" >> $GITHUB_ENV
else
# call by auto-nightly-ci, the event is schedule or its workflow_dispatch
# use main sha for ci image tag
echo "trigger by workflow_call"
echo "RUN_TAG=main" >> $GITHUB_ENV
echo "RUN_E2E_LABEL=" >> $GITHUB_ENV
echo "RUN_E2E_ENABLED=true" >> $GITHUB_ENV
echo "RUN_UNITEST_ENABLED=true" >> $GITHUB_ENV
echo "RUN_UNITTEST_ENABLED=true" >> $GITHUB_ENV
if ${{ inputs.ipfamily == 'ipv4' }}; then
echo "RUN_E2E_IPV4_ONLY=true" >> $GITHUB_ENV
echo "RUN_E2E_IPV6_ONLY=false" >> $GITHUB_ENV
Expand Down Expand Up @@ -163,9 +163,9 @@ jobs:
ref=$( git show -s --format='format:%H')
echo "RUN_REF=${ref}" >> $GITHUB_ENV
call_unitest:
call_unittest:
needs: get_ref
if: ${{ needs.get_ref.outputs.unitest_enabled == 'true' }}
if: ${{ needs.get_ref.outputs.unittest_enabled == 'true' }}
# forbid to specify version for local workflow, GITHUB_REF Same as the caller workflow
uses: ./.github/workflows/lint-golang.yaml
with:
Expand Down
130 changes: 72 additions & 58 deletions .github/workflows/build-image-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,25 @@ on:
required: true
default: v0.8.0
cni_version:
description: 'the version of cni-plugins, default to latest tag'
description: 'the version of cni-plugins, leave empty for latest release'
required: false
default: ""
ovs_version:
description: 'the version of ovs-cni plugin, default to latest tag'
description: 'the version of ovs-cni plugin, leave empty for latest release'
required: false
default: ""
rdma_version:
description: 'the version of rdma-cni plugin, default to main branch'
description: 'the version of rdma-cni plugin, leave empty for latest main code'
required: false
default: "latest"
default: ""
ibsriov_version:
description: 'the version of ib-sriov plugin, leave empty for latest release'
required: false
default: ""
ipoib_version:
description: 'the version of ipoib plugin, leave empty for latest release'
required: false
default: ""
push:
branches:
- main
Expand Down Expand Up @@ -72,71 +80,75 @@ jobs:
id: get_event_version
continue-on-error: false
run: |
cni_latest_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/containernetworking/plugins/releases/latest | jq '.tag_name' | tr -d '"')
if [ -z "${cni_latest_version}" ] ; then
echo "unable to get cni version" && exit 1
fi
ovs_latest_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/k8snetworkplumbingwg/ovs-cni/releases/latest | jq '.tag_name' | tr -d '"')
if [ -z "${ovs_latest_version}" ] ; then
echo "unable to get ovs version" && exit 1
if [ -n "${{ github.event.inputs.cni_version }}" ]; then
cni_version=${{ github.event.inputs.cni_version }}
else
cni_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/containernetworking/plugins/releases/latest | jq '.tag_name' | tr -d '"')
if [ -z "${cni_version}" ] ; then
echo "unable to get cni version" && exit 1
fi
fi
rdma_latest_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/k8snetworkplumbingwg/rdma-cni/releases/latest | jq '.tag_name' | tr -d '"')
if [ -z "${rdma_latest_version}" ] ; then
echo "unable to get rdma version" && exit 1
if [ -n "${{ github.event.inputs.ovs_version }}" ]; then
ovs_version=${{ github.event.inputs.ovs_version }}
else
ovs_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/k8snetworkplumbingwg/ovs-cni/releases/latest | jq '.tag_name' | tr -d '"')
if [ -z "${ovs_version}" ] ; then
echo "unable to get ovs version" && exit 1
fi
fi
if ${{ github.event_name == 'workflow_dispatch' }}; then
echo "trigger by workflow_dispatch"
cni_version=${{ github.event.inputs.cni_version }}
if [ -z "${cni_version}" ]; then
cni_version=${cni_latest_version}
fi
ovs_version=${{ github.event.inputs.ovs_version }}
if [ -z "${ovs_version}" ]; then
ovs_version=${ovs_latest_version}
fi
rdma_version=${{ github.event.inputs.rdma_version }}
if [ -z "${rdma_version}" ]; then
rdma_version=${rdma_latest_version}
elif [ "${rdma_version}" = "latest" ] ; then
if [ -n "${{ github.event.inputs.rdma_version }}" ]; then
rdma_version=${{ github.event.inputs.rdma_version }}
else
# rdma don't release any more, we use main branch to build.
git clone https://github.com/k8snetworkplumbingwg/rdma-cni.git
cd rdma-cni && rdma_version=$(git show -s --format='format:%H') && cd ..
fi
ref=${{ github.event.inputs.ref }}
tag=${{ github.event.inputs.tag }}
echo "cni version: ${cni_version}"
echo "ovs version: ${ovs_version}"
echo "rdma version: ${rdma_version}"
echo "plugins tag: ${tag}"
echo "event_ref=${ref}" >> $GITHUB_OUTPUT
echo "event_tag=${tag}" >> $GITHUB_OUTPUT
echo "event_cni_version=${cni_version}" >> $GITHUB_OUTPUT
echo "event_ovs_version=${ovs_version}" >> $GITHUB_OUTPUT
echo "event_rdma_version=${rdma_version}" >> $GITHUB_OUTPUT
fi
if [ -n "${{ github.event.inputs.ibsriov_version }}" ]; then
ibsriov_version="${{ github.event.inputs.ibsriov_version }}"
else
ibsriov_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/k8snetworkplumbingwg/ib-sriov-cni/releases/latest | jq '.tag_name' | tr -d '"')
if [ -z "${ibsriov_version}" ] ; then
echo "unable to get ibsriov version" && exit 1
fi
fi
if [ -n "${{ github.event.inputs.ipoib_version }}" ]; then
ipoib_version="${{ github.event.inputs.ipoib_version }}"
else
ipoib_version=$(curl --retry 10 -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/Mellanox/ipoib-cni/releases/latest | jq '.tag_name' | tr -d '"')
if [ -z "${ipoib_version}" ] ; then
echo "unable to get ipoib version" && exit 1
fi
fi
if ${{ github.event_name == 'workflow_dispatch' }}; then
ref=${{ github.event.inputs.ref }}
tag=${{ github.event.inputs.tag }}
elif ${{ github.event_name == 'push' }} ; then
echo "trigger by push"
git clone https://github.com/k8snetworkplumbingwg/rdma-cni.git
cd rdma-cni && rdma_latest_version=$(git show -s --format='format:%H') && cd ..
echo "cni version: ${cni_latest_version}"
echo "ovs version: ${ovs_latest_version}"
echo "rdma version: ${rdma_latest_version}"
echo "event_ref=${{ github.ref }}" >> $GITHUB_OUTPUT
echo "event_tag=${{ github.sha }}" >> $GITHUB_OUTPUT
echo "event_cni_version=${cni_latest_version}" >> $GITHUB_OUTPUT
echo "event_ovs_version=${ovs_latest_version}" >> $GITHUB_OUTPUT
echo "event_rdma_version=${rdma_latest_version}" >> $GITHUB_OUTPUT
echo "event_ref=${{ github.ref }}" >> $GITHUB_OUTPUT
echo "event_tag=${{ github.sha }}" >> $GITHUB_OUTPUT
else
echo "unexpected event"
exit 1
echo "unexpected event"
exit 1
fi
echo "event_ref=${ref}" >> $GITHUB_OUTPUT
echo "event_tag=${tag}" >> $GITHUB_OUTPUT
echo "image tag: ${tag}"
echo "cni version: ${cni_version}"
echo "ovs version: ${ovs_version}"
echo "rdma version: ${rdma_version}"
echo "ibsriov version : ${ibsriov_version}"
echo "ipoib version : ${ipoib_version}"
echo "event_cni_version=${cni_version}" >> $GITHUB_OUTPUT
echo "event_ovs_version=${ovs_version}" >> $GITHUB_OUTPUT
echo "event_rdma_version=${rdma_version}" >> $GITHUB_OUTPUT
echo "event_ibsriov_version=${ibsriov_version}" >> $GITHUB_OUTPUT
echo "event_ipoib_version=${ipoib_version}" >> $GITHUB_OUTPUT
- name: Checkout Source Code
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -193,6 +205,8 @@ jobs:
CNI_VERSION=${{ steps.get_event_version.outputs.event_cni_version }}
OVS_VERSION=${{ steps.get_event_version.outputs.event_ovs_version }}
RDMA_VERSION=${{ steps.get_event_version.outputs.event_rdma_version }}
IB_SRIOV_VERSION=${{ steps.get_event_version.outputs.event_ibsriov_version }}
IPOIB_VERSION=${{ steps.get_event_version.outputs.event_ipoib_version }}
- name: Image Release Digest
if: ${{ steps.tag-in-repositories.outputs.exists == 'false' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call-lint-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

# https://github.com/actions/setup-python
- name: Set up Python
uses: actions/setup-python@v4.7.1
uses: actions/setup-python@v5.0.0
with:
python-version: 3.8
architecture: x64
Expand Down
Loading

0 comments on commit 2ad8cbb

Please sign in to comment.