[1.34] Add inject_gomaxprocs via runtime handler precreate hook#9886
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cc @harche |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Implement GOMAXPROCS injection as a composable PreCreate runtime handler hook instead of inline logic in container_create.go. This follows the existing CRI-O hook architecture (like HighPerformanceHooks) and allows the GOMAXPROCS hook to compose with other hooks via CompositeHooks. Key changes: - GomaxprocsHooks: PreCreate hook that reads CPU shares from the OCI spec, calculates GOMAXPROCS with a configurable floor, and injects the env var for burstable/best-effort pods - CompositeHooks: chains multiple RuntimeHandlerHooks implementations, enabling GOMAXPROCS to work alongside high-performance hooks - HooksRetriever.Get(): builds a hook chain when inject_gomaxprocs > 0 - Config field, CLI flag, annotation, docs, completions, and tests The hook fires for all OCI runtimes and skips guaranteed pods, workload-partitioned pods, pods with CPU limits (Go 1.25+ auto-detects), and pods that already have GOMAXPROCS set. Signed-off-by: Peter Hunt <pehunt@redhat.com> Co-authored-by: Harshal Patil <12152047+harche@users.noreply.github.com>
f61b629 to
b027cf7
Compare
/hold |
|
ci failures don't look like they are related to the change. /lgtm |
|
/hold cancel |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-1.34 #9886 +/- ##
================================================
- Coverage 46.91% 46.79% -0.13%
================================================
Files 164 166 +2
Lines 25138 25255 +117
================================================
+ Hits 11793 11817 +24
- Misses 12183 12273 +90
- Partials 1162 1165 +3 🚀 New features to boost your workflow:
|
|
/override ci/prow/e2e-aws-ovn |
|
@haircommander: Overrode contexts on behalf of haircommander: ci/prow/e2e-aws-ovn DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
d024279
into
cri-o:release-1.34
This is an automated cherry-pick of #9860
/assign haircommander
assisted with claude