Skip to content

Merge branch 'linuxkerneltravel:develop' into develop #1

Merge branch 'linuxkerneltravel:develop' into develop

Merge branch 'linuxkerneltravel:develop' into develop #1

name: Network_Subsystem
on:
push:
branches:
- "*"
paths:
- 'eBPF_Supermarket/Network_Subsystem/old_project/**'
- '.github/workflows/old_project_net_subsystem.yml'
pull_request:
branches:
- "*"
paths:
- 'eBPF_Supermarket/Network_Subsystem/old_project/**'
- '.github/workflows/old_project_net_subsystem.yml'
jobs:
ebpf_dns_cache_build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: ATiltedTree/setup-rust@v1
with:
rust-version: stable
components: clippy
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install --no-install-recommends clang libelf-dev zlib1g-dev make libbpf-dev git pkg-config
- name: Build
run: |
cd eBPF_Supermarket/Network_Subsystem/old_project/ebpf_dns_cache
cargo build
- name: Clippy
run: |
cd eBPF_Supermarket/Network_Subsystem/old_project/ebpf_dns_cache
cargo clippy
eBPF_DDoS_build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: test
run: |
cd eBPF_Supermarket/Network_Subsystem/old_project/eBPF_DDoS/bpf/dns-ddos
make builder
docker run -d -m 128m -v `pwd`/test/config:/etc/coredns --name dwq-coredns burkeazbill/docker-coredns -conf /etc/coredns/Corefile
docker run --privileged -d --name dwq-ddos-test --network=container:dwq-coredns \
-v /lib/modules:/lib/modules -v /usr/src:/usr/src -v /sys/kernel/debug:/sys/kernel/debug:rw \
-v /sys/fs/bpf:/sys/fs/bpf -v `pwd`:/ddos bpf-builder \
sh -c "mount -t bpf bpf /sys/fs/bpf && cd /ddos/src && make xdp_dns_kern && \
ip link set dev eth0 xdpgeneric obj xdp_dns_kern.o sec xdp && \
python3 -u catch_dns.py"
for i in $(seq 1 11)
do
if [ $(docker logs dwq-ddos-test | grep 'started!') ]; then break; fi
sleep 5
done
if [ $i -eq 11 ]; then exit 1; fi
eBPF_TCP_Ping_run-test:
name: Build and run
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y bison build-essential flex curl libedit-dev \
libllvm12 llvm-12-dev libclang-12-dev python python3 python3-distutils zlib1g-dev libelf-dev libfl-dev \
bpfcc-tools linux-headers-$(uname -r) libelf-dev libpcap-dev gcc-multilib build-essential
sudo ln -sf /usr/bin/llc-12 /usr/bin/llc
- name: Cache bcc
id: cache-bcc
uses: actions/cache@v3
with:
path: bcc
key: ${{ runner.os }}-bcc-0.24.0
- name: Build bcc
if: steps.cache-bcc.outputs.cache-hit != 'true'
run: |
git clone -b v0.24.0 https://github.com/iovisor/bcc.git
export LLVM_ROOT="/usr/lib/llvm-12"
mkdir bcc/build; cd bcc/build
cmake ..
make -j2
- name: Install bcc
run: |
cd bcc/build
sudo make install
- name: Compile and install xdp
run: |
cd eBPF_Supermarket/old_project/eBPF_TCP_Ping
make && sudo make install
- name: Test run ebpf ping
run: |
cd eBPF_Supermarket/old_project/eBPF_TCP_Ping
go build -o tcp_ping tcp_ping.go
# help
./tcp_ping -h
# sudo ./telescope 127.0.0.1
sudo timeout -s SIGINT 20 ./tcp_ping 127.0.0.1 || pwd
XDP_Res-project-build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Cache BCC build directory
id: cache-bcc
uses: actions/cache@v3
with:
path: bcc
key: ${{ runner.os }}-bcc
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get install -y linux-headers-$(uname -r)
sudo apt-get install -y python-is-python3
sudo apt-get install -y bison build-essential cmake flex git libedit-dev libllvm11 llvm-11-dev libclang-11-dev zlib1g-dev libelf-dev libfl-dev python3-distutils
sudo ln -s /usr/lib/llvm-11 /usr/local/llvm
- name: Build BCC
if: steps.cache-bcc.outputs.cache-hit != 'true'
run: |
wget https://github.com/iovisor/bcc/releases/download/v0.25.0/bcc-src-with-submodule.tar.gz
tar xf bcc-src-with-submodule.tar.gz
cd bcc/
mkdir build
cd build/
cmake -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON_CMD=python3 ..
make
- name: Install BCC
run: |
cd bcc/build/
sudo make install
- name: Run xdp_filter
run: |
cd eBPF_Supermarket/Network_Subsystem/old_project/XDP_Res-Application/
sudo python3 tools/xdp_filter/filter.py -t 5 -i lo -m 0
- name: Run xdp_fast_forward
run: |
cd eBPF_Supermarket/Network_Subsystem/old_project/XDP_Res-Application/
sudo python3 tools/xdp_fast_forward/forward.py -t 5 -i lo -m 0
xdp_ping-libxdp-project-build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install dependencies and Init Env
run: |
sudo apt install libbpf-dev clang llvm libelf-dev libpcap-dev gcc-multilib build-essential
git submodule update --init --recursive
- name: Build and Run
run: |
pushd ./
cd eBPF_Supermarket/Network_Subsystem/old_project/XDP_Res-Application/tools/
./configure
make
cd ./xdp_ping
sudo ./xdp_ping_user -d lo
popd