Skip to content

Switch DCE from NUSE (Linux 4.4) to LKL (Linux 6.12) #14

Switch DCE from NUSE (Linux 4.4) to LKL (Linux 6.12)

Switch DCE from NUSE (Linux 4.4) to LKL (Linux 6.12) #14

Workflow file for this run

name: Build and Test DCE
on:
push:
branches: [ master ]
# Run for every pull request (merge-request pipeline), whatever the target branch
pull_request:
workflow_dispatch:
# Cancel superseded runs of the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NS3_VER: "3.49"
jobs:
build:
name: Build on ${{ matrix.distro }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu-24.04
image: ubuntu:24.04
- distro: debian-trixie
image: debian:trixie
container:
image: ${{ matrix.image }}
steps:
- name: Install dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y \
git \
gcc \
g++ \
python3 \
python3-dev \
cmake \
ninja-build \
pkg-config \
libgsl-dev \
libsqlite3-dev \
libxml2-dev \
wget \
make \
bc \
flex \
bison \
byacc \
gawk \
file \
xz-utils \
libssl-dev \
libdb-dev \
libsctp-dev
- name: Configure git safe directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE/ns-3-dce"
- name: Checkout DCE repository
uses: actions/checkout@v4
with:
path: ns-3-dce
- name: Cache NS-3 build
id: cache-ns3
uses: actions/cache@v4
with:
path: build/
key: ns3-${{ env.NS3_VER }}-${{ matrix.distro }}
restore-keys: |
ns3-${{ env.NS3_VER }}-${{ matrix.distro }}
- name: Clone NS-3
if: steps.cache-ns3.outputs.cache-hit != 'true'
run: |
git clone --branch "ns-${{ env.NS3_VER }}" --depth 1 \
https://gitlab.com/nsnam/ns-3-dev.git "ns-${{ env.NS3_VER }}"
- name: Configure NS-3
if: steps.cache-ns3.outputs.cache-hit != 'true'
working-directory: ns-${{ env.NS3_VER }}
run: |
./ns3 configure \
--disable-werror \
--prefix="$GITHUB_WORKSPACE/build" \
--build-profile=release
- name: Build NS-3
if: steps.cache-ns3.outputs.cache-hit != 'true'
working-directory: ns-${{ env.NS3_VER }}
run: ./ns3 build
- name: Install NS-3
if: steps.cache-ns3.outputs.cache-hit != 'true'
working-directory: ns-${{ env.NS3_VER }}
run: ./ns3 install
# DCE builds of ip, iperf, thttpd, wget, ping and quagga, and the
# ns-3-dce-quagga module.
- name: Cache kernel stack dependencies
id: cache-kernel-deps
uses: actions/cache@v4
with:
path: |
deps/bin_dce
deps/ns-3-dce-quagga
key: kernel-deps-${{ matrix.distro }}-${{ hashFiles('ns-3-dce/utils/build_kernel_deps.sh', 'ns-3-dce/utils/*.patch') }}
- name: Build kernel stack dependencies
if: steps.cache-kernel-deps.outputs.cache-hit != 'true'
working-directory: ns-3-dce
run: |
./utils/build_kernel_deps.sh "$GITHUB_WORKSPACE/deps"
rm -rf "$GITHUB_WORKSPACE/deps/src"
# Linux 6.12 kernel library (LKL) and its headers.
- name: Cache LKL
id: cache-lkl
uses: actions/cache@v4
with:
path: deps/lkl
key: lkl-${{ matrix.distro }}-${{ hashFiles('ns-3-dce/utils/build_lkl.sh', 'ns-3-dce/utils/lkl-patches/*.patch', 'ns-3-dce/utils/lkl-dce.config') }}
- name: Build LKL
if: steps.cache-lkl.outputs.cache-hit != 'true'
working-directory: ns-3-dce
run: |
./utils/build_lkl.sh "$GITHUB_WORKSPACE/lkl-src" "$GITHUB_WORKSPACE/deps/lkl"
rm -rf "$GITHUB_WORKSPACE/lkl-src" "$GITHUB_WORKSPACE/deps/lkl/liblkl.so.debug"
- name: Add Quagga module
run: cp -a deps/ns-3-dce-quagga ns-3-dce/myscripts/
- name: Configure DCE
working-directory: ns-3-dce
run: |
./waf configure \
--with-ns3="$GITHUB_WORKSPACE/build" \
--prefix="$GITHUB_WORKSPACE/build" \
--with-lkl="$GITHUB_WORKSPACE/deps/lkl" \
--enable-opt
- name: Build DCE
working-directory: ns-3-dce
run: ./waf build
- name: Install DCE binaries
working-directory: ns-3-dce
run: |
cp -a "$GITHUB_WORKSPACE/deps/bin_dce/." build/bin_dce/
cp "$GITHUB_WORKSPACE/deps/lkl/liblkl.so" build/bin_dce/
./utils/build_bash.sh build/bin_dce
- name: Run DCE tests
working-directory: ns-3-dce
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/build/lib:${{ github.workspace }}/build/lib64
run: python3 test.py -r
- name: Remove sockets from test output
if: always()
working-directory: ns-3-dce
run: if [ -d testpy-output ]; then find testpy-output -type s -delete; fi
- name: Upload test output
if: always()
uses: actions/upload-artifact@v4
with:
name: testpy-output-${{ matrix.distro }}
path: ns-3-dce/testpy-output
if-no-files-found: ignore