From c59f0ad390b35a9834f33ea37c2c2f004f8c5008 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Mon, 18 Mar 2024 14:52:48 +0000 Subject: [PATCH 1/4] chore(ci): better e2e libsinsp naming Signed-off-by: Roberto Scolaro --- .github/workflows/e2e_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_ci.yml b/.github/workflows/e2e_ci.yml index 67ac249478..8e5fe4acbe 100644 --- a/.github/workflows/e2e_ci.yml +++ b/.github/workflows/e2e_ci.yml @@ -1,4 +1,4 @@ -name: e2e CI +name: libsinsp e2e CI on: pull_request: push: @@ -15,7 +15,7 @@ concurrency: jobs: test-e2e: - name: test-e2e-${{ matrix.arch }} ๐Ÿ˜‡ (bundled_deps) + name: test-e2e-${{ matrix.arch }}-${{ matrix.driver.name }} ๐Ÿ˜‡ (bundled_deps) runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }} strategy: matrix: From 2cbff50a3b9f342db74c97fd3ad1e4be4d4688c6 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Mon, 18 Mar 2024 15:07:46 +0000 Subject: [PATCH 2/4] chore(test/libsinsp_e2e): build only necessary tests Signed-off-by: Roberto Scolaro --- .github/workflows/e2e_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_ci.yml b/.github/workflows/e2e_ci.yml index 8e5fe4acbe..120526cad2 100644 --- a/.github/workflows/e2e_ci.yml +++ b/.github/workflows/e2e_ci.yml @@ -96,7 +96,7 @@ jobs: -DUSE_BUNDLED_LIBBPF=ON \ -DUSE_BUNDLED_GTEST=ON \ .. - make -j6 + make -j6 libsinsp_e2e_tests - name: Run e2e tests with ${{ matrix.driver.name }} ๐ŸŽ๏ธ if: matrix.arch == 'amd64' From 1b0b68de23cd8e7504f2ac2a43ad10351fa5eef2 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Mon, 18 Mar 2024 15:56:18 +0000 Subject: [PATCH 3/4] chore(ci): cache libsinsp e2e builds Signed-off-by: Roberto Scolaro --- .github/workflows/e2e_ci.yml | 50 ++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e_ci.yml b/.github/workflows/e2e_ci.yml index 120526cad2..0c21efd754 100644 --- a/.github/workflows/e2e_ci.yml +++ b/.github/workflows/e2e_ci.yml @@ -5,7 +5,6 @@ on: branches: - master - 'release/**' - - 'maintainers/**' workflow_dispatch: # Checks if any concurrent jobs under the same pull request or branch are being executed @@ -14,25 +13,18 @@ concurrency: cancel-in-progress: true jobs: - test-e2e: - name: test-e2e-${{ matrix.arch }}-${{ matrix.driver.name }} ๐Ÿ˜‡ (bundled_deps) + build-test-e2e: + name: build-test-e2e-${{ matrix.arch }} ๐Ÿ˜‡ (bundled_deps) runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }} strategy: matrix: arch: [amd64, arm64] - driver: [ {name: kmod, option: -k}, {name: bpf, option: -b}, {name: modern-bpf, option: -m} ] fail-fast: false steps: - name: Checkout Libs โคต๏ธ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 - - - name: Fix kernel mmap rnd bits - # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with - # high-entropy ASLR in much newer kernels that GitHub runners are - # using leading to random crashes: https://reviews.llvm.org/D148280 - run: sudo sysctl vm.mmap_rnd_bits=28 - name: Install deps โ›“๏ธ run: | @@ -97,6 +89,44 @@ jobs: -DUSE_BUNDLED_GTEST=ON \ .. make -j6 libsinsp_e2e_tests + cd .. + + - name: Cache build + uses: actions/cache/save@v3 + if: always() + id: cache + with: + path: build + key: build-${{ matrix.arch }}-${{ github.run_id }} + + test-e2e: + name: test-e2e-${{ matrix.arch }}-${{ matrix.driver.name }} ๐Ÿ˜‡ (bundled_deps) + needs: [build-test-e2e] + runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }} + strategy: + matrix: + arch: [amd64, arm64] + driver: [ {name: kmod, option: -k}, {name: bpf, option: -b}, {name: modern-bpf, option: -m} ] + fail-fast: false + steps: + - name: Restore build + id: cache + uses: actions/cache/restore@v3 + with: + path: build + key: build-${{ matrix.arch }}-${{ github.run_id }} + restore-keys: build- + + - name: Fix kernel mmap rnd bits + # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with + # high-entropy ASLR in much newer kernels that GitHub runners are + # using leading to random crashes: https://reviews.llvm.org/D148280 + run: sudo sysctl vm.mmap_rnd_bits=28 + + - name: Install multilib + if: matrix.arch == 'amd64' + run: | + sudo apt install -y --no-install-recommends gcc-multilib g++-multilib - name: Run e2e tests with ${{ matrix.driver.name }} ๐ŸŽ๏ธ if: matrix.arch == 'amd64' From 1c3aa684298897c9f2d09cda1c886b0b21cdc17f Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Tue, 19 Mar 2024 11:17:54 +0000 Subject: [PATCH 4/4] new(ci): add sccache support Signed-off-by: Roberto Scolaro --- .github/workflows/e2e_ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_ci.yml b/.github/workflows/e2e_ci.yml index 0c21efd754..c663706377 100644 --- a/.github/workflows/e2e_ci.yml +++ b/.github/workflows/e2e_ci.yml @@ -35,6 +35,7 @@ jobs: clang-14 llvm-14 \ git \ clang \ + ccache \ llvm \ pkg-config \ autoconf \ @@ -73,11 +74,18 @@ jobs: run: | sudo apt install -y --no-install-recommends linux-headers-$(uname -r) gcc-multilib g++-multilib + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + - name: Build e2e tests ๐Ÿ—๏ธ + env: + SCCACHE_GHA_ENABLED: "true" run: | mkdir -p build cd build && \ cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=sccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ -DBUILD_BPF=ON \ -DUSE_BUNDLED_DEPS=ON \ -DUSE_ASAN=ON \ @@ -97,7 +105,7 @@ jobs: id: cache with: path: build - key: build-${{ matrix.arch }}-${{ github.run_id }} + key: build-e2e-${{ matrix.arch }}-${{ github.run_id }} test-e2e: name: test-e2e-${{ matrix.arch }}-${{ matrix.driver.name }} ๐Ÿ˜‡ (bundled_deps) @@ -114,8 +122,8 @@ jobs: uses: actions/cache/restore@v3 with: path: build - key: build-${{ matrix.arch }}-${{ github.run_id }} - restore-keys: build- + key: build-e2e-${{ matrix.arch }}-${{ github.run_id }} + restore-keys: build-e2e- - name: Fix kernel mmap rnd bits # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with