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

wip: cleanup(userspace/libsinsp,test,build): drop container manager #2207

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented Dec 18, 2024

What type of PR is this?

/kind cleanup

Any specific area of the project related to this PR?

/area build
/area CI
/area libsinsp
/area tests

What this PR does / why we need it:

Following falcosecurity/falco#3403, this PR does multiple things:

  • drops all container related code
  • drops all container related tests
  • drops grpc,curl,openssl and cares deps that are not needed anymore
  • drops MINIMAL_BUILD whose only purpose was to disable gvisor; we already have a flag for that: BUILD_LIBSCAP_GVISOR
  • Allows e2e tests (not libsinsp_e2e ones) to run by downloading the plugin, since they test spawning containers

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Opening this just to let other people know about the cleanup; also, this will be wip until all TODOs below are done.

TODO:

Less important:

Does this PR introduce a user-facing change?:

cleanup(userspace/libsinsp,test,build): drop container manager
cleanup(build): drop MINIMAL_BUILD

@poiana
Copy link
Contributor

poiana commented Dec 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP

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:

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

@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 18, 2024

cc @falcosecurity/libs-maintainers

@poiana poiana requested review from hbrueckner and mstemm December 18, 2024 10:29
Copy link

github-actions bot commented Dec 18, 2024

Perf diff from master - unit tests

   100.00%    -99.54%  [.] 0x00000000000ed560

Heap diff from master - unit tests

peak heap memory consumption: 717.37K
peak RSS (including heaptrack overhead): 0B
total memory leaked: 139.92K

Heap diff from master - scap file

peak heap memory consumption: 272.98K
peak RSS (including heaptrack overhead): 0B
total memory leaked: 141.11K

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            +0.0107         +0.0108           146           148           146           148
BM_sinsp_split_median                                          +0.0143         +0.0144           146           148           146           148
BM_sinsp_split_stddev                                          +0.0305         +0.0307             1             1             1             1
BM_sinsp_split_cv                                              +0.0196         +0.0197             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0157         +0.0158            56            56            56            56
BM_sinsp_concatenate_paths_relative_path_median                +0.0175         +0.0176            56            56            56            56
BM_sinsp_concatenate_paths_relative_path_stddev                +0.5840         +0.5822             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +0.5595         +0.5576             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     +0.0107         +0.0108            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_median                   +0.0092         +0.0094            25            25            25            25
BM_sinsp_concatenate_paths_empty_path_stddev                   +0.2310         +0.2298             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       +0.2180         +0.2167             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0625         +0.0626            55            58            55            58
BM_sinsp_concatenate_paths_absolute_path_median                +0.0719         +0.0720            55            59            55            59
BM_sinsp_concatenate_paths_absolute_path_stddev                +4.4822         +4.4900             0             1             0             1
BM_sinsp_concatenate_paths_absolute_path_cv                    +4.1597         +4.1666             0             0             0             0
BM_sinsp_split_container_image_mean                            +0.0010         +0.0011           385           385           385           385
BM_sinsp_split_container_image_median                          +0.0023         +0.0024           386           387           386           387
BM_sinsp_split_container_image_stddev                          +0.4272         +0.4284             2             3             2             3
BM_sinsp_split_container_image_cv                              +0.4258         +0.4268             0             0             0             0

@FedeDP FedeDP force-pushed the cleanup/drop_container_manager branch 2 times, most recently from b28ea4c to dbfc736 Compare December 18, 2024 12:30
@FedeDP
Copy link
Contributor Author

FedeDP commented Dec 18, 2024

/milestone 0.21.0

@poiana poiana added this to the 0.21.0 milestone Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 21 lines in your changes missing coverage. Please review.

Project coverage is 76.85%. Comparing base (69cfe47) to head (079cef8).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
userspace/libsinsp/examples/test.cpp 0.00% 17 Missing ⚠️
userspace/libsinsp/sinsp_filtercheck_fd.cpp 57.14% 3 Missing ⚠️
userspace/libsinsp/event.cpp 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2207      +/-   ##
==========================================
+ Coverage   75.42%   76.85%   +1.42%     
==========================================
  Files         265      208      -57     
  Lines       34048    29980    -4068     
  Branches     5803     4653    -1150     
==========================================
- Hits        25681    23041    -2640     
+ Misses       8367     6939    -1428     
Flag Coverage Δ
libsinsp 76.85% <30.00%> (+1.42%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FedeDP FedeDP force-pushed the cleanup/drop_container_manager branch 8 times, most recently from d3bcb1d to 6fa963b Compare December 19, 2024 14:49
…container_id from threadinfo.

Signed-off-by: Federico Di Pierro <[email protected]>
… couple of unused methods in sinsp.

Signed-off-by: Federico Di Pierro <[email protected]>
…ger, container info and dependent classes.

Signed-off-by: Federico Di Pierro <[email protected]>
… `TYPE_IS_CONTAINER_LIVENESS_PROBE`, `TYPE_IS_CONTAINER_READINESS_PROBE` extractors.

They are now implemented by the plugin.
Also, dropped threadinfo::m_category, unused.

Finally, dropped `sinsp_observer::on_resolve_container`.

Signed-off-by: Federico Di Pierro <[email protected]>
Signed-off-by: Federico Di Pierro <[email protected]>
…n threadinfo.

It leverages sinsp state table API to retrieve "container_id" field written by the plugin.
Use it where needed.

Moreover, user_group_manager cannot subscribe to container changes anymore, since container changes are no more in sinsp.
Instead, parse ASYNC event "container_removed" to cleanup user_group tables.

Signed-off-by: Federico Di Pierro <[email protected]>
Nowadays, it was only filtering out gvisor (and thus protobuf), but we already have the `BUILD_LIBSCAP_GVISOR` flag for that.

Signed-off-by: Federico Di Pierro <[email protected]>
Signed-off-by: Federico Di Pierro <[email protected]>
@FedeDP
Copy link
Contributor Author

FedeDP commented Jan 2, 2025

Will rebase on master once #2195 is merged too.

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.

2 participants