Skip to content

resource package test#1124

Open
luomingmeng wants to merge 26 commits intokubewharf:mainfrom
luomingmeng:dev/resource-package-test
Open

resource package test#1124
luomingmeng wants to merge 26 commits intokubewharf:mainfrom
luomingmeng:dev/resource-package-test

Conversation

@luomingmeng
Copy link
Copy Markdown
Collaborator

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Special notes for your reviewer:

@luomingmeng luomingmeng force-pushed the dev/resource-package-test branch 7 times, most recently from de87f4c to 39b97e0 Compare April 8, 2026 14:28
…pool to boolean

Update the resource package conversion logic to represent pinned cpuset as a boolean flag instead of a pool name
Modify test cases to reflect the new pinned cpuset representation
- Fix race condition in Start() by properly handling started flag and stop channel
- Replace sleep-based test synchronization with channel signaling
- Ensure cpuPressureEviction only runs when policy is started
…e PinnedCPUSetInfo

- Remove PinnedCPUSetInfo and related fields from QoSRegion interfaces
- Add GetResourcePackageName method to QoSRegion interface
- Introduce ResourcePackageConfig type for storing pinned cpuset info
- Update CPU server to handle resource package config from advisor requests
- Refactor region assembly to use resource package config from metacache
- Simplify region creation by removing pinnedCPUSetInfo parameter
- Add comprehensive tests for resource package config handling
Move zone attribute names used in topology adapter to a centralized consts package
to maintain consistency between CNR producers and consumers. Update all references
to use the new constants from pkg/consts.
…n pools

split the pool allocation logic into separate functions for pinned and common pools
add comprehensive tests for various allocation scenarios
remove redundant pinned CPU set parameter from generatePoolsAndIsolation
…support

Add resource package name handling in region creation and metrics
Modify CPU allocation logic to consider resource package pinned CPUs
… package

Consider resource package when setting origin owner pool name for numa binding containers.
This ensures proper pool name wrapping when a resource package is specified and valid.
…pu allocation logic

remove redundant unwrap operation in GetResourcePackageName and use annotations directly
modify cpu allocation to consider pinned cpusets for better resource isolation
…utes

add attribute selector to filter resource packages for IRQ forbidden CPUs
add helper function to convert CNR attributes to string map
add utility function to aggregate pinned CPU sets from matching resource packages
update IRQ forbidden core logic to include resource package pinned CPUs
add tests for new functionality
…ated logic

Add attributes map to ResourcePackageItemConfig proto message to store additional package metadata.
Refactor state management to use ResourcePackageState struct instead of direct CPUSet maps.
Update sync logic to handle attributes and improve IRQ forbidden cores calculation.
Modify tests to accommodate new state structure and attribute handling.
…ibutes

- Replace direct CPUSet storage with ResourcePackageState struct to support additional attributes
- Add proper nil checks when accessing resource package states
- Update all related test cases to use the new structure
add utility functions to handle resource package states and implement logic to exclude non-reclaimable pinned CPUs from reclaim pool
add disable-reclaim selector configuration and update CPU assembler to consider non-reclaimable packages
extend tests for resource package utilities and policy advisor handler
Add detailed logging to track resource package state changes in CPU dynamic policy
…butes

- Store attributes for non-pinned resource packages
- Fix pinned package detection by tracking pinned packages separately
- Ensure proper CPU allocation for mixed pinned/non-pinned packages
add detailed logging to track cpu pool size calculations and resource package config updates
Add detailed InfoS logging in generateReclaimBlockCPUSet and generateBlockCPUSet functions to track CPU allocation process. This helps in debugging NUMA-aware and non-NUMA-aware block allocation scenarios by logging key variables and their states during execution.
add ParseSelector helper function to parse label selectors from strings
add tests for ParseSelector function
update callers to use new ParseSelector function instead of direct parsing
change DisableReclaimPinnedCPUSetResourcePackageSelector to string type
Ensure the cpu set is not empty before wrapping the owner pool name with the resource package name to avoid unnecessary pool name modifications.
luomingmeng and others added 6 commits April 10, 2026 10:35
Implement support for cpuset partition flags in cgroupv2, including root, member and isolated partitions. Add new ApplyCPUSetPartition method to Manager interface and implement it for fake, v1 and v2 managers. Also add corresponding test cases.
- Add support for hugepages memory resources and exclude static hugepages from memory calculations
- Add NormalMemoryCapacity and NormalMemoryDetails to MemoryTopology for accurate memory accounting
- Support distribute evenly across numa annotation for numa binding pods
- Update memory allocation logic to handle extra memory resources
- Add tests for memory topology discovery and hugepages handling
- Refactor state management to track memory topology and extra resources
remove isReclaimedOrSharedQoS parameter and improve handling of different QoS levels
use aggregated pod request for shared/reclaimed cores with NUMA binding
add support for decimal CPU quantities in topology annotations
Restructure CPU allocation logic to properly handle resource package pinning at NUMA level
Add test cases for various resource package pinning scenarios
@luomingmeng luomingmeng force-pushed the dev/resource-package-test branch from 8e78ade to 4fc2194 Compare April 10, 2026 02:36
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 71.67292% with 679 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.90%. Comparing base (f4d9f38) to head (8f202c1).

Files with missing lines Patch % Lines
...u/assembler/provisionassembler/assembler_common.go 62.72% 126 Missing and 22 partials ⚠️
...lugins/cpu/dynamicpolicy/policy_advisor_handler.go 75.00% 35 Missing and 24 partials ⚠️
...ugins/memory/dynamicpolicy/policy_hint_handlers.go 65.64% 40 Missing and 16 partials ⚠️
pkg/agent/qrm-plugins/memory/dynamicpolicy/util.go 42.04% 49 Missing and 2 partials ⚠️
pkg/util/resource-package/util.go 54.80% 43 Missing and 4 partials ⚠️
...memory/dynamicpolicy/policy_allocation_handlers.go 78.77% 33 Missing and 12 partials ⚠️
...g/agent/qrm-plugins/memory/dynamicpolicy/policy.go 65.83% 32 Missing and 9 partials ⚠️
...ugins/cpu/dynamicpolicy/policy_resource_package.go 82.75% 27 Missing and 13 partials ⚠️
pkg/agent/qrm-plugins/cpu/dynamicpolicy/policy.go 46.00% 25 Missing and 2 partials ⚠️
...ns/cpu/dynamicpolicy/policy_allocation_handlers.go 78.49% 12 Missing and 8 partials ⚠️
... and 29 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1124      +/-   ##
==========================================
+ Coverage   61.54%   61.90%   +0.35%     
==========================================
  Files         783      788       +5     
  Lines       73181    74686    +1505     
==========================================
+ Hits        45038    46232    +1194     
- Misses      23139    23361     +222     
- Partials     5004     5093      +89     
Flag Coverage Δ
unittest 61.90% <71.67%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…cation

- Rename isReclaimBlock to isSharedBlock for clarity and better semantics
- Refactor allocateDedicatedBlocks to handle CPU availability checks more robustly
- Improve NUMA-binding share pool handling and isolation pool priority
- Update reclaim block allocation to properly respect NUMA boundaries
- Add comprehensive test cases for various allocation scenarios
@luomingmeng luomingmeng force-pushed the dev/resource-package-test branch from 2a1f063 to 8f202c1 Compare April 11, 2026 10:53
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