kubewharf / katalyst-core

Katalyst aims to provide a universal solution to help improve resource utilization and optimize the overall costs in the cloud. This is the core components in Katalyst system, including multiple agents and centralized components
Apache License 2.0
420 stars 103 forks source link

feat(general): audit manager framework #572

Closed zzzzhhb closed 3 months ago

zzzzhhb commented 5 months ago

What type of PR is this?

What this PR does / why we need it:

This PR adds a framework to gather all the control actions(like applying cgroups, system calls and etc)executed by katalyst then send them to a data warehouse. This mechanism aims to provide audit data for users. If there is a need to integrate a 3rd-party storage, we can simply implement a Sink interface to send data to it.

Which issue(s) this PR fixes:

Special notes for your reviewer:

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 62.62976% with 108 lines in your changes missing coverage. Please review.

Project coverage is 56.23%. Comparing base (abfa348) to head (5bb5348). Report is 1 commits behind head on main.

Files Patch % Lines
...m-plugins/memory/dynamicpolicy/util_linux_amd64.go 0.00% 46 Missing :warning:
pkg/util/eventbus/event_bus.go 81.72% 12 Missing and 5 partials :warning:
pkg/util/cgroup/manager/v1/fs_linux.go 15.38% 11 Missing :warning:
pkg/agent/audit/sink/logbased.go 66.66% 6 Missing and 1 partial :warning:
pkg/util/cgroup/manager/v2/fs_linux.go 53.33% 6 Missing and 1 partial :warning:
cmd/katalyst-agent/app/options/global/audit.go 66.66% 4 Missing :warning:
pkg/agent/audit/sink/basesink.go 50.00% 2 Missing and 2 partials :warning:
cmd/katalyst-agent/app/agent/audit.go 0.00% 3 Missing :warning:
pkg/agent/audit/manager.go 85.71% 1 Missing and 2 partials :warning:
pkg/util/cgroup/manager/cgroup.go 91.42% 3 Missing :warning:
... and 2 more
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #572 +/- ## ========================================== - Coverage 56.23% 56.23% -0.01% ========================================== Files 535 542 +7 Lines 49869 50122 +253 ========================================== + Hits 28044 28186 +142 - Misses 18252 18371 +119 + Partials 3573 3565 -8 ``` | [Flag](https://app.codecov.io/gh/kubewharf/katalyst-core/pull/572/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewharf) | Coverage Δ | | |---|---|---| | [unittest](https://app.codecov.io/gh/kubewharf/katalyst-core/pull/572/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewharf) | `56.23% <62.62%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubewharf#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.