fix(CI): updating the source and build paths

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
This commit is contained in:
Andrea Terzolo
2022-11-07 14:58:57 +01:00
parent 84effdcf2d
commit b4e5adc585
3 changed files with 21 additions and 28 deletions

View File

@@ -39,7 +39,7 @@ jobs:
- run:
name: Build Falco packages 🏗️
command: |
DOCKER_BUILDKIT=1 docker build -f /tmp/source-arm64/falco/docker/builder/centos7-builder.Dockerfile --output type=local,dest=/tmp --build-arg CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DFALCO_ETC_DIR=/etc/falco -DBUILD_FALCO_MODERN_BPF=ON -DMODERN_BPF_SKEL_DIR=/falco/skeleton-build/skel_dir -DBUILD_DRIVER=Off -DBUILD_BPF=Off" --build-arg DEST_BUILD_DIR=/build-arm64/release /tmp/source-arm64/falco
DOCKER_BUILDKIT=1 docker build -f /tmp/source-arm64/falco/docker/builder/centos7-builder.Dockerfile --output type=local,dest=/tmp --build-arg CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DFALCO_ETC_DIR=/etc/falco -DBUILD_FALCO_MODERN_BPF=ON -DMODERN_BPF_SKEL_DIR=/source/skeleton-build/skel_dir -DBUILD_DRIVER=Off -DBUILD_BPF=Off" --build-arg DEST_BUILD_DIR=/build-arm64/release /tmp/source-arm64/falco
- store_artifacts:
path: /tmp/packages
@@ -120,38 +120,30 @@ jobs:
# Path for the source code
- checkout:
path: /source/falco
path: /tmp/source/falco
- run:
name: Build modern BPF skeleton 🐝
command: |
mkdir -p /source/falco/skeleton-build
cd /source/falco/skeleton-build && cmake -DUSE_BUNDLED_DEPS=ON -DBUILD_FALCO_MODERN_BPF=ON -DCREATE_TEST_TARGETS=Off ../
mkdir -p /tmp/source/falco/skeleton-build
cd /tmp/source/falco/skeleton-build && cmake -DUSE_BUNDLED_DEPS=ON -DBUILD_FALCO_MODERN_BPF=ON -DCREATE_TEST_TARGETS=Off ../
make ProbeSkeleton
# Build the Falco packages (tar, deb, rpm) inside the centos7 builder.
# This dockerfile returns as output:
# - the build directory. (under /${DEST_BUILD_DIR})
# - the 3 packages: tar, deb, rpm. (under /packages)
# - the build directory. (under /tmp/${DEST_BUILD_DIR})
# - the 3 packages: tar, deb, rpm. (under /tmp/packages)
- run:
name: Build Falco packages 🏗️
command: |
DOCKER_BUILDKIT=1 docker build -f /source/falco/docker/builder/centos7-builder.Dockerfile --output type=local,dest=/ --build-arg CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DCREATE_TEST_TARGETS=Off -DFALCO_ETC_DIR=/etc/falco -DBUILD_FALCO_MODERN_BPF=ON -DMODERN_BPF_SKEL_DIR=/falco/skeleton-build/skel_dir -DBUILD_DRIVER=Off -DBUILD_BPF=Off" --build-arg DEST_BUILD_DIR=/build/release /source/falco
# Move packages under /tmp/packages
- run:
name: Prepare Artifacts
command: |
cp /packages/*.deb /tmp/packages
cp /packages/*.tar.gz /tmp/packages
cp /packages/*.rpm /tmp/packages
DOCKER_BUILDKIT=1 docker build -f /tmp/source/falco/docker/builder/centos7-builder.Dockerfile --output type=local,dest=/tmp --build-arg CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DFALCO_ETC_DIR=/etc/falco -DBUILD_FALCO_MODERN_BPF=ON -DMODERN_BPF_SKEL_DIR=/source/skeleton-build/skel_dir -DBUILD_DRIVER=Off -DBUILD_BPF=Off" --build-arg DEST_BUILD_DIR=/build/release /tmp/source/falco
- store_artifacts:
path: /tmp/packages
destination: /packages
- persist_to_workspace:
root: /
root: /tmp
paths:
- build/release
- source
@@ -170,7 +162,8 @@ jobs:
at: /
- run:
name: Execute integration tests
command: /usr/bin/entrypoint test
command: |
/usr/bin/entrypoint test
- store_test_results:
path: /build/release/integration-tests-xunit

View File

@@ -193,7 +193,7 @@ jobs:
- name: Build the artifact from the docker image 🏗️
run: |
DOCKER_BUILDKIT=1 docker build -f ./docker/builder/centos7-builder.Dockerfile --output type=local,dest=export-artifacts --build-arg CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DCREATE_TEST_TARGETS=Off -DFALCO_ETC_DIR=/etc/falco -DBUILD_FALCO_MODERN_BPF=ON -DMODERN_BPF_SKEL_DIR=/falco/skeleton-build/skel_dir -DBUILD_DRIVER=Off -DBUILD_BPF=Off" .
DOCKER_BUILDKIT=1 docker build -f ./docker/builder/centos7-builder.Dockerfile --output type=local,dest=export-artifacts --build-arg CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DUSE_BUNDLED_DEPS=On -DFALCO_ETC_DIR=/etc/falco -DBUILD_FALCO_MODERN_BPF=ON -DMODERN_BPF_SKEL_DIR=/source/skeleton-build/skel_dir -DBUILD_DRIVER=Off -DBUILD_BPF=Off" .
- name: Upload deb ⏫
uses: actions/upload-artifact@v3

View File

@@ -22,22 +22,22 @@ RUN curl -L -o /tmp/cmake.tar.gz https://github.com/Kitware/CMake/releases/downl
rm -rf /tmp/cmake-3.22.5-linux-$(uname -m)/
# Copy Falco folder from the build context
COPY . /falco
WORKDIR /falco
COPY . /source
WORKDIR /build/release
# We need `make tests` and `make all` for integration tests.
RUN source scl_source enable devtoolset-8; \
rm -rf build; \
mkdir build && cd build; \
cmake ${CMAKE_OPTIONS} ..; \
cmake ${CMAKE_OPTIONS} /source; \
make falco -j${MAKE_JOBS}; \
make package; \
make tests -j${MAKE_JOBS}
make tests -j${MAKE_JOBS}; \
make all -j${MAKE_JOBS}
FROM scratch AS export-stage
ARG DEST_BUILD_DIR="/build"
COPY --from=build-stage /falco/build/falco-*.tar.gz /packages/
COPY --from=build-stage /falco/build/falco-*.deb /packages/
COPY --from=build-stage /falco/build/falco-*.rpm /packages/
COPY --from=build-stage /falco/build/ ${DEST_BUILD_DIR}
COPY --from=build-stage /build/release/falco-*.tar.gz /packages/
COPY --from=build-stage /build/release/falco-*.deb /packages/
COPY --from=build-stage /build/release/falco-*.rpm /packages/
COPY --from=build-stage /build/release/ ${DEST_BUILD_DIR}