Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
  • Loading branch information
Andreagit97 committed Dec 9, 2022
1 parent b88ed48 commit ede6d73
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ jobs:
- name: Install deps ⛓️
run: |
sudo apt update
sudo apt install -y --no-install-recommends ca-certificates cmake build-essential clang-14 git pkg-config autoconf automake libtool libelf-dev libcap-dev
sudo apt install -y --no-install-recommends ca-certificates cmake build-essential clang-14 llvm-14 git pkg-config autoconf automake libtool libelf-dev libcap-dev linux-headers-$(uname -r)
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 90
sudo update-alternatives --install /usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-14 90
sudo update-alternatives --install /usr/bin/llc llc /usr/bin/llc-14 90
- name: Build scap-open and drivers 🏗️
run: |
Expand Down Expand Up @@ -208,16 +211,18 @@ jobs:
name: test-drivers-x86 😇 (bundled_deps)
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
os: [ubuntu-20.04, ubuntu-22.04]
include:
- os: ubuntu-22.04
cmake_opts: -DUSE_BUNDLED_DEPS=ON -DBUILD_LIBSCAP_MODERN_BPF=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_BPF=True -DBUILD_LIBSCAP_GVISOR=OFF
packages: clang-14 libtool
cmake_opts: -DUSE_BUNDLED_DEPS=ON -DENABLE_DRIVERS_TESTS=ON -DBUILD_LIBSCAP_MODERN_BPF=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_BPF=True -DBUILD_LIBSCAP_GVISOR=OFF
packages: clang-14 llvm-14 libtool
modern: true
extra_comm: sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 90 && sudo update-alternatives --install /usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-14 90 && sudo update-alternatives --install /usr/bin/llc llc /usr/bin/llc-14 90
- os: ubuntu-20.04
cmake_opts: -DUSE_BUNDLED_DEPS=ON -DBUILD_BPF=True -DBUILD_LIBSCAP_GVISOR=OFF
packages: clang
cmake_opts: -DUSE_BUNDLED_DEPS=ON -DENABLE_DRIVERS_TESTS=ON -DBUILD_BPF=True -DBUILD_LIBSCAP_GVISOR=OFF
packages: clang llvm
modern: false
extra_comm: ls /usr/bin/ | grep clang- && ls /usr/bin/ | grep llc-
runs-on: ${{ matrix.os }}
needs: paths-filter
if: needs.paths-filter.outputs.driver_changed == 'true' || needs.paths-filter.outputs.libscap_changed == 'true'
Expand All @@ -231,7 +236,13 @@ jobs:
- name: Install deps ⛓️
run: |
sudo apt update
sudo apt install -y --no-install-recommends ca-certificates cmake build-essential git pkg-config autoconf automake libelf-dev libcap-dev ${{ matrix.packages }}
sudo apt install -y --no-install-recommends ca-certificates cmake build-essential git pkg-config autoconf automake libelf-dev libcap-dev linux-headers-$(uname -r) ${{ matrix.packages }}
${{ matrix.extra_comm }}
# WIP: CHECK kernel version on ubuntu 20.04
- name: Check kernel version
run: |
uname -a
- name: Build drivers tests 🏗️
run: |
Expand Down Expand Up @@ -284,7 +295,7 @@ jobs:
git config --global --add safe.directory ${{ github.workspace }}
.github/install-deps.sh
mkdir -p build
cd build && cmake -DUSE_BUNDLED_DEPS=OFF -DBUILD_LIBSCAP_MODERN_BPF=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_LIBSCAP_GVISOR=OFF ../
cd build && cmake -DUSE_BUNDLED_DEPS=OFF -DENABLE_DRIVERS_TESTS=ON -DBUILD_LIBSCAP_MODERN_BPF=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_LIBSCAP_GVISOR=OFF ../
make drivers_test
build-only-test-drivers-s390x:
Expand Down Expand Up @@ -314,7 +325,7 @@ jobs:
git config --global --add safe.directory ${{ github.workspace }}
.github/install-deps.sh
mkdir -p build
cd build && cmake -DUSE_BUNDLED_DEPS=OFF -DBUILD_LIBSCAP_MODERN_BPF=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_LIBSCAP_GVISOR=OFF ../
cd build && cmake -DUSE_BUNDLED_DEPS=OFF -DENABLE_DRIVERS_TESTS=ON -DBUILD_LIBSCAP_MODERN_BPF=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_LIBSCAP_GVISOR=OFF ../
make drivers_test
build-libs-driverkit:
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ option(USE_BUNDLED_DEPS "Enable bundled dependencies instead of using the system
option(MINIMAL_BUILD "Produce a minimal build with only the essential features (no eBPF probe driver, no kubernetes, no mesos, no marathon and no container metadata)" OFF)
option(MUSL_OPTIMIZED_BUILD "Enable if you want a musl optimized build" OFF)
option(USE_BUNDLED_DRIVER "Use the driver/ subdirectory in the build process (only available in Linux)" ON)
option(ENABLE_DRIVERS_TESTS "Enable driver tests (bpf, kernel module, modern bpf)" OFF)

include(GNUInstallDirs)

Expand Down Expand Up @@ -94,5 +95,8 @@ if(CREATE_TEST_TARGETS AND NOT WIN32)
)

add_subdirectory(test/e2e)
add_subdirectory(test/drivers)

if(ENABLE_DRIVERS_TESTS)
add_subdirectory(test/drivers)
endif()
endif()

0 comments on commit ede6d73

Please sign in to comment.