Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update(ci): update ci jobs to generate Falco images with the modern BPF probe #2320

Merged
merged 5 commits into from
Dec 21, 2022

Conversation

Andreagit97
Copy link
Member

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area build

/area CI

What this PR does / why we need it:

This PR brings the necessary changes in the circle-ci jobs to build a Falco image for the modern bpf probe. I added a docker image that returns Falco packages as output (deb, rpm, tar).

This PR is the dual of #2282, the idea is to merge this for the release and leave the other PR open until Falco 0.34 is released so users can continue to test the modern probe if they want :)

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

update(ci): update ci jobs to generate Falco images with the modern BPF probe

@FedeDP
Copy link
Contributor

FedeDP commented Dec 13, 2022

Can you use some comments in the circleci config? :)

Copy link
Member Author

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments on arm64 job, they are all valid for the centos7 one

Comment on lines +16 to +17
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 90
sudo update-alternatives --install /usr/bin/llvm-strip llvm-strip /usr/bin/llvm-strip-14 90
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we set llvm-14 and clang-14 as default in the system

Comment on lines +18 to +21
git clone https://github.com/libbpf/bpftool.git --branch v7.0.0 --single-branch
cd bpftool
git submodule update --init
cd src && sudo make install
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we install bpftool

docker run -e BUILD_TYPE="release" -it -v /tmp/source-arm64:/source -v /tmp/build-arm64:/build \
falcosecurity/falco-builder:latest \
package
mkdir -p /tmp/source-arm64/falco/skeleton-build
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we build in a separate build dir called skeleton-build the modern bpf skeleton

cp /tmp/build-arm64/release/*.deb /tmp/packages
cp /tmp/build-arm64/release/*.tar.gz /tmp/packages
cp /tmp/build-arm64/release/*.rpm /tmp/packages
DOCKER_BUILDKIT=1 docker build -f /tmp/source-arm64/falco/docker/builder/modern-falco-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
Copy link
Member Author

@Andreagit97 Andreagit97 Dec 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • DOCKER_BUILDKIT is needed to use the --output docker command
  • as a build arg we pass CMAKE_OPTIONS=, so all the CMake options necessary to build Falco with the modern probe, we need to provide the external built skeleton with the MODERN_BPF_SKEL_DIR CMake variable, note that the provided path is already relative to the container file system not to the host one.
  • --build-arg DEST_BUILD_DIR=/build-arm64/release here we are saying the container to copy the build directory in this location of the ubuntu 22.04 machine, in this way we can reuse this build directory in the test-integrations jobs
  • /tmp/source-arm64/falco this is the docker build context with the source code of Falco

@FedeDP
Copy link
Contributor

FedeDP commented Dec 15, 2022

/hold

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
@Andreagit97 Andreagit97 force-pushed the new/modern_bpf branch 3 times, most recently from 0644a96 to 6338a72 Compare December 15, 2022 15:15
@@ -1,4 +1,6 @@
add_subdirectory(trace_files)

add_subdirectory(plugins)
add_subdirectory(confs/plugins)
if(NOT MUSL_OPTIMIZED_BUILD)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in musl build we don't have plugins so I've disabled the testing phase for plugins

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
@Andreagit97
Copy link
Member Author

I've bumped the resource classes to large in build-centos7 and build-arm64 jobs since we noticed some timeout issues in these 2 jobs.

@FedeDP
Copy link
Contributor

FedeDP commented Dec 16, 2022

This PR also bumps libs and driver to latest tags: 0.10.0 and 4.0.0+driver! Thanks Andrea!

FedeDP
FedeDP previously approved these changes Dec 16, 2022
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Dec 16, 2022

LGTM label has been added.

Git tree hash: 9eecdbdc0bf2cb2823d64ed0fcd7cfa706378004

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
@poiana poiana requested a review from FedeDP December 16, 2022 12:25
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana poiana added the lgtm label Dec 16, 2022
@poiana
Copy link
Contributor

poiana commented Dec 16, 2022

LGTM label has been added.

Git tree hash: 2eeec656e89a1bab5fa9ca172223ad917bddd69c

Copy link
Contributor

@jasondellaluce jasondellaluce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@poiana
Copy link
Contributor

poiana commented Dec 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, jasondellaluce

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,jasondellaluce]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Andreagit97
Copy link
Member Author

/unhold

@poiana poiana merged commit decabbc into master Dec 21, 2022
@poiana poiana deleted the new/modern_bpf branch December 21, 2022 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants