Skip to content

Merge pull request #97 from sanfern/sanfern-kretprobe-update #37

Merge pull request #97 from sanfern/sanfern-kretprobe-update

Merge pull request #97 from sanfern/sanfern-kretprobe-update #37

name: CI build Ubuntu
on:
pull_request: {}
push:
branches:
- main
jobs:
eBPF-Programs-Build:
runs-on: ubuntu-latest
container:
image: ubuntu:focal
steps:
- name: Set env variables
run: |
echo "REPO=eBPF-Package-Repository" >> $GITHUB_ENV
echo "BPF_PATH=samples/bpf" >> $GITHUB_ENV
echo "LINUX_SRC_PATH=$GITHUB_WORKSPACE/linux" >> $GITHUB_ENV
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
echo "TZ=Etc/UTC" >> $GITHUB_ENV
- name: Set up build environment
run: |
apt-get update
apt-get install -y bc \
tzdata \
bison \
build-essential \
clang \
curl \
exuberant-ctags \
flex \
gcc-multilib \
git \
gnutls-bin \
libc6-dev \
libcurl4-openssl-dev \
libelf-dev \
libjson-c-dev \
libncurses5-dev \
libpcap-dev \
libssl-dev \
linux-headers-generic \
linux-tools-common \
linux-tools-generic \
llvm \
rsync \
dwarves \
zlib1g \
libelf1 \
pkg-config
- name: Clone dependencies
run: |
git clone --branch v5.15 --depth 1 https://github.com/torvalds/linux.git $LINUX_SRC_PATH
cd $LINUX_SRC_PATH
sed -i '229a\
if [ "${pahole_ver}" -ge "124" ]; then\
extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_enum64"\
fi' scripts/link-vmlinux.sh
echo "CONFIG_DEBUG_INFO_BTF=y" >> .config
echo "CONFIG_MODULES=y" >> .config
make olddefconfig
make prepare
yes | make -j$(nproc)
make headers_install
- name: Install bpftool
run: |
git clone --branch v7.2.0 --recurse-submodules https://github.com/libbpf/bpftool.git
cd bpftool/src
make
cp bpftool /usr/local/bin/
cd ../../
rm -rf bpftool
- name: Clone kernel function repository
uses: actions/checkout@v2
with:
path: linux/${{ env.BPF_PATH }}/${{ env.REPO }}/
- name: Build eBPF Program and Upload artifacts
run: |
cd $LINUX_SRC_PATH/$BPF_PATH/$REPO
bash buildscript.sh
- name: Upload xdp-root
uses: actions/upload-artifact@v3
with:
name: xdp-root-linux-artifact
path: ${{ env.LINUX_SRC_PATH }}/${{ env.BPF_PATH }}/${{ env.REPO }}/xdp-root/l3af_xdp_root/*
- name: Upload ratelimiting
uses: actions/upload-artifact@v3
with:
name: ratelimiting-linux-artifact
path: ${{ env.LINUX_SRC_PATH }}/${{ env.BPF_PATH }}/${{ env.REPO }}/ratelimiting/l3af_ratelimiting/*
- name: Upload connection-limit
uses: actions/upload-artifact@v3
with:
name: connection-limit-linux-artifact
path: ${{ env.LINUX_SRC_PATH }}/${{ env.BPF_PATH }}/${{ env.REPO }}/connection-limit/l3af_connection_limit/*
- name: Upload tc-root
uses: actions/upload-artifact@v3
with:
name: tc-root-linux-artifact
path: ${{ env.LINUX_SRC_PATH }}/${{ env.BPF_PATH }}/${{ env.REPO }}/tc-root/l3af_tc_root/*
- name: Upload ipfix-flow-exporter
uses: actions/upload-artifact@v3
with:
name: ipfix-flow-exporter-linux-artifact
path: ${{ env.LINUX_SRC_PATH }}/${{ env.BPF_PATH }}/${{ env.REPO }}/ipfix-flow-exporter/l3af_bpf_ipfix/*
- name: Upload traffic-mirroring
uses: actions/upload-artifact@v3
with:
name: traffic-mirroring-linux-artifact
path: ${{ env.LINUX_SRC_PATH }}/${{ env.BPF_PATH }}/${{ env.REPO }}/traffic-mirroring/l3af_traffic_mirroring/*