Skip to content

Import cgroup2 support & use generics to improve pparser's interface#7

Merged
dfinkel merged 5 commits intomasterfrom
import_cgroup2_and_type_changes_2024-12-06
Dec 6, 2024
Merged

Import cgroup2 support & use generics to improve pparser's interface#7
dfinkel merged 5 commits intomasterfrom
import_cgroup2_and_type_changes_2024-12-06

Conversation

@dfinkel
Copy link
Contributor

@dfinkel dfinkel commented Dec 6, 2024

  • Make pparser.LineKVFileParser generic and typesafe
    Improve type-safety by pulling in the recent changes making
    LineKVFileParser generic. This guarantees that the index that has been
    generated for one type cannot be used with another.

    This also lets us eliminate a runtime check that was verifying that the
    correct type was passed. (since that's now enforced at compile-time)

  • cgresolver: cgroup2 & cgroup1 resolution support
    Add a subpackage for resolving the relevant cgroup for a process, and
    finding a usable cgroup mount for that subsystem.

    In particular, this provides the ability to remove the rather
    problematic docker libcgroup implementation from our dependency-set.

  • cgrouplimits: add cgroup2 support
    Replace runc/libcontainer with the new cgresolver package, and implement
    support for parsing the cgroup2 quota/usage files. (to its credit,
    cgroup2 does have a standardized format)

  • Add an unexported .eq method to CPUTime
    This helper simplifies a couple test-conditions.

  • actions: update to go 1.22/1.23
    Also, bump actions/setup-go and actions/checkout to the latest
    available.

Improve type-safety by pulling in the recent changes making
LineKVFileParser generic. This guarantees that the index that has been
generated for one type cannot be used with another.

This also lets us eliminate a runtime check that was verifying that the
correct type was passed. (since that's now enforced at compile-time)
Add a subpackage for resolving the relevant cgroup for a process, and
finding a usable cgroup mount for that subsystem.

In particular, this provides the ability to remove the rather
problematic docker libcgroup implementation from our dependency-set.
Replace runc/libcontainer with the new cgresolver package, and implement
support for parsing the cgroup2 quota/usage files. (to its credit,
cgroup2 does have a standardized format)
This helper simplifies a couple test-conditions.
Also, bump actions/setup-go and actions/checkout to the latest
available.

Also bump staticcheck.
@dfinkel dfinkel force-pushed the import_cgroup2_and_type_changes_2024-12-06 branch from 9918cc8 to 869f771 Compare December 6, 2024 16:00
@dfinkel dfinkel merged commit ef52e45 into master Dec 6, 2024
@dfinkel dfinkel deleted the import_cgroup2_and_type_changes_2024-12-06 branch December 6, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants