Skip to content

Commit

Permalink
Merge branch 'main' into refactor/liblogger-vlogf-vstring-function
Browse files Browse the repository at this point in the history
  • Loading branch information
hparzych committed Oct 31, 2023
2 parents 28b5014 + cb38c38 commit 8379997
Show file tree
Hide file tree
Showing 17 changed files with 981 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ runs:
steps:
- name: Build
shell: bash
run: cmake --build --preset conan-${{ env.LOWERCASE_BUILD_TYPE }}
run: cmake --build ${{ env.CMAKE_BUILD_DIR }}
10 changes: 9 additions & 1 deletion .github/actions/configure/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,12 @@ runs:
steps:
- name: Configure
shell: bash
run: cmake --preset conan-${{ env.LOWERCASE_BUILD_TYPE }} -DBUILD_TESTS=ON -DPROJECT_VERSION=${{ env.PROJECT_VERSION }}
run: >-
cmake
-S .
-B ${{ env.CMAKE_BUILD_DIR }}
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
-DCMAKE_C_COMPILER=gcc
'-DCMAKE_CXX_COMPILER=g++'
-DBUILD_TESTS=ON
-DPROJECT_VERSION=${{ env.PROJECT_VERSION }}
6 changes: 2 additions & 4 deletions .github/actions/install-requirements/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ runs:
run: |
sudo apt-get install -y libelf-dev
sudo apt-get install -y clang
pip install cmake==3.23.3
pip install conan==2.0
conan profile detect
conan install . --build=missing -s build_type=${{ env.CAPITALISED_BUILD_TYPE }}
pip install cmake==3.22.3
pip install conan==1.56.0
4 changes: 2 additions & 2 deletions .github/actions/set-environment-variables/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ runs:
shell: bash
run: |
buildType=${{ inputs.build-type }}
printf "CAPITALISED_BUILD_TYPE=%s\n" "${buildType}" >> $GITHUB_ENV
printf "LOWERCASE_BUILD_TYPE=%s\n" "${buildType,,}" >> $GITHUB_ENV
printf "BUILD_TYPE=%s\n" "${buildType}" >> $GITHUB_ENV
printf "CMAKE_BUILD_DIR=%s\n" "cmake-build-${buildType,,}" >> $GITHUB_ENV
newestVersion="$(git describe --tags --abbrev=0 --always)"
if printf "%s" "${newestVersion}" | grep -qEv "[0-9]+\.[0-9]+\.[0-9]+"; then
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ runs:
steps:
- name: Test
shell: bash
run: ctest --preset conan-${{ env.LOWERCASE_BUILD_TYPE }}
run: ctest --test-dir ${{ env.CMAKE_BUILD_DIR }}
5 changes: 0 additions & 5 deletions .github/workflows/build-test-and-publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ jobs:
requirementPath=${{ env.ARTIFACT_PATH }}/thirdparty/${requirement}
mkdir -p "${requirementPath}"
if printf "%s" "${requirement}" | grep -q "protobuf-c/"; then
downloadLicense "${requirement}" "${requirementPath}" "https://raw.githubusercontent.com/protobuf-c/protobuf-c/master/LICENSE"
continue
fi
if printf "%s" "${requirement}" | grep -q "protobuf/"; then
downloadLicense "${requirement}" "${requirementPath}" "https://raw.githubusercontent.com/protocolbuffers/protobuf/main/LICENSE"
continue
Expand Down
34 changes: 10 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.23)
cmake_minimum_required(VERSION 3.22.3)

option(BUILD_TESTS "Build tests" ON)
set(THIRDPARTY_MAKE_JOBS_COUNT "1" CACHE STRING "Number of jobs to use when compiling thirdparty submodules")
Expand Down Expand Up @@ -57,34 +57,20 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(BPF_C_FLAGS ${BPF_C_FLAGS} ${EXTRA_DEBUG_FLAGS})
endif ()

set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS program_options)
if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif ()

if (NOT TARGET fmt)
find_package(fmt REQUIRED)
endif (NOT TARGET fmt)
if (NOT TARGET spdlog)
find_package(spdlog REQUIRED)
endif (NOT TARGET spdlog)

find_package(Protobuf REQUIRED)


find_package(Microsoft.GSL REQUIRED)
if (Microsoft.GSL_FOUND)
include_directories(${Microsoft.GSL_INCLUDE_DIRS})
if (CONAN_EXPORTED)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
else ()
include(conan.cmake)
conan_cmake_run(CONANFILE conanfile.txt
BASIC_SETUP CMAKE_TARGETS UPDATE NO_OUTPUT_DIRS
BUILD never
)
endif ()

set(INSTALL_GTEST OFF CACHE BOOL "Disable installation of googletest" FORCE)

if (BUILD_TESTS OR BUILD_BPF_TESTS)
include(FetchContent)
FetchContent_Declare(googletest URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip)
FetchContent_MakeAvailable(googletest)

include(CTest)
include(GoogleTest)
enable_testing()
Expand Down
35 changes: 10 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,26 @@

eBPF Discovery is a tool for discovering HTTP endpoints on a given host based on incoming HTTP requests.

## Build requirements
## Prerequisites

```
conan >= 2.0
cmake >= 3.23
libelf-dev
clang
```

## Setup

Build release:
* conan >= 1.56.0
* cmake >= 3.22.3
* libelf-dev
* clang

## Building
```
conan install . --build=missing -s build_type=Release
cmake --preset conan-release -DBUILD_TESTS=OFF -DPROJECT_VERSION=<project version>
cmake --build --preset conan-release
cmake -DCMAKE_BUILD_TYPE=<build type> -DCMAKE_C_COMPILER=gcc '-DCMAKE_CXX_COMPILER=g++' -DBUILD_TESTS=ON -DBUILD_BPF_TESTS=ON -DPROJECT_VERSION=<version> -S . -B <build dir>
cmake --build <build dir>
```
`<version>` must be provided in the format major.minor.patch e.g. 1.2.3

Install release:
## Installation

```
DESTDIR=/ cmake --install <build dir> --prefix /usr/local
```

Build debug:

```
conan install . --build=missing -s build_type=Debug
cmake --preset conan-debug -DTHIRDPARTY_MAKE_JOBS_COUNT=$((`nproc` / 2)) -DBUILD_BPF_TESTS=ON -DPROJECT_VERSION=<project version>
cmake --build --preset conan-debug
```

`project version` must be provided in the format major.minor.patch e.g. 1.2.3

## Help & Support

eBPF Discovery is an open source project. The features are fully supported by [Dynatrace](https://www.dynatrace.com).
Expand Down
Loading

0 comments on commit 8379997

Please sign in to comment.