diff --git a/.github/workflows/reusable_build_packages.yaml b/.github/workflows/reusable_build_packages.yaml index 6d7386eacb9..042f30ddeef 100644 --- a/.github/workflows/reusable_build_packages.yaml +++ b/.github/workflows/reusable_build_packages.yaml @@ -9,12 +9,46 @@ on: outputs: version: description: 'Falco version extracted from config_falco.h' - value: ${{ jobs.build-packages.outputs.version }} + value: ${{ jobs.fetch-version.outputs.version }} jobs: + # We need to use an ubuntu-latest to fetch Falco version because + # Falco version is computed by some cmake scripts that do git sorceries + # to get the current version. + # But centos7 jobs have a git version too old and actions/checkout does not + # fully clone the repo, but uses http rest api instead. + fetch-version: + runs-on: ubuntu-latest + # Map the job outputs to step outputs + outputs: + version: ${{ steps.store_version.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install build dependencies + run: | + sudo apt update + sudo apt install -y cmake build-essential + + - name: Configure project + run: | + mkdir build && cd build + cmake -DUSE_BUNDLED_DEPS=On .. + + - name: Load and store Falco version output + id: store_version + run: | + FALCO_VERSION=$(cat build/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//') + echo "version=${FALCO_VERSION}" >> $GITHUB_OUTPUT + + build-modern-bpf-skeleton: # See https://github.com/actions/runner/issues/409#issuecomment-1158849936 runs-on: ${{ (inputs.arch == 'aarch64' && fromJSON('[ "self-hosted", "linux", "ARM64" ]')) || 'ubuntu-latest' }} + needs: fetch-version container: fedora:latest steps: # Always install deps before invoking checkout action, to properly perform a full clone. @@ -24,13 +58,11 @@ jobs: - name: Checkout uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Build modern BPF skeleton run: | mkdir skeleton-build && cd skeleton-build - cmake -DUSE_BUNDLED_DEPS=ON -DBUILD_FALCO_MODERN_BPF=ON -DCREATE_TEST_TARGETS=Off .. + cmake -DUSE_BUNDLED_DEPS=ON -DBUILD_FALCO_MODERN_BPF=ON -DCREATE_TEST_TARGETS=Off -DFALCO_VERSION=${{ needs.fetch-version.outputs.version }} .. make ProbeSkeleton -j6 - name: Upload skeleton @@ -42,11 +74,8 @@ jobs: build-packages: # See https://github.com/actions/runner/issues/409#issuecomment-1158849936 runs-on: ${{ (inputs.arch == 'aarch64' && fromJSON('[ "self-hosted", "linux", "ARM64" ]')) || 'ubuntu-latest' }} - needs: build-modern-bpf-skeleton + needs: [fetch-version, build-modern-bpf-skeleton] container: centos:7 - # Map the job outputs to step outputs - outputs: - version: ${{ steps.store_version.outputs.version }} steps: # Always install deps before invoking checkout action, to properly perform a full clone. - name: Install build dependencies @@ -54,14 +83,10 @@ jobs: yum -y install centos-release-scl yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ source /opt/rh/devtoolset-9/enable - yum install -y wget make m4 rpm-build - yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm - yum install -y git + yum install -y wget git make m4 rpm-build - name: Checkout uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Download skeleton uses: actions/download-artifact@v3 @@ -89,14 +114,9 @@ jobs: -DMODERN_BPF_SKEL_DIR=/tmp \ -DBUILD_DRIVER=Off \ -DBUILD_BPF=Off \ + -DFALCO_VERSION=${{ needs.fetch-version.outputs.version }} \ .. - - name: Load and store Falco version output - id: store_version - run: | - FALCO_VERSION=$(cat build/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3 | sed -e 's/^"//' -e 's/"$//') - echo "version=${FALCO_VERSION}" >> $GITHUB_OUTPUT - - name: Build project run: | cd build @@ -131,7 +151,7 @@ jobs: ${{ github.workspace }}/build/falco-*.rpm build-musl-package: - needs: build-packages + needs: [fetch-version, build-packages] # x86_64 only for now if: ${{ inputs.arch == 'x86_64' }} runs-on: ubuntu-latest @@ -150,7 +170,7 @@ jobs: - name: Prepare project run: | mkdir build && cd build - cmake -DCPACK_GENERATOR=TGZ -DBUILD_BPF=Off -DBUILD_DRIVER=Off -DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DUSE_BUNDLED_LIBELF=Off -DBUILD_LIBSCAP_MODERN_BPF=ON -DMUSL_OPTIMIZED_BUILD=On -DFALCO_ETC_DIR=/etc/falco ../ + cmake -DCPACK_GENERATOR=TGZ -DBUILD_BPF=Off -DBUILD_DRIVER=Off -DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DUSE_BUNDLED_LIBELF=Off -DBUILD_LIBSCAP_MODERN_BPF=ON -DMUSL_OPTIMIZED_BUILD=On -DFALCO_ETC_DIR=/etc/falco ../ -DFALCO_VERSION=${{ needs.fetch-version.outputs.version }} - name: Build project run: | diff --git a/submodules/falcosecurity-rules b/submodules/falcosecurity-rules index 1bd7e4ac3ac..3f524806184 160000 --- a/submodules/falcosecurity-rules +++ b/submodules/falcosecurity-rules @@ -1 +1 @@ -Subproject commit 1bd7e4ac3aca35020e191ecda00585a1218c9177 +Subproject commit 3f52480618491a9232a1ec6a1f692fc04899c989