-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hugetlbfs support based on empty dir volume plugin #50072
Hugetlbfs support based on empty dir volume plugin #50072
Conversation
Hi @squall0gd. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. 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/test-infra repository. I understand the commands that are listed here. |
cbd37ac
to
9f2fcf8
Compare
@@ -699,6 +699,8 @@ type EmptyDirVolumeSource struct { | |||
// More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir | |||
// +optional | |||
Medium StorageMedium `json:"medium,omitempty" protobuf:"bytes,1,opt,name=medium,casttype=StorageMedium"` | |||
// +optional | |||
HugetlbfsSize string `json:"hugetlbfsSize,omitempty" protobuf:"bytes,3,opt,name=hugetlbfsSize"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since HugetlbfsSize
is new-added. You'd need to run auto-gen scripts again (make update
will run all auto-gen scripts).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
pkg/volume/empty_dir/empty_dir.go
Outdated
if isMnt && medium == mediumHugepages { | ||
return nil | ||
} | ||
if ed.size == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that if we are using StorageMediumHugetlbfs
, the size
is also needed alongside?
If so, you'd better add some validations in pkg/api/validation/validation.go
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's required in that case. I will move this validation to pkg/api/validation/validation.go
pkg/api/types.go
Outdated
@@ -614,6 +614,8 @@ type EmptyDirVolumeSource struct { | |||
// The default is "" which means to use the node's default medium. | |||
// +optional | |||
Medium StorageMedium | |||
// +optional | |||
HugetlbfsSize string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kind of confusing to declare xxSize as string
. May it be int
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll use Quantity
here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to quantity
pkg/volume/empty_dir/empty_dir.go
Outdated
@@ -172,6 +179,7 @@ type emptyDir struct { | |||
mounter mount.Interface | |||
mountDetector mountDetector | |||
plugin *emptyDirPlugin | |||
size string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe int
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to use Quantity
here b/c I need to keep unit.
@squall0gd FYI, there is a proposal on HugePages here: kubernetes/community#837 /cc @derekwaynecarr |
i want to make sure we have agreement on the proposal referenced before merging this, but thank you for your help! |
/ok-to-test |
pkg/api/types.go
Outdated
StorageMediumMemory StorageMedium = "Memory" // use memory (tmpfs) | ||
StorageMediumDefault StorageMedium = "" // use whatever the default is for the node | ||
StorageMediumMemory StorageMedium = "Memory" // use memory (tmpfs) | ||
StorageMediumHugetlbfs StorageMedium = "Hugetlbfs" // use hugepages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer HugePages
pkg/volume/empty_dir/empty_dir.go
Outdated
} | ||
|
||
glog.V(3).Infof("pod %v: mounting hugepages for volume %v", ed.pod.UID, ed.volName) | ||
mountOptions := []string{fmt.Sprintf("size=%s", ed.size)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't understand why you have size.
size is bounded by sum resource requirement across containers on pod.
we need a new field specific for hugepages that aligns with pagesize. mount option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well I've used size
w/o any reason - just want some, easy to track parameter, to verify that passing mount options is working correctly. Actually I'm waiting for proposal's merge to finalize implementing mount options and to play with unit tests. :)
7148723
to
3c0861b
Compare
/lgtm Thanks @squall0gd for your help getting this support. |
/retest Review the full test history for this PR. |
/test pull-kubernetes-e2e-kops-aws |
/retest |
1 similar comment
/retest |
/retest Review the full test history for this PR. |
073ac49
to
59a86e4
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: childsb, derekwaynecarr, eparis, smarterclayton, squall0gd Associated issue: 275 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
@squall0gd: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue |
Curious how this got merged despite failing cross: |
@jdumars didn't notice this error before. Just some timeouts on e2e gates |
The test will need to be updated in order to accommodate the change. |
@jdumars Well it looks like we need to add type to magic number constant. Sadly we need to do this in another PR. |
opened #51984 to type-cast the comparison to the constant |
What this PR does / why we need it: Support for huge pages in empty dir volume plugin. More information about hugepages can be found here
Feature track issue: kubernetes/enhancements#275
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Release note: