Skip to content

Add a PTF test CI pipeline for p4c-dpdk on the DPDK SoftNIC #3

Add a PTF test CI pipeline for p4c-dpdk on the DPDK SoftNIC

Add a PTF test CI pipeline for p4c-dpdk on the DPDK SoftNIC #3

Workflow file for this run

name: "P4SDE CI Build pipeline"
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
# if workflow for PR or push is already running stop it, and start new one
group: build_p4sde_ci-${{ github.ref }}
cancel-in-progress: true
# Envs for infrap4d and dpdk libs
env:
SDE: ${{ github.workspace }}
P4C_DIR: ${{ github.workspace }}/p4c
SDE_INSTALL: ${{ github.workspace }}/install
IPDK_RECIPE: ${{ github.workspace }}/ipdk.recipe
DEPEND_INSTALL: ${{ github.workspace }}/install
jobs:
build_p4dpdk_ubuntu:
runs-on: ubuntu-22.04
steps:
- name: 'Checkout DPDK-target'
uses: actions/checkout@v3
with:
repository: p4lang/p4-dpdk-target
path: p4sde
submodules: 'recursive'
- name: 'Checkout ipdk-recipe'
uses: actions/checkout@v3
with:
repository: ipdk-io/networking-recipe
path: ipdk.recipe
submodules: 'recursive'
- name: checkout P4C
uses: actions/checkout@v3
with:
path: p4c
submodules: recursive
- name: 'Install DPDK dependencies'
working-directory: p4sde/tools/setup
run: |
sudo apt update -y
python install_dep.py
- name: 'Compile p4sde dpdk target'
working-directory: p4sde
run: |
mkdir ${GITHUB_WORKSPACE}/install
./autogen.sh
./configure --prefix=$SDE_INSTALL
make
make install
- name: Build p4c with only the DPDK backend
working-directory: p4c
run: |
sudo -E tools/dpdk-ci-build.sh
- name: 'Compile ipdk recipe'
run: |
echo "Install infrap4d dependencies"
cd ipdk.recipe
sudo apt install libatomic1 libnl-route-3-dev openssl
sudo pip3 install -r requirements.txt
cd $IPDK_RECIPE/setup
echo "Build infrap4d dependencies"
cmake -B build -DCMAKE_INSTALL_PREFIX="$SDE_INSTALL" -DUSE_SUDO=ON
cmake --build build
echo "Build Networking Recipe"
source $IPDK_RECIPE/scripts/dpdk/setup_env.sh $IPDK_RECIPE $SDE_INSTALL $DEPEND_INSTALL
cd $IPDK_RECIPE
sudo ./make-all.sh --target=dpdk --no-krnlmon --no-ovs -S $SDE_INSTALL -D $DEPEND_INSTALL
- name: 'Run simple test'
run: |
source $IPDK_RECIPE/scripts/dpdk/setup_env.sh $IPDK_RECIPE $SDE_INSTALL $DEPEND_INSTALL
sudo $IPDK_RECIPE/scripts/dpdk/copy_config_files.sh $IPDK_RECIPE $SDE_INSTALL
sudo $IPDK_RECIPE/scripts/dpdk/set_hugepages.sh
sudo python3 $P4C_DIR/backends/dpdk/run-dpdk-ptf-test.py $P4C_DIR/testdata/p4_16_samples/pna-dpdk-add_on_miss0.p4 -p4c $P4C_DIR --ipdk-recipe $IPDK_RECIPE --sde-install $SDE_INSTALL --ld-library-path $LD_LIBRARY_PATH --testfile $P4C_DIR/testdata/p4_16_samples/pna-dpdk-add_on_miss0.py -ll DEBUG