-
Notifications
You must be signed in to change notification settings - Fork 12
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
Sync RTE with NFD #32
Conversation
Just an FYI, the scheduler plugin uses |
@@ -691,23 +691,23 @@ func TestResourcesScan(t *testing.T) { | |||
Resources: topologyv1alpha1.ResourceInfoList{ | |||
topologyv1alpha1.ResourceInfo{ | |||
Name: "cpu", | |||
Allocatable: intstr.FromString("10"), | |||
Capacity: intstr.FromString("12"), | |||
Allocatable: resource.MustParse("10"), |
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.
Wanted to point out how I went ahead with this change in NFD, I assumed that capacity=allocatable (i.e. we don't account for kube-reserved and system reserved) and changed the values in the allocatable
field to be captured in the available
field some like I did here: kubernetes-sigs/node-feature-discovery@041aa80 and then later in a subsequent commit took the reserved resources into consideration: kubernetes-sigs/node-feature-discovery@043c7a8.
This is going to be part of this PR but in a separate commit for readability porpuses |
@swatisehgal @fromanirh FYI the |
@@ -18,12 +18,12 @@ package resourcemonitor | |||
|
|||
import ( | |||
"encoding/json" | |||
"k8s.io/apimachinery/pkg/api/resource" |
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.
please put the import in the group below alongside with the other k8s imports
With nodresourcetopology API 0.0.8 "Allocatable" behaves like "Available" in API 0.0.10:
|
Oh I see. Sorry I wasn't aware of that, I misread what Swati mentioned above |
e28642b
to
2ed1d45
Compare
}, | ||
topologyv1alpha1.ResourceInfo{ | ||
Name: "fake.io/net", | ||
Allocatable: intstr.FromString("4"), | ||
Capacity: intstr.FromString("4"), | ||
Available: resource.MustParse("12"), |
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.
This looks like a mistake to me: available should be equal to 4
here as well. Also note that available will always be <= both allocatable and capacity.
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.
yes. copy paste mistake I just found out myself. Thanks!
2ed1d45
to
af0b0d4
Compare
the podres sync patch can be a separate PR which we can merge quickly. |
Signed-off-by: Talor Itzhak <[email protected]>
51c6e19
to
20d613b
Compare
- Update vendor files - Fix code to match the new API This patch is following the way of how the new API integration was done on NFD: It assumes capacity is equal to allocatable and in a subsequent patch we need to account for kube-reserved and system reserved to determine the allocatable, as allocatable = capcity - kube-reserved/system-reserved Signed-off-by: Talor Itzhak <[email protected]>
20d613b
to
223068b
Compare
This patch updates the Capacity, Allocatable and Available accountig logic to be identical to what NFD has: k8stopologyawareschedwg/node-feature-discovery@043c7a8 Signed-off-by: Talor Itzhak <[email protected]>
223068b
to
fcc4691
Compare
good enough, we can improve in followup PRs. |
TODO (on separate PR) when openshift-kni/resource-topology-exporter#23 and jaypipes/ghw#268 get merged we should take care of memory capacity accounting as well