Skip to content

Conversation

@n4mlz
Copy link
Contributor

@n4mlz n4mlz commented Oct 17, 2025

Description

  • Bump the vendored runc used by contest / CI pipelines to v1.3.2 (first release that carries the new log-based CPU shares → weight conversion).
  • Port that conversion into youki’s cgroup v2 and systemd backends so our runtime writes the same cpu.weight values (e.g. 22000 shares → 1204).
  • Update the corresponding unit tests and contest expectation so validate-contest-runc passes with the newer runtime.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test updates
  • CI/CD related changes
  • Other (please describe):

Testing

  • Added new unit tests
  • Added new integration tests
  • Ran existing test suite
  • Tested manually (please provide steps)

Related Issues

Additional Context

@n4mlz n4mlz marked this pull request as draft October 17, 2025 05:00
@n4mlz n4mlz marked this pull request as ready for review October 17, 2025 05:18
@n4mlz n4mlz mentioned this pull request Oct 17, 2025
13 tasks
@saku3
Copy link
Member

saku3 commented Oct 17, 2025

I understand the background.

Due to the following Kubernetes issue, the conversion formula from cgroup v1 shares to cgroup v2 weight has been changed:
kubernetes/kubernetes#131216

The fix in runc is as follows.
opencontainers/cgroups#20

Copy link
Member

@saku3 saku3 left a comment

Choose a reason for hiding this comment

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

@n4mlz
Thanks for the PR!

Overall, it looks good to me.
If you could add comments similar to runc’s, I think it would make the changes even clearer.

}

1 + ((shares.saturating_sub(2)) * 9999) / 262142
const MIN_SHARES: u64 = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Having comments would make it even easier to understand.


let weight = 1 + ((shares.saturating_sub(2)) * 9999) / 262142;
weight.min(MAX_CPU_WEIGHT)
const MIN_SHARES: u64 = 2;
Copy link
Member

Choose a reason for hiding this comment

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

Having comments would make it even easier to understand.

@n4mlz n4mlz requested a review from saku3 October 20, 2025 06:51
Copy link
Member

@saku3 saku3 left a comment

Choose a reason for hiding this comment

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

Thanks!

LGTM once CI passes.

@saku3
Copy link
Member

saku3 commented Oct 21, 2025

@utam0k @YJDoc2
PTAL and run CI, please 🙏

@YJDoc2 YJDoc2 removed the kind/bug label Oct 24, 2025
Copy link
Collaborator

@YJDoc2 YJDoc2 left a comment

Choose a reason for hiding this comment

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

Hey looks good to me, but I'll request you to add the runc release tag link and pr links mentioned by saku3 in a comment here. In future we might not be sure as to why we are using this particular formula , and the git link to pr might also be lost if we run formatting or file movement. The explicit links in comments would help us get the context for this.

@YJDoc2
Copy link
Collaborator

YJDoc2 commented Oct 24, 2025

Also our current CI requires exactly one kind/ label to be assigned , so it works out with our release ci ; I have removed the bug label and kept test ; feel free to change it to something else as appropriate.

@n4mlz
Copy link
Contributor Author

n4mlz commented Oct 30, 2025

Sorry for the delay in my response. I’ve added some comments. Please take a look.

@n4mlz n4mlz requested a review from YJDoc2 October 30, 2025 03:05
@YJDoc2 YJDoc2 enabled auto-merge October 30, 2025 07:13
@YJDoc2 YJDoc2 merged commit 06b7621 into youki-dev:main Oct 30, 2025
29 checks passed
@github-actions github-actions bot mentioned this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants