From 730cb62825c4402a84738de8e970095fcad1cb19 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:43:46 -0300 Subject: [PATCH 1/9] chore: fix package build for conan2 --- .github/actions/build-cpp/entrypoint.sh | 26 ++++++++++--------------- .github/workflows/build-develop.yml | 2 +- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/actions/build-cpp/entrypoint.sh b/.github/actions/build-cpp/entrypoint.sh index 1ecd8b79c..8637c155b 100644 --- a/.github/actions/build-cpp/entrypoint.sh +++ b/.github/actions/build-cpp/entrypoint.sh @@ -19,27 +19,21 @@ function build() { cp -rf /github/workspace/cmake/ /pktvisor-src/cmake/ cp -rf /github/workspace/CMakeLists.txt /pktvisor-src/ cp -rf /github/workspace/conanfile.py /pktvisor-src/ - mkdir /tmp/build - cd /tmp/build - cp -rf /pktvisor-src/build/conan_home/ . - chmod -R 777 /tmp/build/conan_home/ - conan profile new --detect default - conan profile update settings.compiler.libcxx=libstdc++11 default - conan config set general.revisions_enabled=1 - PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DASAN=$INPUT_ASAN /pktvisor-src + cd /pktvisor-src/build/ + conan profile detect -f + PKG_CONFIG_PATH=/local/lib/pkgconfig cmake -DCMAKE_BUILD_TYPE=$INPUT_BUILD_TYPE -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./cmake/conan_provider.cmake -DASAN=$INPUT_ASAN .. make all -j 4 } function move() { echo "========================= Compacting binary and copying =========================" - cd /tmp/build - cp -rf /tmp/build/bin/pktvisord /github/workspace/ - strip -s /tmp/build/bin/crashpad_handler - cp -rf /tmp/build/bin/crashpad_handler /github/workspace/ - cp -rf /tmp/build/bin/pktvisor-reader /github/workspace/ - cp -rf /tmp/build/VERSION /github/workspace/ - chmod -R 777 /tmp/build/conan_home/ - cp -rf /tmp/build/conan_home/ /github/workspace/build/ + cd /pktvisor-src/build/ + cp -rf /pktvisor-src/build/bin/pktvisord /github/workspace/ + strip -s /pktvisor-src/build/bin/crashpad_handler + cp -rf /pktvisor-src/build/bin/crashpad_handler /github/workspace/ + cp -rf /pktvisor-src/build/bin/pktvisor-reader /github/workspace/ + cp -rf /pktvisor-src/build/VERSION /github/workspace/ + cp -rf /pktvisor-src/build/ /github/workspace/build/ cp -rf /pktvisor-src/golang/pkg/client/version.go /github/workspace/version.go cp -rf /pktvisor-src/src/tests/fixtures/pktvisor-port-service-names.csv /github/workspace/custom-iana.csv } diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index 1003fbe9d..fec58df04 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -218,7 +218,7 @@ jobs: needs: [ unit-tests-linux ] runs-on: ubuntu-latest # if this is a push into one of our main branches (rather than just a pull request), we will also package - if: github.event_name != 'pull_request' + #if: github.event_name != 'pull_request' outputs: version_number: ${{ env.VERSION }} steps: From 27ff0020986aee1415540b722814c140d6fe067c Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:47:09 -0300 Subject: [PATCH 2/9] change --- .github/workflows/build-develop.yml | 2 +- .github/workflows/build_debug.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index fec58df04..1003fbe9d 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -218,7 +218,7 @@ jobs: needs: [ unit-tests-linux ] runs-on: ubuntu-latest # if this is a push into one of our main branches (rather than just a pull request), we will also package - #if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' outputs: version_number: ${{ env.VERSION }} steps: diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml index 3fa52ec1a..fd45b1488 100644 --- a/.github/workflows/build_debug.yml +++ b/.github/workflows/build_debug.yml @@ -1,6 +1,9 @@ name: Debug Builds on: + pull_request: + branches: + - develop push: branches: [ develop, master, release/** ] From b5762e4e61a6c16262c13c7572caa5d9f14b8431 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:54:40 -0300 Subject: [PATCH 3/9] update debian --- .github/actions/build-cpp/Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/actions/build-cpp/Dockerfile b/.github/actions/build-cpp/Dockerfile index 881b9c842..ce9500069 100644 --- a/.github/actions/build-cpp/Dockerfile +++ b/.github/actions/build-cpp/Dockerfile @@ -1,8 +1,4 @@ -FROM debian:bullseye-slim - -LABEL author="Everton Haise Taques " -LABEL maintainer="Orb Community" -LABEL version="1.0.0" +FROM debian:bookworm-slim ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates libasan6 zip curl python wget" From 0052c6aa81d9234ac95f6e200ce5cfe3aa2e88da Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:57:10 -0300 Subject: [PATCH 4/9] update python version --- .github/actions/build-cpp/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-cpp/Dockerfile b/.github/actions/build-cpp/Dockerfile index ce9500069..ac9243528 100644 --- a/.github/actions/build-cpp/Dockerfile +++ b/.github/actions/build-cpp/Dockerfile @@ -1,6 +1,6 @@ FROM debian:bookworm-slim -ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3-pip python3-setuptools ca-certificates libasan6 zip curl python wget" +ENV BUILD_DEPS "g++ cmake make git pkgconf jq python3 python3-pip python3-setuptools ca-certificates libasan6 zip curl wget" COPY ./entrypoint.sh /entrypoint.sh From 324c942beb437b53dbab46f1e1a22908c79b14d2 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:59:54 -0300 Subject: [PATCH 5/9] small fix --- .github/actions/build-cpp/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-cpp/Dockerfile b/.github/actions/build-cpp/Dockerfile index ac9243528..0a69a3262 100644 --- a/.github/actions/build-cpp/Dockerfile +++ b/.github/actions/build-cpp/Dockerfile @@ -9,8 +9,8 @@ RUN mkdir -p /pktvisor-src WORKDIR /pktvisor-src RUN apt-get update && \ - apt-get upgrade --yes --force-yes && \ - apt-get install --yes --force-yes --no-install-recommends ${BUILD_DEPS} && \ + apt-get upgrade --yes && \ + apt-get install --yes --no-install-recommends ${BUILD_DEPS} && \ pip3 install conan --force-reinstall RUN chmod +x /entrypoint.sh From fb65eec9d4f9a7cc510c34a4f0201914987a77a3 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:01:17 -0300 Subject: [PATCH 6/9] fix build --- .github/actions/build-cpp/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-cpp/Dockerfile b/.github/actions/build-cpp/Dockerfile index 0a69a3262..ebd1ec0d0 100644 --- a/.github/actions/build-cpp/Dockerfile +++ b/.github/actions/build-cpp/Dockerfile @@ -11,7 +11,7 @@ WORKDIR /pktvisor-src RUN apt-get update && \ apt-get upgrade --yes && \ apt-get install --yes --no-install-recommends ${BUILD_DEPS} && \ - pip3 install conan --force-reinstall + pip3 install conan --force-reinstall --break-system-packages RUN chmod +x /entrypoint.sh From 977fc19f5b1c717c96d7801a6b17911fdc89ff93 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:39:15 -0300 Subject: [PATCH 7/9] test package --- .github/actions/build-cpp/entrypoint.sh | 4 ++-- .github/workflows/build-develop.yml | 10 +++++----- .github/workflows/build-release.yml | 8 ++++---- .github/workflows/build_debug.yml | 4 ++-- .github/workflows/code-ql.yml | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/actions/build-cpp/entrypoint.sh b/.github/actions/build-cpp/entrypoint.sh index 8637c155b..fd7a5eb4f 100644 --- a/.github/actions/build-cpp/entrypoint.sh +++ b/.github/actions/build-cpp/entrypoint.sh @@ -33,14 +33,14 @@ function move() { cp -rf /pktvisor-src/build/bin/crashpad_handler /github/workspace/ cp -rf /pktvisor-src/build/bin/pktvisor-reader /github/workspace/ cp -rf /pktvisor-src/build/VERSION /github/workspace/ - cp -rf /pktvisor-src/build/ /github/workspace/build/ + cp -rf /pktvisor-src/build/p/ /github/workspace/build/ cp -rf /pktvisor-src/golang/pkg/client/version.go /github/workspace/version.go cp -rf /pktvisor-src/src/tests/fixtures/pktvisor-port-service-names.csv /github/workspace/custom-iana.csv } function publishToBugsplat() { echo "========================= Publishing symbol to bugsplat =========================" - cd /tmp/build + cd /pktvisor-src/build/ if [ "$INPUT_BUGSPLAT" == "true" ]; then wget https://github.com/orb-community/CrashpadTools/raw/main/linux/dump_syms chmod a+x ./dump_syms diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index 1003fbe9d..b39d670d6 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -41,7 +41,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -81,7 +81,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -123,7 +123,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -230,7 +230,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -403,7 +403,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}-arm64- diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 4489db275..6c089a444 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -35,7 +35,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -171,7 +171,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -281,7 +281,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}-arm64- @@ -400,7 +400,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}//build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml index fd45b1488..3eaefe464 100644 --- a/.github/workflows/build_debug.yml +++ b/.github/workflows/build_debug.yml @@ -30,7 +30,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -81,7 +81,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}/build/conan_home/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- diff --git a/.github/workflows/code-ql.yml b/.github/workflows/code-ql.yml index 17214dbf4..582c99891 100644 --- a/.github/workflows/code-ql.yml +++ b/.github/workflows/code-ql.yml @@ -74,7 +74,7 @@ jobs: # build and run tests sudo make all test #remove conan files - rm -rf conan_home/ + rm -rf p/ - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 @@ -87,7 +87,7 @@ jobs: uses: advanced-security/filter-sarif@v1 with: patterns: | - -pktvisor/build/conan_home/**/* + -pktvisor/build/p/**/* input: sarif-results/cpp.sarif output: sarif-results/cpp.sarif From 187aa6a270bcbfcc2b615f39f4911795f2c07687 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:40:40 -0300 Subject: [PATCH 8/9] Fix path --- .github/workflows/build-develop.yml | 10 +++++----- .github/workflows/build-release.yml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-develop.yml b/.github/workflows/build-develop.yml index b39d670d6..c4c66e3fa 100644 --- a/.github/workflows/build-develop.yml +++ b/.github/workflows/build-develop.yml @@ -41,7 +41,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -81,7 +81,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -123,7 +123,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -230,7 +230,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -403,7 +403,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}-arm64- diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 6c089a444..cc07e4673 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -35,7 +35,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -171,7 +171,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- @@ -281,7 +281,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-arm64-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}-arm64- @@ -400,7 +400,7 @@ jobs: - name: Setup Conan Cache uses: actions/cache@v4 with: - path: ${{github.workspace}}//build/p/ + path: ${{github.workspace}}/build/p/ key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py', '*/conanfile.py') }} restore-keys: conan-${{ runner.os }}- From 4357e2e7a0cdd2df6cb499d33130e33e2fec5009 Mon Sep 17 00:00:00 2001 From: Leonardo Parente <23251360+leoparente@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:09:08 -0300 Subject: [PATCH 9/9] Fix build --- .github/workflows/build_debug.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml index 3eaefe464..4c10ec889 100644 --- a/.github/workflows/build_debug.yml +++ b/.github/workflows/build_debug.yml @@ -1,9 +1,6 @@ name: Debug Builds on: - pull_request: - branches: - - develop push: branches: [ develop, master, release/** ] @@ -130,7 +127,7 @@ jobs: run: echo ${{ env.BRANCH_NAME }} - name: Get VERSION - run: echo "VERSION=`cat ${{github.workspace}}/build/VERSION`" >> $GITHUB_ENV + run: echo "VERSION=`cat ${{github.workspace}}/VERSION`" >> $GITHUB_ENV - name: Debug version run: echo ${{ env.VERSION }}