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

     8.36%     +1.57%  [.] sinsp_evt::get_type
    11.01%     -1.35%  [.] sinsp_parser::reset
    10.85%     -1.29%  [.] sinsp::next
     1.47%     -0.66%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
     5.43%     +0.60%  [.] next_event_from_file
     1.16%     +0.55%  [.] libsinsp::sinsp_suppress::process_event
     2.04%     +0.49%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node
     1.34%     +0.35%  [.] sinsp::fetch_next_event
     4.09%     -0.33%  [.] gzfile_read
     1.27%     +0.29%  [.] sinsp_evt::get_ts

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.0233         +0.0233           144           148           144           148
BM_sinsp_split_median                                          +0.0251         +0.0251           144           148           144           148
BM_sinsp_split_stddev                                          -0.3396         -0.3386             1             1             1             1
BM_sinsp_split_cv                                              -0.3546         -0.3537             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  +0.1063         +0.1063            57            63            57            63
BM_sinsp_concatenate_paths_relative_path_median                +0.1061         +0.1061            57            63            57            63
BM_sinsp_concatenate_paths_relative_path_stddev                -0.4444         -0.4446             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_cv                    -0.4978         -0.4980             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0322         -0.0322            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0295         -0.0295            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.8635         -0.8635             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.8589         -0.8589             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  +0.1299         +0.1299            56            63            56            63
BM_sinsp_concatenate_paths_absolute_path_median                +0.1323         +0.1323            56            63            56            63
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.5175         -0.5177             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.5730         -0.5732             0             0             0             0
BM_sinsp_split_container_image_mean                            -0.0035         -0.0035           389           387           389           387
BM_sinsp_split_container_image_median                          -0.0035         -0.0035           389           388           389           388
BM_sinsp_split_container_image_stddev                          -0.4851         -0.4850             3             2             3             2
BM_sinsp_split_container_image_cv                              -0.4833         -0.4832             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 27.02703% with 27 lines in your changes missing coverage. Please review.

Project coverage is 76.94%. Comparing base (6c46ed3) to head (4656cef).

Files with missing lines Patch % Lines
userspace/libsinsp/examples/test.cpp 0.00% 17 Missing ⚠️
userspace/libsinsp/sinsp.cpp 25.00% 6 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.16%   76.94%   +1.77%     
==========================================
  Files         278      219      -59     
  Lines       34478    30208    -4270     
  Branches     5922     4653    -1269     
==========================================
- Hits        25916    23244    -2672     
+ Misses       8562     6964    -1598     
Flag Coverage Δ
libsinsp 76.94% <27.02%> (+1.77%) ⬆️

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

@FedeDP FedeDP force-pushed the cleanup/drop_container_manager branch 3 times, most recently from b91ae13 to ca705a6 Compare January 21, 2025 07:57
FedeDP added 17 commits January 21, 2025 12:09
…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 FedeDP force-pushed the cleanup/drop_container_manager branch from 14f504d to 4656cef Compare January 21, 2025 11:09
@leogr
Copy link
Member

leogr commented Jan 21, 2025

I love this
image
🤩

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.

3 participants