Skip to content

Commit

Permalink
ci to test make some commands (#265)
Browse files Browse the repository at this point in the history
Signed-off-by: John O'Loughlin <[email protected]>
  • Loading branch information
johnoloughlin authored Jan 9, 2024
1 parent b8e6ed2 commit ade22dc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 32 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
run: source ./ci/ci.sh && create_kind_cluster
- name: deploy_multus
run: source ./ci/ci.sh && deploy_multus
- name: deploy_userspacecni
run: source ./ci/ci.sh && deploy_userspace
- name: vpp_e2e_test
run: source ./ci/ci.sh && vpp_e2e_test
- name: build_ovs_container
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/weekly_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
run: source ./ci/ci.sh && create_kind_cluster
- name: deploy_multus
run: source ./ci/ci.sh && deploy_multus
- name: deploy_userspacecni
run: source ./ci/ci.sh && deploy_userspace
- name: vpp_e2e_test
run: source ./ci/ci.sh && vpp_e2e_test

Expand All @@ -63,6 +65,8 @@ jobs:
run: source ./ci/ci.sh && create_kind_cluster -v ${{ matrix.kubernetes_version }}
- name: deploy_multus
run: source ./ci/ci.sh && deploy_multus
- name: deploy_userspacecni
run: source ./ci/ci.sh && deploy_userspace
- name: vpp_e2e_test
run: source ./ci/ci.sh && vpp_e2e_test
- name: build_ovs_container
Expand Down
14 changes: 12 additions & 2 deletions ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ kubectl get all --all-namespaces
sleep 10
cd $USERSPACEDIR

docker build . -f ./docker/userspacecni/Dockerfile -t userspacecni:latest
make build
# gets path for one directopry above, needed for mkdir with docker cp below
mkdir_var=$(dirname ${USERSPACEDIR})
kind load docker-image userspacecni
kind load docker-image localhost:5000/userspacecni
docker exec -i kind-control-plane bash -c "mkdir -p $mkdir_var"
docker cp "${USERSPACEDIR}" "kind-control-plane:${USERSPACEDIR}"
}
Expand All @@ -62,6 +62,15 @@ sed -i "s/snapshot-thick/v4.0.2/g" multus-daemonset.yml
kubectl apply -f ./multus-daemonset.yml
}

deploy_userspace(){
cd $USERSPACEDIR
#kubectl label nodes kind-control-plane app=userspace-cni
kubectl label nodes --all app=userspace-cni
make deploy
echo "sleeping for 20 to allow userspace to deploy first"
sleep 20
}

vpp_e2e_test(){
cd $CI_DIR/vpp_test_setup/
echo "Setting up vpp host"
Expand Down Expand Up @@ -161,6 +170,7 @@ run_all(){
install_go_kubectl_kind
create_kind_cluster -v v1.27.3
deploy_multus
deploy_userspace
vpp_e2e_test
build_ovs_container
build_testpmd_container
Expand Down
30 changes: 0 additions & 30 deletions ci/vpp_test_setup/vpp_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,8 @@ kubectl create -n vpp configmap vpp-startup-config --from-file="${USERSPACEDIR}/

worker="kind-control-plane"


rm /opt/cni/bin/userspace
docker exec -i kind-control-plane bash -c "mkdir -p /var/run/vpp/app"

cat << EOF | kubectl apply -f -
---
apiVersion: v1
kind: Pod
metadata:
name: userspacecni-$worker
namespace: vpp
spec:
nodeSelector:
kubernetes.io/hostname: $worker
containers:
- name: userspacecni-$worker
image: userspacecni:latest
imagePullPolicy: IfNotPresent
volumeMounts:
- name: cni
mountPath: /opt/cni/bin
volumes:
- name: cni
hostPath:
path: /opt/cni/bin
restartPolicy: Never
EOF


echo "sleeping for 20 to allow userspace to deploy first"
sleep 20

cat << EOF | kubectl apply -f -
---
apiVersion: v1
Expand Down
10 changes: 10 additions & 0 deletions kubernetes/userspace-daemonset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ spec:
- name: userspace-cni-plugin
image: localhost:5000/userspacecni #registory:imagename
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
privileged: false
resources:
requests:
cpu: 1m
memory: 1Mi
limits:
cpu: 100m
memory: 30Mi
volumeMounts:
- name: cnibin
mountPath: /opt/cni/bin
Expand Down

0 comments on commit ade22dc

Please sign in to comment.