Skip to content

[1.34] Add inject_gomaxprocs via runtime handler precreate hook#9886

Merged
openshift-merge-bot[bot] merged 1 commit into
cri-o:release-1.34from
haircommander:cherry-pick-9860-to-release-1.34
Apr 15, 2026
Merged

[1.34] Add inject_gomaxprocs via runtime handler precreate hook#9886
openshift-merge-bot[bot] merged 1 commit into
cri-o:release-1.34from
haircommander:cherry-pick-9860-to-release-1.34

Conversation

@haircommander

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #9860

/assign haircommander

assisted with claude

add min_injected_gomaxprocs option, which allows a user to specify GOMAXPROCS in every container CRI-O creates. The config field itself is an integer that represents the floor of GOMAXPROCS. CRI-O will inject max(floor, cpu.request), if the pod is not a guaranteed pod or is part of a partitioned workload

@haircommander haircommander requested a review from mrunalp as a code owner April 14, 2026 18:27
@openshift-ci openshift-ci Bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Apr 14, 2026
@openshift-ci openshift-ci Bot requested review from bitoku and littlejawa April 14, 2026 18:27
@openshift-ci openshift-ci Bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Apr 14, 2026
@openshift-ci

openshift-ci Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

[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

Details 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2026
@haircommander

Copy link
Copy Markdown
Member Author

/cc @harche

@openshift-ci openshift-ci Bot requested a review from harche April 14, 2026 18:28
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9eccb941-a05a-46c2-9df2-c8896677128f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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>
@haircommander haircommander force-pushed the cherry-pick-9860-to-release-1.34 branch from f61b629 to b027cf7 Compare April 14, 2026 18:33

@harche harche left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto cherry pick.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2026
@harche

harche commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

auto cherry pick.

/lgtm

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 14, 2026
@harche

harche commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

ci failures don't look like they are related to the change.

/lgtm

@haircommander

Copy link
Copy Markdown
Member Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 14, 2026
@codecov

codecov Bot commented Apr 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.40984% with 91 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.79%. Comparing base (dd7d093) to head (b027cf7).
⚠️ Report is 2 commits behind head on release-1.34.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haircommander

Copy link
Copy Markdown
Member Author

/override ci/prow/e2e-aws-ovn

@openshift-ci

openshift-ci Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

@haircommander: Overrode contexts on behalf of haircommander: ci/prow/e2e-aws-ovn

Details

In response to this:

/override ci/prow/e2e-aws-ovn

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit d024279 into cri-o:release-1.34 Apr 15, 2026
41 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants