Test LLVM 18 #1694
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test runtime | |
on: | |
workflow_dispatch: | |
push: | |
branches: "*" | |
pull_request: | |
branches: "master" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
cancel-in-progress: true | |
env: | |
BPFTIME_VM_NAME: llvm | |
jobs: | |
build: | |
runs-on: "ubuntu-latest" | |
strategy: | |
matrix: | |
container: | |
- ubuntu-2204 | |
- fedora-39 | |
container: | |
image: "manjusakalza/bpftime-base-image:${{matrix.container}}" | |
options: --privileged | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Remount shm dev | |
# The size of /dev/shm defaults to be 64M, but boost won't detect this at all, leaving bus error to us.. | |
# So we remount it to make it larger | |
run: | | |
mount -o remount,size=1G /dev/shm | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
channels: conda-forge,bioconda | |
channel-priority: strict | |
miniforge-version: latest | |
- name: Install absl and protobuf | |
run: conda install libabseil libprotobuf | |
- name: Install lcov | |
if: "matrix.container == 'ubuntu-2204'" | |
run: | | |
apt-get update -y && apt-get install -y lcov libzstd-dev libboost-all-dev gpg | |
- name: Install lcov | |
if: "matrix.container == 'fedora-39'" | |
run: | | |
dnf install -y dnf-plugins-core | |
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/fedora39/x86_64/cuda-fedora39.repo | |
dnf install -y lcov cuda clang-devel | |
- name: Build | |
run: | | |
export BPFTIME_VM_NAME=llvm | |
cmake -DTEST_LCOV=ON -DBPFTIME_LLVM_JIT=YES -DBPFTIME_ENABLE_UNIT_TESTING=YES -DENABLE_PROBE_WRITE_CHECK=1 -DENABLE_PROBE_READ_CHECK=1 -DCMAKE_BUILD_TYPE=Debug -B build | |
cmake --build build --config Debug --target bpftime_runtime_tests -j$(nproc) | |
- name: Test Runtime | |
run: | | |
export BPFTIME_VM_NAME=llvm | |
./build/runtime/unit-test/bpftime_runtime_tests | |
- name: Generate runtime coverage (Ubuntu) | |
if: "matrix.container == 'ubuntu-2204'" | |
run: | | |
lcov --capture --directory . --output-file coverage-runtime.info --gcov-tool $(which gcov-12) | |
lcov --remove coverage-runtime.info '/usr/*' --output-file coverage-runtime.info | |
lcov --list coverage-runtime.info | |
- name: Generate runtime coverage (Fedora) | |
if: "matrix.container == 'fedora-39'" | |
run: | | |
lcov --capture --directory . --output-file coverage-runtime.info | |
lcov --remove coverage-runtime.info '/usr/*' --output-file coverage-runtime.info | |
lcov --list coverage-runtime.info | |
- name: Upload runtime coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-runtime-${{matrix.container}} | |
include-hidden-files: false | |
path: | | |
./coverage-runtime.info | |
- name: build runtime with mpk enable | |
run: | | |
rm -rf build | |
cmake -Bbuild -DTEST_LCOV=ON -DBPFTIME_LLVM_JIT=YES -DBPFTIME_ENABLE_UNIT_TESTING=YES -DBPFTIME_ENABLE_MPK=YES -DCMAKE_BUILD_TYPE=Debug -DENABLE_PROBE_WRITE_CHECK=1 -DENABLE_PROBE_READ_CHECK=1 -Dabsl_DIR=~/miniconda3/lib/cmake/absl -DProtobuf_DIR=~/miniconda3/lib/cmake/protobuf -Dutf8_range_DIR=~/miniconda3/lib/cmake/utf8_range | |
mkdir -p build/runtime/pos/include/proto/ | |
mkdir -p build/runtime/pos/cuda_impl/proto/ | |
ln -sf /usr/lib/llvm-*/include/clang-c/ /usr/include/ || true | |
ln -sf /usr/lib/llvm-*/lib/libclang.so /usr/lib || true | |
cmake --build build --config Debug --target bpftime_runtime_tests -j$(nproc) || true | |
# sed -i "s/&::descriptor_table_pos_2finclude_2fproto_2fhandle_2eproto/nullptr/g" build/runtime/pos/cuda_impl/proto/*.pb.cc | |
# cmake --build build --config Debug --target bpftime_runtime_tests -j$(nproc) || true | |
# sed -i "s/&::descriptor_table_pos_2finclude_2fproto_2fhandle_2eproto/nullptr/g" build/runtime/pos/cuda_impl/proto/*.pb.cc | |
# cmake --build build --config Debug --target bpftime_runtime_tests -j$(nproc) || true | |
# sed -i "s/&::descriptor_table_pos_2finclude_2fproto_2fhandle_2eproto/nullptr/g" build/runtime/pos/cuda_impl/proto/*.pb.cc | |
# cmake --build build --config Debug --target bpftime_runtime_tests -j$(nproc) || true | |
# sed -i "s/&::descriptor_table_pos_2finclude_2fproto_2fhandle_2eproto/nullptr/g" build/runtime/pos/cuda_impl/proto/*.pb.cc | |
cmake --build build --config Debug --target bpftime_runtime_tests -j$(nproc) | |
- name: test runtime with mpk | |
run: ./build/runtime/unit-test/bpftime_runtime_tests | |
- name: Generate runtime with mpk enable coverage (Ubuntu) | |
if: "matrix.container == 'ubuntu-2204'" | |
run: | | |
lcov --capture --directory . --output-file coverage-runtime-mpk.info --gcov-tool $(which gcov-12) | |
lcov --remove coverage-runtime-mpk.info '/usr/*' --output-file coverage-runtime-mpk.info | |
lcov --list coverage-runtime-mpk.info | |
- name: Generate runtime with mpk enable coverage (Fedora) | |
if: "matrix.container == 'fedora-39'" | |
run: | | |
lcov --capture --directory . --output-file coverage-runtime-mpk.info | |
lcov --remove coverage-runtime-mpk.info '/usr/*' --output-file coverage-runtime-mpk.info | |
lcov --list coverage-runtime-mpk.info | |
- name: Upload runtime-mpk coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-runtime-mpk-${{matrix.container}} | |
include-hidden-files: false | |
path: | | |
./coverage-runtime-mpk.info | |
- uses: codecov/codecov-action@v4 | |
if: github.repository == 'eunomia-bpf/bpftime' && github.event_name == 'push' && github.ref == 'refs/heads/main' | |
with: | |
fail_ci_if_error: true # optional (default = false) | |
files: ./coverage-runtime.info | |
flags: runtime tests | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
verbose: true # optional (default = false) | |