Skip to content

Commit

Permalink
fix binary build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclinder committed Mar 7, 2023
1 parent b6d656c commit 2dfc5af
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 43 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/bin-build.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: Binary build

on:
pull_request_target:
types:
- opened
- synchronize
- reopened
workflow_call:
inputs:
ref:
Expand All @@ -14,10 +9,6 @@ on:
tag:
required: false
type: string
push:
branch:
tags:
- main

permissions: write-all

Expand Down Expand Up @@ -65,16 +56,18 @@ jobs:
fi
- name: Build
run:
run: |
make build ARCH=${{ matrix.go_arch }} GIT_TAG=${{ steps.tag.outputs.tag }}
if [ "${{ steps.tag.outputs.upload }}" == "true" ]; then
cd ./.tmp/bin && tar -cvzf /home/spider-plugins-linux-${{ matrix.go_arch }}-${{ steps.tag.outputs.tag }}.tar *
sudo mkdir -p /home/spider/
cd ./.tmp/bin
sudo tar -cvzf /home/spider/spider-plugins-linux-${{ matrix.go_arch }}-${{ steps.tag.outputs.tag }}.tar *
fi
- name: Upload Binary artifact
if: ${{ steps.tag.outputs.upload == 'true' }}
uses: actions/[email protected]
with:
name: binary_files
path: /home/spider-plugins-linux-${{ matrix.go_arch }}-${{ steps.tag.outputs.tag }}.tar
path: /home/spider/spider-plugins-linux-${{ matrix.go_arch }}-${{ steps.tag.outputs.tag }}.tar
retention-days: 1
6 changes: 1 addition & 5 deletions .github/workflows/e2e-init.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: call e2e

env:
CI_IMAGE_REPO: ghcr.io/spidernet-io/cni-plugins/meta-plugins
PERFORMANCESCRIPT: "./tools/scripts/e2eperformance.sh"

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -54,7 +50,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: binary_files
path: /home
path: .tmp

- name: Install
id: install
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Spider Plugins

[![Run E2E Kind Test](https://github.com/spidernet-io/plugins/actions/workflows/e2e-test.yaml/badge.svg)](https://github.com/spidernet-io/plugins/actions/workflows/e2e-test.yaml)
[![Run E2E Kind Test](https://github.com/spidernet-io/plugins/actions/workflows/e2e-test.yaml/badge.svg?branch=main)](https://github.com/spidernet-io/plugins/actions/workflows/e2e-test.yaml)
[![Auto Golang Lint And Unitest](https://github.com/spidernet-io/plugins/actions/workflows/lint-golang.yaml/badge.svg?branch=main)](https://github.com/spidernet-io/plugins/actions/workflows/lint-golang.yaml)

Some legacy applications expect to be directly connected to the physical network. The Pod has the performance of the physical network and with real source IP. In this type of situation, you maybe use the MacVlan or SR-IoV CNI to achieve this. And if you use MacVlan CNI, you maybe be run into some network communication bugs, As shown the following issues below:

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var _ = Describe("config", func() {
}
var want = &ty.RPFilter{
Enable: pointer.Bool(true),
Value: 2,
Value: 0,
}
validateRPFilterConfig(config)
Expect(config).To(Equal(want))
Expand Down
3 changes: 0 additions & 3 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ install:
export VLAN_GATEWAY_CONTAINER=${VLAN_GATEWAY_CONTAINER} ; \
export CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION} ; \
export RUN_ON_LOCAL=${RUN_ON_LOCAL} ; \
export META_PLUGINS_CI_REGISTRY=${META_PLUGINS_CI_REGISTRY} ; \
export META_PLUGINS_CI_REPOSITORY=${META_PLUGINS_CI_REPOSITORY} ; \
export META_PLUGINS_CI_TAG=${META_PLUGINS_CI_TAG} ; \
export SPIDERPOOL_VERSION=${SPIDERPOOL_VERSION} ; \
export SPIDERDOCTOR_VERSION=${SPIDERDOCTOR_VERSION} ; \
export SPIDERDOCTOR_REPORT_PATH=${SPIDERDOCTOR_REPORT_PATH} ; \
Expand Down
31 changes: 17 additions & 14 deletions test/scripts/install/02-multus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,23 @@ PROJECT_ROOT_PATH=$( cd ${CURRENT_DIR_PATH}/../.. && pwd )
MACVLAN_MASTER=${MACVLAN_MASTER:-eth0}
MACVLAN_TYPE=${MACVLAN_TYPE:-macvlan-standalone}



if [ ${RUN_ON_LOCAL} == false ]; then
MULTUS_HELM_OPTIONS+=" --set multus.image.registry=ghcr.io \
--set sriov.images.sriovCni.registry=ghcr.io \
--set sriov.images.sriovDevicePlugin.registry=ghcr.io "
fi
case ${IP_FAMILY} in
ipv4)
SERVICE_HIJACK_SUBNET="[\"${CLUSTER_SERVICE_SUBNET_V4}\"]"
OVERLAY_HIJACK_SUBNET="[\"${CLUSTER_POD_SUBNET_V4}\"]"
;;
ipv6)
SERVICE_HIJACK_SUBNET="[\"${CLUSTER_SERVICE_SUBNET_V6}\"]"
OVERLAY_HIJACK_SUBNET="[\"${CLUSTER_POD_SUBNET_V6}\"]"
;;
dual)
SERVICE_HIJACK_SUBNET="[\"${CLUSTER_SERVICE_SUBNET_V4}\",\"${CLUSTER_SERVICE_SUBNET_V6}\"]"
OVERLAY_HIJACK_SUBNET="[\"${CLUSTER_POD_SUBNET_V4}\",\"${CLUSTER_POD_SUBNET_V6}\"]"
;;
*)
echo "the value of IP_FAMILY: ipv4 or ipv6 or dual"
exit 1
esac

git clone https://github.com/k8snetworkplumbingwg/multus-cni.git
cat multus-cni/deployments/multus-daemonset-thick.yml | kubectl apply --kubeconfig ${E2E_KUBECONFIG} -f -
Expand All @@ -35,13 +45,6 @@ apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
annotations:
v1.multus-underlay-cni.io/coexist-types: '["macvlan-standalone"]'
v1.multus-underlay-cni.io/default-cni: "true"
v1.multus-underlay-cni.io/instance-type: macvlan_standalone
v1.multus-underlay-cni.io/underlay-cni: "true"
v1.multus-underlay-cni.io/vlanId: "${MACVLAN_VLANID}"
labels:
v1.multus-underlay-cni.io/instance-status: enable
name: macvlan-standalone-vlan${MACVLAN_VLANID}
namespace: kube-system
spec:
Expand Down
17 changes: 10 additions & 7 deletions test/scripts/install/04-cni-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,20 @@ CNI_PACKAGE_PATH=${PROJECT_ROOT_PATH}/.tmp/plugins/${PACKAGE_NAME}

echo ${CNI_PACKAGE_PATH}

ls /home/spider-plugins-*.tar
[ "$?" != "0"] && echo "spider plugins no found" && exit 2
SPIDER_PLUGINS_FILES_PATH=`ls /home/spider-plugins-*.tar`
ls ${PROJECT_ROOT_PATH}/.tmp/spider-plugins-linux-amd64-*.tar
[ "$?" != "0" ] && echo "spider plugins no found" && exit 2
SPIDER_PLUGINS_FILE_PATH=`ls ${PROJECT_ROOT_PATH}/.tmp/spider-plugins-linux-amd64-*.tar`
SPIDER_PLUGINS_FILE_NAME=${SPIDER_PLUGINS_FILE_PATH##*/}
mv ${PROJECT_ROOT_PATH}/.tmp/${SPIDER_PLUGINS_FILE_NAME} ${PROJECT_ROOT_PATH}/.tmp/plugins/

ls ${PROJECT_ROOT_PATH}/.tmp/plugins/

kind_nodes=`docker ps | egrep "kindest/node.* ${IP_FAMILY}-(control-plane|worker)" | awk '{print $1}'`
for node in ${kind_nodes} ; do
echo "install cni-plugins to kind-node: ${node} "
docker cp ${CNI_PACKAGE_PATH} $node:/root/
docker cp ${PROJECT_ROOT_PATH}/.tmp/plugins/${PACKAGE_NAME} $node:/root/
docker exec $node tar xvfzp /root/${PACKAGE_NAME} -C /opt/cni/bin
docker cp ${SPIDER_PLUGINS_FILES_PATH} $node:/root/
docker exec $node tar xvfzp /root/${SPIDER_PLUGINS_FILES_PATH} -C /opt/cni/bin
docker cp ${PROJECT_ROOT_PATH}/.tmp/plugins/${SPIDER_PLUGINS_FILE_NAME} $node:/root/
docker exec $node tar -xvf /root/${SPIDER_PLUGINS_FILE_NAME} -C /opt/cni/bin
done

echo -e "\033[35m Succeed to install cni-plugins to kind-node \033[0m"

0 comments on commit 2dfc5af

Please sign in to comment.