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 18 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

    11.36%     -1.39%  [.] sinsp::next
     1.42%     -0.87%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
     4.08%     +0.68%  [.] gzfile_read
     9.84%     +0.60%  [.] sinsp_parser::reset
     1.92%     +0.55%  [.] scap_event_decode_params
     9.39%     -0.47%  [.] sinsp_evt::get_type
     2.88%     +0.39%  [.] sinsp_thread_manager::get_thread_ref
     3.17%     -0.36%  [.] sinsp_thread_manager::find_thread
     1.29%     +0.33%  [.] libsinsp::sinsp_suppress::process_event
     1.24%     +0.30%  [.] sinsp::fetch_next_event

Heap diff from master - unit tests

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

Heap diff from master - scap file

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

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.0338         -0.0337           153           147           153           147
BM_sinsp_split_median                                          -0.0368         -0.0367           152           147           152           147
BM_sinsp_split_stddev                                          +2.0024         +1.9991             1             2             1             2
BM_sinsp_split_cv                                              +2.1074         +2.1038             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.0014         +0.0015            61            61            61            61
BM_sinsp_concatenate_paths_relative_path_median                +0.0028         +0.0029            61            61            61            61
BM_sinsp_concatenate_paths_relative_path_stddev                +0.4913         +0.4932             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    +0.4892         +0.4909             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0456         -0.0455            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0430         -0.0429            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.7590         -0.7588             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.7474         -0.7474             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.0336         +0.0337            63            65            63            65
BM_sinsp_concatenate_paths_absolute_path_median                +0.0452         +0.0453            62            65            62            65
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.4140         -0.4137             1             1             1             1
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.4331         -0.4329             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0284         -0.0284           404           392           403           392
BM_sinsp_split_container_image_median                          -0.0291         -0.0291           404           392           404           392
BM_sinsp_split_container_image_stddev                          -0.3097         -0.3097             2             2             2             2
BM_sinsp_split_container_image_cv                              -0.2895         -0.2895             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.89%. Comparing base (cb93f4b) to head (b59265c).

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.11%   76.89%   +1.78%     
==========================================
  Files         276      217      -59     
  Lines       34394    30123    -4271     
  Branches     5922     4651    -1271     
==========================================
- Hits        25836    23164    -2672     
+ Misses       8558     6959    -1599     
Flag Coverage Δ
libsinsp 76.89% <30.00%> (+1.78%) ⬆️

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 9 times, most recently from 6fa963b to 079cef8 Compare December 19, 2024 15:41
@FedeDP
Copy link
Contributor Author

FedeDP commented Jan 2, 2025

Will rebase on master once #2195 is merged too.

FedeDP added 15 commits January 17, 2025 11:10
…container_id from threadinfo.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
… couple of unused methods in sinsp.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
…ger, container info and dependent classes.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
… `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 <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
…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 <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
…gin.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
…re unused.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
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 <nierro92@gmail.com>
…sts.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
@FedeDP FedeDP force-pushed the cleanup/drop_container_manager branch from 079cef8 to fee7a8a Compare January 17, 2025 10:36
@FedeDP
Copy link
Contributor Author

FedeDP commented Jan 17, 2025

Rebased on top of latest master.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
…pture.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants