$script = <<SCRIPT
export DEBIAN_FRONTEND=noninteractive
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker vagrant
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.vm.synced_folder './','/home/vagrant/src'
docker container run --cap-add=IPC_LOCK -it --rm ubuntu:16.04 /bin/bash
###################
# Deps
###################
apt-get update -y && apt-get -y install \
build-essential libpcap-dev wget libnuma-dev
###################
Custom Bridge
sudo su
ip addr flush dev <dataintf> # Should not be ssh intf
brctl addbr bridge0
brctl addif bridge0 <dataintf>
ip addr add <subnet> dev bridge0
ip link set dev bridge0 up
git clone https://github.com/mattgodbolt/compiler-explorer.git
cat << "EOF" > compiler-explorer/Dockerfile
FROM ubuntu:16.04
RUN apt-get update -y && apt-get install -y software-properties-common python-software-properties && \
add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update -y && \
apt-get install -y make gcc g++ gcc-5 g++-5 gcc-6 g++-6 gcc-7 g++-7 git nodejs npm
git clone http://dpdk.org/git/dpdk -b v16.11 && cd dpdk
make config T=x86_64-native-linuxapp-gcc
make -j
# native BDW
# -march=native -DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 \
# -DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES \
# -DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND \
# -DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C -DRTE_MACHINE_CPUFLAG_AVX2
To enable cpu-manager in k8s kubelet
cat << EOF | sudo tee /etc/systemd/system/kubelet.service.d/0-cpu-manager.conf
[Service]
Environment="KUBELET_EXTRA_ARGS=--cpu-manager-policy=static --cpu-manager-reconcile-period=5s --kube-reserved=cpu=500m"
EOF
sudo systemctl daemon-reload && sudo systemctl restart kubelet
systemctl status kubelet | lessVHOST
sudo rm -rf /tmp/sock0 && docker run -it --ulimit memlock=-1 -v /tmp:/tmp -v /dev/hugepages:/dev/hugepages dpdk-app-testpmd testpmd --socket-mem 1024,1024 --no-pci --vdev="net_vhost0,iface=/tmp/sock0" --file-prefix=vhost --log-level=8 -- --txqflags=0xf00 --disable-hw-vlan --forward-mode=txonly --port-topology=chained --total-num-mbufs=2048 -a
VIRTIO
docker run --ulimit memlock=-1 -i -t -v /tmp/sock0:/var/run/usvhost -v /dev/hugepages:/dev/hugepages dpdk-app-testpmd testpmd --socket-mem 1024,1024 --no-pci --vdev=virtio_user0,path=/var/run/usvhost --file-prefix=container -- --txqflags=0xf00 --disable-hw-vlan --forward-mode=rxonly --port-topology=chained -a --total-num-mbufs=2048
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| from scapy.all import get_if_hwaddr | |
| # Create port | |
| eth0 = PMDPort(name="eth0", vdev="net_af_packet0,iface=eth0") | |
| eth0_ip = socket.gethostbyname(socket.gethostname()) | |
| # Create pipeline | |
| eth0_in::PortInc(port=eth0.name) -> bpf::BPF() | |
| bpf:0 -> Sink() |
wget https://downloadmirror.intel.com/25791/eng/XL710_NVMUpdatePackage_v6_01_Linux.tar.gz
tar xvzf XL710_NVMUpdatePackage_v6_01_Linux.tar.gz
cd XL710/Linux_x64/
./nvmupdate64e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Multi-stage Dockerfile | |
| # Stage bess-build: builds bess with its dependencies | |
| FROM nefelinetworks/bess_build AS bess-build | |
| ARG BESS_COMMIT=master | |
| RUN apt-get update && apt-get install -y wget unzip ca-certificates git | |
| RUN wget -qO bess.zip https://github.com/NetSys/bess/archive/${BESS_COMMIT}.zip && unzip bess.zip | |
| WORKDIR bess-${BESS_COMMIT} | |
| RUN ./build.py bess && cp bin/bessd /bin | |
| RUN mkdir -p /opt/bess && cp -r bessctl pybess /opt/bess |