action #735
This file contains 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
name: action | |
on: | |
push: | |
branches: [main] | |
schedule: | |
- cron: '0 0 * * *' | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install deps | |
run: | | |
set -x | |
# refs: https://github.com/p4lang/p4c#ubuntu | |
source /etc/os-release | |
echo "deb https://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/home:p4lang.list | |
curl -L "https://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${VERSION_ID}/Release.key" | sudo apt-key add - | |
# refs: https://deb.frrouting.org/ | |
curl -s https://deb.frrouting.org/frr/keys.asc | sudo apt-key add - | |
FRRVER="frr-stable" | |
echo deb https://deb.frrouting.org/frr $(lsb_release -s -c) $FRRVER | sudo tee -a /etc/apt/sources.list.d/frr.list | |
sudo apt update | |
sudo apt install -y \ | |
tox tshark frr frr-pythontools p4lang-p4c clang linux-headers-$(uname -r) \ | |
infiniband-diags rdma-core rdmacm-utils ibverbs-utils \ | |
bpfcc-tools bcc libnuma-dev python3.11 python2.7 meson python3-pyelftools | |
sudo ln -s /usr/include/asm-generic /usr/include/asm | |
sudo pip install tox-pip-version | |
# install mininet | |
git clone https://github.com/mininet/mininet.git -b 2.3.0 --depth 1 | |
wget https://raw.githubusercontent.com/p4lang/behavioral-model/13d7267/mininet/p4_mininet.py | |
pushd mininet | |
./util/install.sh -n | |
popd | |
# install libbpf | |
grep CONFIG_BPF=y /boot/config-$(uname -r) | |
grep CONFIG_BPF_SYSCALL=y /boot/config-$(uname -r) | |
grep CONFIG_XDP_SOCKETS=y /boot/config-$(uname -r) | |
git clone git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git -b v5.15 --depth 1 | |
pushd ./bpf-next/tools/lib/bpf | |
sudo make install | |
sudo sh -c "echo /usr/local/lib64 >> /etc/ld.so.conf" | |
sudo ldconfig | |
popd | |
# install DPDK. | |
wget https://fast.dpdk.org/rel/dpdk-22.11.1.tar.xz | |
tar xf dpdk-22.11.1.tar.xz | |
pushd dpdk-stable-22.11.1 | |
meson build -Denable_drivers=net/tap | |
ninja -C build | |
sudo ninja -C build install | |
sudo ldconfig | |
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig | |
pkg-config --modversion libdpdk | |
popd | |
# install ovs with afxdp | |
git clone https://github.com/openvswitch/ovs.git -b v3.2.0 --depth 1 | |
pushd ovs | |
./boot.sh | |
./configure --enable-afxdp --with-debug --with-dpdk=static | |
make -j $(nproc) | |
sudo make install | |
popd | |
- name: run test | |
run: | | |
sudo make -C ./ovs check-afxdp TESTSUITEFLAGS='1 3' | |
sudo /usr/local/share/openvswitch/scripts/ovs-ctl start | |
sudo -E mn --switch ovs --test pingall | |
sudo -E tox |