Skip to content

fix: extend pod hugepages based on dpdk_base_memory_mb#2399

Open
assafgi wants to merge 1 commit intomainfrom
03-25-fix_extend_pod_hugepages_based_on_dpdk_base_memory_mb
Open

fix: extend pod hugepages based on dpdk_base_memory_mb#2399
assafgi wants to merge 1 commit intomainfrom
03-25-fix_extend_pod_hugepages_based_on_dpdk_base_memory_mb

Conversation

@assafgi
Copy link
Contributor

@assafgi assafgi commented Mar 25, 2026

No description provided.

@assafgi assafgi marked this pull request as ready for review March 25, 2026 17:10
@assafgi assafgi requested a review from a team as a code owner March 25, 2026 17:10
Copilot AI review requested due to automatic review settings March 25, 2026 17:10
Copy link
Contributor Author

assafgi commented Mar 25, 2026


How to use the Graphite Merge Queue

Add the label main-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

github-actions bot commented Mar 25, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA b63609b.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@graphite-app
Copy link

graphite-app bot commented Mar 25, 2026

Graphite Automations

"Add anton/matt/sergey/kristina as reviwers on operator PRs" took an action on this PR • (03/25/26)

2 reviewers were added to this PR based on Anton Bykov's automation.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the hugepages “offset” used to compute the MEMORY env var for Weka pods, aiming to better account for DPDK base memory needs on frontend containers.

Changes:

  • Update GetHugePagesOffset default logic to scale frontend offset with NumCores (64 MiB per core) instead of a fixed 200 MiB.
  • Keep the previous 200 MiB default offset for non-frontend containers in the default mode branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1041 to +1042
offset = 64 * container.Spec.NumCores // 64 is same as the value we put int dpdk_base_memory_mb in resources.json
} else {
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The inline comment has a typo (“put int”). Also, the reference to dpdk_base_memory_mb in resources.json is hard to validate/trace from this codebase, and the raw 64 is an unexplained magic number. Please fix the typo and consider replacing 64 with a named constant (or config-driven value) and update the comment to point to the actual source of truth for this offset.

Copilot uses AI. Check for mistakes.
default:
offset = 200
if container.HasFrontend() {
offset = 64 * container.Spec.NumCores // 64 is same as the value we put int dpdk_base_memory_mb in resources.json
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

Typo in comment: “put int” should be “put in”.

Suggested change
offset = 64 * container.Spec.NumCores // 64 is same as the value we put int dpdk_base_memory_mb in resources.json
offset = 64 * container.Spec.NumCores // 64 is same as the value we put in dpdk_base_memory_mb in resources.json

Copilot uses AI. Check for mistakes.
Comment on lines +1040 to +1044
if container.HasFrontend() {
offset = 64 * container.Spec.NumCores // 64 is same as the value we put int dpdk_base_memory_mb in resources.json
} else {
offset = 200
}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

This new frontend-specific offset logic only runs when container.Spec.HugepagesOffset == 0. In the common WekaCluster/WekaClient flows, HugepagesOffset is always set (e.g., via template defaults), so this change may not actually affect the pods you’re trying to fix. Consider updating the default hugepages offset where it’s populated (templates/factory) or intentionally leaving HugepagesOffset unset so this function’s defaults take effect.

Copilot uses AI. Check for mistakes.
@assafgi assafgi force-pushed the 03-25-fix_extend_pod_hugepages_based_on_dpdk_base_memory_mb branch from 2e1f2f0 to b63609b Compare March 26, 2026 15:35
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.

3 participants