Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC support for xsync with optimizations #387

Merged
merged 13 commits into from
Sep 5, 2023
48 changes: 48 additions & 0 deletions cicd/sync/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

loxilbs = (ENV['LOXILBS'] || "2").to_i
eps = (ENV['LOXILBS'] || "1").to_i
box_name = (ENV['VAGRANT_BOX'] || "sysnet4admin/Ubuntu-k8s")
box_version = "0.7.1"
Vagrant.configure("2") do |config|
config.vm.box = "#{box_name}"
config.vm.box_version = "#{box_version}"

(1..loxilbs).each do |node_number|
config.vm.define "llb#{node_number}" do |loxilb|
loxilb.vm.hostname = "llb#{node_number}"
ip = node_number + 10
loxilb.vm.network :private_network, ip: "192.168.80.#{ip}", :netmask => "255.255.255.0"
loxilb.vm.network :private_network, ip: "192.168.90.#{ip}", :netmask => "255.255.255.0"
loxilb.vm.provision :shell, :path => "loxilb.sh"
loxilb.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", 6000]
vbox.customize ["modifyvm", :id, "--cpus", 4]
end
end
end

config.vm.define "client" do |client|
client.vm.hostname = 'client'
client.vm.network :private_network, ip: "192.168.80.100", :netmask => "255.255.255.0"
client.vm.provision :shell, :path => "client.sh"
client.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", 6000]
vbox.customize ["modifyvm", :id, "--cpus", 4]
end
end

(1..eps).each do |node_number|
config.vm.define "ep#{node_number}" do |ep|
ep.vm.hostname = "ep#{node_number}"
ip = node_number + 100
ep.vm.network :private_network, ip: "192.168.90.#{ip}", :netmask => "255.255.255.0"
ep.vm.provision :shell, :path => "ep.sh"
ep.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", 6000]
vbox.customize ["modifyvm", :id, "--cpus", 4]
end
end
end
end
3 changes: 3 additions & 0 deletions cicd/sync/client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sudo apt -y install autoconf automake libtool bison flex gcc ncurses-dev
git clone https://github.com/satori-com/tcpkali.git
sudo ip route add 20.20.20.1 via 192.168.80.11
3 changes: 3 additions & 0 deletions cicd/sync/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
vagrant global-status | grep -i virtualbox | cut -f 1 -d ' ' | xargs -L 1 vagrant destroy -f
vagrant up
4 changes: 4 additions & 0 deletions cicd/sync/ep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sudo ip route add 20.20.20.1 via 192.168.90.11
sudo ip route add 192.168.80.0/24 via 192.168.90.11
sudo apt -y install autoconf automake libtool bison flex gcc ncurses-dev
git clone https://github.com/satori-com/tcpkali.git
17 changes: 17 additions & 0 deletions cicd/sync/loxilb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export LOXILB_IP=$(ip a |grep global | grep -v '10.0.2.15' | grep -v '192.168.80' | awk '{print $2}' | cut -f1 -d '/')

apt-get update
apt-get install -y software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get install -y docker-ce
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged --entrypoint /bin/bash -dit -v /dev/log:/dev/log --net=host --name loxilb ghcr.io/loxilb-io/loxilb:latest

docker exec -it loxilb apt update
docker exec -it loxilb apt -y install clang-10 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iperf iproute2 nodejs socat ethtool
docker exec -it loxilb git clone https://github.com/loxilb-io/loxilb.git --recurse-submodules

echo alias loxicmd=\"sudo docker exec -it loxilb loxicmd\" >> ~/.bashrc
echo alias loxilb=\"sudo docker exec -it loxilb \" >> ~/.bashrc

echo $LOXILB_IP > /vagrant/loxilb-$(hostname)
5 changes: 5 additions & 0 deletions cicd/sync/rmconfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
vagrant destroy -f ep1
vagrant destroy -f client
vagrant destroy -f llb1
vagrant destroy -f llb2
49 changes: 49 additions & 0 deletions cicd/sync/validation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
source ../common.sh
echo k3s-cilium-cluster

if [ "$1" ]; then
KUBECONFIG="$1"
fi

# Set space as the delimiter
IFS=' '

sleep 45
extIP="123.123.123.1"
echo $extIP

echo "Service Info"
vagrant ssh master -c 'sudo kubectl get svc'
echo "LB Info"
vagrant ssh loxilb -c 'sudo docker exec -i loxilb loxicmd get lb -o wide'
echo "EP Info"
vagrant ssh loxilb -c 'sudo docker exec -i loxilb loxicmd get ep -o wide'

print_debug_info() {
echo "llb1 route-info"
vagrant ssh loxilb -c 'ip route'
vagrant ssh master -c 'sudo kubectl get pods -A'
vagrant ssh master -c 'sudo kubectl get svc'
vagrant ssh master -c 'sudo kubectl get nodes'
}

out=$(curl -s --connect-timeout 10 http://$extIP:55002)
if [[ ${out} == *"Welcome to nginx"* ]]; then
echo "k3s-cilium-cluster (kube-loxilb) tcp [OK]"
else
echo "k3s-cilium-cluster (kube-loxilb) tcp [FAILED]"
print_debug_info
exit 1
fi

out=$(timeout 10 ../common/udp_client $extIP 55003)
if [[ ${out} == *"Client"* ]]; then
echo "k3s-cilium-cluster (kube-loxilb) udp [OK]"
else
echo "k3s-cilium-cluster (kube-loxilb) udp [FAILED]"
print_debug_info
exit 1
fi

exit
Loading
Loading